Keine Beschreibung

components.js 1.8MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383
  1. this["wp"] = this["wp"] || {}; this["wp"]["components"] =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = "SB3u");
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ "+51k":
  90. /***/ (function(module, exports, __webpack_require__) {
  91. "use strict";
  92. Object.defineProperty(exports, "__esModule", {
  93. value: true
  94. });
  95. exports['default'] = getActiveElement;
  96. function getActiveElement() {
  97. return typeof document !== 'undefined' && document.activeElement;
  98. }
  99. /***/ }),
  100. /***/ "+WFq":
  101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102. "use strict";
  103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSlot; });
  104. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  105. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  106. /* harmony import */ var _slot_fill_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("JYkG");
  107. /**
  108. * WordPress dependencies
  109. */
  110. /**
  111. * Internal dependencies
  112. */
  113. function useSlot(name) {
  114. const registry = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_slot_fill_context__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]);
  115. const slot = registry.slots[name] || {};
  116. const slotFills = registry.fills[name];
  117. const fills = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => slotFills || [], [slotFills]);
  118. const updateSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillProps => {
  119. registry.updateSlot(name, fillProps);
  120. }, [name, registry.updateSlot]);
  121. const unregisterSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(slotRef => {
  122. registry.unregisterSlot(name, slotRef);
  123. }, [name, registry.unregisterSlot]);
  124. const registerFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => {
  125. registry.registerFill(name, fillRef);
  126. }, [name, registry.registerFill]);
  127. const unregisterFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => {
  128. registry.unregisterFill(name, fillRef);
  129. }, [name, registry.unregisterFill]);
  130. return { ...slot,
  131. updateSlot,
  132. unregisterSlot,
  133. fills,
  134. registerFill,
  135. unregisterFill
  136. };
  137. }
  138. /***/ }),
  139. /***/ "+ipW":
  140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  141. "use strict";
  142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDOM; });
  143. /* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("SyVe");
  144. function checkIsBrowser() {
  145. var _window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "a"])();
  146. return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement);
  147. }
  148. /**
  149. * It's `true` if it is running in a browser environment or `false` if it is not (SSR).
  150. *
  151. * @example
  152. * import { canUseDOM } from "reakit-utils";
  153. *
  154. * const title = canUseDOM ? document.title : "";
  155. */
  156. var canUseDOM = checkIsBrowser();
  157. /***/ }),
  158. /***/ "/9aa":
  159. /***/ (function(module, exports, __webpack_require__) {
  160. var baseGetTag = __webpack_require__("NykK"),
  161. isObjectLike = __webpack_require__("ExA7");
  162. /** `Object#toString` result references. */
  163. var symbolTag = '[object Symbol]';
  164. /**
  165. * Checks if `value` is classified as a `Symbol` primitive or object.
  166. *
  167. * @static
  168. * @memberOf _
  169. * @since 4.0.0
  170. * @category Lang
  171. * @param {*} value The value to check.
  172. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  173. * @example
  174. *
  175. * _.isSymbol(Symbol.iterator);
  176. * // => true
  177. *
  178. * _.isSymbol('abc');
  179. * // => false
  180. */
  181. function isSymbol(value) {
  182. return typeof value == 'symbol' ||
  183. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  184. }
  185. module.exports = isSymbol;
  186. /***/ }),
  187. /***/ "/ZKw":
  188. /***/ (function(module, exports, __webpack_require__) {
  189. "use strict";
  190. var define = __webpack_require__("82c2");
  191. var callBind = __webpack_require__("PrET");
  192. var implementation = __webpack_require__("yN6O");
  193. var getPolyfill = __webpack_require__("22yB");
  194. var polyfill = getPolyfill();
  195. var shim = __webpack_require__("v3P4");
  196. var boundFlat = callBind(polyfill);
  197. define(boundFlat, {
  198. getPolyfill: getPolyfill,
  199. implementation: implementation,
  200. shim: shim
  201. });
  202. module.exports = boundFlat;
  203. /***/ }),
  204. /***/ "/sVA":
  205. /***/ (function(module, exports, __webpack_require__) {
  206. "use strict";
  207. var toStr = Object.prototype.toString;
  208. var hasSymbols = __webpack_require__("UVaH")();
  209. if (hasSymbols) {
  210. var symToStr = Symbol.prototype.toString;
  211. var symStringRegex = /^Symbol\(.*\)$/;
  212. var isSymbolObject = function isRealSymbolObject(value) {
  213. if (typeof value.valueOf() !== 'symbol') {
  214. return false;
  215. }
  216. return symStringRegex.test(symToStr.call(value));
  217. };
  218. module.exports = function isSymbol(value) {
  219. if (typeof value === 'symbol') {
  220. return true;
  221. }
  222. if (toStr.call(value) !== '[object Symbol]') {
  223. return false;
  224. }
  225. try {
  226. return isSymbolObject(value);
  227. } catch (e) {
  228. return false;
  229. }
  230. };
  231. } else {
  232. module.exports = function isSymbol(value) {
  233. // this environment does not support Symbols.
  234. return false && false;
  235. };
  236. }
  237. /***/ }),
  238. /***/ 0:
  239. /***/ (function(module, exports) {
  240. /* (ignored) */
  241. /***/ }),
  242. /***/ "030x":
  243. /***/ (function(module, exports, __webpack_require__) {
  244. "use strict";
  245. Object.defineProperty(exports, "__esModule", {
  246. value: true
  247. });
  248. var styleInterface = void 0;
  249. var styleTheme = void 0;
  250. var START_MARK = 'react-with-styles.resolve.start';
  251. var END_MARK = 'react-with-styles.resolve.end';
  252. var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]';
  253. function registerTheme(theme) {
  254. styleTheme = theme;
  255. }
  256. function registerInterface(interfaceToRegister) {
  257. styleInterface = interfaceToRegister;
  258. }
  259. function create(makeFromTheme, createWithDirection) {
  260. var styles = createWithDirection(makeFromTheme(styleTheme));
  261. return function () {
  262. return styles;
  263. };
  264. }
  265. function createLTR(makeFromTheme) {
  266. return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
  267. }
  268. function createRTL(makeFromTheme) {
  269. return create(makeFromTheme, styleInterface.createRTL || styleInterface.create);
  270. }
  271. function get() {
  272. return styleTheme;
  273. }
  274. function resolve() {
  275. if (false) {}
  276. for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {
  277. styles[_key] = arguments[_key];
  278. }
  279. var result = styleInterface.resolve(styles);
  280. if (false) {}
  281. return result;
  282. }
  283. function resolveLTR() {
  284. for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  285. styles[_key2] = arguments[_key2];
  286. }
  287. if (styleInterface.resolveLTR) {
  288. return styleInterface.resolveLTR(styles);
  289. }
  290. return resolve(styles);
  291. }
  292. function resolveRTL() {
  293. for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  294. styles[_key3] = arguments[_key3];
  295. }
  296. if (styleInterface.resolveRTL) {
  297. return styleInterface.resolveRTL(styles);
  298. }
  299. return resolve(styles);
  300. }
  301. function flush() {
  302. if (styleInterface.flush) {
  303. styleInterface.flush();
  304. }
  305. }
  306. exports['default'] = {
  307. registerTheme: registerTheme,
  308. registerInterface: registerInterface,
  309. create: createLTR,
  310. createLTR: createLTR,
  311. createRTL: createRTL,
  312. get: get,
  313. resolve: resolveLTR,
  314. resolveLTR: resolveLTR,
  315. resolveRTL: resolveRTL,
  316. flush: flush
  317. };
  318. /***/ }),
  319. /***/ "0Dl3":
  320. /***/ (function(module, exports, __webpack_require__) {
  321. "use strict";
  322. Object.defineProperty(exports, "__esModule", {
  323. value: true
  324. });
  325. exports['default'] = getNumberOfCalendarMonthWeeks;
  326. var _moment = __webpack_require__("wy2R");
  327. var _moment2 = _interopRequireDefault(_moment);
  328. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  329. function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) {
  330. var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek;
  331. return (weekDayDiff + 7) % 7;
  332. }
  333. function getNumberOfCalendarMonthWeeks(month) {
  334. var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek();
  335. var firstDayOfMonth = month.clone().startOf('month');
  336. var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek);
  337. return Math.ceil((numBlankDays + month.daysInMonth()) / 7);
  338. }
  339. /***/ }),
  340. /***/ "0HL0":
  341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  342. "use strict";
  343. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setTextFieldValue; });
  344. /* harmony import */ var reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("qOxZ");
  345. function setTextFieldValue(element, value) {
  346. if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
  347. var _Object$getOwnPropert;
  348. var proto = Object.getPrototypeOf(element);
  349. var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set;
  350. if (setValue) {
  351. setValue.call(element, value);
  352. Object(reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__[/* fireEvent */ "a"])(element, "input", {
  353. bubbles: true
  354. });
  355. }
  356. }
  357. }
  358. /***/ }),
  359. /***/ "0XP8":
  360. /***/ (function(module, exports, __webpack_require__) {
  361. "use strict";
  362. Object.defineProperty(exports, "__esModule", {
  363. value: true
  364. });
  365. var _react = __webpack_require__("cDcd");
  366. var _react2 = _interopRequireDefault(_react);
  367. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  368. var LeftArrow = function () {
  369. function LeftArrow(props) {
  370. return _react2['default'].createElement(
  371. 'svg',
  372. props,
  373. _react2['default'].createElement('path', {
  374. d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z'
  375. })
  376. );
  377. }
  378. return LeftArrow;
  379. }();
  380. LeftArrow.defaultProps = {
  381. viewBox: '0 0 1000 1000'
  382. };
  383. exports['default'] = LeftArrow;
  384. /***/ }),
  385. /***/ "1+Kn":
  386. /***/ (function(module, exports, __webpack_require__) {
  387. "use strict";
  388. Object.defineProperty(exports, "__esModule", {
  389. value: true
  390. });
  391. exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined;
  392. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  393. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  394. var _object = __webpack_require__("Koq/");
  395. var _object2 = _interopRequireDefault(_object);
  396. var _react = __webpack_require__("cDcd");
  397. var _react2 = _interopRequireDefault(_react);
  398. var _propTypes = __webpack_require__("17x9");
  399. var _propTypes2 = _interopRequireDefault(_propTypes);
  400. var _airbnbPropTypes = __webpack_require__("Hsqg");
  401. var _reactWithStyles = __webpack_require__("TG4+");
  402. var _defaultPhrases = __webpack_require__("vV+G");
  403. var _getPhrasePropTypes = __webpack_require__("yc2e");
  404. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  405. var _KeyboardShortcutRow = __webpack_require__("zN8g");
  406. var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow);
  407. var _CloseButton = __webpack_require__("xEte");
  408. var _CloseButton2 = _interopRequireDefault(_CloseButton);
  409. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  410. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  411. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  412. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  413. var TOP_LEFT = exports.TOP_LEFT = 'top-left';
  414. var TOP_RIGHT = exports.TOP_RIGHT = 'top-right';
  415. var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right';
  416. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  417. block: _propTypes2['default'].bool,
  418. buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]),
  419. showKeyboardShortcutsPanel: _propTypes2['default'].bool,
  420. openKeyboardShortcutsPanel: _propTypes2['default'].func,
  421. closeKeyboardShortcutsPanel: _propTypes2['default'].func,
  422. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases))
  423. }));
  424. var defaultProps = {
  425. block: false,
  426. buttonLocation: BOTTOM_RIGHT,
  427. showKeyboardShortcutsPanel: false,
  428. openKeyboardShortcutsPanel: function () {
  429. function openKeyboardShortcutsPanel() {}
  430. return openKeyboardShortcutsPanel;
  431. }(),
  432. closeKeyboardShortcutsPanel: function () {
  433. function closeKeyboardShortcutsPanel() {}
  434. return closeKeyboardShortcutsPanel;
  435. }(),
  436. phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases
  437. };
  438. function getKeyboardShortcuts(phrases) {
  439. return [{
  440. unicode: '↵',
  441. label: phrases.enterKey,
  442. action: phrases.selectFocusedDate
  443. }, {
  444. unicode: '←/→',
  445. label: phrases.leftArrowRightArrow,
  446. action: phrases.moveFocusByOneDay
  447. }, {
  448. unicode: '↑/↓',
  449. label: phrases.upArrowDownArrow,
  450. action: phrases.moveFocusByOneWeek
  451. }, {
  452. unicode: 'PgUp/PgDn',
  453. label: phrases.pageUpPageDown,
  454. action: phrases.moveFocusByOneMonth
  455. }, {
  456. unicode: 'Home/End',
  457. label: phrases.homeEnd,
  458. action: phrases.moveFocustoStartAndEndOfWeek
  459. }, {
  460. unicode: 'Esc',
  461. label: phrases.escape,
  462. action: phrases.returnFocusToInput
  463. }, {
  464. unicode: '?',
  465. label: phrases.questionMark,
  466. action: phrases.openThisPanel
  467. }];
  468. }
  469. var DayPickerKeyboardShortcuts = function (_React$Component) {
  470. _inherits(DayPickerKeyboardShortcuts, _React$Component);
  471. function DayPickerKeyboardShortcuts() {
  472. var _ref;
  473. _classCallCheck(this, DayPickerKeyboardShortcuts);
  474. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  475. args[_key] = arguments[_key];
  476. }
  477. var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args)));
  478. var phrases = _this.props.phrases;
  479. _this.keyboardShortcuts = getKeyboardShortcuts(phrases);
  480. _this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this);
  481. _this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this);
  482. _this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this);
  483. _this.handleFocus = _this.handleFocus.bind(_this);
  484. _this.onKeyDown = _this.onKeyDown.bind(_this);
  485. return _this;
  486. }
  487. _createClass(DayPickerKeyboardShortcuts, [{
  488. key: 'componentWillReceiveProps',
  489. value: function () {
  490. function componentWillReceiveProps(nextProps) {
  491. var phrases = this.props.phrases;
  492. if (nextProps.phrases !== phrases) {
  493. this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases);
  494. }
  495. }
  496. return componentWillReceiveProps;
  497. }()
  498. }, {
  499. key: 'componentDidUpdate',
  500. value: function () {
  501. function componentDidUpdate() {
  502. this.handleFocus();
  503. }
  504. return componentDidUpdate;
  505. }()
  506. }, {
  507. key: 'onKeyDown',
  508. value: function () {
  509. function onKeyDown(e) {
  510. e.stopPropagation();
  511. var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel;
  512. // Because the close button is the only focusable element inside of the panel, this
  513. // amounts to a very basic focus trap. The user can exit the panel by "pressing" the
  514. // close button or hitting escape
  515. switch (e.key) {
  516. case 'Enter':
  517. case ' ':
  518. case 'Spacebar': // for older browsers
  519. case 'Escape':
  520. closeKeyboardShortcutsPanel();
  521. break;
  522. // do nothing - this allows the up and down arrows continue their
  523. // default behavior of scrolling the content of the Keyboard Shortcuts Panel
  524. // which is needed when only a single month is shown for instance.
  525. case 'ArrowUp':
  526. case 'ArrowDown':
  527. break;
  528. // completely block the rest of the keys that have functionality outside of this panel
  529. case 'Tab':
  530. case 'Home':
  531. case 'End':
  532. case 'PageUp':
  533. case 'PageDown':
  534. case 'ArrowLeft':
  535. case 'ArrowRight':
  536. e.preventDefault();
  537. break;
  538. default:
  539. break;
  540. }
  541. }
  542. return onKeyDown;
  543. }()
  544. }, {
  545. key: 'onShowKeyboardShortcutsButtonClick',
  546. value: function () {
  547. function onShowKeyboardShortcutsButtonClick() {
  548. var _this2 = this;
  549. var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel;
  550. // we want to return focus to this button after closing the keyboard shortcuts panel
  551. openKeyboardShortcutsPanel(function () {
  552. _this2.showKeyboardShortcutsButton.focus();
  553. });
  554. }
  555. return onShowKeyboardShortcutsButtonClick;
  556. }()
  557. }, {
  558. key: 'setShowKeyboardShortcutsButtonRef',
  559. value: function () {
  560. function setShowKeyboardShortcutsButtonRef(ref) {
  561. this.showKeyboardShortcutsButton = ref;
  562. }
  563. return setShowKeyboardShortcutsButtonRef;
  564. }()
  565. }, {
  566. key: 'setHideKeyboardShortcutsButtonRef',
  567. value: function () {
  568. function setHideKeyboardShortcutsButtonRef(ref) {
  569. this.hideKeyboardShortcutsButton = ref;
  570. }
  571. return setHideKeyboardShortcutsButtonRef;
  572. }()
  573. }, {
  574. key: 'handleFocus',
  575. value: function () {
  576. function handleFocus() {
  577. if (this.hideKeyboardShortcutsButton) {
  578. // automatically move focus into the dialog by moving
  579. // to the only interactive element, the hide button
  580. this.hideKeyboardShortcutsButton.focus();
  581. }
  582. }
  583. return handleFocus;
  584. }()
  585. }, {
  586. key: 'render',
  587. value: function () {
  588. function render() {
  589. var _this3 = this;
  590. var _props = this.props,
  591. block = _props.block,
  592. buttonLocation = _props.buttonLocation,
  593. showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel,
  594. closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel,
  595. styles = _props.styles,
  596. phrases = _props.phrases;
  597. var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel;
  598. var bottomRight = buttonLocation === BOTTOM_RIGHT;
  599. var topRight = buttonLocation === TOP_RIGHT;
  600. var topLeft = buttonLocation === TOP_LEFT;
  601. return _react2['default'].createElement(
  602. 'div',
  603. null,
  604. _react2['default'].createElement(
  605. 'button',
  606. _extends({
  607. ref: this.setShowKeyboardShortcutsButtonRef
  608. }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), {
  609. type: 'button',
  610. 'aria-label': toggleButtonText,
  611. onClick: this.onShowKeyboardShortcutsButtonClick,
  612. onKeyDown: function () {
  613. function onKeyDown(e) {
  614. if (e.key === 'Enter') {
  615. e.preventDefault();
  616. } else if (e.key === 'Space') {
  617. _this3.onShowKeyboardShortcutsButtonClick(e);
  618. }
  619. }
  620. return onKeyDown;
  621. }(),
  622. onMouseUp: function () {
  623. function onMouseUp(e) {
  624. e.currentTarget.blur();
  625. }
  626. return onMouseUp;
  627. }()
  628. }),
  629. _react2['default'].createElement(
  630. 'span',
  631. (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft),
  632. '?'
  633. )
  634. ),
  635. showKeyboardShortcutsPanel && _react2['default'].createElement(
  636. 'div',
  637. _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), {
  638. role: 'dialog',
  639. 'aria-labelledby': 'DayPickerKeyboardShortcuts_title',
  640. 'aria-describedby': 'DayPickerKeyboardShortcuts_description'
  641. }),
  642. _react2['default'].createElement(
  643. 'div',
  644. _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), {
  645. id: 'DayPickerKeyboardShortcuts_title'
  646. }),
  647. phrases.keyboardShortcuts
  648. ),
  649. _react2['default'].createElement(
  650. 'button',
  651. _extends({
  652. ref: this.setHideKeyboardShortcutsButtonRef
  653. }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), {
  654. type: 'button',
  655. tabIndex: '0',
  656. 'aria-label': phrases.hideKeyboardShortcutsPanel,
  657. onClick: closeKeyboardShortcutsPanel,
  658. onKeyDown: this.onKeyDown
  659. }),
  660. _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg))
  661. ),
  662. _react2['default'].createElement(
  663. 'ul',
  664. _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), {
  665. id: 'DayPickerKeyboardShortcuts_description'
  666. }),
  667. this.keyboardShortcuts.map(function (_ref2) {
  668. var unicode = _ref2.unicode,
  669. label = _ref2.label,
  670. action = _ref2.action;
  671. return _react2['default'].createElement(_KeyboardShortcutRow2['default'], {
  672. key: label,
  673. unicode: unicode,
  674. label: label,
  675. action: action,
  676. block: block
  677. });
  678. })
  679. )
  680. )
  681. );
  682. }
  683. return render;
  684. }()
  685. }]);
  686. return DayPickerKeyboardShortcuts;
  687. }(_react2['default'].Component);
  688. DayPickerKeyboardShortcuts.propTypes = propTypes;
  689. DayPickerKeyboardShortcuts.defaultProps = defaultProps;
  690. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref3) {
  691. var _ref3$reactDates = _ref3.reactDates,
  692. color = _ref3$reactDates.color,
  693. font = _ref3$reactDates.font,
  694. zIndex = _ref3$reactDates.zIndex;
  695. return {
  696. DayPickerKeyboardShortcuts_buttonReset: {
  697. background: 'none',
  698. border: 0,
  699. borderRadius: 0,
  700. color: 'inherit',
  701. font: 'inherit',
  702. lineHeight: 'normal',
  703. overflow: 'visible',
  704. padding: 0,
  705. cursor: 'pointer',
  706. fontSize: font.size,
  707. ':active': {
  708. outline: 'none'
  709. }
  710. },
  711. DayPickerKeyboardShortcuts_show: {
  712. width: 22,
  713. position: 'absolute',
  714. zIndex: zIndex + 2
  715. },
  716. DayPickerKeyboardShortcuts_show__bottomRight: {
  717. borderTop: '26px solid transparent',
  718. borderRight: '33px solid ' + String(color.core.primary),
  719. bottom: 0,
  720. right: 0,
  721. ':hover': {
  722. borderRight: '33px solid ' + String(color.core.primary_dark)
  723. }
  724. },
  725. DayPickerKeyboardShortcuts_show__topRight: {
  726. borderBottom: '26px solid transparent',
  727. borderRight: '33px solid ' + String(color.core.primary),
  728. top: 0,
  729. right: 0,
  730. ':hover': {
  731. borderRight: '33px solid ' + String(color.core.primary_dark)
  732. }
  733. },
  734. DayPickerKeyboardShortcuts_show__topLeft: {
  735. borderBottom: '26px solid transparent',
  736. borderLeft: '33px solid ' + String(color.core.primary),
  737. top: 0,
  738. left: 0,
  739. ':hover': {
  740. borderLeft: '33px solid ' + String(color.core.primary_dark)
  741. }
  742. },
  743. DayPickerKeyboardShortcuts_showSpan: {
  744. color: color.core.white,
  745. position: 'absolute'
  746. },
  747. DayPickerKeyboardShortcuts_showSpan__bottomRight: {
  748. bottom: 0,
  749. right: -28
  750. },
  751. DayPickerKeyboardShortcuts_showSpan__topRight: {
  752. top: 1,
  753. right: -28
  754. },
  755. DayPickerKeyboardShortcuts_showSpan__topLeft: {
  756. top: 1,
  757. left: -28
  758. },
  759. DayPickerKeyboardShortcuts_panel: {
  760. overflow: 'auto',
  761. background: color.background,
  762. border: '1px solid ' + String(color.core.border),
  763. borderRadius: 2,
  764. position: 'absolute',
  765. top: 0,
  766. bottom: 0,
  767. right: 0,
  768. left: 0,
  769. zIndex: zIndex + 2,
  770. padding: 22,
  771. margin: 33
  772. },
  773. DayPickerKeyboardShortcuts_title: {
  774. fontSize: 16,
  775. fontWeight: 'bold',
  776. margin: 0
  777. },
  778. DayPickerKeyboardShortcuts_list: {
  779. listStyle: 'none',
  780. padding: 0,
  781. fontSize: font.size
  782. },
  783. DayPickerKeyboardShortcuts_close: {
  784. position: 'absolute',
  785. right: 22,
  786. top: 22,
  787. zIndex: zIndex + 2,
  788. ':active': {
  789. outline: 'none'
  790. }
  791. },
  792. DayPickerKeyboardShortcuts_closeSvg: {
  793. height: 15,
  794. width: 15,
  795. fill: color.core.grayLighter,
  796. ':hover': {
  797. fill: color.core.grayLight
  798. },
  799. ':focus': {
  800. fill: color.core.grayLight
  801. }
  802. }
  803. };
  804. })(DayPickerKeyboardShortcuts);
  805. /***/ }),
  806. /***/ "10Kj":
  807. /***/ (function(module, exports, __webpack_require__) {
  808. "use strict";
  809. var GetIntrinsic = __webpack_require__("rZ7t");
  810. var $TypeError = GetIntrinsic('%TypeError%');
  811. var $SyntaxError = GetIntrinsic('%SyntaxError%');
  812. var has = __webpack_require__("oNNP");
  813. var predicates = {
  814. // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
  815. 'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
  816. if (Type(Desc) !== 'Object') {
  817. return false;
  818. }
  819. var allowed = {
  820. '[[Configurable]]': true,
  821. '[[Enumerable]]': true,
  822. '[[Get]]': true,
  823. '[[Set]]': true,
  824. '[[Value]]': true,
  825. '[[Writable]]': true
  826. };
  827. for (var key in Desc) { // eslint-disable-line
  828. if (has(Desc, key) && !allowed[key]) {
  829. return false;
  830. }
  831. }
  832. var isData = has(Desc, '[[Value]]');
  833. var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
  834. if (isData && IsAccessor) {
  835. throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
  836. }
  837. return true;
  838. }
  839. };
  840. module.exports = function assertRecord(Type, recordType, argumentName, value) {
  841. var predicate = predicates[recordType];
  842. if (typeof predicate !== 'function') {
  843. throw new $SyntaxError('unknown record type: ' + recordType);
  844. }
  845. if (!predicate(Type, value)) {
  846. throw new $TypeError(argumentName + ' must be a ' + recordType);
  847. }
  848. };
  849. /***/ }),
  850. /***/ "16Al":
  851. /***/ (function(module, exports, __webpack_require__) {
  852. "use strict";
  853. /**
  854. * Copyright (c) 2013-present, Facebook, Inc.
  855. *
  856. * This source code is licensed under the MIT license found in the
  857. * LICENSE file in the root directory of this source tree.
  858. */
  859. var ReactPropTypesSecret = __webpack_require__("WbBG");
  860. function emptyFunction() {}
  861. function emptyFunctionWithReset() {}
  862. emptyFunctionWithReset.resetWarningCache = emptyFunction;
  863. module.exports = function() {
  864. function shim(props, propName, componentName, location, propFullName, secret) {
  865. if (secret === ReactPropTypesSecret) {
  866. // It is still safe when called from React.
  867. return;
  868. }
  869. var err = new Error(
  870. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  871. 'Use PropTypes.checkPropTypes() to call them. ' +
  872. 'Read more at http://fb.me/use-check-prop-types'
  873. );
  874. err.name = 'Invariant Violation';
  875. throw err;
  876. };
  877. shim.isRequired = shim;
  878. function getShim() {
  879. return shim;
  880. };
  881. // Important!
  882. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  883. var ReactPropTypes = {
  884. array: shim,
  885. bool: shim,
  886. func: shim,
  887. number: shim,
  888. object: shim,
  889. string: shim,
  890. symbol: shim,
  891. any: shim,
  892. arrayOf: getShim,
  893. element: shim,
  894. elementType: shim,
  895. instanceOf: getShim,
  896. node: shim,
  897. objectOf: getShim,
  898. oneOf: getShim,
  899. oneOfType: getShim,
  900. shape: getShim,
  901. exact: getShim,
  902. checkPropTypes: emptyFunctionWithReset,
  903. resetWarningCache: emptyFunction
  904. };
  905. ReactPropTypes.PropTypes = ReactPropTypes;
  906. return ReactPropTypes;
  907. };
  908. /***/ }),
  909. /***/ "17x9":
  910. /***/ (function(module, exports, __webpack_require__) {
  911. /**
  912. * Copyright (c) 2013-present, Facebook, Inc.
  913. *
  914. * This source code is licensed under the MIT license found in the
  915. * LICENSE file in the root directory of this source tree.
  916. */
  917. if (false) { var throwOnDirectAccess, ReactIs; } else {
  918. // By explicitly using `prop-types` you are opting into new production behavior.
  919. // http://fb.me/prop-types-in-prod
  920. module.exports = __webpack_require__("16Al")();
  921. }
  922. /***/ }),
  923. /***/ "1CF3":
  924. /***/ (function(module, exports) {
  925. (function() { module.exports = window["wp"]["dom"]; }());
  926. /***/ }),
  927. /***/ "1KsK":
  928. /***/ (function(module, exports, __webpack_require__) {
  929. "use strict";
  930. var toStr = Object.prototype.toString;
  931. module.exports = function isArguments(value) {
  932. var str = toStr.call(value);
  933. var isArgs = str === '[object Arguments]';
  934. if (!isArgs) {
  935. isArgs = str !== '[object Array]' &&
  936. value !== null &&
  937. typeof value === 'object' &&
  938. typeof value.length === 'number' &&
  939. value.length >= 0 &&
  940. toStr.call(value.callee) === '[object Function]';
  941. }
  942. return isArgs;
  943. };
  944. /***/ }),
  945. /***/ "1LY1":
  946. /***/ (function(module, exports, __webpack_require__) {
  947. "use strict";
  948. var bind = __webpack_require__("D3zA");
  949. var GetIntrinsic = __webpack_require__("rZ7t");
  950. var $apply = GetIntrinsic('%Function.prototype.apply%');
  951. var $call = GetIntrinsic('%Function.prototype.call%');
  952. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  953. var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
  954. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  955. var $max = GetIntrinsic('%Math.max%');
  956. if ($defineProperty) {
  957. try {
  958. $defineProperty({}, 'a', { value: 1 });
  959. } catch (e) {
  960. // IE 8 has a broken defineProperty
  961. $defineProperty = null;
  962. }
  963. }
  964. module.exports = function callBind(originalFunction) {
  965. var func = $reflectApply(bind, $call, arguments);
  966. if ($gOPD && $defineProperty) {
  967. var desc = $gOPD(func, 'length');
  968. if (desc.configurable) {
  969. // original length, plus the receiver, minus any additional arguments (after the receiver)
  970. $defineProperty(
  971. func,
  972. 'length',
  973. { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
  974. );
  975. }
  976. }
  977. return func;
  978. };
  979. var applyBind = function applyBind() {
  980. return $reflectApply(bind, $apply, arguments);
  981. };
  982. if ($defineProperty) {
  983. $defineProperty(module.exports, 'apply', { value: applyBind });
  984. } else {
  985. module.exports.apply = applyBind;
  986. }
  987. /***/ }),
  988. /***/ "1TsT":
  989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  990. "use strict";
  991. __webpack_require__.r(__webpack_exports__);
  992. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; });
  993. var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  994. // Adapted from Modernizr
  995. // https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37
  996. function testPassiveEventListeners() {
  997. if (!CAN_USE_DOM) {
  998. return false;
  999. }
  1000. if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) {
  1001. return false;
  1002. }
  1003. var supportsPassiveOption = false;
  1004. try {
  1005. var opts = Object.defineProperty({}, 'passive', {
  1006. // eslint-disable-next-line getter-return
  1007. get: function () {
  1008. function get() {
  1009. supportsPassiveOption = true;
  1010. }
  1011. return get;
  1012. }()
  1013. });
  1014. var noop = function noop() {};
  1015. window.addEventListener('testPassiveEventSupport', noop, opts);
  1016. window.removeEventListener('testPassiveEventSupport', noop, opts);
  1017. } catch (e) {
  1018. // do nothing
  1019. }
  1020. return supportsPassiveOption;
  1021. }
  1022. var memoized = void 0;
  1023. function canUsePassiveEventListeners() {
  1024. if (memoized === undefined) {
  1025. memoized = testPassiveEventListeners();
  1026. }
  1027. return memoized;
  1028. }
  1029. function normalizeEventOptions(eventOptions) {
  1030. if (!eventOptions) {
  1031. return undefined;
  1032. }
  1033. if (!canUsePassiveEventListeners()) {
  1034. // If the browser does not support the passive option, then it is expecting
  1035. // a boolean for the options argument to specify whether it should use
  1036. // capture or not. In more modern browsers, this is passed via the `capture`
  1037. // option, so let's just hoist that value up.
  1038. return !!eventOptions.capture;
  1039. }
  1040. return eventOptions;
  1041. }
  1042. /* eslint-disable no-bitwise */
  1043. /**
  1044. * Generate a unique key for any set of event options
  1045. */
  1046. function eventOptionsKey(normalizedEventOptions) {
  1047. if (!normalizedEventOptions) {
  1048. return 0;
  1049. }
  1050. // If the browser does not support passive event listeners, the normalized
  1051. // event options will be a boolean.
  1052. if (normalizedEventOptions === true) {
  1053. return 100;
  1054. }
  1055. // At this point, the browser supports passive event listeners, so we expect
  1056. // the event options to be an object with possible properties of capture,
  1057. // passive, and once.
  1058. //
  1059. // We want to consistently return the same value, regardless of the order of
  1060. // these properties, so let's use binary maths to assign each property to a
  1061. // bit, and then add those together (with an offset to account for the
  1062. // booleans at the beginning of this function).
  1063. var capture = normalizedEventOptions.capture << 0;
  1064. var passive = normalizedEventOptions.passive << 1;
  1065. var once = normalizedEventOptions.once << 2;
  1066. return capture + passive + once;
  1067. }
  1068. function ensureCanMutateNextEventHandlers(eventHandlers) {
  1069. if (eventHandlers.handlers === eventHandlers.nextHandlers) {
  1070. // eslint-disable-next-line no-param-reassign
  1071. eventHandlers.nextHandlers = eventHandlers.handlers.slice();
  1072. }
  1073. }
  1074. function TargetEventHandlers(target) {
  1075. this.target = target;
  1076. this.events = {};
  1077. }
  1078. TargetEventHandlers.prototype.getEventHandlers = function () {
  1079. function getEventHandlers(eventName, options) {
  1080. var key = String(eventName) + ' ' + String(eventOptionsKey(options));
  1081. if (!this.events[key]) {
  1082. this.events[key] = {
  1083. handlers: [],
  1084. handleEvent: undefined
  1085. };
  1086. this.events[key].nextHandlers = this.events[key].handlers;
  1087. }
  1088. return this.events[key];
  1089. }
  1090. return getEventHandlers;
  1091. }();
  1092. TargetEventHandlers.prototype.handleEvent = function () {
  1093. function handleEvent(eventName, options, event) {
  1094. var eventHandlers = this.getEventHandlers(eventName, options);
  1095. eventHandlers.handlers = eventHandlers.nextHandlers;
  1096. eventHandlers.handlers.forEach(function (handler) {
  1097. if (handler) {
  1098. // We need to check for presence here because a handler function may
  1099. // cause later handlers to get removed. This can happen if you for
  1100. // instance have a waypoint that unmounts another waypoint as part of an
  1101. // onEnter/onLeave handler.
  1102. handler(event);
  1103. }
  1104. });
  1105. }
  1106. return handleEvent;
  1107. }();
  1108. TargetEventHandlers.prototype.add = function () {
  1109. function add(eventName, listener, options) {
  1110. var _this = this;
  1111. // options has already been normalized at this point.
  1112. var eventHandlers = this.getEventHandlers(eventName, options);
  1113. ensureCanMutateNextEventHandlers(eventHandlers);
  1114. if (eventHandlers.nextHandlers.length === 0) {
  1115. eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options);
  1116. this.target.addEventListener(eventName, eventHandlers.handleEvent, options);
  1117. }
  1118. eventHandlers.nextHandlers.push(listener);
  1119. var isSubscribed = true;
  1120. var unsubscribe = function () {
  1121. function unsubscribe() {
  1122. if (!isSubscribed) {
  1123. return;
  1124. }
  1125. isSubscribed = false;
  1126. ensureCanMutateNextEventHandlers(eventHandlers);
  1127. var index = eventHandlers.nextHandlers.indexOf(listener);
  1128. eventHandlers.nextHandlers.splice(index, 1);
  1129. if (eventHandlers.nextHandlers.length === 0) {
  1130. // All event handlers have been removed, so we want to remove the event
  1131. // listener from the target node.
  1132. if (_this.target) {
  1133. // There can be a race condition where the target may no longer exist
  1134. // when this function is called, e.g. when a React component is
  1135. // unmounting. Guarding against this prevents the following error:
  1136. //
  1137. // Cannot read property 'removeEventListener' of undefined
  1138. _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options);
  1139. }
  1140. eventHandlers.handleEvent = undefined;
  1141. }
  1142. }
  1143. return unsubscribe;
  1144. }();
  1145. return unsubscribe;
  1146. }
  1147. return add;
  1148. }();
  1149. var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__';
  1150. // eslint-disable-next-line import/prefer-default-export
  1151. function addEventListener(target, eventName, listener, options) {
  1152. if (!target[EVENT_HANDLERS_KEY]) {
  1153. // eslint-disable-next-line no-param-reassign
  1154. target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target);
  1155. }
  1156. var normalizedEventOptions = normalizeEventOptions(options);
  1157. return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions);
  1158. }
  1159. /***/ }),
  1160. /***/ "1iEr":
  1161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1162. "use strict";
  1163. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  1164. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  1165. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  1166. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  1167. /**
  1168. * WordPress dependencies
  1169. */
  1170. const chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  1171. xmlns: "http://www.w3.org/2000/svg",
  1172. viewBox: "0 0 24 24"
  1173. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  1174. d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
  1175. }));
  1176. /* harmony default export */ __webpack_exports__["a"] = (chevronRight);
  1177. /***/ }),
  1178. /***/ "1seS":
  1179. /***/ (function(module, exports, __webpack_require__) {
  1180. "use strict";
  1181. var slice = Array.prototype.slice;
  1182. var isArgs = __webpack_require__("1KsK");
  1183. var origKeys = Object.keys;
  1184. var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__("sYn3");
  1185. var originalKeys = Object.keys;
  1186. keysShim.shim = function shimObjectKeys() {
  1187. if (Object.keys) {
  1188. var keysWorksWithArguments = (function () {
  1189. // Safari 5.0 bug
  1190. var args = Object.keys(arguments);
  1191. return args && args.length === arguments.length;
  1192. }(1, 2));
  1193. if (!keysWorksWithArguments) {
  1194. Object.keys = function keys(object) { // eslint-disable-line func-name-matching
  1195. if (isArgs(object)) {
  1196. return originalKeys(slice.call(object));
  1197. }
  1198. return originalKeys(object);
  1199. };
  1200. }
  1201. } else {
  1202. Object.keys = keysShim;
  1203. }
  1204. return Object.keys || keysShim;
  1205. };
  1206. module.exports = keysShim;
  1207. /***/ }),
  1208. /***/ "22yB":
  1209. /***/ (function(module, exports, __webpack_require__) {
  1210. "use strict";
  1211. var implementation = __webpack_require__("yN6O");
  1212. module.exports = function getPolyfill() {
  1213. return Array.prototype.flat || implementation;
  1214. };
  1215. /***/ }),
  1216. /***/ "25kQ":
  1217. /***/ (function(module, exports, __webpack_require__) {
  1218. "use strict";
  1219. module.exports = __webpack_require__("aUaa");
  1220. /***/ }),
  1221. /***/ "2Q00":
  1222. /***/ (function(module, exports, __webpack_require__) {
  1223. "use strict";
  1224. Object.defineProperty(exports, "__esModule", {
  1225. value: true
  1226. });
  1227. exports['default'] = CalendarWeek;
  1228. var _react = __webpack_require__("cDcd");
  1229. var _react2 = _interopRequireDefault(_react);
  1230. var _airbnbPropTypes = __webpack_require__("Hsqg");
  1231. var _CalendarDay = __webpack_require__("N3k4");
  1232. var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
  1233. var _CustomizableCalendarDay = __webpack_require__("GET3");
  1234. var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay);
  1235. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1236. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
  1237. children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired
  1238. });
  1239. function CalendarWeek(_ref) {
  1240. var children = _ref.children;
  1241. return _react2['default'].createElement(
  1242. 'tr',
  1243. null,
  1244. children
  1245. );
  1246. }
  1247. CalendarWeek.propTypes = propTypes;
  1248. /***/ }),
  1249. /***/ "2S2E":
  1250. /***/ (function(module, exports, __webpack_require__) {
  1251. "use strict";
  1252. Object.defineProperty(exports, "__esModule", {
  1253. value: true
  1254. });
  1255. var _propTypes = __webpack_require__("17x9");
  1256. var _propTypes2 = _interopRequireDefault(_propTypes);
  1257. var _constants = __webpack_require__("Fv1B");
  1258. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1259. exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
  1260. /***/ }),
  1261. /***/ "2gm7":
  1262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1263. "use strict";
  1264. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  1265. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  1266. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  1267. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  1268. /**
  1269. * WordPress dependencies
  1270. */
  1271. const chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  1272. xmlns: "http://www.w3.org/2000/svg",
  1273. viewBox: "0 0 24 24"
  1274. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  1275. d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
  1276. }));
  1277. /* harmony default export */ __webpack_exports__["a"] = (chevronLeft);
  1278. /***/ }),
  1279. /***/ "2mql":
  1280. /***/ (function(module, exports, __webpack_require__) {
  1281. "use strict";
  1282. var reactIs = __webpack_require__("TOwV");
  1283. /**
  1284. * Copyright 2015, Yahoo! Inc.
  1285. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
  1286. */
  1287. var REACT_STATICS = {
  1288. childContextTypes: true,
  1289. contextType: true,
  1290. contextTypes: true,
  1291. defaultProps: true,
  1292. displayName: true,
  1293. getDefaultProps: true,
  1294. getDerivedStateFromError: true,
  1295. getDerivedStateFromProps: true,
  1296. mixins: true,
  1297. propTypes: true,
  1298. type: true
  1299. };
  1300. var KNOWN_STATICS = {
  1301. name: true,
  1302. length: true,
  1303. prototype: true,
  1304. caller: true,
  1305. callee: true,
  1306. arguments: true,
  1307. arity: true
  1308. };
  1309. var FORWARD_REF_STATICS = {
  1310. '$$typeof': true,
  1311. render: true,
  1312. defaultProps: true,
  1313. displayName: true,
  1314. propTypes: true
  1315. };
  1316. var MEMO_STATICS = {
  1317. '$$typeof': true,
  1318. compare: true,
  1319. defaultProps: true,
  1320. displayName: true,
  1321. propTypes: true,
  1322. type: true
  1323. };
  1324. var TYPE_STATICS = {};
  1325. TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
  1326. TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
  1327. function getStatics(component) {
  1328. // React v16.11 and below
  1329. if (reactIs.isMemo(component)) {
  1330. return MEMO_STATICS;
  1331. } // React v16.12 and above
  1332. return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
  1333. }
  1334. var defineProperty = Object.defineProperty;
  1335. var getOwnPropertyNames = Object.getOwnPropertyNames;
  1336. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  1337. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1338. var getPrototypeOf = Object.getPrototypeOf;
  1339. var objectPrototype = Object.prototype;
  1340. function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
  1341. if (typeof sourceComponent !== 'string') {
  1342. // don't hoist over string (html) components
  1343. if (objectPrototype) {
  1344. var inheritedComponent = getPrototypeOf(sourceComponent);
  1345. if (inheritedComponent && inheritedComponent !== objectPrototype) {
  1346. hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
  1347. }
  1348. }
  1349. var keys = getOwnPropertyNames(sourceComponent);
  1350. if (getOwnPropertySymbols) {
  1351. keys = keys.concat(getOwnPropertySymbols(sourceComponent));
  1352. }
  1353. var targetStatics = getStatics(targetComponent);
  1354. var sourceStatics = getStatics(sourceComponent);
  1355. for (var i = 0; i < keys.length; ++i) {
  1356. var key = keys[i];
  1357. if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
  1358. var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
  1359. try {
  1360. // Avoid failures from read-only properties
  1361. defineProperty(targetComponent, key, descriptor);
  1362. } catch (e) {}
  1363. }
  1364. }
  1365. }
  1366. return targetComponent;
  1367. }
  1368. module.exports = hoistNonReactStatics;
  1369. /***/ }),
  1370. /***/ "3HjQ":
  1371. /***/ (function(module, exports) {
  1372. Object.defineProperty(exports, "__esModule", {
  1373. value: true
  1374. });
  1375. // This function takes an array of styles and separates them into styles that
  1376. // are handled by Aphrodite and inline styles.
  1377. function separateStyles(stylesArray) {
  1378. var classNames = [];
  1379. // Since determining if an Object is empty requires collecting all of its
  1380. // keys, and we want the best performance in this code because we are in the
  1381. // render path, we are going to do a little bookkeeping ourselves.
  1382. var hasInlineStyles = false;
  1383. var inlineStyles = {};
  1384. // This is run on potentially every node in the tree when rendering, where
  1385. // performance is critical. Normally we would prefer using `forEach`, but
  1386. // old-fashioned for loops are faster so that's what we have chosen here.
  1387. for (var i = 0; i < stylesArray.length; i++) {
  1388. // eslint-disable-line no-plusplus
  1389. var style = stylesArray[i];
  1390. // If this style is falsy, we just want to disregard it. This allows for
  1391. // syntax like:
  1392. //
  1393. // css(isFoo && styles.foo)
  1394. if (style) {
  1395. if (typeof style === 'string') {
  1396. classNames.push(style);
  1397. } else {
  1398. Object.assign(inlineStyles, style);
  1399. hasInlineStyles = true;
  1400. }
  1401. }
  1402. }
  1403. return {
  1404. classNames: classNames,
  1405. hasInlineStyles: hasInlineStyles,
  1406. inlineStyles: inlineStyles
  1407. };
  1408. }
  1409. exports['default'] = separateStyles;
  1410. /***/ }),
  1411. /***/ "3aeR":
  1412. /***/ (function(module, exports, __webpack_require__) {
  1413. "use strict";
  1414. var GetIntrinsic = __webpack_require__("rZ7t");
  1415. var $TypeError = GetIntrinsic('%TypeError%');
  1416. var inspect = __webpack_require__("4qvr");
  1417. var IsPropertyKey = __webpack_require__("i10q");
  1418. var Type = __webpack_require__("V1cy");
  1419. /**
  1420. * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
  1421. * 1. Assert: Type(O) is Object.
  1422. * 2. Assert: IsPropertyKey(P) is true.
  1423. * 3. Return O.[[Get]](P, O).
  1424. */
  1425. module.exports = function Get(O, P) {
  1426. // 7.3.1.1
  1427. if (Type(O) !== 'Object') {
  1428. throw new $TypeError('Assertion failed: Type(O) is not Object');
  1429. }
  1430. // 7.3.1.2
  1431. if (!IsPropertyKey(P)) {
  1432. throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
  1433. }
  1434. // 7.3.1.3
  1435. return O[P];
  1436. };
  1437. /***/ }),
  1438. /***/ "3gBW":
  1439. /***/ (function(module, exports, __webpack_require__) {
  1440. // eslint-disable-next-line import/no-unresolved
  1441. module.exports = __webpack_require__("50qU");
  1442. /***/ }),
  1443. /***/ "4HRn":
  1444. /***/ (function(module, exports, __webpack_require__) {
  1445. "use strict";
  1446. // var modulo = require('./modulo');
  1447. var $floor = Math.floor;
  1448. // http://262.ecma-international.org/5.1/#sec-5.2
  1449. module.exports = function floor(x) {
  1450. // return x - modulo(x, 1);
  1451. return $floor(x);
  1452. };
  1453. /***/ }),
  1454. /***/ "4cSd":
  1455. /***/ (function(module, exports, __webpack_require__) {
  1456. "use strict";
  1457. var define = __webpack_require__("82c2");
  1458. var callBind = __webpack_require__("PrET");
  1459. var implementation = __webpack_require__("rQy3");
  1460. var getPolyfill = __webpack_require__("xoj2");
  1461. var shim = __webpack_require__("ib7Q");
  1462. var polyfill = callBind(getPolyfill(), Object);
  1463. define(polyfill, {
  1464. getPolyfill: getPolyfill,
  1465. implementation: implementation,
  1466. shim: shim
  1467. });
  1468. module.exports = polyfill;
  1469. /***/ }),
  1470. /***/ "4eJC":
  1471. /***/ (function(module, exports, __webpack_require__) {
  1472. /**
  1473. * Memize options object.
  1474. *
  1475. * @typedef MemizeOptions
  1476. *
  1477. * @property {number} [maxSize] Maximum size of the cache.
  1478. */
  1479. /**
  1480. * Internal cache entry.
  1481. *
  1482. * @typedef MemizeCacheNode
  1483. *
  1484. * @property {?MemizeCacheNode|undefined} [prev] Previous node.
  1485. * @property {?MemizeCacheNode|undefined} [next] Next node.
  1486. * @property {Array<*>} args Function arguments for cache
  1487. * entry.
  1488. * @property {*} val Function result.
  1489. */
  1490. /**
  1491. * Properties of the enhanced function for controlling cache.
  1492. *
  1493. * @typedef MemizeMemoizedFunction
  1494. *
  1495. * @property {()=>void} clear Clear the cache.
  1496. */
  1497. /**
  1498. * Accepts a function to be memoized, and returns a new memoized function, with
  1499. * optional options.
  1500. *
  1501. * @template {Function} F
  1502. *
  1503. * @param {F} fn Function to memoize.
  1504. * @param {MemizeOptions} [options] Options object.
  1505. *
  1506. * @return {F & MemizeMemoizedFunction} Memoized function.
  1507. */
  1508. function memize( fn, options ) {
  1509. var size = 0;
  1510. /** @type {?MemizeCacheNode|undefined} */
  1511. var head;
  1512. /** @type {?MemizeCacheNode|undefined} */
  1513. var tail;
  1514. options = options || {};
  1515. function memoized( /* ...args */ ) {
  1516. var node = head,
  1517. len = arguments.length,
  1518. args, i;
  1519. searchCache: while ( node ) {
  1520. // Perform a shallow equality test to confirm that whether the node
  1521. // under test is a candidate for the arguments passed. Two arrays
  1522. // are shallowly equal if their length matches and each entry is
  1523. // strictly equal between the two sets. Avoid abstracting to a
  1524. // function which could incur an arguments leaking deoptimization.
  1525. // Check whether node arguments match arguments length
  1526. if ( node.args.length !== arguments.length ) {
  1527. node = node.next;
  1528. continue;
  1529. }
  1530. // Check whether node arguments match arguments values
  1531. for ( i = 0; i < len; i++ ) {
  1532. if ( node.args[ i ] !== arguments[ i ] ) {
  1533. node = node.next;
  1534. continue searchCache;
  1535. }
  1536. }
  1537. // At this point we can assume we've found a match
  1538. // Surface matched node to head if not already
  1539. if ( node !== head ) {
  1540. // As tail, shift to previous. Must only shift if not also
  1541. // head, since if both head and tail, there is no previous.
  1542. if ( node === tail ) {
  1543. tail = node.prev;
  1544. }
  1545. // Adjust siblings to point to each other. If node was tail,
  1546. // this also handles new tail's empty `next` assignment.
  1547. /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
  1548. if ( node.next ) {
  1549. node.next.prev = node.prev;
  1550. }
  1551. node.next = head;
  1552. node.prev = null;
  1553. /** @type {MemizeCacheNode} */ ( head ).prev = node;
  1554. head = node;
  1555. }
  1556. // Return immediately
  1557. return node.val;
  1558. }
  1559. // No cached value found. Continue to insertion phase:
  1560. // Create a copy of arguments (avoid leaking deoptimization)
  1561. args = new Array( len );
  1562. for ( i = 0; i < len; i++ ) {
  1563. args[ i ] = arguments[ i ];
  1564. }
  1565. node = {
  1566. args: args,
  1567. // Generate the result from original function
  1568. val: fn.apply( null, args ),
  1569. };
  1570. // Don't need to check whether node is already head, since it would
  1571. // have been returned above already if it was
  1572. // Shift existing head down list
  1573. if ( head ) {
  1574. head.prev = node;
  1575. node.next = head;
  1576. } else {
  1577. // If no head, follows that there's no tail (at initial or reset)
  1578. tail = node;
  1579. }
  1580. // Trim tail if we're reached max size and are pending cache insertion
  1581. if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
  1582. tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
  1583. /** @type {MemizeCacheNode} */ ( tail ).next = null;
  1584. } else {
  1585. size++;
  1586. }
  1587. head = node;
  1588. return node.val;
  1589. }
  1590. memoized.clear = function() {
  1591. head = null;
  1592. tail = null;
  1593. size = 0;
  1594. };
  1595. if ( false ) {}
  1596. // Ignore reason: There's not a clear solution to create an intersection of
  1597. // the function with additional properties, where the goal is to retain the
  1598. // function signature of the incoming argument and add control properties
  1599. // on the return value.
  1600. // @ts-ignore
  1601. return memoized;
  1602. }
  1603. module.exports = memize;
  1604. /***/ }),
  1605. /***/ "4po3":
  1606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1607. "use strict";
  1608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isTextField; });
  1609. /**
  1610. * Check whether the given element is a text field, where text field is defined
  1611. * by the ability to select within the input, or that it is contenteditable.
  1612. *
  1613. * @example
  1614. * import { isTextField } from "reakit-utils";
  1615. *
  1616. * isTextField(document.querySelector("div")); // false
  1617. * isTextField(document.querySelector("input")); // true
  1618. * isTextField(document.querySelector("input[type='button']")); // false
  1619. * isTextField(document.querySelector("textarea")); // true
  1620. * isTextField(document.querySelector("div[contenteditable='true']")); // true
  1621. */
  1622. function isTextField(element) {
  1623. try {
  1624. var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
  1625. var isTextArea = element.tagName === "TEXTAREA";
  1626. var isContentEditable = element.contentEditable === "true";
  1627. return isTextInput || isTextArea || isContentEditable || false;
  1628. } catch (error) {
  1629. // Safari throws an exception when trying to get `selectionStart`
  1630. // on non-text <input> elements (which, understandably, don't
  1631. // have the text selection API). We catch this via a try/catch
  1632. // block, as opposed to a more explicit check of the element's
  1633. // input types, because of Safari's non-standard behavior. This
  1634. // also means we don't have to worry about the list of input
  1635. // types that support `selectionStart` changing as the HTML spec
  1636. // evolves over time.
  1637. return false;
  1638. }
  1639. }
  1640. /***/ }),
  1641. /***/ "4qRI":
  1642. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1643. "use strict";
  1644. function memoize(fn) {
  1645. var cache = {};
  1646. return function (arg) {
  1647. if (cache[arg] === undefined) cache[arg] = fn(arg);
  1648. return cache[arg];
  1649. };
  1650. }
  1651. /* harmony default export */ __webpack_exports__["a"] = (memoize);
  1652. /***/ }),
  1653. /***/ "4qvr":
  1654. /***/ (function(module, exports, __webpack_require__) {
  1655. var hasMap = typeof Map === 'function' && Map.prototype;
  1656. var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
  1657. var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
  1658. var mapForEach = hasMap && Map.prototype.forEach;
  1659. var hasSet = typeof Set === 'function' && Set.prototype;
  1660. var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
  1661. var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
  1662. var setForEach = hasSet && Set.prototype.forEach;
  1663. var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
  1664. var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
  1665. var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
  1666. var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
  1667. var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
  1668. var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
  1669. var booleanValueOf = Boolean.prototype.valueOf;
  1670. var objectToString = Object.prototype.toString;
  1671. var functionToString = Function.prototype.toString;
  1672. var match = String.prototype.match;
  1673. var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
  1674. var gOPS = Object.getOwnPropertySymbols;
  1675. var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
  1676. var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
  1677. var isEnumerable = Object.prototype.propertyIsEnumerable;
  1678. var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
  1679. [].__proto__ === Array.prototype // eslint-disable-line no-proto
  1680. ? function (O) {
  1681. return O.__proto__; // eslint-disable-line no-proto
  1682. }
  1683. : null
  1684. );
  1685. var inspectCustom = __webpack_require__(0).custom;
  1686. var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
  1687. var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
  1688. module.exports = function inspect_(obj, options, depth, seen) {
  1689. var opts = options || {};
  1690. if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
  1691. throw new TypeError('option "quoteStyle" must be "single" or "double"');
  1692. }
  1693. if (
  1694. has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
  1695. ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
  1696. : opts.maxStringLength !== null
  1697. )
  1698. ) {
  1699. throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
  1700. }
  1701. var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
  1702. if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
  1703. throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
  1704. }
  1705. if (
  1706. has(opts, 'indent')
  1707. && opts.indent !== null
  1708. && opts.indent !== '\t'
  1709. && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
  1710. ) {
  1711. throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
  1712. }
  1713. if (typeof obj === 'undefined') {
  1714. return 'undefined';
  1715. }
  1716. if (obj === null) {
  1717. return 'null';
  1718. }
  1719. if (typeof obj === 'boolean') {
  1720. return obj ? 'true' : 'false';
  1721. }
  1722. if (typeof obj === 'string') {
  1723. return inspectString(obj, opts);
  1724. }
  1725. if (typeof obj === 'number') {
  1726. if (obj === 0) {
  1727. return Infinity / obj > 0 ? '0' : '-0';
  1728. }
  1729. return String(obj);
  1730. }
  1731. if (typeof obj === 'bigint') {
  1732. return String(obj) + 'n';
  1733. }
  1734. var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
  1735. if (typeof depth === 'undefined') { depth = 0; }
  1736. if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
  1737. return isArray(obj) ? '[Array]' : '[Object]';
  1738. }
  1739. var indent = getIndent(opts, depth);
  1740. if (typeof seen === 'undefined') {
  1741. seen = [];
  1742. } else if (indexOf(seen, obj) >= 0) {
  1743. return '[Circular]';
  1744. }
  1745. function inspect(value, from, noIndent) {
  1746. if (from) {
  1747. seen = seen.slice();
  1748. seen.push(from);
  1749. }
  1750. if (noIndent) {
  1751. var newOpts = {
  1752. depth: opts.depth
  1753. };
  1754. if (has(opts, 'quoteStyle')) {
  1755. newOpts.quoteStyle = opts.quoteStyle;
  1756. }
  1757. return inspect_(value, newOpts, depth + 1, seen);
  1758. }
  1759. return inspect_(value, opts, depth + 1, seen);
  1760. }
  1761. if (typeof obj === 'function') {
  1762. var name = nameOf(obj);
  1763. var keys = arrObjKeys(obj, inspect);
  1764. return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
  1765. }
  1766. if (isSymbol(obj)) {
  1767. var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
  1768. return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
  1769. }
  1770. if (isElement(obj)) {
  1771. var s = '<' + String(obj.nodeName).toLowerCase();
  1772. var attrs = obj.attributes || [];
  1773. for (var i = 0; i < attrs.length; i++) {
  1774. s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
  1775. }
  1776. s += '>';
  1777. if (obj.childNodes && obj.childNodes.length) { s += '...'; }
  1778. s += '</' + String(obj.nodeName).toLowerCase() + '>';
  1779. return s;
  1780. }
  1781. if (isArray(obj)) {
  1782. if (obj.length === 0) { return '[]'; }
  1783. var xs = arrObjKeys(obj, inspect);
  1784. if (indent && !singleLineValues(xs)) {
  1785. return '[' + indentedJoin(xs, indent) + ']';
  1786. }
  1787. return '[ ' + xs.join(', ') + ' ]';
  1788. }
  1789. if (isError(obj)) {
  1790. var parts = arrObjKeys(obj, inspect);
  1791. if (parts.length === 0) { return '[' + String(obj) + ']'; }
  1792. return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
  1793. }
  1794. if (typeof obj === 'object' && customInspect) {
  1795. if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
  1796. return obj[inspectSymbol]();
  1797. } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
  1798. return obj.inspect();
  1799. }
  1800. }
  1801. if (isMap(obj)) {
  1802. var mapParts = [];
  1803. mapForEach.call(obj, function (value, key) {
  1804. mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
  1805. });
  1806. return collectionOf('Map', mapSize.call(obj), mapParts, indent);
  1807. }
  1808. if (isSet(obj)) {
  1809. var setParts = [];
  1810. setForEach.call(obj, function (value) {
  1811. setParts.push(inspect(value, obj));
  1812. });
  1813. return collectionOf('Set', setSize.call(obj), setParts, indent);
  1814. }
  1815. if (isWeakMap(obj)) {
  1816. return weakCollectionOf('WeakMap');
  1817. }
  1818. if (isWeakSet(obj)) {
  1819. return weakCollectionOf('WeakSet');
  1820. }
  1821. if (isWeakRef(obj)) {
  1822. return weakCollectionOf('WeakRef');
  1823. }
  1824. if (isNumber(obj)) {
  1825. return markBoxed(inspect(Number(obj)));
  1826. }
  1827. if (isBigInt(obj)) {
  1828. return markBoxed(inspect(bigIntValueOf.call(obj)));
  1829. }
  1830. if (isBoolean(obj)) {
  1831. return markBoxed(booleanValueOf.call(obj));
  1832. }
  1833. if (isString(obj)) {
  1834. return markBoxed(inspect(String(obj)));
  1835. }
  1836. if (!isDate(obj) && !isRegExp(obj)) {
  1837. var ys = arrObjKeys(obj, inspect);
  1838. var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
  1839. var protoTag = obj instanceof Object ? '' : 'null prototype';
  1840. var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
  1841. var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
  1842. var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
  1843. if (ys.length === 0) { return tag + '{}'; }
  1844. if (indent) {
  1845. return tag + '{' + indentedJoin(ys, indent) + '}';
  1846. }
  1847. return tag + '{ ' + ys.join(', ') + ' }';
  1848. }
  1849. return String(obj);
  1850. };
  1851. function wrapQuotes(s, defaultStyle, opts) {
  1852. var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
  1853. return quoteChar + s + quoteChar;
  1854. }
  1855. function quote(s) {
  1856. return String(s).replace(/"/g, '&quot;');
  1857. }
  1858. function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1859. function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1860. function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1861. function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1862. function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1863. function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1864. function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
  1865. // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
  1866. function isSymbol(obj) {
  1867. if (hasShammedSymbols) {
  1868. return obj && typeof obj === 'object' && obj instanceof Symbol;
  1869. }
  1870. if (typeof obj === 'symbol') {
  1871. return true;
  1872. }
  1873. if (!obj || typeof obj !== 'object' || !symToString) {
  1874. return false;
  1875. }
  1876. try {
  1877. symToString.call(obj);
  1878. return true;
  1879. } catch (e) {}
  1880. return false;
  1881. }
  1882. function isBigInt(obj) {
  1883. if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
  1884. return false;
  1885. }
  1886. try {
  1887. bigIntValueOf.call(obj);
  1888. return true;
  1889. } catch (e) {}
  1890. return false;
  1891. }
  1892. var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
  1893. function has(obj, key) {
  1894. return hasOwn.call(obj, key);
  1895. }
  1896. function toStr(obj) {
  1897. return objectToString.call(obj);
  1898. }
  1899. function nameOf(f) {
  1900. if (f.name) { return f.name; }
  1901. var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
  1902. if (m) { return m[1]; }
  1903. return null;
  1904. }
  1905. function indexOf(xs, x) {
  1906. if (xs.indexOf) { return xs.indexOf(x); }
  1907. for (var i = 0, l = xs.length; i < l; i++) {
  1908. if (xs[i] === x) { return i; }
  1909. }
  1910. return -1;
  1911. }
  1912. function isMap(x) {
  1913. if (!mapSize || !x || typeof x !== 'object') {
  1914. return false;
  1915. }
  1916. try {
  1917. mapSize.call(x);
  1918. try {
  1919. setSize.call(x);
  1920. } catch (s) {
  1921. return true;
  1922. }
  1923. return x instanceof Map; // core-js workaround, pre-v2.5.0
  1924. } catch (e) {}
  1925. return false;
  1926. }
  1927. function isWeakMap(x) {
  1928. if (!weakMapHas || !x || typeof x !== 'object') {
  1929. return false;
  1930. }
  1931. try {
  1932. weakMapHas.call(x, weakMapHas);
  1933. try {
  1934. weakSetHas.call(x, weakSetHas);
  1935. } catch (s) {
  1936. return true;
  1937. }
  1938. return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
  1939. } catch (e) {}
  1940. return false;
  1941. }
  1942. function isWeakRef(x) {
  1943. if (!weakRefDeref || !x || typeof x !== 'object') {
  1944. return false;
  1945. }
  1946. try {
  1947. weakRefDeref.call(x);
  1948. return true;
  1949. } catch (e) {}
  1950. return false;
  1951. }
  1952. function isSet(x) {
  1953. if (!setSize || !x || typeof x !== 'object') {
  1954. return false;
  1955. }
  1956. try {
  1957. setSize.call(x);
  1958. try {
  1959. mapSize.call(x);
  1960. } catch (m) {
  1961. return true;
  1962. }
  1963. return x instanceof Set; // core-js workaround, pre-v2.5.0
  1964. } catch (e) {}
  1965. return false;
  1966. }
  1967. function isWeakSet(x) {
  1968. if (!weakSetHas || !x || typeof x !== 'object') {
  1969. return false;
  1970. }
  1971. try {
  1972. weakSetHas.call(x, weakSetHas);
  1973. try {
  1974. weakMapHas.call(x, weakMapHas);
  1975. } catch (s) {
  1976. return true;
  1977. }
  1978. return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
  1979. } catch (e) {}
  1980. return false;
  1981. }
  1982. function isElement(x) {
  1983. if (!x || typeof x !== 'object') { return false; }
  1984. if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
  1985. return true;
  1986. }
  1987. return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
  1988. }
  1989. function inspectString(str, opts) {
  1990. if (str.length > opts.maxStringLength) {
  1991. var remaining = str.length - opts.maxStringLength;
  1992. var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
  1993. return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
  1994. }
  1995. // eslint-disable-next-line no-control-regex
  1996. var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
  1997. return wrapQuotes(s, 'single', opts);
  1998. }
  1999. function lowbyte(c) {
  2000. var n = c.charCodeAt(0);
  2001. var x = {
  2002. 8: 'b',
  2003. 9: 't',
  2004. 10: 'n',
  2005. 12: 'f',
  2006. 13: 'r'
  2007. }[n];
  2008. if (x) { return '\\' + x; }
  2009. return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
  2010. }
  2011. function markBoxed(str) {
  2012. return 'Object(' + str + ')';
  2013. }
  2014. function weakCollectionOf(type) {
  2015. return type + ' { ? }';
  2016. }
  2017. function collectionOf(type, size, entries, indent) {
  2018. var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
  2019. return type + ' (' + size + ') {' + joinedEntries + '}';
  2020. }
  2021. function singleLineValues(xs) {
  2022. for (var i = 0; i < xs.length; i++) {
  2023. if (indexOf(xs[i], '\n') >= 0) {
  2024. return false;
  2025. }
  2026. }
  2027. return true;
  2028. }
  2029. function getIndent(opts, depth) {
  2030. var baseIndent;
  2031. if (opts.indent === '\t') {
  2032. baseIndent = '\t';
  2033. } else if (typeof opts.indent === 'number' && opts.indent > 0) {
  2034. baseIndent = Array(opts.indent + 1).join(' ');
  2035. } else {
  2036. return null;
  2037. }
  2038. return {
  2039. base: baseIndent,
  2040. prev: Array(depth + 1).join(baseIndent)
  2041. };
  2042. }
  2043. function indentedJoin(xs, indent) {
  2044. if (xs.length === 0) { return ''; }
  2045. var lineJoiner = '\n' + indent.prev + indent.base;
  2046. return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
  2047. }
  2048. function arrObjKeys(obj, inspect) {
  2049. var isArr = isArray(obj);
  2050. var xs = [];
  2051. if (isArr) {
  2052. xs.length = obj.length;
  2053. for (var i = 0; i < obj.length; i++) {
  2054. xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
  2055. }
  2056. }
  2057. var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
  2058. var symMap;
  2059. if (hasShammedSymbols) {
  2060. symMap = {};
  2061. for (var k = 0; k < syms.length; k++) {
  2062. symMap['$' + syms[k]] = syms[k];
  2063. }
  2064. }
  2065. for (var key in obj) { // eslint-disable-line no-restricted-syntax
  2066. if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
  2067. if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
  2068. if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
  2069. // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
  2070. continue; // eslint-disable-line no-restricted-syntax, no-continue
  2071. } else if ((/[^\w$]/).test(key)) {
  2072. xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
  2073. } else {
  2074. xs.push(key + ': ' + inspect(obj[key], obj));
  2075. }
  2076. }
  2077. if (typeof gOPS === 'function') {
  2078. for (var j = 0; j < syms.length; j++) {
  2079. if (isEnumerable.call(obj, syms[j])) {
  2080. xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
  2081. }
  2082. }
  2083. }
  2084. return xs;
  2085. }
  2086. /***/ }),
  2087. /***/ "50qU":
  2088. /***/ (function(module, exports, __webpack_require__) {
  2089. "use strict";
  2090. Object.defineProperty(exports, "__esModule", {
  2091. value: true
  2092. });
  2093. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2094. var _react = __webpack_require__("cDcd");
  2095. var _react2 = _interopRequireDefault(_react);
  2096. var _propTypes = __webpack_require__("17x9");
  2097. var _propTypes2 = _interopRequireDefault(_propTypes);
  2098. var _airbnbPropTypes = __webpack_require__("Hsqg");
  2099. var _consolidatedEvents = __webpack_require__("1TsT");
  2100. var _object = __webpack_require__("4cSd");
  2101. var _object2 = _interopRequireDefault(_object);
  2102. var _document = __webpack_require__("n1Y7");
  2103. var _document2 = _interopRequireDefault(_document);
  2104. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  2105. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2106. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2107. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2108. var DISPLAY = {
  2109. BLOCK: 'block',
  2110. FLEX: 'flex',
  2111. INLINE: 'inline',
  2112. INLINE_BLOCK: 'inline-block',
  2113. CONTENTS: 'contents'
  2114. };
  2115. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
  2116. children: _propTypes2['default'].node.isRequired,
  2117. onOutsideClick: _propTypes2['default'].func.isRequired,
  2118. disabled: _propTypes2['default'].bool,
  2119. useCapture: _propTypes2['default'].bool,
  2120. display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY))
  2121. });
  2122. var defaultProps = {
  2123. disabled: false,
  2124. // `useCapture` is set to true by default so that a `stopPropagation` in the
  2125. // children will not prevent all outside click handlers from firing - maja
  2126. useCapture: true,
  2127. display: DISPLAY.BLOCK
  2128. };
  2129. var OutsideClickHandler = function (_React$Component) {
  2130. _inherits(OutsideClickHandler, _React$Component);
  2131. function OutsideClickHandler() {
  2132. var _ref;
  2133. _classCallCheck(this, OutsideClickHandler);
  2134. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2135. args[_key] = arguments[_key];
  2136. }
  2137. var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args)));
  2138. _this.onMouseDown = _this.onMouseDown.bind(_this);
  2139. _this.onMouseUp = _this.onMouseUp.bind(_this);
  2140. _this.setChildNodeRef = _this.setChildNodeRef.bind(_this);
  2141. return _this;
  2142. }
  2143. _createClass(OutsideClickHandler, [{
  2144. key: 'componentDidMount',
  2145. value: function () {
  2146. function componentDidMount() {
  2147. var _props = this.props,
  2148. disabled = _props.disabled,
  2149. useCapture = _props.useCapture;
  2150. if (!disabled) this.addMouseDownEventListener(useCapture);
  2151. }
  2152. return componentDidMount;
  2153. }()
  2154. }, {
  2155. key: 'componentDidUpdate',
  2156. value: function () {
  2157. function componentDidUpdate(_ref2) {
  2158. var prevDisabled = _ref2.disabled;
  2159. var _props2 = this.props,
  2160. disabled = _props2.disabled,
  2161. useCapture = _props2.useCapture;
  2162. if (prevDisabled !== disabled) {
  2163. if (disabled) {
  2164. this.removeEventListeners();
  2165. } else {
  2166. this.addMouseDownEventListener(useCapture);
  2167. }
  2168. }
  2169. }
  2170. return componentDidUpdate;
  2171. }()
  2172. }, {
  2173. key: 'componentWillUnmount',
  2174. value: function () {
  2175. function componentWillUnmount() {
  2176. this.removeEventListeners();
  2177. }
  2178. return componentWillUnmount;
  2179. }()
  2180. // Use mousedown/mouseup to enforce that clicks remain outside the root's
  2181. // descendant tree, even when dragged. This should also get triggered on
  2182. // touch devices.
  2183. }, {
  2184. key: 'onMouseDown',
  2185. value: function () {
  2186. function onMouseDown(e) {
  2187. var useCapture = this.props.useCapture;
  2188. var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
  2189. if (!isDescendantOfRoot) {
  2190. if (this.removeMouseUp) {
  2191. this.removeMouseUp();
  2192. this.removeMouseUp = null;
  2193. }
  2194. this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture });
  2195. }
  2196. }
  2197. return onMouseDown;
  2198. }()
  2199. // Use mousedown/mouseup to enforce that clicks remain outside the root's
  2200. // descendant tree, even when dragged. This should also get triggered on
  2201. // touch devices.
  2202. }, {
  2203. key: 'onMouseUp',
  2204. value: function () {
  2205. function onMouseUp(e) {
  2206. var onOutsideClick = this.props.onOutsideClick;
  2207. var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
  2208. if (this.removeMouseUp) {
  2209. this.removeMouseUp();
  2210. this.removeMouseUp = null;
  2211. }
  2212. if (!isDescendantOfRoot) {
  2213. onOutsideClick(e);
  2214. }
  2215. }
  2216. return onMouseUp;
  2217. }()
  2218. }, {
  2219. key: 'setChildNodeRef',
  2220. value: function () {
  2221. function setChildNodeRef(ref) {
  2222. this.childNode = ref;
  2223. }
  2224. return setChildNodeRef;
  2225. }()
  2226. }, {
  2227. key: 'addMouseDownEventListener',
  2228. value: function () {
  2229. function addMouseDownEventListener(useCapture) {
  2230. this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture });
  2231. }
  2232. return addMouseDownEventListener;
  2233. }()
  2234. }, {
  2235. key: 'removeEventListeners',
  2236. value: function () {
  2237. function removeEventListeners() {
  2238. if (this.removeMouseDown) this.removeMouseDown();
  2239. if (this.removeMouseUp) this.removeMouseUp();
  2240. }
  2241. return removeEventListeners;
  2242. }()
  2243. }, {
  2244. key: 'render',
  2245. value: function () {
  2246. function render() {
  2247. var _props3 = this.props,
  2248. children = _props3.children,
  2249. display = _props3.display;
  2250. return _react2['default'].createElement(
  2251. 'div',
  2252. {
  2253. ref: this.setChildNodeRef,
  2254. style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined
  2255. },
  2256. children
  2257. );
  2258. }
  2259. return render;
  2260. }()
  2261. }]);
  2262. return OutsideClickHandler;
  2263. }(_react2['default'].Component);
  2264. exports['default'] = OutsideClickHandler;
  2265. OutsideClickHandler.propTypes = propTypes;
  2266. OutsideClickHandler.defaultProps = defaultProps;
  2267. /***/ }),
  2268. /***/ "5V/u":
  2269. /***/ (function(module, exports) {
  2270. module.exports =
  2271. /******/ (function(modules) { // webpackBootstrap
  2272. /******/ // The module cache
  2273. /******/ var installedModules = {};
  2274. /******/
  2275. /******/ // The require function
  2276. /******/ function __webpack_require__(moduleId) {
  2277. /******/
  2278. /******/ // Check if module is in cache
  2279. /******/ if(installedModules[moduleId])
  2280. /******/ return installedModules[moduleId].exports;
  2281. /******/
  2282. /******/ // Create a new module (and put it into the cache)
  2283. /******/ var module = installedModules[moduleId] = {
  2284. /******/ exports: {},
  2285. /******/ id: moduleId,
  2286. /******/ loaded: false
  2287. /******/ };
  2288. /******/
  2289. /******/ // Execute the module function
  2290. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  2291. /******/
  2292. /******/ // Flag the module as loaded
  2293. /******/ module.loaded = true;
  2294. /******/
  2295. /******/ // Return the exports of the module
  2296. /******/ return module.exports;
  2297. /******/ }
  2298. /******/
  2299. /******/
  2300. /******/ // expose the modules object (__webpack_modules__)
  2301. /******/ __webpack_require__.m = modules;
  2302. /******/
  2303. /******/ // expose the module cache
  2304. /******/ __webpack_require__.c = installedModules;
  2305. /******/
  2306. /******/ // __webpack_public_path__
  2307. /******/ __webpack_require__.p = "";
  2308. /******/
  2309. /******/ // Load entry module and return exports
  2310. /******/ return __webpack_require__(0);
  2311. /******/ })
  2312. /************************************************************************/
  2313. /******/ ([
  2314. /* 0 */
  2315. /***/ (function(module, exports, __webpack_require__) {
  2316. module.exports = __webpack_require__(1);
  2317. /***/ }),
  2318. /* 1 */
  2319. /***/ (function(module, exports, __webpack_require__) {
  2320. 'use strict';
  2321. Object.defineProperty(exports, "__esModule", {
  2322. value: true
  2323. });
  2324. var _utils = __webpack_require__(2);
  2325. Object.defineProperty(exports, 'combineChunks', {
  2326. enumerable: true,
  2327. get: function get() {
  2328. return _utils.combineChunks;
  2329. }
  2330. });
  2331. Object.defineProperty(exports, 'fillInChunks', {
  2332. enumerable: true,
  2333. get: function get() {
  2334. return _utils.fillInChunks;
  2335. }
  2336. });
  2337. Object.defineProperty(exports, 'findAll', {
  2338. enumerable: true,
  2339. get: function get() {
  2340. return _utils.findAll;
  2341. }
  2342. });
  2343. Object.defineProperty(exports, 'findChunks', {
  2344. enumerable: true,
  2345. get: function get() {
  2346. return _utils.findChunks;
  2347. }
  2348. });
  2349. /***/ }),
  2350. /* 2 */
  2351. /***/ (function(module, exports) {
  2352. 'use strict';
  2353. Object.defineProperty(exports, "__esModule", {
  2354. value: true
  2355. });
  2356. /**
  2357. * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
  2358. * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
  2359. */
  2360. var findAll = exports.findAll = function findAll(_ref) {
  2361. var autoEscape = _ref.autoEscape,
  2362. _ref$caseSensitive = _ref.caseSensitive,
  2363. caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
  2364. _ref$findChunks = _ref.findChunks,
  2365. findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
  2366. sanitize = _ref.sanitize,
  2367. searchWords = _ref.searchWords,
  2368. textToHighlight = _ref.textToHighlight;
  2369. return fillInChunks({
  2370. chunksToHighlight: combineChunks({
  2371. chunks: findChunks({
  2372. autoEscape: autoEscape,
  2373. caseSensitive: caseSensitive,
  2374. sanitize: sanitize,
  2375. searchWords: searchWords,
  2376. textToHighlight: textToHighlight
  2377. })
  2378. }),
  2379. totalLength: textToHighlight ? textToHighlight.length : 0
  2380. });
  2381. };
  2382. /**
  2383. * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
  2384. * @return {start:number, end:number}[]
  2385. */
  2386. var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
  2387. var chunks = _ref2.chunks;
  2388. chunks = chunks.sort(function (first, second) {
  2389. return first.start - second.start;
  2390. }).reduce(function (processedChunks, nextChunk) {
  2391. // First chunk just goes straight in the array...
  2392. if (processedChunks.length === 0) {
  2393. return [nextChunk];
  2394. } else {
  2395. // ... subsequent chunks get checked to see if they overlap...
  2396. var prevChunk = processedChunks.pop();
  2397. if (nextChunk.start <= prevChunk.end) {
  2398. // It may be the case that prevChunk completely surrounds nextChunk, so take the
  2399. // largest of the end indeces.
  2400. var endIndex = Math.max(prevChunk.end, nextChunk.end);
  2401. processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
  2402. } else {
  2403. processedChunks.push(prevChunk, nextChunk);
  2404. }
  2405. return processedChunks;
  2406. }
  2407. }, []);
  2408. return chunks;
  2409. };
  2410. /**
  2411. * Examine text for any matches.
  2412. * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
  2413. * @return {start:number, end:number}[]
  2414. */
  2415. var defaultFindChunks = function defaultFindChunks(_ref3) {
  2416. var autoEscape = _ref3.autoEscape,
  2417. caseSensitive = _ref3.caseSensitive,
  2418. _ref3$sanitize = _ref3.sanitize,
  2419. sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize,
  2420. searchWords = _ref3.searchWords,
  2421. textToHighlight = _ref3.textToHighlight;
  2422. textToHighlight = sanitize(textToHighlight);
  2423. return searchWords.filter(function (searchWord) {
  2424. return searchWord;
  2425. }) // Remove empty words
  2426. .reduce(function (chunks, searchWord) {
  2427. searchWord = sanitize(searchWord);
  2428. if (autoEscape) {
  2429. searchWord = escapeRegExpFn(searchWord);
  2430. }
  2431. var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
  2432. var match = void 0;
  2433. while (match = regex.exec(textToHighlight)) {
  2434. var _start = match.index;
  2435. var _end = regex.lastIndex;
  2436. // We do not return zero-length matches
  2437. if (_end > _start) {
  2438. chunks.push({ highlight: false, start: _start, end: _end });
  2439. }
  2440. // Prevent browsers like Firefox from getting stuck in an infinite loop
  2441. // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
  2442. if (match.index === regex.lastIndex) {
  2443. regex.lastIndex++;
  2444. }
  2445. }
  2446. return chunks;
  2447. }, []);
  2448. };
  2449. // Allow the findChunks to be overridden in findAll,
  2450. // but for backwards compatibility we export as the old name
  2451. exports.findChunks = defaultFindChunks;
  2452. /**
  2453. * Given a set of chunks to highlight, create an additional set of chunks
  2454. * to represent the bits of text between the highlighted text.
  2455. * @param chunksToHighlight {start:number, end:number}[]
  2456. * @param totalLength number
  2457. * @return {start:number, end:number, highlight:boolean}[]
  2458. */
  2459. var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
  2460. var chunksToHighlight = _ref4.chunksToHighlight,
  2461. totalLength = _ref4.totalLength;
  2462. var allChunks = [];
  2463. var append = function append(start, end, highlight) {
  2464. if (end - start > 0) {
  2465. allChunks.push({
  2466. start: start,
  2467. end: end,
  2468. highlight: highlight
  2469. });
  2470. }
  2471. };
  2472. if (chunksToHighlight.length === 0) {
  2473. append(0, totalLength, false);
  2474. } else {
  2475. var lastIndex = 0;
  2476. chunksToHighlight.forEach(function (chunk) {
  2477. append(lastIndex, chunk.start, false);
  2478. append(chunk.start, chunk.end, true);
  2479. lastIndex = chunk.end;
  2480. });
  2481. append(lastIndex, totalLength, false);
  2482. }
  2483. return allChunks;
  2484. };
  2485. function defaultSanitize(string) {
  2486. return string;
  2487. }
  2488. function escapeRegExpFn(string) {
  2489. return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
  2490. }
  2491. /***/ })
  2492. /******/ ]);
  2493. /***/ }),
  2494. /***/ "5aBA":
  2495. /***/ (function(module, exports, __webpack_require__) {
  2496. "use strict";
  2497. /** @license React v17.0.2
  2498. * react-is.production.min.js
  2499. *
  2500. * Copyright (c) Facebook, Inc. and its affiliates.
  2501. *
  2502. * This source code is licensed under the MIT license found in the
  2503. * LICENSE file in the root directory of this source tree.
  2504. */
  2505. var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
  2506. if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")}
  2507. function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;
  2508. exports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};
  2509. exports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
  2510. exports.typeOf=y;
  2511. /***/ }),
  2512. /***/ "5yQQ":
  2513. /***/ (function(module, exports, __webpack_require__) {
  2514. "use strict";
  2515. var implementation = __webpack_require__("nRDI");
  2516. module.exports = function getPolyfill() {
  2517. if (typeof document !== 'undefined') {
  2518. if (document.contains) {
  2519. return document.contains;
  2520. }
  2521. if (document.body && document.body.contains) {
  2522. try {
  2523. if (typeof document.body.contains.call(document, '') === 'boolean') {
  2524. return document.body.contains;
  2525. }
  2526. } catch (e) { /**/ }
  2527. }
  2528. }
  2529. return implementation;
  2530. };
  2531. /***/ }),
  2532. /***/ "60zJ":
  2533. /***/ (function(module, exports, __webpack_require__) {
  2534. "use strict";
  2535. // https://262.ecma-international.org/5.1/#sec-8
  2536. module.exports = function Type(x) {
  2537. if (x === null) {
  2538. return 'Null';
  2539. }
  2540. if (typeof x === 'undefined') {
  2541. return 'Undefined';
  2542. }
  2543. if (typeof x === 'function' || typeof x === 'object') {
  2544. return 'Object';
  2545. }
  2546. if (typeof x === 'number') {
  2547. return 'Number';
  2548. }
  2549. if (typeof x === 'boolean') {
  2550. return 'Boolean';
  2551. }
  2552. if (typeof x === 'string') {
  2553. return 'String';
  2554. }
  2555. };
  2556. /***/ }),
  2557. /***/ "6HWY":
  2558. /***/ (function(module, exports, __webpack_require__) {
  2559. "use strict";
  2560. Object.defineProperty(exports, "__esModule", {
  2561. value: true
  2562. });
  2563. exports['default'] = isNextMonth;
  2564. var _moment = __webpack_require__("wy2R");
  2565. var _moment2 = _interopRequireDefault(_moment);
  2566. var _isSameMonth = __webpack_require__("ulUS");
  2567. var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
  2568. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  2569. function isNextMonth(a, b) {
  2570. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  2571. return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b);
  2572. }
  2573. /***/ }),
  2574. /***/ "6I5v":
  2575. /***/ (function(module, exports, __webpack_require__) {
  2576. "use strict";
  2577. module.exports = function sign(number) {
  2578. return number >= 0 ? 1 : -1;
  2579. };
  2580. /***/ }),
  2581. /***/ "6ZB3":
  2582. /***/ (function(module, exports, __webpack_require__) {
  2583. "use strict";
  2584. var GetIntrinsic = __webpack_require__("rZ7t");
  2585. var callBind = __webpack_require__("1LY1");
  2586. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  2587. module.exports = function callBoundIntrinsic(name, allowMissing) {
  2588. var intrinsic = GetIntrinsic(name, !!allowMissing);
  2589. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  2590. return callBind(intrinsic);
  2591. }
  2592. return intrinsic;
  2593. };
  2594. /***/ }),
  2595. /***/ "6zzY":
  2596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2597. "use strict";
  2598. // EXPORTS
  2599. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ useComponentsContext; });
  2600. // UNUSED EXPORTS: ComponentsContext, ContextSystemProvider
  2601. // EXTERNAL MODULE: external ["wp","element"]
  2602. var external_wp_element_ = __webpack_require__("GRId");
  2603. // EXTERNAL MODULE: external "lodash"
  2604. var external_lodash_ = __webpack_require__("YLtl");
  2605. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-isomorphic-layout-effect.js
  2606. /**
  2607. * WordPress dependencies
  2608. */
  2609. /**
  2610. * Copied from `@wordpress/compose` in order for us to be able to maintain all the types for the ui folder
  2611. */
  2612. const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_element_["useLayoutEffect"] : external_wp_element_["useEffect"];
  2613. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-system-provider.js
  2614. /**
  2615. * External dependencies
  2616. */
  2617. /**
  2618. * WordPress dependencies
  2619. */
  2620. /**
  2621. * Internal dependencies
  2622. */
  2623. const ComponentsContext = Object(external_wp_element_["createContext"])(
  2624. /** @type {Record<string, any>} */
  2625. {});
  2626. const useComponentsContext = () => Object(external_wp_element_["useContext"])(ComponentsContext);
  2627. /**
  2628. * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.
  2629. *
  2630. * @param {Object} props
  2631. * @param {Record<string, any>} props.value
  2632. * @return {Record<string, any>} The consolidated value.
  2633. */
  2634. function useContextSystemBridge({
  2635. value
  2636. }) {
  2637. const parentContext = useComponentsContext();
  2638. const parentContextRef = Object(external_wp_element_["useRef"])(parentContext);
  2639. const valueRef = Object(external_wp_element_["useRef"])(Object(external_lodash_["merge"])(parentContext, value));
  2640. const [config, setConfig] = Object(external_wp_element_["useState"])(valueRef.current);
  2641. useIsomorphicLayoutEffect(() => {
  2642. let hasChange = false;
  2643. if (!Object(external_lodash_["isEqual"])(value, valueRef.current)) {
  2644. valueRef.current = value;
  2645. hasChange = true;
  2646. }
  2647. if (!Object(external_lodash_["isEqual"])(parentContext, parentContextRef.current)) {
  2648. valueRef.current = Object(external_lodash_["merge"])(parentContext, valueRef.current);
  2649. parentContextRef.current = parentContext;
  2650. hasChange = true;
  2651. }
  2652. if (hasChange) {
  2653. setConfig(prev => ({ ...prev,
  2654. ...valueRef.current
  2655. }));
  2656. }
  2657. }, [value, parentContext]);
  2658. return config;
  2659. }
  2660. /**
  2661. * A Provider component that can modify props for connected components within
  2662. * the Context system.
  2663. *
  2664. * @example
  2665. * ```jsx
  2666. * <ContextSystemProvider value={{ Button: { size: 'small' }}}>
  2667. * <Button>...</Button>
  2668. * </ContextSystemProvider>
  2669. * ```
  2670. *
  2671. * @template {Record<string, any>} T
  2672. * @param {Object} options
  2673. * @param {import('react').ReactNode} options.children Children to render.
  2674. * @param {T} options.value Props to render into connected components.
  2675. * @return {JSX.Element} A Provider wrapped component.
  2676. */
  2677. const BaseContextSystemProvider = ({
  2678. children,
  2679. value
  2680. }) => {
  2681. const contextValue = useContextSystemBridge({
  2682. value
  2683. });
  2684. return Object(external_wp_element_["createElement"])(ComponentsContext.Provider, {
  2685. value: contextValue
  2686. }, children);
  2687. };
  2688. const ContextSystemProvider = Object(external_wp_element_["memo"])(BaseContextSystemProvider);
  2689. /***/ }),
  2690. /***/ "71Og":
  2691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2692. "use strict";
  2693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isButton; });
  2694. var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"];
  2695. /**
  2696. * Checks whether `element` is a native HTML button element.
  2697. *
  2698. * @example
  2699. * import { isButton } from "reakit-utils";
  2700. *
  2701. * isButton(document.querySelector("button")); // true
  2702. * isButton(document.querySelector("input[type='button']")); // true
  2703. * isButton(document.querySelector("div")); // false
  2704. * isButton(document.querySelector("input[type='text']")); // false
  2705. * isButton(document.querySelector("div[role='button']")); // false
  2706. *
  2707. * @returns {boolean}
  2708. */
  2709. function isButton(element) {
  2710. if (element.tagName === "BUTTON") return true;
  2711. if (element.tagName === "INPUT") {
  2712. var input = element;
  2713. return buttonInputTypes.indexOf(input.type) !== -1;
  2714. }
  2715. return false;
  2716. }
  2717. /***/ }),
  2718. /***/ "75pU":
  2719. /***/ (function(module, exports) {
  2720. //
  2721. // Main
  2722. //
  2723. function memoize (fn, options) {
  2724. var cache = options && options.cache
  2725. ? options.cache
  2726. : cacheDefault
  2727. var serializer = options && options.serializer
  2728. ? options.serializer
  2729. : serializerDefault
  2730. var strategy = options && options.strategy
  2731. ? options.strategy
  2732. : strategyDefault
  2733. return strategy(fn, {
  2734. cache: cache,
  2735. serializer: serializer
  2736. })
  2737. }
  2738. //
  2739. // Strategy
  2740. //
  2741. function isPrimitive (value) {
  2742. return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs
  2743. }
  2744. function monadic (fn, cache, serializer, arg) {
  2745. var cacheKey = isPrimitive(arg) ? arg : serializer(arg)
  2746. var computedValue = cache.get(cacheKey)
  2747. if (typeof computedValue === 'undefined') {
  2748. computedValue = fn.call(this, arg)
  2749. cache.set(cacheKey, computedValue)
  2750. }
  2751. return computedValue
  2752. }
  2753. function variadic (fn, cache, serializer) {
  2754. var args = Array.prototype.slice.call(arguments, 3)
  2755. var cacheKey = serializer(args)
  2756. var computedValue = cache.get(cacheKey)
  2757. if (typeof computedValue === 'undefined') {
  2758. computedValue = fn.apply(this, args)
  2759. cache.set(cacheKey, computedValue)
  2760. }
  2761. return computedValue
  2762. }
  2763. function assemble (fn, context, strategy, cache, serialize) {
  2764. return strategy.bind(
  2765. context,
  2766. fn,
  2767. cache,
  2768. serialize
  2769. )
  2770. }
  2771. function strategyDefault (fn, options) {
  2772. var strategy = fn.length === 1 ? monadic : variadic
  2773. return assemble(
  2774. fn,
  2775. this,
  2776. strategy,
  2777. options.cache.create(),
  2778. options.serializer
  2779. )
  2780. }
  2781. function strategyVariadic (fn, options) {
  2782. var strategy = variadic
  2783. return assemble(
  2784. fn,
  2785. this,
  2786. strategy,
  2787. options.cache.create(),
  2788. options.serializer
  2789. )
  2790. }
  2791. function strategyMonadic (fn, options) {
  2792. var strategy = monadic
  2793. return assemble(
  2794. fn,
  2795. this,
  2796. strategy,
  2797. options.cache.create(),
  2798. options.serializer
  2799. )
  2800. }
  2801. //
  2802. // Serializer
  2803. //
  2804. function serializerDefault () {
  2805. return JSON.stringify(arguments)
  2806. }
  2807. //
  2808. // Cache
  2809. //
  2810. function ObjectWithoutPrototypeCache () {
  2811. this.cache = Object.create(null)
  2812. }
  2813. ObjectWithoutPrototypeCache.prototype.has = function (key) {
  2814. return (key in this.cache)
  2815. }
  2816. ObjectWithoutPrototypeCache.prototype.get = function (key) {
  2817. return this.cache[key]
  2818. }
  2819. ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
  2820. this.cache[key] = value
  2821. }
  2822. var cacheDefault = {
  2823. create: function create () {
  2824. return new ObjectWithoutPrototypeCache()
  2825. }
  2826. }
  2827. //
  2828. // API
  2829. //
  2830. module.exports = memoize
  2831. module.exports.strategies = {
  2832. variadic: strategyVariadic,
  2833. monadic: strategyMonadic
  2834. }
  2835. /***/ }),
  2836. /***/ "7Cbv":
  2837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2838. "use strict";
  2839. // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
  2840. // Unique ID creation requires a high quality random # generator. In the browser we therefore
  2841. // require the crypto API and do not support built-in fallback to lower quality random number
  2842. // generators (like Math.random()).
  2843. var getRandomValues;
  2844. var rnds8 = new Uint8Array(16);
  2845. function rng() {
  2846. // lazy load so that environments that need to polyfill have a chance to do so
  2847. if (!getRandomValues) {
  2848. // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
  2849. // find the complete implementation of crypto (msCrypto) on IE11.
  2850. getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
  2851. if (!getRandomValues) {
  2852. throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
  2853. }
  2854. }
  2855. return getRandomValues(rnds8);
  2856. }
  2857. // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
  2858. /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
  2859. // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
  2860. function validate(uuid) {
  2861. return typeof uuid === 'string' && regex.test(uuid);
  2862. }
  2863. /* harmony default export */ var esm_browser_validate = (validate);
  2864. // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
  2865. /**
  2866. * Convert array of 16 byte values to UUID string format of the form:
  2867. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  2868. */
  2869. var byteToHex = [];
  2870. for (var stringify_i = 0; stringify_i < 256; ++stringify_i) {
  2871. byteToHex.push((stringify_i + 0x100).toString(16).substr(1));
  2872. }
  2873. function stringify(arr) {
  2874. var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  2875. // Note: Be careful editing this code! It's been tuned for performance
  2876. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  2877. var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
  2878. // of the following:
  2879. // - One or more input array values don't map to a hex octet (leading to
  2880. // "undefined" in the uuid)
  2881. // - Invalid input values for the RFC `version` or `variant` fields
  2882. if (!esm_browser_validate(uuid)) {
  2883. throw TypeError('Stringified UUID is invalid');
  2884. }
  2885. return uuid;
  2886. }
  2887. /* harmony default export */ var esm_browser_stringify = (stringify);
  2888. // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
  2889. function v4(options, buf, offset) {
  2890. options = options || {};
  2891. var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  2892. rnds[6] = rnds[6] & 0x0f | 0x40;
  2893. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  2894. if (buf) {
  2895. offset = offset || 0;
  2896. for (var i = 0; i < 16; ++i) {
  2897. buf[offset + i] = rnds[i];
  2898. }
  2899. return buf;
  2900. }
  2901. return esm_browser_stringify(rnds);
  2902. }
  2903. /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
  2904. /***/ }),
  2905. /***/ "7Ji+":
  2906. /***/ (function(module, exports, __webpack_require__) {
  2907. "use strict";
  2908. var GetIntrinsic = __webpack_require__("rZ7t");
  2909. var $Array = GetIntrinsic('%Array%');
  2910. var $species = GetIntrinsic('%Symbol.species%', true);
  2911. var $TypeError = GetIntrinsic('%TypeError%');
  2912. var Get = __webpack_require__("3aeR");
  2913. var IsArray = __webpack_require__("9cOx");
  2914. var IsConstructor = __webpack_require__("kuGu");
  2915. var IsInteger = __webpack_require__("R/b7");
  2916. var Type = __webpack_require__("V1cy");
  2917. // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
  2918. module.exports = function ArraySpeciesCreate(originalArray, length) {
  2919. if (!IsInteger(length) || length < 0) {
  2920. throw new $TypeError('Assertion failed: length must be an integer >= 0');
  2921. }
  2922. var len = length === 0 ? 0 : length;
  2923. var C;
  2924. var isArray = IsArray(originalArray);
  2925. if (isArray) {
  2926. C = Get(originalArray, 'constructor');
  2927. // TODO: figure out how to make a cross-realm normal Array, a same-realm Array
  2928. // if (IsConstructor(C)) {
  2929. // if C is another realm's Array, C = undefined
  2930. // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
  2931. // }
  2932. if ($species && Type(C) === 'Object') {
  2933. C = Get(C, $species);
  2934. if (C === null) {
  2935. C = void 0;
  2936. }
  2937. }
  2938. }
  2939. if (typeof C === 'undefined') {
  2940. return $Array(len);
  2941. }
  2942. if (!IsConstructor(C)) {
  2943. throw new $TypeError('C must be a constructor');
  2944. }
  2945. return new C(len); // Construct(C, len);
  2946. };
  2947. /***/ }),
  2948. /***/ "7Jlx":
  2949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2950. "use strict";
  2951. /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contextConnect; });
  2952. /* unused harmony export getConnectNamespace */
  2953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasConnectNamespace; });
  2954. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl");
  2955. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
  2956. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  2957. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  2958. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Z23Y");
  2959. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_2__);
  2960. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tQ+x");
  2961. /* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("UAm0");
  2962. /**
  2963. * External dependencies
  2964. */
  2965. /**
  2966. * WordPress dependencies
  2967. */
  2968. /**
  2969. * Internal dependencies
  2970. */
  2971. /* eslint-disable jsdoc/valid-types */
  2972. /**
  2973. * Forwards ref (React.ForwardRef) and "Connects" (or registers) a component
  2974. * within the Context system under a specified namespace.
  2975. *
  2976. * This is an (experimental) evolution of the initial connect() HOC.
  2977. * The hope is that we can improve render performance by removing functional
  2978. * component wrappers.
  2979. *
  2980. * @template {import('./polymorphic-component').ViewOwnProps<{}, any>} P
  2981. * @param {(props: P, ref: import('react').Ref<any>) => JSX.Element | null} Component The component to register into the Context system.
  2982. * @param {string} namespace The namespace to register the component under.
  2983. * @param {Object} options
  2984. * @param {boolean} [options.memo=false]
  2985. * @return {import('./polymorphic-component').PolymorphicComponent<import('./polymorphic-component').ElementTypeFromViewOwnProps<P>, import('./polymorphic-component').PropsFromViewOwnProps<P>>} The connected PolymorphicComponent
  2986. */
  2987. function contextConnect(Component, namespace, options = {}) {
  2988. /* eslint-enable jsdoc/valid-types */
  2989. const {
  2990. memo: memoProp = false
  2991. } = options;
  2992. let WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Component);
  2993. if (memoProp) {
  2994. // @ts-ignore
  2995. WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["memo"])(WrappedComponent);
  2996. }
  2997. if (typeof namespace === 'undefined') {
  2998. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default()('contextConnect: Please provide a namespace') : void 0;
  2999. } // @ts-ignore internal property
  3000. let mergedNamespace = WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] || [namespace];
  3001. /**
  3002. * Consolidate (merge) namespaces before attaching it to the WrappedComponent.
  3003. */
  3004. if (Array.isArray(namespace)) {
  3005. mergedNamespace = [...mergedNamespace, ...namespace];
  3006. }
  3007. if (typeof namespace === 'string') {
  3008. mergedNamespace = [...mergedNamespace, namespace];
  3009. }
  3010. WrappedComponent.displayName = namespace; // @ts-ignore internal property
  3011. WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["uniq"])(mergedNamespace); // @ts-ignore PolymorphicComponent property
  3012. WrappedComponent.selector = `.${Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__[/* getStyledClassNameFromKey */ "a"])(namespace)}`; // @ts-ignore
  3013. return WrappedComponent;
  3014. }
  3015. /**
  3016. * Attempts to retrieve the connected namespace from a component.
  3017. *
  3018. * @param {import('react').ReactChild | undefined | {}} Component The component to retrieve a namespace from.
  3019. * @return {Array<string>} The connected namespaces.
  3020. */
  3021. function getConnectNamespace(Component) {
  3022. if (!Component) return [];
  3023. let namespaces = []; // @ts-ignore internal property
  3024. if (Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) {
  3025. // @ts-ignore internal property
  3026. namespaces = Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]];
  3027. } // @ts-ignore
  3028. if (Component.type && Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) {
  3029. // @ts-ignore
  3030. namespaces = Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]];
  3031. }
  3032. return namespaces;
  3033. }
  3034. /**
  3035. * Checks to see if a component is connected within the Context system.
  3036. *
  3037. * @param {import('react').ReactNode} Component The component to retrieve a namespace from.
  3038. * @param {Array<string>|string} match The namespace to check.
  3039. * @return {boolean} The result.
  3040. */
  3041. function hasConnectNamespace(Component, match) {
  3042. if (!Component) return false;
  3043. if (typeof match === 'string') {
  3044. return getConnectNamespace(Component).includes(match);
  3045. }
  3046. if (Array.isArray(match)) {
  3047. return match.some(result => getConnectNamespace(Component).includes(result));
  3048. }
  3049. return false;
  3050. }
  3051. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  3052. /***/ }),
  3053. /***/ "82c2":
  3054. /***/ (function(module, exports, __webpack_require__) {
  3055. "use strict";
  3056. var keys = __webpack_require__("1seS");
  3057. var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
  3058. var toStr = Object.prototype.toString;
  3059. var concat = Array.prototype.concat;
  3060. var origDefineProperty = Object.defineProperty;
  3061. var isFunction = function (fn) {
  3062. return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
  3063. };
  3064. var arePropertyDescriptorsSupported = function () {
  3065. var obj = {};
  3066. try {
  3067. origDefineProperty(obj, 'x', { enumerable: false, value: obj });
  3068. // eslint-disable-next-line no-unused-vars, no-restricted-syntax
  3069. for (var _ in obj) { // jscs:ignore disallowUnusedVariables
  3070. return false;
  3071. }
  3072. return obj.x === obj;
  3073. } catch (e) { /* this is IE 8. */
  3074. return false;
  3075. }
  3076. };
  3077. var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
  3078. var defineProperty = function (object, name, value, predicate) {
  3079. if (name in object && (!isFunction(predicate) || !predicate())) {
  3080. return;
  3081. }
  3082. if (supportsDescriptors) {
  3083. origDefineProperty(object, name, {
  3084. configurable: true,
  3085. enumerable: false,
  3086. value: value,
  3087. writable: true
  3088. });
  3089. } else {
  3090. object[name] = value;
  3091. }
  3092. };
  3093. var defineProperties = function (object, map) {
  3094. var predicates = arguments.length > 2 ? arguments[2] : {};
  3095. var props = keys(map);
  3096. if (hasSymbols) {
  3097. props = concat.call(props, Object.getOwnPropertySymbols(map));
  3098. }
  3099. for (var i = 0; i < props.length; i += 1) {
  3100. defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  3101. }
  3102. };
  3103. defineProperties.supportsDescriptors = !!supportsDescriptors;
  3104. module.exports = defineProperties;
  3105. /***/ }),
  3106. /***/ "8OQS":
  3107. /***/ (function(module, exports) {
  3108. function _objectWithoutPropertiesLoose(source, excluded) {
  3109. if (source == null) return {};
  3110. var target = {};
  3111. var sourceKeys = Object.keys(source);
  3112. var key, i;
  3113. for (i = 0; i < sourceKeys.length; i++) {
  3114. key = sourceKeys[i];
  3115. if (excluded.indexOf(key) >= 0) continue;
  3116. target[key] = source[key];
  3117. }
  3118. return target;
  3119. }
  3120. module.exports = _objectWithoutPropertiesLoose;
  3121. module.exports["default"] = module.exports, module.exports.__esModule = true;
  3122. /***/ }),
  3123. /***/ "8R9v":
  3124. /***/ (function(module, exports, __webpack_require__) {
  3125. "use strict";
  3126. var define = __webpack_require__("82c2");
  3127. var getPolyfill = __webpack_require__("yLpt");
  3128. module.exports = function shimAssign() {
  3129. var polyfill = getPolyfill();
  3130. define(
  3131. Object,
  3132. { assign: polyfill },
  3133. { assign: function () { return Object.assign !== polyfill; } }
  3134. );
  3135. return polyfill;
  3136. };
  3137. /***/ }),
  3138. /***/ "8oxB":
  3139. /***/ (function(module, exports) {
  3140. // shim for using process in browser
  3141. var process = module.exports = {};
  3142. // cached from whatever global is present so that test runners that stub it
  3143. // don't break things. But we need to wrap it in a try catch in case it is
  3144. // wrapped in strict mode code which doesn't define any globals. It's inside a
  3145. // function because try/catches deoptimize in certain engines.
  3146. var cachedSetTimeout;
  3147. var cachedClearTimeout;
  3148. function defaultSetTimout() {
  3149. throw new Error('setTimeout has not been defined');
  3150. }
  3151. function defaultClearTimeout () {
  3152. throw new Error('clearTimeout has not been defined');
  3153. }
  3154. (function () {
  3155. try {
  3156. if (typeof setTimeout === 'function') {
  3157. cachedSetTimeout = setTimeout;
  3158. } else {
  3159. cachedSetTimeout = defaultSetTimout;
  3160. }
  3161. } catch (e) {
  3162. cachedSetTimeout = defaultSetTimout;
  3163. }
  3164. try {
  3165. if (typeof clearTimeout === 'function') {
  3166. cachedClearTimeout = clearTimeout;
  3167. } else {
  3168. cachedClearTimeout = defaultClearTimeout;
  3169. }
  3170. } catch (e) {
  3171. cachedClearTimeout = defaultClearTimeout;
  3172. }
  3173. } ())
  3174. function runTimeout(fun) {
  3175. if (cachedSetTimeout === setTimeout) {
  3176. //normal enviroments in sane situations
  3177. return setTimeout(fun, 0);
  3178. }
  3179. // if setTimeout wasn't available but was latter defined
  3180. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  3181. cachedSetTimeout = setTimeout;
  3182. return setTimeout(fun, 0);
  3183. }
  3184. try {
  3185. // when when somebody has screwed with setTimeout but no I.E. maddness
  3186. return cachedSetTimeout(fun, 0);
  3187. } catch(e){
  3188. try {
  3189. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  3190. return cachedSetTimeout.call(null, fun, 0);
  3191. } catch(e){
  3192. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  3193. return cachedSetTimeout.call(this, fun, 0);
  3194. }
  3195. }
  3196. }
  3197. function runClearTimeout(marker) {
  3198. if (cachedClearTimeout === clearTimeout) {
  3199. //normal enviroments in sane situations
  3200. return clearTimeout(marker);
  3201. }
  3202. // if clearTimeout wasn't available but was latter defined
  3203. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  3204. cachedClearTimeout = clearTimeout;
  3205. return clearTimeout(marker);
  3206. }
  3207. try {
  3208. // when when somebody has screwed with setTimeout but no I.E. maddness
  3209. return cachedClearTimeout(marker);
  3210. } catch (e){
  3211. try {
  3212. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  3213. return cachedClearTimeout.call(null, marker);
  3214. } catch (e){
  3215. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  3216. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  3217. return cachedClearTimeout.call(this, marker);
  3218. }
  3219. }
  3220. }
  3221. var queue = [];
  3222. var draining = false;
  3223. var currentQueue;
  3224. var queueIndex = -1;
  3225. function cleanUpNextTick() {
  3226. if (!draining || !currentQueue) {
  3227. return;
  3228. }
  3229. draining = false;
  3230. if (currentQueue.length) {
  3231. queue = currentQueue.concat(queue);
  3232. } else {
  3233. queueIndex = -1;
  3234. }
  3235. if (queue.length) {
  3236. drainQueue();
  3237. }
  3238. }
  3239. function drainQueue() {
  3240. if (draining) {
  3241. return;
  3242. }
  3243. var timeout = runTimeout(cleanUpNextTick);
  3244. draining = true;
  3245. var len = queue.length;
  3246. while(len) {
  3247. currentQueue = queue;
  3248. queue = [];
  3249. while (++queueIndex < len) {
  3250. if (currentQueue) {
  3251. currentQueue[queueIndex].run();
  3252. }
  3253. }
  3254. queueIndex = -1;
  3255. len = queue.length;
  3256. }
  3257. currentQueue = null;
  3258. draining = false;
  3259. runClearTimeout(timeout);
  3260. }
  3261. process.nextTick = function (fun) {
  3262. var args = new Array(arguments.length - 1);
  3263. if (arguments.length > 1) {
  3264. for (var i = 1; i < arguments.length; i++) {
  3265. args[i - 1] = arguments[i];
  3266. }
  3267. }
  3268. queue.push(new Item(fun, args));
  3269. if (queue.length === 1 && !draining) {
  3270. runTimeout(drainQueue);
  3271. }
  3272. };
  3273. // v8 likes predictible objects
  3274. function Item(fun, array) {
  3275. this.fun = fun;
  3276. this.array = array;
  3277. }
  3278. Item.prototype.run = function () {
  3279. this.fun.apply(null, this.array);
  3280. };
  3281. process.title = 'browser';
  3282. process.browser = true;
  3283. process.env = {};
  3284. process.argv = [];
  3285. process.version = ''; // empty string to avoid regexp issues
  3286. process.versions = {};
  3287. function noop() {}
  3288. process.on = noop;
  3289. process.addListener = noop;
  3290. process.once = noop;
  3291. process.off = noop;
  3292. process.removeListener = noop;
  3293. process.removeAllListeners = noop;
  3294. process.emit = noop;
  3295. process.prependListener = noop;
  3296. process.prependOnceListener = noop;
  3297. process.listeners = function (name) { return [] }
  3298. process.binding = function (name) {
  3299. throw new Error('process.binding is not supported');
  3300. };
  3301. process.cwd = function () { return '/' };
  3302. process.chdir = function (dir) {
  3303. throw new Error('process.chdir is not supported');
  3304. };
  3305. process.umask = function() { return 0; };
  3306. /***/ }),
  3307. /***/ "9Do8":
  3308. /***/ (function(module, exports, __webpack_require__) {
  3309. "use strict";
  3310. module.exports = __webpack_require__("zt9T");
  3311. /***/ }),
  3312. /***/ "9NHk":
  3313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3314. "use strict";
  3315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return withNext; });
  3316. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14");
  3317. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  3318. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  3319. /**
  3320. * Internal dependencies
  3321. */
  3322. /**
  3323. * @template {{}} TCurrentProps
  3324. * @template {{}} TNextProps
  3325. * @param {import('react').ForwardRefExoticComponent<TCurrentProps>} CurrentComponent
  3326. * @param {import('react').ComponentType<TNextProps>} NextComponent
  3327. * @param {string} namespace
  3328. * @param {(props: TCurrentProps) => TNextProps} adapter
  3329. */
  3330. function withNext(CurrentComponent, NextComponent = () => null, namespace = 'Component', adapter = p =>
  3331. /** @type {any} */
  3332. p) {
  3333. if (false) {}
  3334. return CurrentComponent;
  3335. }
  3336. /***/ }),
  3337. /***/ "9VDH":
  3338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3339. "use strict";
  3340. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14");
  3341. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  3342. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  3343. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Tqx9");
  3344. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__);
  3345. /* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vUUf");
  3346. /**
  3347. * WordPress dependencies
  3348. */
  3349. /**
  3350. * Internal dependencies
  3351. */
  3352. function Icon({
  3353. icon = null,
  3354. size,
  3355. ...additionalProps
  3356. }) {
  3357. if ('string' === typeof icon) {
  3358. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
  3359. icon: icon
  3360. }, additionalProps));
  3361. }
  3362. if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] === icon.type) {
  3363. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, { ...additionalProps
  3364. });
  3365. } // Icons should be 24x24 by default.
  3366. const iconSize = size || 24;
  3367. if ('function' === typeof icon) {
  3368. if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Component"]) {
  3369. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(icon, {
  3370. size: iconSize,
  3371. ...additionalProps
  3372. });
  3373. }
  3374. return icon({
  3375. size: iconSize,
  3376. ...additionalProps
  3377. });
  3378. }
  3379. if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"])) {
  3380. const appliedProps = {
  3381. width: iconSize,
  3382. height: iconSize,
  3383. ...icon.props,
  3384. ...additionalProps
  3385. };
  3386. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"], appliedProps);
  3387. }
  3388. if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["isValidElement"])(icon)) {
  3389. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, {
  3390. size: iconSize,
  3391. ...additionalProps
  3392. });
  3393. }
  3394. return icon;
  3395. }
  3396. /* harmony default export */ __webpack_exports__["a"] = (Icon);
  3397. /***/ }),
  3398. /***/ "9cOx":
  3399. /***/ (function(module, exports, __webpack_require__) {
  3400. "use strict";
  3401. var GetIntrinsic = __webpack_require__("rZ7t");
  3402. var $Array = GetIntrinsic('%Array%');
  3403. // eslint-disable-next-line global-require
  3404. var toStr = !$Array.isArray && __webpack_require__("EXo9")('Object.prototype.toString');
  3405. // https://ecma-international.org/ecma-262/6.0/#sec-isarray
  3406. module.exports = $Array.isArray || function IsArray(argument) {
  3407. return toStr(argument) === '[object Array]';
  3408. };
  3409. /***/ }),
  3410. /***/ "9gmn":
  3411. /***/ (function(module, exports, __webpack_require__) {
  3412. "use strict";
  3413. Object.defineProperty(exports, "__esModule", {
  3414. value: true
  3415. });
  3416. var _react = __webpack_require__("cDcd");
  3417. var _react2 = _interopRequireDefault(_react);
  3418. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  3419. var ChevronUp = function () {
  3420. function ChevronUp(props) {
  3421. return _react2['default'].createElement(
  3422. 'svg',
  3423. props,
  3424. _react2['default'].createElement('path', {
  3425. d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z'
  3426. })
  3427. );
  3428. }
  3429. return ChevronUp;
  3430. }();
  3431. ChevronUp.defaultProps = {
  3432. viewBox: '0 0 1000 1000'
  3433. };
  3434. exports['default'] = ChevronUp;
  3435. /***/ }),
  3436. /***/ "9pTB":
  3437. /***/ (function(module, exports, __webpack_require__) {
  3438. "use strict";
  3439. /* WEBPACK VAR INJECTION */(function(global) {
  3440. var define = __webpack_require__("82c2");
  3441. var isSymbol = __webpack_require__("/sVA");
  3442. var globalKey = '__ global cache key __';
  3443. /* istanbul ignore else */
  3444. // eslint-disable-next-line no-restricted-properties
  3445. if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') {
  3446. // eslint-disable-next-line no-restricted-properties
  3447. globalKey = Symbol['for'](globalKey);
  3448. }
  3449. var trueThunk = function () {
  3450. return true;
  3451. };
  3452. var ensureCache = function ensureCache() {
  3453. if (!global[globalKey]) {
  3454. var properties = {};
  3455. properties[globalKey] = {};
  3456. var predicates = {};
  3457. predicates[globalKey] = trueThunk;
  3458. define(global, properties, predicates);
  3459. }
  3460. return global[globalKey];
  3461. };
  3462. var cache = ensureCache();
  3463. var isPrimitive = function isPrimitive(val) {
  3464. return val === null || (typeof val !== 'object' && typeof val !== 'function');
  3465. };
  3466. var getPrimitiveKey = function getPrimitiveKey(val) {
  3467. if (isSymbol(val)) {
  3468. return Symbol.prototype.valueOf.call(val);
  3469. }
  3470. return typeof val + ' | ' + String(val);
  3471. };
  3472. var requirePrimitiveKey = function requirePrimitiveKey(val) {
  3473. if (!isPrimitive(val)) {
  3474. throw new TypeError('key must not be an object');
  3475. }
  3476. };
  3477. var globalCache = {
  3478. clear: function clear() {
  3479. delete global[globalKey];
  3480. cache = ensureCache();
  3481. },
  3482. 'delete': function deleteKey(key) {
  3483. requirePrimitiveKey(key);
  3484. delete cache[getPrimitiveKey(key)];
  3485. return !globalCache.has(key);
  3486. },
  3487. get: function get(key) {
  3488. requirePrimitiveKey(key);
  3489. return cache[getPrimitiveKey(key)];
  3490. },
  3491. has: function has(key) {
  3492. requirePrimitiveKey(key);
  3493. return getPrimitiveKey(key) in cache;
  3494. },
  3495. set: function set(key, value) {
  3496. requirePrimitiveKey(key);
  3497. var primitiveKey = getPrimitiveKey(key);
  3498. var props = {};
  3499. props[primitiveKey] = value;
  3500. var predicates = {};
  3501. predicates[primitiveKey] = trueThunk;
  3502. define(cache, props, predicates);
  3503. return globalCache.has(key);
  3504. },
  3505. setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) {
  3506. if (globalCache.has(key)) {
  3507. return globalCache.get(key);
  3508. }
  3509. var item = valueThunk();
  3510. globalCache.set(key, item);
  3511. return item;
  3512. }
  3513. };
  3514. module.exports = globalCache;
  3515. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj")))
  3516. /***/ }),
  3517. /***/ "9uj6":
  3518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3519. "use strict";
  3520. __webpack_require__.r(__webpack_exports__);
  3521. /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4qRI");
  3522. var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
  3523. var index = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(function (prop) {
  3524. return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
  3525. /* o */
  3526. && prop.charCodeAt(1) === 110
  3527. /* n */
  3528. && prop.charCodeAt(2) < 91;
  3529. }
  3530. /* Z+1 */
  3531. );
  3532. /* harmony default export */ __webpack_exports__["default"] = (index);
  3533. /***/ }),
  3534. /***/ "AClM":
  3535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3536. "use strict";
  3537. // EXPORTS
  3538. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ensureFocus; });
  3539. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
  3540. var getActiveElement = __webpack_require__("Nym8");
  3541. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js
  3542. /**
  3543. * Checks if `element` has focus. Elements that are referenced by
  3544. * `aria-activedescendant` are also considered.
  3545. *
  3546. * @example
  3547. * import { hasFocus } from "reakit-utils";
  3548. *
  3549. * hasFocus(document.getElementById("id"));
  3550. */
  3551. function hasFocus(element) {
  3552. var activeElement = Object(getActiveElement["a" /* getActiveElement */])(element);
  3553. if (!activeElement) return false;
  3554. if (activeElement === element) return true;
  3555. var activeDescendant = activeElement.getAttribute("aria-activedescendant");
  3556. if (!activeDescendant) return false;
  3557. return activeDescendant === element.id;
  3558. }
  3559. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js
  3560. /**
  3561. * Ensures `element` will receive focus if it's not already.
  3562. *
  3563. * @example
  3564. * import { ensureFocus } from "reakit-utils";
  3565. *
  3566. * ensureFocus(document.activeElement); // does nothing
  3567. *
  3568. * const element = document.querySelector("input");
  3569. *
  3570. * ensureFocus(element); // focuses element
  3571. * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump
  3572. *
  3573. * function isActive(el) {
  3574. * return el.dataset.active === "true";
  3575. * }
  3576. *
  3577. * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing
  3578. *
  3579. * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed.
  3580. */
  3581. function ensureFocus(element, _temp) {
  3582. var _ref = _temp === void 0 ? {} : _temp,
  3583. preventScroll = _ref.preventScroll,
  3584. _ref$isActive = _ref.isActive,
  3585. isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive;
  3586. if (isActive(element)) return -1;
  3587. element.focus({
  3588. preventScroll: preventScroll
  3589. });
  3590. if (isActive(element)) return -1;
  3591. return requestAnimationFrame(function () {
  3592. element.focus({
  3593. preventScroll: preventScroll
  3594. });
  3595. });
  3596. }
  3597. /***/ }),
  3598. /***/ "AM7I":
  3599. /***/ (function(module, exports, __webpack_require__) {
  3600. "use strict";
  3601. /* globals
  3602. AggregateError,
  3603. Atomics,
  3604. FinalizationRegistry,
  3605. SharedArrayBuffer,
  3606. WeakRef,
  3607. */
  3608. var undefined;
  3609. var $SyntaxError = SyntaxError;
  3610. var $Function = Function;
  3611. var $TypeError = TypeError;
  3612. // eslint-disable-next-line consistent-return
  3613. var getEvalledConstructor = function (expressionSyntax) {
  3614. try {
  3615. // eslint-disable-next-line no-new-func
  3616. return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  3617. } catch (e) {}
  3618. };
  3619. var $gOPD = Object.getOwnPropertyDescriptor;
  3620. if ($gOPD) {
  3621. try {
  3622. $gOPD({}, '');
  3623. } catch (e) {
  3624. $gOPD = null; // this is IE 8, which has a broken gOPD
  3625. }
  3626. }
  3627. var throwTypeError = function () {
  3628. throw new $TypeError();
  3629. };
  3630. var ThrowTypeError = $gOPD
  3631. ? (function () {
  3632. try {
  3633. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  3634. arguments.callee; // IE 8 does not throw here
  3635. return throwTypeError;
  3636. } catch (calleeThrows) {
  3637. try {
  3638. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  3639. return $gOPD(arguments, 'callee').get;
  3640. } catch (gOPDthrows) {
  3641. return throwTypeError;
  3642. }
  3643. }
  3644. }())
  3645. : throwTypeError;
  3646. var hasSymbols = __webpack_require__("UVaH")();
  3647. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  3648. var asyncGenFunction = getEvalledConstructor('async function* () {}');
  3649. var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
  3650. var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
  3651. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  3652. var INTRINSICS = {
  3653. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  3654. '%Array%': Array,
  3655. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  3656. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  3657. '%AsyncFromSyncIteratorPrototype%': undefined,
  3658. '%AsyncFunction%': getEvalledConstructor('async function () {}'),
  3659. '%AsyncGenerator%': asyncGenFunctionPrototype,
  3660. '%AsyncGeneratorFunction%': asyncGenFunction,
  3661. '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
  3662. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  3663. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  3664. '%Boolean%': Boolean,
  3665. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  3666. '%Date%': Date,
  3667. '%decodeURI%': decodeURI,
  3668. '%decodeURIComponent%': decodeURIComponent,
  3669. '%encodeURI%': encodeURI,
  3670. '%encodeURIComponent%': encodeURIComponent,
  3671. '%Error%': Error,
  3672. '%eval%': eval, // eslint-disable-line no-eval
  3673. '%EvalError%': EvalError,
  3674. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  3675. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  3676. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  3677. '%Function%': $Function,
  3678. '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
  3679. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  3680. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  3681. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  3682. '%isFinite%': isFinite,
  3683. '%isNaN%': isNaN,
  3684. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  3685. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  3686. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  3687. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  3688. '%Math%': Math,
  3689. '%Number%': Number,
  3690. '%Object%': Object,
  3691. '%parseFloat%': parseFloat,
  3692. '%parseInt%': parseInt,
  3693. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  3694. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  3695. '%RangeError%': RangeError,
  3696. '%ReferenceError%': ReferenceError,
  3697. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  3698. '%RegExp%': RegExp,
  3699. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  3700. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  3701. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  3702. '%String%': String,
  3703. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  3704. '%Symbol%': hasSymbols ? Symbol : undefined,
  3705. '%SyntaxError%': $SyntaxError,
  3706. '%ThrowTypeError%': ThrowTypeError,
  3707. '%TypedArray%': TypedArray,
  3708. '%TypeError%': $TypeError,
  3709. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  3710. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  3711. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  3712. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  3713. '%URIError%': URIError,
  3714. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  3715. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  3716. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  3717. };
  3718. var LEGACY_ALIASES = {
  3719. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  3720. '%ArrayPrototype%': ['Array', 'prototype'],
  3721. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  3722. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  3723. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  3724. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  3725. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  3726. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  3727. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  3728. '%BooleanPrototype%': ['Boolean', 'prototype'],
  3729. '%DataViewPrototype%': ['DataView', 'prototype'],
  3730. '%DatePrototype%': ['Date', 'prototype'],
  3731. '%ErrorPrototype%': ['Error', 'prototype'],
  3732. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  3733. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  3734. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  3735. '%FunctionPrototype%': ['Function', 'prototype'],
  3736. '%Generator%': ['GeneratorFunction', 'prototype'],
  3737. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  3738. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  3739. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  3740. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  3741. '%JSONParse%': ['JSON', 'parse'],
  3742. '%JSONStringify%': ['JSON', 'stringify'],
  3743. '%MapPrototype%': ['Map', 'prototype'],
  3744. '%NumberPrototype%': ['Number', 'prototype'],
  3745. '%ObjectPrototype%': ['Object', 'prototype'],
  3746. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  3747. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  3748. '%PromisePrototype%': ['Promise', 'prototype'],
  3749. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  3750. '%Promise_all%': ['Promise', 'all'],
  3751. '%Promise_reject%': ['Promise', 'reject'],
  3752. '%Promise_resolve%': ['Promise', 'resolve'],
  3753. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  3754. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  3755. '%RegExpPrototype%': ['RegExp', 'prototype'],
  3756. '%SetPrototype%': ['Set', 'prototype'],
  3757. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  3758. '%StringPrototype%': ['String', 'prototype'],
  3759. '%SymbolPrototype%': ['Symbol', 'prototype'],
  3760. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  3761. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  3762. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  3763. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  3764. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  3765. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  3766. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  3767. '%URIErrorPrototype%': ['URIError', 'prototype'],
  3768. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  3769. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  3770. };
  3771. var bind = __webpack_require__("D3zA");
  3772. var hasOwn = __webpack_require__("oNNP");
  3773. var $concat = bind.call(Function.call, Array.prototype.concat);
  3774. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  3775. var $replace = bind.call(Function.call, String.prototype.replace);
  3776. var $strSlice = bind.call(Function.call, String.prototype.slice);
  3777. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  3778. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  3779. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  3780. var stringToPath = function stringToPath(string) {
  3781. var first = $strSlice(string, 0, 1);
  3782. var last = $strSlice(string, -1);
  3783. if (first === '%' && last !== '%') {
  3784. throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
  3785. } else if (last === '%' && first !== '%') {
  3786. throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
  3787. }
  3788. var result = [];
  3789. $replace(string, rePropName, function (match, number, quote, subString) {
  3790. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  3791. });
  3792. return result;
  3793. };
  3794. /* end adaptation */
  3795. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  3796. var intrinsicName = name;
  3797. var alias;
  3798. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  3799. alias = LEGACY_ALIASES[intrinsicName];
  3800. intrinsicName = '%' + alias[0] + '%';
  3801. }
  3802. if (hasOwn(INTRINSICS, intrinsicName)) {
  3803. var value = INTRINSICS[intrinsicName];
  3804. if (typeof value === 'undefined' && !allowMissing) {
  3805. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  3806. }
  3807. return {
  3808. alias: alias,
  3809. name: intrinsicName,
  3810. value: value
  3811. };
  3812. }
  3813. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  3814. };
  3815. module.exports = function GetIntrinsic(name, allowMissing) {
  3816. if (typeof name !== 'string' || name.length === 0) {
  3817. throw new $TypeError('intrinsic name must be a non-empty string');
  3818. }
  3819. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  3820. throw new $TypeError('"allowMissing" argument must be a boolean');
  3821. }
  3822. var parts = stringToPath(name);
  3823. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  3824. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  3825. var intrinsicRealName = intrinsic.name;
  3826. var value = intrinsic.value;
  3827. var skipFurtherCaching = false;
  3828. var alias = intrinsic.alias;
  3829. if (alias) {
  3830. intrinsicBaseName = alias[0];
  3831. $spliceApply(parts, $concat([0, 1], alias));
  3832. }
  3833. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  3834. var part = parts[i];
  3835. var first = $strSlice(part, 0, 1);
  3836. var last = $strSlice(part, -1);
  3837. if (
  3838. (
  3839. (first === '"' || first === "'" || first === '`')
  3840. || (last === '"' || last === "'" || last === '`')
  3841. )
  3842. && first !== last
  3843. ) {
  3844. throw new $SyntaxError('property names with quotes must have matching quotes');
  3845. }
  3846. if (part === 'constructor' || !isOwn) {
  3847. skipFurtherCaching = true;
  3848. }
  3849. intrinsicBaseName += '.' + part;
  3850. intrinsicRealName = '%' + intrinsicBaseName + '%';
  3851. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  3852. value = INTRINSICS[intrinsicRealName];
  3853. } else if (value != null) {
  3854. if (!(part in value)) {
  3855. if (!allowMissing) {
  3856. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  3857. }
  3858. return void undefined;
  3859. }
  3860. if ($gOPD && (i + 1) >= parts.length) {
  3861. var desc = $gOPD(value, part);
  3862. isOwn = !!desc;
  3863. // By convention, when a data property is converted to an accessor
  3864. // property to emulate a data property that does not suffer from
  3865. // the override mistake, that accessor's getter is marked with
  3866. // an `originalValue` property. Here, when we detect this, we
  3867. // uphold the illusion by pretending to see that original data
  3868. // property, i.e., returning the value rather than the getter
  3869. // itself.
  3870. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
  3871. value = desc.get;
  3872. } else {
  3873. value = value[part];
  3874. }
  3875. } else {
  3876. isOwn = hasOwn(value, part);
  3877. value = value[part];
  3878. }
  3879. if (isOwn && !skipFurtherCaching) {
  3880. INTRINSICS[intrinsicRealName] = value;
  3881. }
  3882. }
  3883. }
  3884. return value;
  3885. };
  3886. /***/ }),
  3887. /***/ "AP2z":
  3888. /***/ (function(module, exports, __webpack_require__) {
  3889. var Symbol = __webpack_require__("nmnc");
  3890. /** Used for built-in method references. */
  3891. var objectProto = Object.prototype;
  3892. /** Used to check objects for own properties. */
  3893. var hasOwnProperty = objectProto.hasOwnProperty;
  3894. /**
  3895. * Used to resolve the
  3896. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3897. * of values.
  3898. */
  3899. var nativeObjectToString = objectProto.toString;
  3900. /** Built-in value references. */
  3901. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3902. /**
  3903. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  3904. *
  3905. * @private
  3906. * @param {*} value The value to query.
  3907. * @returns {string} Returns the raw `toStringTag`.
  3908. */
  3909. function getRawTag(value) {
  3910. var isOwn = hasOwnProperty.call(value, symToStringTag),
  3911. tag = value[symToStringTag];
  3912. try {
  3913. value[symToStringTag] = undefined;
  3914. var unmasked = true;
  3915. } catch (e) {}
  3916. var result = nativeObjectToString.call(value);
  3917. if (unmasked) {
  3918. if (isOwn) {
  3919. value[symToStringTag] = tag;
  3920. } else {
  3921. delete value[symToStringTag];
  3922. }
  3923. }
  3924. return result;
  3925. }
  3926. module.exports = getRawTag;
  3927. /***/ }),
  3928. /***/ "AXvK":
  3929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3930. "use strict";
  3931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsomorphicEffect; });
  3932. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  3933. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  3934. /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+ipW");
  3935. /**
  3936. * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side
  3937. * rendering.
  3938. */
  3939. var useIsomorphicEffect = !_canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__[/* canUseDOM */ "a"] ? react__WEBPACK_IMPORTED_MODULE_0__["useEffect"] : react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"];
  3940. /***/ }),
  3941. /***/ "Ae65":
  3942. /***/ (function(module, exports, __webpack_require__) {
  3943. "use strict";
  3944. Object.defineProperty(exports, "__esModule", {
  3945. value: true
  3946. });
  3947. exports['default'] = getCalendarDaySettings;
  3948. var _getPhrase = __webpack_require__("oOcr");
  3949. var _getPhrase2 = _interopRequireDefault(_getPhrase);
  3950. var _constants = __webpack_require__("Fv1B");
  3951. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  3952. function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
  3953. var chooseAvailableDate = phrases.chooseAvailableDate,
  3954. dateIsUnavailable = phrases.dateIsUnavailable,
  3955. dateIsSelected = phrases.dateIsSelected;
  3956. var daySizeStyles = {
  3957. width: daySize,
  3958. height: daySize - 1
  3959. };
  3960. var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range');
  3961. var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end');
  3962. var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start'));
  3963. var isOutsideRange = modifiers.has('blocked-out-of-range');
  3964. var formattedDate = { date: day.format(ariaLabelFormat) };
  3965. var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate);
  3966. if (modifiers.has(_constants.BLOCKED_MODIFIER)) {
  3967. ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate);
  3968. } else if (selected) {
  3969. ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate);
  3970. }
  3971. return {
  3972. daySizeStyles: daySizeStyles,
  3973. useDefaultCursor: useDefaultCursor,
  3974. selected: selected,
  3975. hoveredSpan: hoveredSpan,
  3976. isOutsideRange: isOutsideRange,
  3977. ariaLabel: ariaLabel
  3978. };
  3979. }
  3980. /***/ }),
  3981. /***/ "Asd8":
  3982. /***/ (function(module, exports, __webpack_require__) {
  3983. "use strict";
  3984. var fnToStr = Function.prototype.toString;
  3985. var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
  3986. var badArrayLike;
  3987. var isCallableMarker;
  3988. if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
  3989. try {
  3990. badArrayLike = Object.defineProperty({}, 'length', {
  3991. get: function () {
  3992. throw isCallableMarker;
  3993. }
  3994. });
  3995. isCallableMarker = {};
  3996. // eslint-disable-next-line no-throw-literal
  3997. reflectApply(function () { throw 42; }, null, badArrayLike);
  3998. } catch (_) {
  3999. if (_ !== isCallableMarker) {
  4000. reflectApply = null;
  4001. }
  4002. }
  4003. } else {
  4004. reflectApply = null;
  4005. }
  4006. var constructorRegex = /^\s*class\b/;
  4007. var isES6ClassFn = function isES6ClassFunction(value) {
  4008. try {
  4009. var fnStr = fnToStr.call(value);
  4010. return constructorRegex.test(fnStr);
  4011. } catch (e) {
  4012. return false; // not a function
  4013. }
  4014. };
  4015. var tryFunctionObject = function tryFunctionToStr(value) {
  4016. try {
  4017. if (isES6ClassFn(value)) { return false; }
  4018. fnToStr.call(value);
  4019. return true;
  4020. } catch (e) {
  4021. return false;
  4022. }
  4023. };
  4024. var toStr = Object.prototype.toString;
  4025. var fnClass = '[object Function]';
  4026. var genClass = '[object GeneratorFunction]';
  4027. var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
  4028. /* globals document: false */
  4029. var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
  4030. module.exports = reflectApply
  4031. ? function isCallable(value) {
  4032. if (value === documentDotAll) { return true; }
  4033. if (!value) { return false; }
  4034. if (typeof value !== 'function' && typeof value !== 'object') { return false; }
  4035. if (typeof value === 'function' && !value.prototype) { return true; }
  4036. try {
  4037. reflectApply(value, null, badArrayLike);
  4038. } catch (e) {
  4039. if (e !== isCallableMarker) { return false; }
  4040. }
  4041. return !isES6ClassFn(value);
  4042. }
  4043. : function isCallable(value) {
  4044. if (value === documentDotAll) { return true; }
  4045. if (!value) { return false; }
  4046. if (typeof value !== 'function' && typeof value !== 'object') { return false; }
  4047. if (typeof value === 'function' && !value.prototype) { return true; }
  4048. if (hasToStringTag) { return tryFunctionObject(value); }
  4049. if (isES6ClassFn(value)) { return false; }
  4050. var strClass = toStr.call(value);
  4051. return strClass === fnClass || strClass === genClass;
  4052. };
  4053. /***/ }),
  4054. /***/ "B6Q+":
  4055. /***/ (function(module, exports, __webpack_require__) {
  4056. "use strict";
  4057. var hasSymbols = __webpack_require__("qGip");
  4058. module.exports = function hasToStringTagShams() {
  4059. return hasSymbols() && !!Symbol.toStringTag;
  4060. };
  4061. /***/ }),
  4062. /***/ "B9Az":
  4063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4064. "use strict";
  4065. // EXTERNAL MODULE: external ["wp","element"]
  4066. var external_wp_element_ = __webpack_require__("GRId");
  4067. // EXTERNAL MODULE: external ["wp","primitives"]
  4068. var external_wp_primitives_ = __webpack_require__("Tqx9");
  4069. // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
  4070. /**
  4071. * WordPress dependencies
  4072. */
  4073. const pencil = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  4074. xmlns: "http://www.w3.org/2000/svg",
  4075. viewBox: "0 0 24 24"
  4076. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
  4077. d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
  4078. }));
  4079. /* harmony default export */ var library_pencil = (pencil);
  4080. // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
  4081. /**
  4082. * Internal dependencies
  4083. */
  4084. /* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil);
  4085. /***/ }),
  4086. /***/ "BZp5":
  4087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4088. "use strict";
  4089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
  4090. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; });
  4091. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; });
  4092. function _defineProperty(obj, key, value) {
  4093. if (key in obj) {
  4094. Object.defineProperty(obj, key, {
  4095. value: value,
  4096. enumerable: true,
  4097. configurable: true,
  4098. writable: true
  4099. });
  4100. } else {
  4101. obj[key] = value;
  4102. }
  4103. return obj;
  4104. }
  4105. function ownKeys(object, enumerableOnly) {
  4106. var keys = Object.keys(object);
  4107. if (Object.getOwnPropertySymbols) {
  4108. var symbols = Object.getOwnPropertySymbols(object);
  4109. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  4110. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4111. });
  4112. keys.push.apply(keys, symbols);
  4113. }
  4114. return keys;
  4115. }
  4116. function _objectSpread2(target) {
  4117. for (var i = 1; i < arguments.length; i++) {
  4118. var source = arguments[i] != null ? arguments[i] : {};
  4119. if (i % 2) {
  4120. ownKeys(Object(source), true).forEach(function (key) {
  4121. _defineProperty(target, key, source[key]);
  4122. });
  4123. } else if (Object.getOwnPropertyDescriptors) {
  4124. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  4125. } else {
  4126. ownKeys(Object(source)).forEach(function (key) {
  4127. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4128. });
  4129. }
  4130. }
  4131. return target;
  4132. }
  4133. function _objectWithoutPropertiesLoose(source, excluded) {
  4134. if (source == null) return {};
  4135. var target = {};
  4136. var sourceKeys = Object.keys(source);
  4137. var key, i;
  4138. for (i = 0; i < sourceKeys.length; i++) {
  4139. key = sourceKeys[i];
  4140. if (excluded.indexOf(key) >= 0) continue;
  4141. target[key] = source[key];
  4142. }
  4143. return target;
  4144. }
  4145. function _unsupportedIterableToArray(o, minLen) {
  4146. if (!o) return;
  4147. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  4148. var n = Object.prototype.toString.call(o).slice(8, -1);
  4149. if (n === "Object" && o.constructor) n = o.constructor.name;
  4150. if (n === "Map" || n === "Set") return Array.from(o);
  4151. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  4152. }
  4153. function _arrayLikeToArray(arr, len) {
  4154. if (len == null || len > arr.length) len = arr.length;
  4155. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  4156. return arr2;
  4157. }
  4158. function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  4159. var it;
  4160. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  4161. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  4162. if (it) o = it;
  4163. var i = 0;
  4164. return function () {
  4165. if (i >= o.length) return {
  4166. done: true
  4167. };
  4168. return {
  4169. done: false,
  4170. value: o[i++]
  4171. };
  4172. };
  4173. }
  4174. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  4175. }
  4176. it = o[Symbol.iterator]();
  4177. return it.next.bind(it);
  4178. }
  4179. /***/ }),
  4180. /***/ "BeK9":
  4181. /***/ (function(module, exports, __webpack_require__) {
  4182. "use strict";
  4183. module.exports = function isPrimitive(value) {
  4184. return value === null || (typeof value !== 'function' && typeof value !== 'object');
  4185. };
  4186. /***/ }),
  4187. /***/ "Bpkj":
  4188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4189. "use strict";
  4190. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  4191. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  4192. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  4193. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  4194. /**
  4195. * WordPress dependencies
  4196. */
  4197. const link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  4198. xmlns: "http://www.w3.org/2000/svg",
  4199. viewBox: "0 0 24 24"
  4200. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  4201. d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
  4202. }));
  4203. /* harmony default export */ __webpack_exports__["a"] = (link);
  4204. /***/ }),
  4205. /***/ "C6yU":
  4206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4207. "use strict";
  4208. /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useContextSystem; });
  4209. /* harmony import */ var emotion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("kDDq");
  4210. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Z23Y");
  4211. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__);
  4212. /* harmony import */ var _context_system_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6zzY");
  4213. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Ohaz");
  4214. /* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("UAm0");
  4215. /**
  4216. * WordPress dependencies
  4217. */
  4218. /**
  4219. * Internal dependencies
  4220. */
  4221. /* eslint-disable jsdoc/valid-types */
  4222. /**
  4223. * @template TProps
  4224. * @typedef {TProps & { className: string; children?: import('react').ReactNode }} ConnectedProps
  4225. */
  4226. /* eslint-enable jsdoc/valid-types */
  4227. /**
  4228. * Custom hook that derives registered props from the Context system.
  4229. * These derived props are then consolidated with incoming component props.
  4230. *
  4231. * @template {{ className?: string }} P
  4232. * @param {P} props Incoming props from the component.
  4233. * @param {string} namespace The namespace to register and to derive context props from.
  4234. * @return {ConnectedProps<P>} The connected props.
  4235. */
  4236. function useContextSystem(props, namespace) {
  4237. const contextSystemProps = Object(_context_system_provider__WEBPACK_IMPORTED_MODULE_2__[/* useComponentsContext */ "a"])();
  4238. if (typeof namespace === 'undefined') {
  4239. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('useContextSystem: Please provide a namespace') : void 0;
  4240. }
  4241. const contextProps = (contextSystemProps === null || contextSystemProps === void 0 ? void 0 : contextSystemProps[namespace]) || {};
  4242. /* eslint-disable jsdoc/no-undefined-types */
  4243. /** @type {ConnectedProps<P>} */
  4244. // @ts-ignore We fill in the missing properties below
  4245. const finalComponentProps = { ...Object(_utils__WEBPACK_IMPORTED_MODULE_3__[/* getConnectedNamespace */ "a"])(),
  4246. ...Object(_utils__WEBPACK_IMPORTED_MODULE_3__[/* getNamespace */ "b"])(namespace)
  4247. };
  4248. /* eslint-enable jsdoc/no-undefined-types */
  4249. const {
  4250. _overrides: overrideProps,
  4251. ...otherContextProps
  4252. } = contextProps;
  4253. const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
  4254. const classes = Object(emotion__WEBPACK_IMPORTED_MODULE_0__[/* cx */ "b"])(Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__[/* getStyledClassNameFromKey */ "a"])(namespace), props.className); // Provides the ability to customize the render of the component.
  4255. const rendered = typeof initialMergedProps.renderChildren === 'function' ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children;
  4256. for (const key in initialMergedProps) {
  4257. // @ts-ignore filling in missing props
  4258. finalComponentProps[key] = initialMergedProps[key];
  4259. }
  4260. for (const key in overrideProps) {
  4261. // @ts-ignore filling in missing props
  4262. finalComponentProps[key] = overrideProps[key];
  4263. }
  4264. finalComponentProps.children = rendered;
  4265. finalComponentProps.className = classes;
  4266. return finalComponentProps;
  4267. }
  4268. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  4269. /***/ }),
  4270. /***/ "CGNl":
  4271. /***/ (function(module, exports, __webpack_require__) {
  4272. "use strict";
  4273. var has = __webpack_require__("oNNP");
  4274. var assertRecord = __webpack_require__("10Kj");
  4275. var Type = __webpack_require__("V1cy");
  4276. // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
  4277. module.exports = function IsDataDescriptor(Desc) {
  4278. if (typeof Desc === 'undefined') {
  4279. return false;
  4280. }
  4281. assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
  4282. if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
  4283. return false;
  4284. }
  4285. return true;
  4286. };
  4287. /***/ }),
  4288. /***/ "Cw+6":
  4289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4290. "use strict";
  4291. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  4292. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  4293. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl");
  4294. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  4295. /**
  4296. * External dependencies
  4297. */
  4298. /** @typedef {string | { display: string, ariaLabel: string }} Shortcut */
  4299. /**
  4300. * @typedef Props
  4301. * @property {Shortcut} shortcut Shortcut configuration
  4302. * @property {string} [className] Classname
  4303. */
  4304. /**
  4305. * @param {Props} props Props
  4306. * @return {JSX.Element | null} Element
  4307. */
  4308. function Shortcut({
  4309. shortcut,
  4310. className
  4311. }) {
  4312. if (!shortcut) {
  4313. return null;
  4314. }
  4315. let displayText;
  4316. let ariaLabel;
  4317. if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
  4318. displayText = shortcut;
  4319. }
  4320. if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
  4321. displayText = shortcut.display;
  4322. ariaLabel = shortcut.ariaLabel;
  4323. }
  4324. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
  4325. className: className,
  4326. "aria-label": ariaLabel
  4327. }, displayText);
  4328. }
  4329. /* harmony default export */ __webpack_exports__["a"] = (Shortcut);
  4330. /***/ }),
  4331. /***/ "D3zA":
  4332. /***/ (function(module, exports, __webpack_require__) {
  4333. "use strict";
  4334. var implementation = __webpack_require__("aI7X");
  4335. module.exports = Function.prototype.bind || implementation;
  4336. /***/ }),
  4337. /***/ "DHWS":
  4338. /***/ (function(module, exports, __webpack_require__) {
  4339. "use strict";
  4340. Object.defineProperty(exports, "__esModule", {
  4341. value: true
  4342. });
  4343. var _react = __webpack_require__("cDcd");
  4344. var _react2 = _interopRequireDefault(_react);
  4345. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  4346. var ChevronDown = function () {
  4347. function ChevronDown(props) {
  4348. return _react2['default'].createElement(
  4349. 'svg',
  4350. props,
  4351. _react2['default'].createElement('path', {
  4352. d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z'
  4353. })
  4354. );
  4355. }
  4356. return ChevronDown;
  4357. }();
  4358. ChevronDown.defaultProps = {
  4359. viewBox: '0 0 1000 1000'
  4360. };
  4361. exports['default'] = ChevronDown;
  4362. /***/ }),
  4363. /***/ "DciD":
  4364. /***/ (function(module, exports, __webpack_require__) {
  4365. "use strict";
  4366. function noop() {
  4367. return null;
  4368. }
  4369. noop.isRequired = noop;
  4370. function noopThunk() {
  4371. return noop;
  4372. }
  4373. module.exports = {
  4374. and: noopThunk,
  4375. between: noopThunk,
  4376. booleanSome: noopThunk,
  4377. childrenHavePropXorChildren: noopThunk,
  4378. childrenOf: noopThunk,
  4379. childrenOfType: noopThunk,
  4380. childrenSequenceOf: noopThunk,
  4381. componentWithName: noopThunk,
  4382. disallowedIf: noopThunk,
  4383. elementType: noopThunk,
  4384. empty: noopThunk,
  4385. explicitNull: noopThunk,
  4386. forbidExtraProps: Object,
  4387. integer: noopThunk,
  4388. keysOf: noopThunk,
  4389. mutuallyExclusiveProps: noopThunk,
  4390. mutuallyExclusiveTrueProps: noopThunk,
  4391. nChildren: noopThunk,
  4392. nonNegativeInteger: noop,
  4393. nonNegativeNumber: noopThunk,
  4394. numericString: noopThunk,
  4395. object: noopThunk,
  4396. or: noopThunk,
  4397. predicate: noopThunk,
  4398. range: noopThunk,
  4399. ref: noopThunk,
  4400. requiredBy: noopThunk,
  4401. restrictedProp: noopThunk,
  4402. sequenceOf: noopThunk,
  4403. shape: noopThunk,
  4404. stringEndsWith: noopThunk,
  4405. stringStartsWith: noopThunk,
  4406. uniqueArray: noopThunk,
  4407. uniqueArrayOf: noopThunk,
  4408. valuesOf: noopThunk,
  4409. withShape: noopThunk
  4410. };
  4411. /***/ }),
  4412. /***/ "DmXP":
  4413. /***/ (function(module, exports, __webpack_require__) {
  4414. "use strict";
  4415. var getDay = Date.prototype.getDay;
  4416. var tryDateObject = function tryDateGetDayCall(value) {
  4417. try {
  4418. getDay.call(value);
  4419. return true;
  4420. } catch (e) {
  4421. return false;
  4422. }
  4423. };
  4424. var toStr = Object.prototype.toString;
  4425. var dateClass = '[object Date]';
  4426. var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  4427. module.exports = function isDateObject(value) {
  4428. if (typeof value !== 'object' || value === null) {
  4429. return false;
  4430. }
  4431. return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
  4432. };
  4433. /***/ }),
  4434. /***/ "DvWQ":
  4435. /***/ (function(module, exports, __webpack_require__) {
  4436. "use strict";
  4437. var GetIntrinsic = __webpack_require__("rZ7t");
  4438. var $TypeError = GetIntrinsic('%TypeError%');
  4439. var DefineOwnProperty = __webpack_require__("wTIp");
  4440. var FromPropertyDescriptor = __webpack_require__("zYbv");
  4441. var OrdinaryGetOwnProperty = __webpack_require__("kgBv");
  4442. var IsDataDescriptor = __webpack_require__("CGNl");
  4443. var IsExtensible = __webpack_require__("rDFq");
  4444. var IsPropertyKey = __webpack_require__("i10q");
  4445. var SameValue = __webpack_require__("HI8u");
  4446. var Type = __webpack_require__("V1cy");
  4447. // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
  4448. module.exports = function CreateDataProperty(O, P, V) {
  4449. if (Type(O) !== 'Object') {
  4450. throw new $TypeError('Assertion failed: Type(O) is not Object');
  4451. }
  4452. if (!IsPropertyKey(P)) {
  4453. throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
  4454. }
  4455. var oldDesc = OrdinaryGetOwnProperty(O, P);
  4456. var extensible = !oldDesc || IsExtensible(O);
  4457. var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
  4458. if (immutable || !extensible) {
  4459. return false;
  4460. }
  4461. return DefineOwnProperty(
  4462. IsDataDescriptor,
  4463. SameValue,
  4464. FromPropertyDescriptor,
  4465. O,
  4466. P,
  4467. {
  4468. '[[Configurable]]': true,
  4469. '[[Enumerable]]': true,
  4470. '[[Value]]': V,
  4471. '[[Writable]]': true
  4472. }
  4473. );
  4474. };
  4475. /***/ }),
  4476. /***/ "DzJC":
  4477. /***/ (function(module, exports, __webpack_require__) {
  4478. var debounce = __webpack_require__("sEfC"),
  4479. isObject = __webpack_require__("GoyQ");
  4480. /** Error message constants. */
  4481. var FUNC_ERROR_TEXT = 'Expected a function';
  4482. /**
  4483. * Creates a throttled function that only invokes `func` at most once per
  4484. * every `wait` milliseconds. The throttled function comes with a `cancel`
  4485. * method to cancel delayed `func` invocations and a `flush` method to
  4486. * immediately invoke them. Provide `options` to indicate whether `func`
  4487. * should be invoked on the leading and/or trailing edge of the `wait`
  4488. * timeout. The `func` is invoked with the last arguments provided to the
  4489. * throttled function. Subsequent calls to the throttled function return the
  4490. * result of the last `func` invocation.
  4491. *
  4492. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  4493. * invoked on the trailing edge of the timeout only if the throttled function
  4494. * is invoked more than once during the `wait` timeout.
  4495. *
  4496. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  4497. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  4498. *
  4499. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  4500. * for details over the differences between `_.throttle` and `_.debounce`.
  4501. *
  4502. * @static
  4503. * @memberOf _
  4504. * @since 0.1.0
  4505. * @category Function
  4506. * @param {Function} func The function to throttle.
  4507. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  4508. * @param {Object} [options={}] The options object.
  4509. * @param {boolean} [options.leading=true]
  4510. * Specify invoking on the leading edge of the timeout.
  4511. * @param {boolean} [options.trailing=true]
  4512. * Specify invoking on the trailing edge of the timeout.
  4513. * @returns {Function} Returns the new throttled function.
  4514. * @example
  4515. *
  4516. * // Avoid excessively updating the position while scrolling.
  4517. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  4518. *
  4519. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  4520. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  4521. * jQuery(element).on('click', throttled);
  4522. *
  4523. * // Cancel the trailing throttled invocation.
  4524. * jQuery(window).on('popstate', throttled.cancel);
  4525. */
  4526. function throttle(func, wait, options) {
  4527. var leading = true,
  4528. trailing = true;
  4529. if (typeof func != 'function') {
  4530. throw new TypeError(FUNC_ERROR_TEXT);
  4531. }
  4532. if (isObject(options)) {
  4533. leading = 'leading' in options ? !!options.leading : leading;
  4534. trailing = 'trailing' in options ? !!options.trailing : trailing;
  4535. }
  4536. return debounce(func, wait, {
  4537. 'leading': leading,
  4538. 'maxWait': wait,
  4539. 'trailing': trailing
  4540. });
  4541. }
  4542. module.exports = throttle;
  4543. /***/ }),
  4544. /***/ "EXo9":
  4545. /***/ (function(module, exports, __webpack_require__) {
  4546. "use strict";
  4547. var GetIntrinsic = __webpack_require__("rZ7t");
  4548. var callBind = __webpack_require__("hZ2/");
  4549. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  4550. module.exports = function callBoundIntrinsic(name, allowMissing) {
  4551. var intrinsic = GetIntrinsic(name, !!allowMissing);
  4552. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  4553. return callBind(intrinsic);
  4554. }
  4555. return intrinsic;
  4556. };
  4557. /***/ }),
  4558. /***/ "ExA7":
  4559. /***/ (function(module, exports) {
  4560. /**
  4561. * Checks if `value` is object-like. A value is object-like if it's not `null`
  4562. * and has a `typeof` result of "object".
  4563. *
  4564. * @static
  4565. * @memberOf _
  4566. * @since 4.0.0
  4567. * @category Lang
  4568. * @param {*} value The value to check.
  4569. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  4570. * @example
  4571. *
  4572. * _.isObjectLike({});
  4573. * // => true
  4574. *
  4575. * _.isObjectLike([1, 2, 3]);
  4576. * // => true
  4577. *
  4578. * _.isObjectLike(_.noop);
  4579. * // => false
  4580. *
  4581. * _.isObjectLike(null);
  4582. * // => false
  4583. */
  4584. function isObjectLike(value) {
  4585. return value != null && typeof value == 'object';
  4586. }
  4587. module.exports = isObjectLike;
  4588. /***/ }),
  4589. /***/ "F7ZS":
  4590. /***/ (function(module, exports, __webpack_require__) {
  4591. "use strict";
  4592. Object.defineProperty(exports, "__esModule", {
  4593. value: true
  4594. });
  4595. exports['default'] = getCalendarMonthWeeks;
  4596. var _moment = __webpack_require__("wy2R");
  4597. var _moment2 = _interopRequireDefault(_moment);
  4598. var _constants = __webpack_require__("Fv1B");
  4599. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  4600. function getCalendarMonthWeeks(month, enableOutsideDays) {
  4601. var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek();
  4602. if (!_moment2['default'].isMoment(month) || !month.isValid()) {
  4603. throw new TypeError('`month` must be a valid moment object');
  4604. }
  4605. if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) {
  4606. throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6');
  4607. }
  4608. // set utc offset to get correct dates in future (when timezone changes)
  4609. var firstOfMonth = month.clone().startOf('month').hour(12);
  4610. var lastOfMonth = month.clone().endOf('month').hour(12);
  4611. // calculate the exact first and last days to fill the entire matrix
  4612. // (considering days outside month)
  4613. var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7;
  4614. var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7;
  4615. var firstDay = firstOfMonth.clone().subtract(prevDays, 'day');
  4616. var lastDay = lastOfMonth.clone().add(nextDays, 'day');
  4617. var totalDays = lastDay.diff(firstDay, 'days') + 1;
  4618. var currentDay = firstDay.clone();
  4619. var weeksInMonth = [];
  4620. for (var i = 0; i < totalDays; i += 1) {
  4621. if (i % 7 === 0) {
  4622. weeksInMonth.push([]);
  4623. }
  4624. var day = null;
  4625. if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) {
  4626. day = currentDay.clone();
  4627. }
  4628. weeksInMonth[weeksInMonth.length - 1].push(day);
  4629. currentDay.add(1, 'day');
  4630. }
  4631. return weeksInMonth;
  4632. }
  4633. /***/ }),
  4634. /***/ "FpZJ":
  4635. /***/ (function(module, exports, __webpack_require__) {
  4636. "use strict";
  4637. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  4638. module.exports = function hasSymbols() {
  4639. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  4640. if (typeof Symbol.iterator === 'symbol') { return true; }
  4641. var obj = {};
  4642. var sym = Symbol('test');
  4643. var symObj = Object(sym);
  4644. if (typeof sym === 'string') { return false; }
  4645. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  4646. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  4647. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  4648. // if (sym instanceof Symbol) { return false; }
  4649. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  4650. // if (!(symObj instanceof Symbol)) { return false; }
  4651. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  4652. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  4653. var symVal = 42;
  4654. obj[sym] = symVal;
  4655. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
  4656. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  4657. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  4658. var syms = Object.getOwnPropertySymbols(obj);
  4659. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  4660. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  4661. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  4662. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  4663. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  4664. }
  4665. return true;
  4666. };
  4667. /***/ }),
  4668. /***/ "FqII":
  4669. /***/ (function(module, exports) {
  4670. (function() { module.exports = window["wp"]["date"]; }());
  4671. /***/ }),
  4672. /***/ "FufO":
  4673. /***/ (function(module, exports, __webpack_require__) {
  4674. "use strict";
  4675. // modified from https://github.com/es-shims/es6-shim
  4676. var keys = __webpack_require__("1seS");
  4677. var canBeObject = function (obj) {
  4678. return typeof obj !== 'undefined' && obj !== null;
  4679. };
  4680. var hasSymbols = __webpack_require__("FpZJ")();
  4681. var callBound = __webpack_require__("VF6F");
  4682. var toObject = Object;
  4683. var $push = callBound('Array.prototype.push');
  4684. var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  4685. var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
  4686. // eslint-disable-next-line no-unused-vars
  4687. module.exports = function assign(target, source1) {
  4688. if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
  4689. var objTarget = toObject(target);
  4690. var s, source, i, props, syms, value, key;
  4691. for (s = 1; s < arguments.length; ++s) {
  4692. source = toObject(arguments[s]);
  4693. props = keys(source);
  4694. var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
  4695. if (getSymbols) {
  4696. syms = getSymbols(source);
  4697. for (i = 0; i < syms.length; ++i) {
  4698. key = syms[i];
  4699. if ($propIsEnumerable(source, key)) {
  4700. $push(props, key);
  4701. }
  4702. }
  4703. }
  4704. for (i = 0; i < props.length; ++i) {
  4705. key = props[i];
  4706. value = source[key];
  4707. if ($propIsEnumerable(source, key)) {
  4708. objTarget[key] = value;
  4709. }
  4710. }
  4711. }
  4712. return objTarget;
  4713. };
  4714. /***/ }),
  4715. /***/ "Fv1B":
  4716. /***/ (function(module, exports, __webpack_require__) {
  4717. "use strict";
  4718. Object.defineProperty(exports, "__esModule", {
  4719. value: true
  4720. });
  4721. var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';
  4722. var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';
  4723. var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';
  4724. var START_DATE = exports.START_DATE = 'startDate';
  4725. var END_DATE = exports.END_DATE = 'endDate';
  4726. var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';
  4727. var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';
  4728. var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';
  4729. var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';
  4730. var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';
  4731. var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';
  4732. var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';
  4733. var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';
  4734. var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';
  4735. var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';
  4736. var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';
  4737. var OPEN_DOWN = exports.OPEN_DOWN = 'down';
  4738. var OPEN_UP = exports.OPEN_UP = 'up';
  4739. var DAY_SIZE = exports.DAY_SIZE = 39;
  4740. var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';
  4741. var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
  4742. var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;
  4743. var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;
  4744. var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
  4745. var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
  4746. /***/ }),
  4747. /***/ "G3V0":
  4748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4749. "use strict";
  4750. /* unused harmony export Tabbable */
  4751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useTabbable; });
  4752. /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
  4753. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
  4754. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
  4755. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
  4756. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  4757. /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aU41");
  4758. /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("71Og");
  4759. /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("KA1K");
  4760. /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("eNtd");
  4761. /* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("AXvK");
  4762. /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("PcHe");
  4763. /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("Vq1w");
  4764. /* harmony import */ var reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("reMF");
  4765. /* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("kqkJ");
  4766. /* harmony import */ var _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("zGFp");
  4767. // Automatically generated
  4768. var TABBABLE_KEYS = ["disabled", "focusable"];
  4769. var isSafariOrFirefoxOnMac = Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Mac") && !Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Chrome") && (Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Safari") || Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Firefox"));
  4770. function focusIfNeeded(element) {
  4771. if (!Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__[/* hasFocusWithin */ "a"])(element) && Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__[/* isFocusable */ "a"])(element)) {
  4772. element.focus();
  4773. }
  4774. }
  4775. function isNativeTabbable(element) {
  4776. return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA" || element.tagName === "A";
  4777. }
  4778. function supportsDisabledAttribute(element) {
  4779. return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA";
  4780. }
  4781. function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) {
  4782. if (trulyDisabled) {
  4783. if (nativeTabbable && !supportsDisabled) {
  4784. // Anchor, audio and video tags don't support the `disabled` attribute.
  4785. // We must pass tabIndex={-1} so they don't receive focus on tab.
  4786. return -1;
  4787. } // Elements that support the `disabled` attribute don't need tabIndex.
  4788. return undefined;
  4789. }
  4790. if (nativeTabbable) {
  4791. // If the element is enabled and it's natively tabbable, we don't need to
  4792. // specify a tabIndex attribute unless it's explicitly set by the user.
  4793. return htmlTabIndex;
  4794. } // If the element is enabled and is not natively tabbable, we have to
  4795. // fallback tabIndex={0}.
  4796. return htmlTabIndex || 0;
  4797. }
  4798. function useDisableEvent(htmlEventRef, disabled) {
  4799. return Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  4800. var _htmlEventRef$current;
  4801. (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event);
  4802. if (event.defaultPrevented) return;
  4803. if (disabled) {
  4804. event.stopPropagation();
  4805. event.preventDefault();
  4806. }
  4807. }, [htmlEventRef, disabled]);
  4808. }
  4809. var useTabbable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
  4810. name: "Tabbable",
  4811. compose: _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__[/* useRole */ "a"],
  4812. keys: TABBABLE_KEYS,
  4813. useOptions: function useOptions(options, _ref) {
  4814. var disabled = _ref.disabled;
  4815. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  4816. disabled: disabled
  4817. }, options);
  4818. },
  4819. useProps: function useProps(options, _ref2) {
  4820. var htmlRef = _ref2.ref,
  4821. htmlTabIndex = _ref2.tabIndex,
  4822. htmlOnClickCapture = _ref2.onClickCapture,
  4823. htmlOnMouseDownCapture = _ref2.onMouseDownCapture,
  4824. htmlOnMouseDown = _ref2.onMouseDown,
  4825. htmlOnKeyPressCapture = _ref2.onKeyPressCapture,
  4826. htmlStyle = _ref2.style,
  4827. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]);
  4828. var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
  4829. var onClickCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnClickCapture);
  4830. var onMouseDownCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDownCapture);
  4831. var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDown);
  4832. var onKeyPressCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnKeyPressCapture);
  4833. var trulyDisabled = !!options.disabled && !options.focusable;
  4834. var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true),
  4835. nativeTabbable = _React$useState[0],
  4836. setNativeTabbable = _React$useState[1];
  4837. var _React$useState2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true),
  4838. supportsDisabled = _React$useState2[0],
  4839. setSupportsDisabled = _React$useState2[1];
  4840. var style = options.disabled ? Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  4841. pointerEvents: "none"
  4842. }, htmlStyle) : htmlStyle;
  4843. Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__[/* useIsomorphicEffect */ "a"])(function () {
  4844. var tabbable = ref.current;
  4845. if (!tabbable) {
  4846. false ? undefined : void 0;
  4847. return;
  4848. }
  4849. if (!isNativeTabbable(tabbable)) {
  4850. setNativeTabbable(false);
  4851. }
  4852. if (!supportsDisabledAttribute(tabbable)) {
  4853. setSupportsDisabled(false);
  4854. }
  4855. }, []);
  4856. var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled);
  4857. var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled);
  4858. var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled);
  4859. var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  4860. var _onMouseDownRef$curre;
  4861. (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event);
  4862. var element = event.currentTarget;
  4863. if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down
  4864. // like other browsers/platforms. Instead, they focus on the closest
  4865. // focusable ancestor element, which is ultimately the body element. So
  4866. // we make sure to give focus to the tabbable element on mouse down so
  4867. // it works consistently across browsers.
  4868. if (!isSafariOrFirefoxOnMac) return;
  4869. if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__[/* isPortalEvent */ "a"])(event)) return;
  4870. if (!Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__[/* isButton */ "a"])(element)) return; // We can't focus right away after on mouse down, otherwise it would
  4871. // prevent drag events from happening. So we schedule the focus to the
  4872. // next animation frame.
  4873. var raf = requestAnimationFrame(function () {
  4874. element.removeEventListener("mouseup", focusImmediately, true);
  4875. focusIfNeeded(element);
  4876. }); // If mouseUp happens before the next animation frame (which is common
  4877. // on touch screens or by just tapping the trackpad on MacBook's), we
  4878. // cancel the animation frame and immediately focus on the element.
  4879. var focusImmediately = function focusImmediately() {
  4880. cancelAnimationFrame(raf);
  4881. focusIfNeeded(element);
  4882. }; // By listening to the event in the capture phase, we make sure the
  4883. // focus event is fired before the onMouseUp and onMouseUpCapture React
  4884. // events, which is aligned with the default browser behavior.
  4885. element.addEventListener("mouseup", focusImmediately, {
  4886. once: true,
  4887. capture: true
  4888. });
  4889. }, []);
  4890. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  4891. ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef),
  4892. style: style,
  4893. tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex),
  4894. disabled: trulyDisabled && supportsDisabled ? true : undefined,
  4895. "aria-disabled": options.disabled ? true : undefined,
  4896. onClickCapture: onClickCapture,
  4897. onMouseDownCapture: onMouseDownCapture,
  4898. onMouseDown: onMouseDown,
  4899. onKeyPressCapture: onKeyPressCapture
  4900. }, htmlProps);
  4901. }
  4902. });
  4903. var Tabbable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
  4904. as: "div",
  4905. useHook: useTabbable
  4906. });
  4907. /***/ }),
  4908. /***/ "GET3":
  4909. /***/ (function(module, exports, __webpack_require__) {
  4910. "use strict";
  4911. Object.defineProperty(exports, "__esModule", {
  4912. value: true
  4913. });
  4914. exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = undefined;
  4915. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4916. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4917. var _object = __webpack_require__("Koq/");
  4918. var _object2 = _interopRequireDefault(_object);
  4919. var _react = __webpack_require__("cDcd");
  4920. var _react2 = _interopRequireDefault(_react);
  4921. var _propTypes = __webpack_require__("17x9");
  4922. var _propTypes2 = _interopRequireDefault(_propTypes);
  4923. var _reactAddonsShallowCompare = __webpack_require__("YZDV");
  4924. var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
  4925. var _reactMomentProptypes = __webpack_require__("XGBb");
  4926. var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
  4927. var _airbnbPropTypes = __webpack_require__("Hsqg");
  4928. var _reactWithStyles = __webpack_require__("TG4+");
  4929. var _moment = __webpack_require__("wy2R");
  4930. var _moment2 = _interopRequireDefault(_moment);
  4931. var _defaultPhrases = __webpack_require__("vV+G");
  4932. var _getPhrasePropTypes = __webpack_require__("yc2e");
  4933. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  4934. var _getCalendarDaySettings = __webpack_require__("Ae65");
  4935. var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
  4936. var _constants = __webpack_require__("Fv1B");
  4937. var _DefaultTheme = __webpack_require__("xOhs");
  4938. var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
  4939. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  4940. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4941. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4942. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4943. var color = _DefaultTheme2['default'].reactDates.color;
  4944. function getStyles(stylesObj, isHovered) {
  4945. if (!stylesObj) return null;
  4946. var hover = stylesObj.hover;
  4947. if (isHovered && hover) {
  4948. return hover;
  4949. }
  4950. return stylesObj;
  4951. }
  4952. var DayStyleShape = _propTypes2['default'].shape({
  4953. background: _propTypes2['default'].string,
  4954. border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
  4955. color: _propTypes2['default'].string,
  4956. hover: _propTypes2['default'].shape({
  4957. background: _propTypes2['default'].string,
  4958. border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
  4959. color: _propTypes2['default'].string
  4960. })
  4961. });
  4962. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  4963. day: _reactMomentProptypes2['default'].momentObj,
  4964. daySize: _airbnbPropTypes.nonNegativeInteger,
  4965. isOutsideDay: _propTypes2['default'].bool,
  4966. modifiers: _propTypes2['default'].instanceOf(Set),
  4967. isFocused: _propTypes2['default'].bool,
  4968. tabIndex: _propTypes2['default'].oneOf([0, -1]),
  4969. onDayClick: _propTypes2['default'].func,
  4970. onDayMouseEnter: _propTypes2['default'].func,
  4971. onDayMouseLeave: _propTypes2['default'].func,
  4972. renderDayContents: _propTypes2['default'].func,
  4973. ariaLabelFormat: _propTypes2['default'].string,
  4974. // style overrides
  4975. defaultStyles: DayStyleShape,
  4976. outsideStyles: DayStyleShape,
  4977. todayStyles: DayStyleShape,
  4978. firstDayOfWeekStyles: DayStyleShape,
  4979. lastDayOfWeekStyles: DayStyleShape,
  4980. highlightedCalendarStyles: DayStyleShape,
  4981. blockedMinNightsStyles: DayStyleShape,
  4982. blockedCalendarStyles: DayStyleShape,
  4983. blockedOutOfRangeStyles: DayStyleShape,
  4984. hoveredSpanStyles: DayStyleShape,
  4985. selectedSpanStyles: DayStyleShape,
  4986. lastInRangeStyles: DayStyleShape,
  4987. selectedStyles: DayStyleShape,
  4988. selectedStartStyles: DayStyleShape,
  4989. selectedEndStyles: DayStyleShape,
  4990. afterHoveredStartStyles: DayStyleShape,
  4991. // internationalization
  4992. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
  4993. }));
  4994. var defaultStyles = exports.defaultStyles = {
  4995. border: '1px solid ' + String(color.core.borderLight),
  4996. color: color.text,
  4997. background: color.background,
  4998. hover: {
  4999. background: color.core.borderLight,
  5000. border: '1px double ' + String(color.core.borderLight),
  5001. color: 'inherit'
  5002. }
  5003. };
  5004. var outsideStyles = exports.outsideStyles = {
  5005. background: color.outside.backgroundColor,
  5006. border: 0,
  5007. color: color.outside.color
  5008. };
  5009. var highlightedCalendarStyles = exports.highlightedCalendarStyles = {
  5010. background: color.highlighted.backgroundColor,
  5011. color: color.highlighted.color,
  5012. hover: {
  5013. background: color.highlighted.backgroundColor_hover,
  5014. color: color.highlighted.color_active
  5015. }
  5016. };
  5017. var blockedMinNightsStyles = exports.blockedMinNightsStyles = {
  5018. background: color.minimumNights.backgroundColor,
  5019. border: '1px solid ' + String(color.minimumNights.borderColor),
  5020. color: color.minimumNights.color,
  5021. hover: {
  5022. background: color.minimumNights.backgroundColor_hover,
  5023. color: color.minimumNights.color_active
  5024. }
  5025. };
  5026. var blockedCalendarStyles = exports.blockedCalendarStyles = {
  5027. background: color.blocked_calendar.backgroundColor,
  5028. border: '1px solid ' + String(color.blocked_calendar.borderColor),
  5029. color: color.blocked_calendar.color,
  5030. hover: {
  5031. background: color.blocked_calendar.backgroundColor_hover,
  5032. border: '1px solid ' + String(color.blocked_calendar.borderColor),
  5033. color: color.blocked_calendar.color_active
  5034. }
  5035. };
  5036. var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = {
  5037. background: color.blocked_out_of_range.backgroundColor,
  5038. border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
  5039. color: color.blocked_out_of_range.color,
  5040. hover: {
  5041. background: color.blocked_out_of_range.backgroundColor_hover,
  5042. border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
  5043. color: color.blocked_out_of_range.color_active
  5044. }
  5045. };
  5046. var hoveredSpanStyles = exports.hoveredSpanStyles = {
  5047. background: color.hoveredSpan.backgroundColor,
  5048. border: '1px solid ' + String(color.hoveredSpan.borderColor),
  5049. color: color.hoveredSpan.color,
  5050. hover: {
  5051. background: color.hoveredSpan.backgroundColor_hover,
  5052. border: '1px solid ' + String(color.hoveredSpan.borderColor),
  5053. color: color.hoveredSpan.color_active
  5054. }
  5055. };
  5056. var selectedSpanStyles = exports.selectedSpanStyles = {
  5057. background: color.selectedSpan.backgroundColor,
  5058. border: '1px solid ' + String(color.selectedSpan.borderColor),
  5059. color: color.selectedSpan.color,
  5060. hover: {
  5061. background: color.selectedSpan.backgroundColor_hover,
  5062. border: '1px solid ' + String(color.selectedSpan.borderColor),
  5063. color: color.selectedSpan.color_active
  5064. }
  5065. };
  5066. var lastInRangeStyles = exports.lastInRangeStyles = {
  5067. borderRight: color.core.primary
  5068. };
  5069. var selectedStyles = exports.selectedStyles = {
  5070. background: color.selected.backgroundColor,
  5071. border: '1px solid ' + String(color.selected.borderColor),
  5072. color: color.selected.color,
  5073. hover: {
  5074. background: color.selected.backgroundColor_hover,
  5075. border: '1px solid ' + String(color.selected.borderColor),
  5076. color: color.selected.color_active
  5077. }
  5078. };
  5079. var defaultProps = {
  5080. day: (0, _moment2['default'])(),
  5081. daySize: _constants.DAY_SIZE,
  5082. isOutsideDay: false,
  5083. modifiers: new Set(),
  5084. isFocused: false,
  5085. tabIndex: -1,
  5086. onDayClick: function () {
  5087. function onDayClick() {}
  5088. return onDayClick;
  5089. }(),
  5090. onDayMouseEnter: function () {
  5091. function onDayMouseEnter() {}
  5092. return onDayMouseEnter;
  5093. }(),
  5094. onDayMouseLeave: function () {
  5095. function onDayMouseLeave() {}
  5096. return onDayMouseLeave;
  5097. }(),
  5098. renderDayContents: null,
  5099. ariaLabelFormat: 'dddd, LL',
  5100. // style defaults
  5101. defaultStyles: defaultStyles,
  5102. outsideStyles: outsideStyles,
  5103. todayStyles: {},
  5104. highlightedCalendarStyles: highlightedCalendarStyles,
  5105. blockedMinNightsStyles: blockedMinNightsStyles,
  5106. blockedCalendarStyles: blockedCalendarStyles,
  5107. blockedOutOfRangeStyles: blockedOutOfRangeStyles,
  5108. hoveredSpanStyles: hoveredSpanStyles,
  5109. selectedSpanStyles: selectedSpanStyles,
  5110. lastInRangeStyles: lastInRangeStyles,
  5111. selectedStyles: selectedStyles,
  5112. selectedStartStyles: {},
  5113. selectedEndStyles: {},
  5114. afterHoveredStartStyles: {},
  5115. firstDayOfWeekStyles: {},
  5116. lastDayOfWeekStyles: {},
  5117. // internationalization
  5118. phrases: _defaultPhrases.CalendarDayPhrases
  5119. };
  5120. var CustomizableCalendarDay = function (_React$Component) {
  5121. _inherits(CustomizableCalendarDay, _React$Component);
  5122. function CustomizableCalendarDay() {
  5123. var _ref;
  5124. _classCallCheck(this, CustomizableCalendarDay);
  5125. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5126. args[_key] = arguments[_key];
  5127. }
  5128. var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args)));
  5129. _this.state = {
  5130. isHovered: false
  5131. };
  5132. _this.setButtonRef = _this.setButtonRef.bind(_this);
  5133. return _this;
  5134. }
  5135. _createClass(CustomizableCalendarDay, [{
  5136. key: 'shouldComponentUpdate',
  5137. value: function () {
  5138. function shouldComponentUpdate(nextProps, nextState) {
  5139. return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
  5140. }
  5141. return shouldComponentUpdate;
  5142. }()
  5143. }, {
  5144. key: 'componentDidUpdate',
  5145. value: function () {
  5146. function componentDidUpdate(prevProps) {
  5147. var _props = this.props,
  5148. isFocused = _props.isFocused,
  5149. tabIndex = _props.tabIndex;
  5150. if (tabIndex === 0) {
  5151. if (isFocused || tabIndex !== prevProps.tabIndex) {
  5152. this.buttonRef.focus();
  5153. }
  5154. }
  5155. }
  5156. return componentDidUpdate;
  5157. }()
  5158. }, {
  5159. key: 'onDayClick',
  5160. value: function () {
  5161. function onDayClick(day, e) {
  5162. var onDayClick = this.props.onDayClick;
  5163. onDayClick(day, e);
  5164. }
  5165. return onDayClick;
  5166. }()
  5167. }, {
  5168. key: 'onDayMouseEnter',
  5169. value: function () {
  5170. function onDayMouseEnter(day, e) {
  5171. var onDayMouseEnter = this.props.onDayMouseEnter;
  5172. this.setState({ isHovered: true });
  5173. onDayMouseEnter(day, e);
  5174. }
  5175. return onDayMouseEnter;
  5176. }()
  5177. }, {
  5178. key: 'onDayMouseLeave',
  5179. value: function () {
  5180. function onDayMouseLeave(day, e) {
  5181. var onDayMouseLeave = this.props.onDayMouseLeave;
  5182. this.setState({ isHovered: false });
  5183. onDayMouseLeave(day, e);
  5184. }
  5185. return onDayMouseLeave;
  5186. }()
  5187. }, {
  5188. key: 'onKeyDown',
  5189. value: function () {
  5190. function onKeyDown(day, e) {
  5191. var onDayClick = this.props.onDayClick;
  5192. var key = e.key;
  5193. if (key === 'Enter' || key === ' ') {
  5194. onDayClick(day, e);
  5195. }
  5196. }
  5197. return onKeyDown;
  5198. }()
  5199. }, {
  5200. key: 'setButtonRef',
  5201. value: function () {
  5202. function setButtonRef(ref) {
  5203. this.buttonRef = ref;
  5204. }
  5205. return setButtonRef;
  5206. }()
  5207. }, {
  5208. key: 'render',
  5209. value: function () {
  5210. function render() {
  5211. var _this2 = this;
  5212. var _props2 = this.props,
  5213. day = _props2.day,
  5214. ariaLabelFormat = _props2.ariaLabelFormat,
  5215. daySize = _props2.daySize,
  5216. isOutsideDay = _props2.isOutsideDay,
  5217. modifiers = _props2.modifiers,
  5218. tabIndex = _props2.tabIndex,
  5219. renderDayContents = _props2.renderDayContents,
  5220. styles = _props2.styles,
  5221. phrases = _props2.phrases,
  5222. defaultStylesWithHover = _props2.defaultStyles,
  5223. outsideStylesWithHover = _props2.outsideStyles,
  5224. todayStylesWithHover = _props2.todayStyles,
  5225. firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles,
  5226. lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles,
  5227. highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles,
  5228. blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles,
  5229. blockedCalendarStylesWithHover = _props2.blockedCalendarStyles,
  5230. blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles,
  5231. hoveredSpanStylesWithHover = _props2.hoveredSpanStyles,
  5232. selectedSpanStylesWithHover = _props2.selectedSpanStyles,
  5233. lastInRangeStylesWithHover = _props2.lastInRangeStyles,
  5234. selectedStylesWithHover = _props2.selectedStyles,
  5235. selectedStartStylesWithHover = _props2.selectedStartStyles,
  5236. selectedEndStylesWithHover = _props2.selectedEndStyles,
  5237. afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles;
  5238. var isHovered = this.state.isHovered;
  5239. if (!day) return _react2['default'].createElement('td', null);
  5240. var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
  5241. daySizeStyles = _getCalendarDaySettin.daySizeStyles,
  5242. useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
  5243. selected = _getCalendarDaySettin.selected,
  5244. hoveredSpan = _getCalendarDaySettin.hoveredSpan,
  5245. isOutsideRange = _getCalendarDaySettin.isOutsideRange,
  5246. ariaLabel = _getCalendarDaySettin.ariaLabel;
  5247. return _react2['default'].createElement(
  5248. 'td',
  5249. _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), {
  5250. role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
  5251. , ref: this.setButtonRef,
  5252. 'aria-label': ariaLabel,
  5253. onMouseEnter: function () {
  5254. function onMouseEnter(e) {
  5255. _this2.onDayMouseEnter(day, e);
  5256. }
  5257. return onMouseEnter;
  5258. }(),
  5259. onMouseLeave: function () {
  5260. function onMouseLeave(e) {
  5261. _this2.onDayMouseLeave(day, e);
  5262. }
  5263. return onMouseLeave;
  5264. }(),
  5265. onMouseUp: function () {
  5266. function onMouseUp(e) {
  5267. e.currentTarget.blur();
  5268. }
  5269. return onMouseUp;
  5270. }(),
  5271. onClick: function () {
  5272. function onClick(e) {
  5273. _this2.onDayClick(day, e);
  5274. }
  5275. return onClick;
  5276. }(),
  5277. onKeyDown: function () {
  5278. function onKeyDown(e) {
  5279. _this2.onKeyDown(day, e);
  5280. }
  5281. return onKeyDown;
  5282. }(),
  5283. tabIndex: tabIndex
  5284. }),
  5285. renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
  5286. );
  5287. }
  5288. return render;
  5289. }()
  5290. }]);
  5291. return CustomizableCalendarDay;
  5292. }(_react2['default'].Component);
  5293. CustomizableCalendarDay.propTypes = propTypes;
  5294. CustomizableCalendarDay.defaultProps = defaultProps;
  5295. exports.PureCustomizableCalendarDay = CustomizableCalendarDay;
  5296. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
  5297. var font = _ref2.reactDates.font;
  5298. return {
  5299. CalendarDay: {
  5300. boxSizing: 'border-box',
  5301. cursor: 'pointer',
  5302. fontSize: font.size,
  5303. textAlign: 'center',
  5304. ':active': {
  5305. outline: 0
  5306. }
  5307. },
  5308. CalendarDay__defaultCursor: {
  5309. cursor: 'default'
  5310. }
  5311. };
  5312. })(CustomizableCalendarDay);
  5313. /***/ }),
  5314. /***/ "GG7f":
  5315. /***/ (function(module, exports, __webpack_require__) {
  5316. // eslint-disable-next-line import/no-unresolved
  5317. __webpack_require__("H24B");
  5318. /***/ }),
  5319. /***/ "GK4x":
  5320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5321. "use strict";
  5322. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  5323. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  5324. /**
  5325. * WordPress dependencies
  5326. */
  5327. const ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])();
  5328. /* harmony default export */ __webpack_exports__["a"] = (ToolbarContext);
  5329. /***/ }),
  5330. /***/ "GRId":
  5331. /***/ (function(module, exports) {
  5332. (function() { module.exports = window["wp"]["element"]; }());
  5333. /***/ }),
  5334. /***/ "Gn0q":
  5335. /***/ (function(module, exports, __webpack_require__) {
  5336. "use strict";
  5337. var define = __webpack_require__("82c2");
  5338. var getPolyfill = __webpack_require__("5yQQ");
  5339. module.exports = function shimContains() {
  5340. var polyfill = getPolyfill();
  5341. if (typeof document !== 'undefined') {
  5342. define(
  5343. document,
  5344. { contains: polyfill },
  5345. { contains: function () { return document.contains !== polyfill; } }
  5346. );
  5347. if (typeof Element !== 'undefined') {
  5348. define(
  5349. Element.prototype,
  5350. { contains: polyfill },
  5351. { contains: function () { return Element.prototype.contains !== polyfill; } }
  5352. );
  5353. }
  5354. }
  5355. return polyfill;
  5356. };
  5357. /***/ }),
  5358. /***/ "GoyQ":
  5359. /***/ (function(module, exports) {
  5360. /**
  5361. * Checks if `value` is the
  5362. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  5363. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  5364. *
  5365. * @static
  5366. * @memberOf _
  5367. * @since 0.1.0
  5368. * @category Lang
  5369. * @param {*} value The value to check.
  5370. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  5371. * @example
  5372. *
  5373. * _.isObject({});
  5374. * // => true
  5375. *
  5376. * _.isObject([1, 2, 3]);
  5377. * // => true
  5378. *
  5379. * _.isObject(_.noop);
  5380. * // => true
  5381. *
  5382. * _.isObject(null);
  5383. * // => false
  5384. */
  5385. function isObject(value) {
  5386. var type = typeof value;
  5387. return value != null && (type == 'object' || type == 'function');
  5388. }
  5389. module.exports = isObject;
  5390. /***/ }),
  5391. /***/ "H24B":
  5392. /***/ (function(module, exports, __webpack_require__) {
  5393. "use strict";
  5394. var _registerCSSInterfaceWithDefaultTheme = __webpack_require__("TUyu");
  5395. var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme);
  5396. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5397. (0, _registerCSSInterfaceWithDefaultTheme2['default'])();
  5398. /***/ }),
  5399. /***/ "HI8u":
  5400. /***/ (function(module, exports, __webpack_require__) {
  5401. "use strict";
  5402. var $isNaN = __webpack_require__("HwJD");
  5403. // http://262.ecma-international.org/5.1/#sec-9.12
  5404. module.exports = function SameValue(x, y) {
  5405. if (x === y) { // 0 === -0, but they are not identical.
  5406. if (x === 0) { return 1 / x === 1 / y; }
  5407. return true;
  5408. }
  5409. return $isNaN(x) && $isNaN(y);
  5410. };
  5411. /***/ }),
  5412. /***/ "Hsqg":
  5413. /***/ (function(module, exports, __webpack_require__) {
  5414. module.exports = true ? __webpack_require__("DciD") : undefined;
  5415. /***/ }),
  5416. /***/ "HwJD":
  5417. /***/ (function(module, exports, __webpack_require__) {
  5418. "use strict";
  5419. module.exports = Number.isNaN || function isNaN(a) {
  5420. return a !== a;
  5421. };
  5422. /***/ }),
  5423. /***/ "Hx/O":
  5424. /***/ (function(module, exports, __webpack_require__) {
  5425. "use strict";
  5426. var GetIntrinsic = __webpack_require__("rZ7t");
  5427. var $String = GetIntrinsic('%String%');
  5428. var $TypeError = GetIntrinsic('%TypeError%');
  5429. // https://ecma-international.org/ecma-262/6.0/#sec-tostring
  5430. module.exports = function ToString(argument) {
  5431. if (typeof argument === 'symbol') {
  5432. throw new $TypeError('Cannot convert a Symbol value to a string');
  5433. }
  5434. return $String(argument);
  5435. };
  5436. /***/ }),
  5437. /***/ "HyUg":
  5438. /***/ (function(module, exports, __webpack_require__) {
  5439. "use strict";
  5440. var origSymbol = typeof Symbol !== 'undefined' && Symbol;
  5441. var hasSymbolSham = __webpack_require__("eJkf");
  5442. module.exports = function hasNativeSymbols() {
  5443. if (typeof origSymbol !== 'function') { return false; }
  5444. if (typeof Symbol !== 'function') { return false; }
  5445. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  5446. if (typeof Symbol('bar') !== 'symbol') { return false; }
  5447. return hasSymbolSham();
  5448. };
  5449. /***/ }),
  5450. /***/ "I/A+":
  5451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5452. "use strict";
  5453. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
  5454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; });
  5455. /* unused harmony export b */
  5456. function _defineProperty(obj, key, value) {
  5457. if (key in obj) {
  5458. Object.defineProperty(obj, key, {
  5459. value: value,
  5460. enumerable: true,
  5461. configurable: true,
  5462. writable: true
  5463. });
  5464. } else {
  5465. obj[key] = value;
  5466. }
  5467. return obj;
  5468. }
  5469. function ownKeys(object, enumerableOnly) {
  5470. var keys = Object.keys(object);
  5471. if (Object.getOwnPropertySymbols) {
  5472. var symbols = Object.getOwnPropertySymbols(object);
  5473. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  5474. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  5475. });
  5476. keys.push.apply(keys, symbols);
  5477. }
  5478. return keys;
  5479. }
  5480. function _objectSpread2(target) {
  5481. for (var i = 1; i < arguments.length; i++) {
  5482. var source = arguments[i] != null ? arguments[i] : {};
  5483. if (i % 2) {
  5484. ownKeys(Object(source), true).forEach(function (key) {
  5485. _defineProperty(target, key, source[key]);
  5486. });
  5487. } else if (Object.getOwnPropertyDescriptors) {
  5488. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  5489. } else {
  5490. ownKeys(Object(source)).forEach(function (key) {
  5491. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  5492. });
  5493. }
  5494. }
  5495. return target;
  5496. }
  5497. function _objectWithoutPropertiesLoose(source, excluded) {
  5498. if (source == null) return {};
  5499. var target = {};
  5500. var sourceKeys = Object.keys(source);
  5501. var key, i;
  5502. for (i = 0; i < sourceKeys.length; i++) {
  5503. key = sourceKeys[i];
  5504. if (excluded.indexOf(key) >= 0) continue;
  5505. target[key] = source[key];
  5506. }
  5507. return target;
  5508. }
  5509. function _unsupportedIterableToArray(o, minLen) {
  5510. if (!o) return;
  5511. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  5512. var n = Object.prototype.toString.call(o).slice(8, -1);
  5513. if (n === "Object" && o.constructor) n = o.constructor.name;
  5514. if (n === "Map" || n === "Set") return Array.from(o);
  5515. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  5516. }
  5517. function _arrayLikeToArray(arr, len) {
  5518. if (len == null || len > arr.length) len = arr.length;
  5519. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  5520. return arr2;
  5521. }
  5522. function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  5523. var it;
  5524. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  5525. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  5526. if (it) o = it;
  5527. var i = 0;
  5528. return function () {
  5529. if (i >= o.length) return {
  5530. done: true
  5531. };
  5532. return {
  5533. done: false,
  5534. value: o[i++]
  5535. };
  5536. };
  5537. }
  5538. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  5539. }
  5540. it = o[Symbol.iterator]();
  5541. return it.next.bind(it);
  5542. }
  5543. /***/ }),
  5544. /***/ "IVEb":
  5545. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5546. "use strict";
  5547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useCreateElement; });
  5548. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  5549. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  5550. /* harmony import */ var _SystemContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("eUCI");
  5551. /* harmony import */ var _rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("RDTF");
  5552. function isRenderProp(children) {
  5553. return typeof children === "function";
  5554. }
  5555. /**
  5556. * Custom hook that will call `children` if it's a function. If
  5557. * `useCreateElement` has been passed to the context, it'll be used instead.
  5558. *
  5559. * @example
  5560. * import React from "react";
  5561. * import { SystemProvider, useCreateElement } from "reakit-system";
  5562. *
  5563. * const system = {
  5564. * useCreateElement(type, props, children = props.children) {
  5565. * // very similar to what `useCreateElement` does already
  5566. * if (typeof children === "function") {
  5567. * const { children: _, ...rest } = props;
  5568. * return children(rest);
  5569. * }
  5570. * return React.createElement(type, props, children);
  5571. * },
  5572. * };
  5573. *
  5574. * function Component(props) {
  5575. * return useCreateElement("div", props);
  5576. * }
  5577. *
  5578. * function App() {
  5579. * return (
  5580. * <SystemProvider unstable_system={system}>
  5581. * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component>
  5582. * </SystemProvider>
  5583. * );
  5584. * }
  5585. */
  5586. var useCreateElement = function useCreateElement(type, props, children) {
  5587. if (children === void 0) {
  5588. children = props.children;
  5589. }
  5590. var context = Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_SystemContext_js__WEBPACK_IMPORTED_MODULE_1__[/* SystemContext */ "a"]);
  5591. if (context.useCreateElement) {
  5592. return context.useCreateElement(type, props, children);
  5593. }
  5594. if (typeof type === "string" && isRenderProp(children)) {
  5595. var _ = props.children,
  5596. rest = Object(_rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__[/* a */ "b"])(props, ["children"]);
  5597. return children(rest);
  5598. }
  5599. return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(type, props, children);
  5600. };
  5601. /***/ }),
  5602. /***/ "IdCN":
  5603. /***/ (function(module, exports, __webpack_require__) {
  5604. "use strict";
  5605. var fnToStr = Function.prototype.toString;
  5606. var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
  5607. var badArrayLike;
  5608. var isCallableMarker;
  5609. if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
  5610. try {
  5611. badArrayLike = Object.defineProperty({}, 'length', {
  5612. get: function () {
  5613. throw isCallableMarker;
  5614. }
  5615. });
  5616. isCallableMarker = {};
  5617. // eslint-disable-next-line no-throw-literal
  5618. reflectApply(function () { throw 42; }, null, badArrayLike);
  5619. } catch (_) {
  5620. if (_ !== isCallableMarker) {
  5621. reflectApply = null;
  5622. }
  5623. }
  5624. } else {
  5625. reflectApply = null;
  5626. }
  5627. var constructorRegex = /^\s*class\b/;
  5628. var isES6ClassFn = function isES6ClassFunction(value) {
  5629. try {
  5630. var fnStr = fnToStr.call(value);
  5631. return constructorRegex.test(fnStr);
  5632. } catch (e) {
  5633. return false; // not a function
  5634. }
  5635. };
  5636. var tryFunctionObject = function tryFunctionToStr(value) {
  5637. try {
  5638. if (isES6ClassFn(value)) { return false; }
  5639. fnToStr.call(value);
  5640. return true;
  5641. } catch (e) {
  5642. return false;
  5643. }
  5644. };
  5645. var toStr = Object.prototype.toString;
  5646. var fnClass = '[object Function]';
  5647. var genClass = '[object GeneratorFunction]';
  5648. var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  5649. module.exports = reflectApply
  5650. ? function isCallable(value) {
  5651. if (!value) { return false; }
  5652. if (typeof value !== 'function' && typeof value !== 'object') { return false; }
  5653. if (typeof value === 'function' && !value.prototype) { return true; }
  5654. try {
  5655. reflectApply(value, null, badArrayLike);
  5656. } catch (e) {
  5657. if (e !== isCallableMarker) { return false; }
  5658. }
  5659. return !isES6ClassFn(value);
  5660. }
  5661. : function isCallable(value) {
  5662. if (!value) { return false; }
  5663. if (typeof value !== 'function' && typeof value !== 'object') { return false; }
  5664. if (typeof value === 'function' && !value.prototype) { return true; }
  5665. if (hasToStringTag) { return tryFunctionObject(value); }
  5666. if (isES6ClassFn(value)) { return false; }
  5667. var strClass = toStr.call(value);
  5668. return strClass === fnClass || strClass === genClass;
  5669. };
  5670. /***/ }),
  5671. /***/ "IgE5":
  5672. /***/ (function(module, exports, __webpack_require__) {
  5673. "use strict";
  5674. Object.defineProperty(exports, "__esModule", {
  5675. value: true
  5676. });
  5677. exports['default'] = isDayVisible;
  5678. var _isBeforeDay = __webpack_require__("h6xH");
  5679. var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
  5680. var _isAfterDay = __webpack_require__("Nho6");
  5681. var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
  5682. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5683. function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
  5684. var firstDayOfFirstMonth = month.clone().startOf('month');
  5685. if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
  5686. if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
  5687. var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
  5688. if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
  5689. return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
  5690. }
  5691. /***/ }),
  5692. /***/ "In1I":
  5693. /***/ (function(module, exports, __webpack_require__) {
  5694. "use strict";
  5695. var GetIntrinsic = __webpack_require__("rZ7t");
  5696. var $abs = GetIntrinsic('%Math.abs%');
  5697. // http://262.ecma-international.org/5.1/#sec-5.2
  5698. module.exports = function abs(x) {
  5699. return $abs(x);
  5700. };
  5701. /***/ }),
  5702. /***/ "J7JS":
  5703. /***/ (function(module, exports, __webpack_require__) {
  5704. "use strict";
  5705. Object.defineProperty(exports, "__esModule", {
  5706. value: true
  5707. });
  5708. var _propTypes = __webpack_require__("17x9");
  5709. var _propTypes2 = _interopRequireDefault(_propTypes);
  5710. var _airbnbPropTypes = __webpack_require__("Hsqg");
  5711. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5712. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5713. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  5714. exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () {
  5715. function modifiers(props, propName) {
  5716. for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  5717. rest[_key - 2] = arguments[_key];
  5718. }
  5719. var propValue = props[propName];
  5720. var firstError = void 0;
  5721. [].concat(_toConsumableArray(propValue)).some(function (v, i) {
  5722. var _PropTypes$string;
  5723. var fakePropName = String(propName) + ': index ' + String(i);
  5724. firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
  5725. return firstError != null;
  5726. });
  5727. return firstError == null ? null : firstError;
  5728. }
  5729. return modifiers;
  5730. }()], 'Modifiers (Set of Strings)');
  5731. /***/ }),
  5732. /***/ "JLmN":
  5733. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5734. "use strict";
  5735. /* unused harmony export Clickable */
  5736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useClickable; });
  5737. /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
  5738. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
  5739. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
  5740. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
  5741. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  5742. /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("71Og");
  5743. /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KA1K");
  5744. /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eNtd");
  5745. /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("k2cL");
  5746. /* harmony import */ var _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("G3V0");
  5747. // Automatically generated
  5748. var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"];
  5749. function isNativeClick(event) {
  5750. var element = event.currentTarget;
  5751. if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet
  5752. return Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__[/* isButton */ "a"])(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT";
  5753. }
  5754. var useClickable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
  5755. name: "Clickable",
  5756. compose: _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__[/* useTabbable */ "a"],
  5757. keys: CLICKABLE_KEYS,
  5758. useOptions: function useOptions(_ref) {
  5759. var _ref$unstable_clickOn = _ref.unstable_clickOnEnter,
  5760. unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn,
  5761. _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace,
  5762. unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2,
  5763. options = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]);
  5764. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  5765. unstable_clickOnEnter: unstable_clickOnEnter,
  5766. unstable_clickOnSpace: unstable_clickOnSpace
  5767. }, options);
  5768. },
  5769. useProps: function useProps(options, _ref2) {
  5770. var htmlOnKeyDown = _ref2.onKeyDown,
  5771. htmlOnKeyUp = _ref2.onKeyUp,
  5772. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["onKeyDown", "onKeyUp"]);
  5773. var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(false),
  5774. active = _React$useState[0],
  5775. setActive = _React$useState[1];
  5776. var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown);
  5777. var onKeyUpRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyUp);
  5778. var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  5779. var _onKeyDownRef$current;
  5780. (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
  5781. if (event.defaultPrevented) return;
  5782. if (options.disabled) return;
  5783. if (event.metaKey) return;
  5784. if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return;
  5785. var isEnter = options.unstable_clickOnEnter && event.key === "Enter";
  5786. var isSpace = options.unstable_clickOnSpace && event.key === " ";
  5787. if (isEnter || isSpace) {
  5788. if (isNativeClick(event)) return;
  5789. event.preventDefault();
  5790. if (isEnter) {
  5791. event.currentTarget.click();
  5792. } else if (isSpace) {
  5793. setActive(true);
  5794. }
  5795. }
  5796. }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]);
  5797. var onKeyUp = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  5798. var _onKeyUpRef$current;
  5799. (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event);
  5800. if (event.defaultPrevented) return;
  5801. if (options.disabled) return;
  5802. if (event.metaKey) return;
  5803. var isSpace = options.unstable_clickOnSpace && event.key === " ";
  5804. if (active && isSpace) {
  5805. setActive(false);
  5806. event.currentTarget.click();
  5807. }
  5808. }, [options.disabled, options.unstable_clickOnSpace, active]);
  5809. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  5810. "data-active": active || undefined,
  5811. onKeyDown: onKeyDown,
  5812. onKeyUp: onKeyUp
  5813. }, htmlProps);
  5814. }
  5815. });
  5816. var Clickable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
  5817. as: "button",
  5818. memo: true,
  5819. useHook: useClickable
  5820. });
  5821. /***/ }),
  5822. /***/ "JYkG":
  5823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5824. "use strict";
  5825. /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  5826. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  5827. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Z23Y");
  5828. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__);
  5829. /**
  5830. * WordPress dependencies
  5831. */
  5832. const SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({
  5833. slots: {},
  5834. fills: {},
  5835. registerSlot: () => {
  5836. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
  5837. },
  5838. updateSlot: () => {},
  5839. unregisterSlot: () => {},
  5840. registerFill: () => {},
  5841. unregisterFill: () => {}
  5842. });
  5843. /* harmony default export */ __webpack_exports__["a"] = (SlotFillContext);
  5844. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  5845. /***/ }),
  5846. /***/ "Jt44":
  5847. /***/ (function(module, exports, __webpack_require__) {
  5848. "use strict";
  5849. // TODO: remove, semver-major
  5850. module.exports = __webpack_require__("rZ7t");
  5851. /***/ }),
  5852. /***/ "Jx1U":
  5853. /***/ (function(module, exports) {
  5854. // Copyright (c) 2014 Rafael Caricio. All rights reserved.
  5855. // Use of this source code is governed by a BSD-style license that can be
  5856. // found in the LICENSE file.
  5857. var GradientParser = {};
  5858. GradientParser.parse = (function() {
  5859. var tokens = {
  5860. linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
  5861. repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
  5862. radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
  5863. repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
  5864. sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,
  5865. extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
  5866. positionKeywords: /^(left|center|right|top|bottom)/i,
  5867. pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
  5868. percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
  5869. emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
  5870. angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
  5871. startCall: /^\(/,
  5872. endCall: /^\)/,
  5873. comma: /^,/,
  5874. hexColor: /^\#([0-9a-fA-F]+)/,
  5875. literalColor: /^([a-zA-Z]+)/,
  5876. rgbColor: /^rgb/i,
  5877. rgbaColor: /^rgba/i,
  5878. number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
  5879. };
  5880. var input = '';
  5881. function error(msg) {
  5882. var err = new Error(input + ': ' + msg);
  5883. err.source = input;
  5884. throw err;
  5885. }
  5886. function getAST() {
  5887. var ast = matchListDefinitions();
  5888. if (input.length > 0) {
  5889. error('Invalid input not EOF');
  5890. }
  5891. return ast;
  5892. }
  5893. function matchListDefinitions() {
  5894. return matchListing(matchDefinition);
  5895. }
  5896. function matchDefinition() {
  5897. return matchGradient(
  5898. 'linear-gradient',
  5899. tokens.linearGradient,
  5900. matchLinearOrientation) ||
  5901. matchGradient(
  5902. 'repeating-linear-gradient',
  5903. tokens.repeatingLinearGradient,
  5904. matchLinearOrientation) ||
  5905. matchGradient(
  5906. 'radial-gradient',
  5907. tokens.radialGradient,
  5908. matchListRadialOrientations) ||
  5909. matchGradient(
  5910. 'repeating-radial-gradient',
  5911. tokens.repeatingRadialGradient,
  5912. matchListRadialOrientations);
  5913. }
  5914. function matchGradient(gradientType, pattern, orientationMatcher) {
  5915. return matchCall(pattern, function(captures) {
  5916. var orientation = orientationMatcher();
  5917. if (orientation) {
  5918. if (!scan(tokens.comma)) {
  5919. error('Missing comma before color stops');
  5920. }
  5921. }
  5922. return {
  5923. type: gradientType,
  5924. orientation: orientation,
  5925. colorStops: matchListing(matchColorStop)
  5926. };
  5927. });
  5928. }
  5929. function matchCall(pattern, callback) {
  5930. var captures = scan(pattern);
  5931. if (captures) {
  5932. if (!scan(tokens.startCall)) {
  5933. error('Missing (');
  5934. }
  5935. result = callback(captures);
  5936. if (!scan(tokens.endCall)) {
  5937. error('Missing )');
  5938. }
  5939. return result;
  5940. }
  5941. }
  5942. function matchLinearOrientation() {
  5943. return matchSideOrCorner() ||
  5944. matchAngle();
  5945. }
  5946. function matchSideOrCorner() {
  5947. return match('directional', tokens.sideOrCorner, 1);
  5948. }
  5949. function matchAngle() {
  5950. return match('angular', tokens.angleValue, 1);
  5951. }
  5952. function matchListRadialOrientations() {
  5953. var radialOrientations,
  5954. radialOrientation = matchRadialOrientation(),
  5955. lookaheadCache;
  5956. if (radialOrientation) {
  5957. radialOrientations = [];
  5958. radialOrientations.push(radialOrientation);
  5959. lookaheadCache = input;
  5960. if (scan(tokens.comma)) {
  5961. radialOrientation = matchRadialOrientation();
  5962. if (radialOrientation) {
  5963. radialOrientations.push(radialOrientation);
  5964. } else {
  5965. input = lookaheadCache;
  5966. }
  5967. }
  5968. }
  5969. return radialOrientations;
  5970. }
  5971. function matchRadialOrientation() {
  5972. var radialType = matchCircle() ||
  5973. matchEllipse();
  5974. if (radialType) {
  5975. radialType.at = matchAtPosition();
  5976. } else {
  5977. var defaultPosition = matchPositioning();
  5978. if (defaultPosition) {
  5979. radialType = {
  5980. type: 'default-radial',
  5981. at: defaultPosition
  5982. };
  5983. }
  5984. }
  5985. return radialType;
  5986. }
  5987. function matchCircle() {
  5988. var circle = match('shape', /^(circle)/i, 0);
  5989. if (circle) {
  5990. circle.style = matchLength() || matchExtentKeyword();
  5991. }
  5992. return circle;
  5993. }
  5994. function matchEllipse() {
  5995. var ellipse = match('shape', /^(ellipse)/i, 0);
  5996. if (ellipse) {
  5997. ellipse.style = matchDistance() || matchExtentKeyword();
  5998. }
  5999. return ellipse;
  6000. }
  6001. function matchExtentKeyword() {
  6002. return match('extent-keyword', tokens.extentKeywords, 1);
  6003. }
  6004. function matchAtPosition() {
  6005. if (match('position', /^at/, 0)) {
  6006. var positioning = matchPositioning();
  6007. if (!positioning) {
  6008. error('Missing positioning value');
  6009. }
  6010. return positioning;
  6011. }
  6012. }
  6013. function matchPositioning() {
  6014. var location = matchCoordinates();
  6015. if (location.x || location.y) {
  6016. return {
  6017. type: 'position',
  6018. value: location
  6019. };
  6020. }
  6021. }
  6022. function matchCoordinates() {
  6023. return {
  6024. x: matchDistance(),
  6025. y: matchDistance()
  6026. };
  6027. }
  6028. function matchListing(matcher) {
  6029. var captures = matcher(),
  6030. result = [];
  6031. if (captures) {
  6032. result.push(captures);
  6033. while (scan(tokens.comma)) {
  6034. captures = matcher();
  6035. if (captures) {
  6036. result.push(captures);
  6037. } else {
  6038. error('One extra comma');
  6039. }
  6040. }
  6041. }
  6042. return result;
  6043. }
  6044. function matchColorStop() {
  6045. var color = matchColor();
  6046. if (!color) {
  6047. error('Expected color definition');
  6048. }
  6049. color.length = matchDistance();
  6050. return color;
  6051. }
  6052. function matchColor() {
  6053. return matchHexColor() ||
  6054. matchRGBAColor() ||
  6055. matchRGBColor() ||
  6056. matchLiteralColor();
  6057. }
  6058. function matchLiteralColor() {
  6059. return match('literal', tokens.literalColor, 0);
  6060. }
  6061. function matchHexColor() {
  6062. return match('hex', tokens.hexColor, 1);
  6063. }
  6064. function matchRGBColor() {
  6065. return matchCall(tokens.rgbColor, function() {
  6066. return {
  6067. type: 'rgb',
  6068. value: matchListing(matchNumber)
  6069. };
  6070. });
  6071. }
  6072. function matchRGBAColor() {
  6073. return matchCall(tokens.rgbaColor, function() {
  6074. return {
  6075. type: 'rgba',
  6076. value: matchListing(matchNumber)
  6077. };
  6078. });
  6079. }
  6080. function matchNumber() {
  6081. return scan(tokens.number)[1];
  6082. }
  6083. function matchDistance() {
  6084. return match('%', tokens.percentageValue, 1) ||
  6085. matchPositionKeyword() ||
  6086. matchLength();
  6087. }
  6088. function matchPositionKeyword() {
  6089. return match('position-keyword', tokens.positionKeywords, 1);
  6090. }
  6091. function matchLength() {
  6092. return match('px', tokens.pixelValue, 1) ||
  6093. match('em', tokens.emValue, 1);
  6094. }
  6095. function match(type, pattern, captureIndex) {
  6096. var captures = scan(pattern);
  6097. if (captures) {
  6098. return {
  6099. type: type,
  6100. value: captures[captureIndex]
  6101. };
  6102. }
  6103. }
  6104. function scan(regexp) {
  6105. var captures,
  6106. blankCaptures;
  6107. blankCaptures = /^[\n\r\t\s]+/.exec(input);
  6108. if (blankCaptures) {
  6109. consume(blankCaptures[0].length);
  6110. }
  6111. captures = regexp.exec(input);
  6112. if (captures) {
  6113. consume(captures[0].length);
  6114. }
  6115. return captures;
  6116. }
  6117. function consume(size) {
  6118. input = input.substr(size);
  6119. }
  6120. return function(code) {
  6121. input = code.toString();
  6122. return getAST();
  6123. };
  6124. })();
  6125. exports.parse = (GradientParser || {}).parse;
  6126. /***/ }),
  6127. /***/ "K+tz":
  6128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6129. "use strict";
  6130. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  6131. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  6132. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  6133. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  6134. /**
  6135. * WordPress dependencies
  6136. */
  6137. const external = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  6138. xmlns: "http://www.w3.org/2000/svg",
  6139. viewBox: "0 0 24 24"
  6140. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  6141. d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
  6142. }));
  6143. /* harmony default export */ __webpack_exports__["a"] = (external);
  6144. /***/ }),
  6145. /***/ "K9lf":
  6146. /***/ (function(module, exports) {
  6147. (function() { module.exports = window["wp"]["compose"]; }());
  6148. /***/ }),
  6149. /***/ "KA1K":
  6150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6151. "use strict";
  6152. // UNUSED EXPORTS: warning, useWarning
  6153. // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js
  6154. var warning = __webpack_require__("WnOg");
  6155. // EXTERNAL MODULE: external "React"
  6156. var external_React_ = __webpack_require__("cDcd");
  6157. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js
  6158. var isObject = __webpack_require__("Ptb8");
  6159. // CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js
  6160. function isRefObject(ref) {
  6161. return Object(isObject["a" /* isObject */])(ref) && "current" in ref;
  6162. }
  6163. /**
  6164. * Logs `messages` to the console using `console.warn` based on a `condition`.
  6165. * This should be used inside components.
  6166. */
  6167. function useWarning(condition) {
  6168. for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  6169. messages[_key - 1] = arguments[_key];
  6170. }
  6171. if (false) {}
  6172. }
  6173. // CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js
  6174. /***/ }),
  6175. /***/ "KCH1":
  6176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6177. "use strict";
  6178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_IdContext; });
  6179. /* unused harmony export unstable_IdProvider */
  6180. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  6181. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  6182. var defaultPrefix = "id";
  6183. function generateRandomString(prefix) {
  6184. if (prefix === void 0) {
  6185. prefix = defaultPrefix;
  6186. }
  6187. return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6);
  6188. }
  6189. var unstable_IdContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])(generateRandomString);
  6190. function unstable_IdProvider(_ref) {
  6191. var children = _ref.children,
  6192. _ref$prefix = _ref.prefix,
  6193. prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix;
  6194. var count = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0);
  6195. var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function (localPrefix) {
  6196. if (localPrefix === void 0) {
  6197. localPrefix = prefix;
  6198. }
  6199. return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current;
  6200. }, [prefix]);
  6201. return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(unstable_IdContext.Provider, {
  6202. value: generateId
  6203. }, children);
  6204. }
  6205. /***/ }),
  6206. /***/ "KfNM":
  6207. /***/ (function(module, exports) {
  6208. /** Used for built-in method references. */
  6209. var objectProto = Object.prototype;
  6210. /**
  6211. * Used to resolve the
  6212. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  6213. * of values.
  6214. */
  6215. var nativeObjectToString = objectProto.toString;
  6216. /**
  6217. * Converts `value` to a string using `Object.prototype.toString`.
  6218. *
  6219. * @private
  6220. * @param {*} value The value to convert.
  6221. * @returns {string} Returns the converted string.
  6222. */
  6223. function objectToString(value) {
  6224. return nativeObjectToString.call(value);
  6225. }
  6226. module.exports = objectToString;
  6227. /***/ }),
  6228. /***/ "Koq/":
  6229. /***/ (function(module, exports, __webpack_require__) {
  6230. "use strict";
  6231. var defineProperties = __webpack_require__("82c2");
  6232. var callBind = __webpack_require__("PrET");
  6233. var implementation = __webpack_require__("FufO");
  6234. var getPolyfill = __webpack_require__("yLpt");
  6235. var shim = __webpack_require__("8R9v");
  6236. var polyfill = callBind.apply(getPolyfill());
  6237. // eslint-disable-next-line no-unused-vars
  6238. var bound = function assign(target, source1) {
  6239. return polyfill(Object, arguments);
  6240. };
  6241. defineProperties(bound, {
  6242. getPolyfill: getPolyfill,
  6243. implementation: implementation,
  6244. shim: shim
  6245. });
  6246. module.exports = bound;
  6247. /***/ }),
  6248. /***/ "Kz5y":
  6249. /***/ (function(module, exports, __webpack_require__) {
  6250. var freeGlobal = __webpack_require__("WFqU");
  6251. /** Detect free variable `self`. */
  6252. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  6253. /** Used as a reference to the global object. */
  6254. var root = freeGlobal || freeSelf || Function('return this')();
  6255. module.exports = root;
  6256. /***/ }),
  6257. /***/ "L7Wv":
  6258. /***/ (function(module, exports, __webpack_require__) {
  6259. "use strict";
  6260. var toPrimitive = __webpack_require__("WZeS");
  6261. // https://ecma-international.org/ecma-262/6.0/#sec-toprimitive
  6262. module.exports = function ToPrimitive(input) {
  6263. if (arguments.length > 1) {
  6264. return toPrimitive(input, arguments[1]);
  6265. }
  6266. return toPrimitive(input);
  6267. };
  6268. /***/ }),
  6269. /***/ "L8Kx":
  6270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6271. "use strict";
  6272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getAnimateClassName; });
  6273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animate; });
  6274. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TSYQ");
  6275. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
  6276. /**
  6277. * External dependencies
  6278. */
  6279. /**
  6280. * @typedef {'top' | 'top left' | 'top right' | 'middle' | 'middle left' | 'middle right' | 'bottom' | 'bottom left' | 'bottom right'} AppearOrigin
  6281. * @typedef {'left' | 'right'} SlideInOrigin
  6282. * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions
  6283. * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions
  6284. * @typedef {{ type: 'loading'; }} LoadingOptions
  6285. * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions
  6286. */
  6287. /* eslint-disable jsdoc/valid-types */
  6288. /**
  6289. * @param {GetAnimateOptions['type']} type The animation type
  6290. * @return {'top' | 'left'} Default origin
  6291. */
  6292. function getDefaultOrigin(type) {
  6293. return type === 'appear' ? 'top' : 'left';
  6294. }
  6295. /* eslint-enable jsdoc/valid-types */
  6296. /**
  6297. * @param {GetAnimateOptions} options
  6298. *
  6299. * @return {string | void} ClassName that applies the animations
  6300. */
  6301. function getAnimateClassName(options) {
  6302. if (options.type === 'loading') {
  6303. return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__loading');
  6304. }
  6305. const {
  6306. type,
  6307. origin = getDefaultOrigin(type)
  6308. } = options;
  6309. if (type === 'appear') {
  6310. const [yAxis, xAxis = 'center'] = origin.split(' ');
  6311. return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__appear', {
  6312. ['is-from-' + xAxis]: xAxis !== 'center',
  6313. ['is-from-' + yAxis]: yAxis !== 'middle'
  6314. });
  6315. }
  6316. if (type === 'slide-in') {
  6317. return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__slide-in', 'is-from-' + origin);
  6318. }
  6319. } // @ts-ignore Reason: Planned for deprecation
  6320. function Animate({
  6321. type,
  6322. options = {},
  6323. children
  6324. }) {
  6325. return children({
  6326. className: getAnimateClassName({
  6327. type,
  6328. ...options
  6329. })
  6330. });
  6331. }
  6332. /***/ }),
  6333. /***/ "LTAC":
  6334. /***/ (function(module, exports) {
  6335. Object.defineProperty(exports, "__esModule", {
  6336. value: true
  6337. });
  6338. exports['default'] = isTouchDevice;
  6339. function isTouchDevice() {
  6340. return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints));
  6341. }
  6342. module.exports = exports['default'];
  6343. /***/ }),
  6344. /***/ "Lxf3":
  6345. /***/ (function(module, exports, __webpack_require__) {
  6346. "use strict";
  6347. var toStr = Object.prototype.toString;
  6348. var isPrimitive = __webpack_require__("Teho");
  6349. var isCallable = __webpack_require__("IdCN");
  6350. // http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
  6351. var ES5internalSlots = {
  6352. '[[DefaultValue]]': function (O) {
  6353. var actualHint;
  6354. if (arguments.length > 1) {
  6355. actualHint = arguments[1];
  6356. } else {
  6357. actualHint = toStr.call(O) === '[object Date]' ? String : Number;
  6358. }
  6359. if (actualHint === String || actualHint === Number) {
  6360. var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
  6361. var value, i;
  6362. for (i = 0; i < methods.length; ++i) {
  6363. if (isCallable(O[methods[i]])) {
  6364. value = O[methods[i]]();
  6365. if (isPrimitive(value)) {
  6366. return value;
  6367. }
  6368. }
  6369. }
  6370. throw new TypeError('No default value');
  6371. }
  6372. throw new TypeError('invalid [[DefaultValue]] hint supplied');
  6373. }
  6374. };
  6375. // http://ecma-international.org/ecma-262/5.1/#sec-9.1
  6376. module.exports = function ToPrimitive(input) {
  6377. if (isPrimitive(input)) {
  6378. return input;
  6379. }
  6380. if (arguments.length > 1) {
  6381. return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
  6382. }
  6383. return ES5internalSlots['[[DefaultValue]]'](input);
  6384. };
  6385. /***/ }),
  6386. /***/ "MiSq":
  6387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6388. "use strict";
  6389. // EXPORTS
  6390. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ serialize_browser_esm_serializeStyles; });
  6391. // CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
  6392. /* eslint-disable */
  6393. // Inspired by https://github.com/garycourt/murmurhash-js
  6394. // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
  6395. function murmur2(str) {
  6396. // 'm' and 'r' are mixing constants generated offline.
  6397. // They're not really 'magic', they just happen to work well.
  6398. // const m = 0x5bd1e995;
  6399. // const r = 24;
  6400. // Initialize the hash
  6401. var h = 0; // Mix 4 bytes at a time into the hash
  6402. var k,
  6403. i = 0,
  6404. len = str.length;
  6405. for (; len >= 4; ++i, len -= 4) {
  6406. k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
  6407. k =
  6408. /* Math.imul(k, m): */
  6409. (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
  6410. k ^=
  6411. /* k >>> r: */
  6412. k >>> 24;
  6413. h =
  6414. /* Math.imul(k, m): */
  6415. (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
  6416. /* Math.imul(h, m): */
  6417. (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
  6418. } // Handle the last few bytes of the input array
  6419. switch (len) {
  6420. case 3:
  6421. h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
  6422. case 2:
  6423. h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
  6424. case 1:
  6425. h ^= str.charCodeAt(i) & 0xff;
  6426. h =
  6427. /* Math.imul(h, m): */
  6428. (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
  6429. } // Do a few final mixes of the hash to ensure the last few
  6430. // bytes are well-incorporated.
  6431. h ^= h >>> 13;
  6432. h =
  6433. /* Math.imul(h, m): */
  6434. (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
  6435. return ((h ^ h >>> 15) >>> 0).toString(36);
  6436. }
  6437. /* harmony default export */ var hash_browser_esm = (murmur2);
  6438. // CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
  6439. var unitlessKeys = {
  6440. animationIterationCount: 1,
  6441. borderImageOutset: 1,
  6442. borderImageSlice: 1,
  6443. borderImageWidth: 1,
  6444. boxFlex: 1,
  6445. boxFlexGroup: 1,
  6446. boxOrdinalGroup: 1,
  6447. columnCount: 1,
  6448. columns: 1,
  6449. flex: 1,
  6450. flexGrow: 1,
  6451. flexPositive: 1,
  6452. flexShrink: 1,
  6453. flexNegative: 1,
  6454. flexOrder: 1,
  6455. gridRow: 1,
  6456. gridRowEnd: 1,
  6457. gridRowSpan: 1,
  6458. gridRowStart: 1,
  6459. gridColumn: 1,
  6460. gridColumnEnd: 1,
  6461. gridColumnSpan: 1,
  6462. gridColumnStart: 1,
  6463. msGridRow: 1,
  6464. msGridRowSpan: 1,
  6465. msGridColumn: 1,
  6466. msGridColumnSpan: 1,
  6467. fontWeight: 1,
  6468. lineHeight: 1,
  6469. opacity: 1,
  6470. order: 1,
  6471. orphans: 1,
  6472. tabSize: 1,
  6473. widows: 1,
  6474. zIndex: 1,
  6475. zoom: 1,
  6476. WebkitLineClamp: 1,
  6477. // SVG-related properties
  6478. fillOpacity: 1,
  6479. floodOpacity: 1,
  6480. stopOpacity: 1,
  6481. strokeDasharray: 1,
  6482. strokeDashoffset: 1,
  6483. strokeMiterlimit: 1,
  6484. strokeOpacity: 1,
  6485. strokeWidth: 1
  6486. };
  6487. /* harmony default export */ var unitless_browser_esm = (unitlessKeys);
  6488. // EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
  6489. var memoize_browser_esm = __webpack_require__("4qRI");
  6490. // CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js
  6491. var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
  6492. var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
  6493. var hyphenateRegex = /[A-Z]|^ms/g;
  6494. var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
  6495. var isCustomProperty = function isCustomProperty(property) {
  6496. return property.charCodeAt(1) === 45;
  6497. };
  6498. var isProcessableValue = function isProcessableValue(value) {
  6499. return value != null && typeof value !== 'boolean';
  6500. };
  6501. var processStyleName = Object(memoize_browser_esm["a" /* default */])(function (styleName) {
  6502. return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
  6503. });
  6504. var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) {
  6505. switch (key) {
  6506. case 'animation':
  6507. case 'animationName':
  6508. {
  6509. if (typeof value === 'string') {
  6510. return value.replace(animationRegex, function (match, p1, p2) {
  6511. cursor = {
  6512. name: p1,
  6513. styles: p2,
  6514. next: cursor
  6515. };
  6516. return p1;
  6517. });
  6518. }
  6519. }
  6520. }
  6521. if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
  6522. return value + 'px';
  6523. }
  6524. return value;
  6525. };
  6526. if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
  6527. var shouldWarnAboutInterpolatingClassNameFromCss = true;
  6528. function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
  6529. if (interpolation == null) {
  6530. return '';
  6531. }
  6532. if (interpolation.__emotion_styles !== undefined) {
  6533. if (false) {}
  6534. return interpolation;
  6535. }
  6536. switch (typeof interpolation) {
  6537. case 'boolean':
  6538. {
  6539. return '';
  6540. }
  6541. case 'object':
  6542. {
  6543. if (interpolation.anim === 1) {
  6544. cursor = {
  6545. name: interpolation.name,
  6546. styles: interpolation.styles,
  6547. next: cursor
  6548. };
  6549. return interpolation.name;
  6550. }
  6551. if (interpolation.styles !== undefined) {
  6552. var next = interpolation.next;
  6553. if (next !== undefined) {
  6554. // not the most efficient thing ever but this is a pretty rare case
  6555. // and there will be very few iterations of this generally
  6556. while (next !== undefined) {
  6557. cursor = {
  6558. name: next.name,
  6559. styles: next.styles,
  6560. next: cursor
  6561. };
  6562. next = next.next;
  6563. }
  6564. }
  6565. var styles = interpolation.styles + ";";
  6566. if (false) {}
  6567. return styles;
  6568. }
  6569. return createStringFromObject(mergedProps, registered, interpolation);
  6570. }
  6571. case 'function':
  6572. {
  6573. if (mergedProps !== undefined) {
  6574. var previousCursor = cursor;
  6575. var result = interpolation(mergedProps);
  6576. cursor = previousCursor;
  6577. return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);
  6578. } else if (false) {}
  6579. break;
  6580. }
  6581. case 'string':
  6582. if (false) { var replaced, matched; }
  6583. break;
  6584. } // finalize string values (regular strings and functions interpolated into css calls)
  6585. if (registered == null) {
  6586. return interpolation;
  6587. }
  6588. var cached = registered[interpolation];
  6589. if (false) {}
  6590. return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
  6591. }
  6592. function createStringFromObject(mergedProps, registered, obj) {
  6593. var string = '';
  6594. if (Array.isArray(obj)) {
  6595. for (var i = 0; i < obj.length; i++) {
  6596. string += handleInterpolation(mergedProps, registered, obj[i], false);
  6597. }
  6598. } else {
  6599. for (var _key in obj) {
  6600. var value = obj[_key];
  6601. if (typeof value !== 'object') {
  6602. if (registered != null && registered[value] !== undefined) {
  6603. string += _key + "{" + registered[value] + "}";
  6604. } else if (isProcessableValue(value)) {
  6605. string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";";
  6606. }
  6607. } else {
  6608. if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {
  6609. throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
  6610. }
  6611. if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
  6612. for (var _i = 0; _i < value.length; _i++) {
  6613. if (isProcessableValue(value[_i])) {
  6614. string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";";
  6615. }
  6616. }
  6617. } else {
  6618. var interpolated = handleInterpolation(mergedProps, registered, value, false);
  6619. switch (_key) {
  6620. case 'animation':
  6621. case 'animationName':
  6622. {
  6623. string += processStyleName(_key) + ":" + interpolated + ";";
  6624. break;
  6625. }
  6626. default:
  6627. {
  6628. if (false) {}
  6629. string += _key + "{" + interpolated + "}";
  6630. }
  6631. }
  6632. }
  6633. }
  6634. }
  6635. }
  6636. return string;
  6637. }
  6638. var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
  6639. var sourceMapPattern;
  6640. if (false) {} // this is the cursor for keyframes
  6641. // keyframes are stored on the SerializedStyles object as a linked list
  6642. var cursor;
  6643. var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
  6644. if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
  6645. return args[0];
  6646. }
  6647. var stringMode = true;
  6648. var styles = '';
  6649. cursor = undefined;
  6650. var strings = args[0];
  6651. if (strings == null || strings.raw === undefined) {
  6652. stringMode = false;
  6653. styles += handleInterpolation(mergedProps, registered, strings, false);
  6654. } else {
  6655. if (false) {}
  6656. styles += strings[0];
  6657. } // we start at 1 since we've already handled the first arg
  6658. for (var i = 1; i < args.length; i++) {
  6659. styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
  6660. if (stringMode) {
  6661. if (false) {}
  6662. styles += strings[i];
  6663. }
  6664. }
  6665. var sourceMap;
  6666. if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
  6667. labelPattern.lastIndex = 0;
  6668. var identifierName = '';
  6669. var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
  6670. while ((match = labelPattern.exec(styles)) !== null) {
  6671. identifierName += '-' + // $FlowFixMe we know it's not null
  6672. match[1];
  6673. }
  6674. var name = hash_browser_esm(styles) + identifierName;
  6675. if (false) {}
  6676. return {
  6677. name: name,
  6678. styles: styles,
  6679. next: cursor
  6680. };
  6681. };
  6682. /***/ }),
  6683. /***/ "Mih7":
  6684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6685. "use strict";
  6686. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasUserFocus; });
  6687. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setUserFocus; });
  6688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return userFocus; });
  6689. function userFocus(element) {
  6690. element.userFocus = true;
  6691. element.focus();
  6692. element.userFocus = false;
  6693. }
  6694. function hasUserFocus(element) {
  6695. return !!element.userFocus;
  6696. }
  6697. function setUserFocus(element, value) {
  6698. element.userFocus = value;
  6699. }
  6700. /***/ }),
  6701. /***/ "Mp0b":
  6702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6703. "use strict";
  6704. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  6705. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  6706. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  6707. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  6708. /**
  6709. * WordPress dependencies
  6710. */
  6711. const linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  6712. xmlns: "http://www.w3.org/2000/svg",
  6713. viewBox: "0 0 24 24"
  6714. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  6715. d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
  6716. }));
  6717. /* harmony default export */ __webpack_exports__["a"] = (linkOff);
  6718. /***/ }),
  6719. /***/ "N3k4":
  6720. /***/ (function(module, exports, __webpack_require__) {
  6721. "use strict";
  6722. Object.defineProperty(exports, "__esModule", {
  6723. value: true
  6724. });
  6725. exports.PureCalendarDay = undefined;
  6726. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  6727. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6728. var _object = __webpack_require__("Koq/");
  6729. var _object2 = _interopRequireDefault(_object);
  6730. var _react = __webpack_require__("cDcd");
  6731. var _react2 = _interopRequireDefault(_react);
  6732. var _propTypes = __webpack_require__("17x9");
  6733. var _propTypes2 = _interopRequireDefault(_propTypes);
  6734. var _reactAddonsShallowCompare = __webpack_require__("YZDV");
  6735. var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
  6736. var _reactMomentProptypes = __webpack_require__("XGBb");
  6737. var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
  6738. var _airbnbPropTypes = __webpack_require__("Hsqg");
  6739. var _reactWithStyles = __webpack_require__("TG4+");
  6740. var _moment = __webpack_require__("wy2R");
  6741. var _moment2 = _interopRequireDefault(_moment);
  6742. var _defaultPhrases = __webpack_require__("vV+G");
  6743. var _getPhrasePropTypes = __webpack_require__("yc2e");
  6744. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  6745. var _getCalendarDaySettings = __webpack_require__("Ae65");
  6746. var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
  6747. var _ModifiersShape = __webpack_require__("J7JS");
  6748. var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
  6749. var _constants = __webpack_require__("Fv1B");
  6750. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  6751. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6752. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6753. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6754. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  6755. day: _reactMomentProptypes2['default'].momentObj,
  6756. daySize: _airbnbPropTypes.nonNegativeInteger,
  6757. isOutsideDay: _propTypes2['default'].bool,
  6758. modifiers: _ModifiersShape2['default'],
  6759. isFocused: _propTypes2['default'].bool,
  6760. tabIndex: _propTypes2['default'].oneOf([0, -1]),
  6761. onDayClick: _propTypes2['default'].func,
  6762. onDayMouseEnter: _propTypes2['default'].func,
  6763. onDayMouseLeave: _propTypes2['default'].func,
  6764. renderDayContents: _propTypes2['default'].func,
  6765. ariaLabelFormat: _propTypes2['default'].string,
  6766. // internationalization
  6767. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
  6768. }));
  6769. var defaultProps = {
  6770. day: (0, _moment2['default'])(),
  6771. daySize: _constants.DAY_SIZE,
  6772. isOutsideDay: false,
  6773. modifiers: new Set(),
  6774. isFocused: false,
  6775. tabIndex: -1,
  6776. onDayClick: function () {
  6777. function onDayClick() {}
  6778. return onDayClick;
  6779. }(),
  6780. onDayMouseEnter: function () {
  6781. function onDayMouseEnter() {}
  6782. return onDayMouseEnter;
  6783. }(),
  6784. onDayMouseLeave: function () {
  6785. function onDayMouseLeave() {}
  6786. return onDayMouseLeave;
  6787. }(),
  6788. renderDayContents: null,
  6789. ariaLabelFormat: 'dddd, LL',
  6790. // internationalization
  6791. phrases: _defaultPhrases.CalendarDayPhrases
  6792. };
  6793. var CalendarDay = function (_React$Component) {
  6794. _inherits(CalendarDay, _React$Component);
  6795. function CalendarDay() {
  6796. var _ref;
  6797. _classCallCheck(this, CalendarDay);
  6798. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6799. args[_key] = arguments[_key];
  6800. }
  6801. var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
  6802. _this.setButtonRef = _this.setButtonRef.bind(_this);
  6803. return _this;
  6804. }
  6805. _createClass(CalendarDay, [{
  6806. key: 'shouldComponentUpdate',
  6807. value: function () {
  6808. function shouldComponentUpdate(nextProps, nextState) {
  6809. return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
  6810. }
  6811. return shouldComponentUpdate;
  6812. }()
  6813. }, {
  6814. key: 'componentDidUpdate',
  6815. value: function () {
  6816. function componentDidUpdate(prevProps) {
  6817. var _props = this.props,
  6818. isFocused = _props.isFocused,
  6819. tabIndex = _props.tabIndex;
  6820. if (tabIndex === 0) {
  6821. if (isFocused || tabIndex !== prevProps.tabIndex) {
  6822. this.buttonRef.focus();
  6823. }
  6824. }
  6825. }
  6826. return componentDidUpdate;
  6827. }()
  6828. }, {
  6829. key: 'onDayClick',
  6830. value: function () {
  6831. function onDayClick(day, e) {
  6832. var onDayClick = this.props.onDayClick;
  6833. onDayClick(day, e);
  6834. }
  6835. return onDayClick;
  6836. }()
  6837. }, {
  6838. key: 'onDayMouseEnter',
  6839. value: function () {
  6840. function onDayMouseEnter(day, e) {
  6841. var onDayMouseEnter = this.props.onDayMouseEnter;
  6842. onDayMouseEnter(day, e);
  6843. }
  6844. return onDayMouseEnter;
  6845. }()
  6846. }, {
  6847. key: 'onDayMouseLeave',
  6848. value: function () {
  6849. function onDayMouseLeave(day, e) {
  6850. var onDayMouseLeave = this.props.onDayMouseLeave;
  6851. onDayMouseLeave(day, e);
  6852. }
  6853. return onDayMouseLeave;
  6854. }()
  6855. }, {
  6856. key: 'onKeyDown',
  6857. value: function () {
  6858. function onKeyDown(day, e) {
  6859. var onDayClick = this.props.onDayClick;
  6860. var key = e.key;
  6861. if (key === 'Enter' || key === ' ') {
  6862. onDayClick(day, e);
  6863. }
  6864. }
  6865. return onKeyDown;
  6866. }()
  6867. }, {
  6868. key: 'setButtonRef',
  6869. value: function () {
  6870. function setButtonRef(ref) {
  6871. this.buttonRef = ref;
  6872. }
  6873. return setButtonRef;
  6874. }()
  6875. }, {
  6876. key: 'render',
  6877. value: function () {
  6878. function render() {
  6879. var _this2 = this;
  6880. var _props2 = this.props,
  6881. day = _props2.day,
  6882. ariaLabelFormat = _props2.ariaLabelFormat,
  6883. daySize = _props2.daySize,
  6884. isOutsideDay = _props2.isOutsideDay,
  6885. modifiers = _props2.modifiers,
  6886. renderDayContents = _props2.renderDayContents,
  6887. tabIndex = _props2.tabIndex,
  6888. styles = _props2.styles,
  6889. phrases = _props2.phrases;
  6890. if (!day) return _react2['default'].createElement('td', null);
  6891. var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
  6892. daySizeStyles = _getCalendarDaySettin.daySizeStyles,
  6893. useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
  6894. selected = _getCalendarDaySettin.selected,
  6895. hoveredSpan = _getCalendarDaySettin.hoveredSpan,
  6896. isOutsideRange = _getCalendarDaySettin.isOutsideRange,
  6897. ariaLabel = _getCalendarDaySettin.ariaLabel;
  6898. return _react2['default'].createElement(
  6899. 'td',
  6900. _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
  6901. role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
  6902. , ref: this.setButtonRef,
  6903. 'aria-label': ariaLabel,
  6904. onMouseEnter: function () {
  6905. function onMouseEnter(e) {
  6906. _this2.onDayMouseEnter(day, e);
  6907. }
  6908. return onMouseEnter;
  6909. }(),
  6910. onMouseLeave: function () {
  6911. function onMouseLeave(e) {
  6912. _this2.onDayMouseLeave(day, e);
  6913. }
  6914. return onMouseLeave;
  6915. }(),
  6916. onMouseUp: function () {
  6917. function onMouseUp(e) {
  6918. e.currentTarget.blur();
  6919. }
  6920. return onMouseUp;
  6921. }(),
  6922. onClick: function () {
  6923. function onClick(e) {
  6924. _this2.onDayClick(day, e);
  6925. }
  6926. return onClick;
  6927. }(),
  6928. onKeyDown: function () {
  6929. function onKeyDown(e) {
  6930. _this2.onKeyDown(day, e);
  6931. }
  6932. return onKeyDown;
  6933. }(),
  6934. tabIndex: tabIndex
  6935. }),
  6936. renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
  6937. );
  6938. }
  6939. return render;
  6940. }()
  6941. }]);
  6942. return CalendarDay;
  6943. }(_react2['default'].Component);
  6944. CalendarDay.propTypes = propTypes;
  6945. CalendarDay.defaultProps = defaultProps;
  6946. exports.PureCalendarDay = CalendarDay;
  6947. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
  6948. var _ref2$reactDates = _ref2.reactDates,
  6949. color = _ref2$reactDates.color,
  6950. font = _ref2$reactDates.font;
  6951. return {
  6952. CalendarDay: {
  6953. boxSizing: 'border-box',
  6954. cursor: 'pointer',
  6955. fontSize: font.size,
  6956. textAlign: 'center',
  6957. ':active': {
  6958. outline: 0
  6959. }
  6960. },
  6961. CalendarDay__defaultCursor: {
  6962. cursor: 'default'
  6963. },
  6964. CalendarDay__default: {
  6965. border: '1px solid ' + String(color.core.borderLight),
  6966. color: color.text,
  6967. background: color.background,
  6968. ':hover': {
  6969. background: color.core.borderLight,
  6970. border: '1px double ' + String(color.core.borderLight),
  6971. color: 'inherit'
  6972. }
  6973. },
  6974. CalendarDay__hovered_offset: {
  6975. background: color.core.borderBright,
  6976. border: '1px double ' + String(color.core.borderLight),
  6977. color: 'inherit'
  6978. },
  6979. CalendarDay__outside: {
  6980. border: 0,
  6981. background: color.outside.backgroundColor,
  6982. color: color.outside.color,
  6983. ':hover': {
  6984. border: 0
  6985. }
  6986. },
  6987. CalendarDay__blocked_minimum_nights: {
  6988. background: color.minimumNights.backgroundColor,
  6989. border: '1px solid ' + String(color.minimumNights.borderColor),
  6990. color: color.minimumNights.color,
  6991. ':hover': {
  6992. background: color.minimumNights.backgroundColor_hover,
  6993. color: color.minimumNights.color_active
  6994. },
  6995. ':active': {
  6996. background: color.minimumNights.backgroundColor_active,
  6997. color: color.minimumNights.color_active
  6998. }
  6999. },
  7000. CalendarDay__highlighted_calendar: {
  7001. background: color.highlighted.backgroundColor,
  7002. color: color.highlighted.color,
  7003. ':hover': {
  7004. background: color.highlighted.backgroundColor_hover,
  7005. color: color.highlighted.color_active
  7006. },
  7007. ':active': {
  7008. background: color.highlighted.backgroundColor_active,
  7009. color: color.highlighted.color_active
  7010. }
  7011. },
  7012. CalendarDay__selected_span: {
  7013. background: color.selectedSpan.backgroundColor,
  7014. border: '1px solid ' + String(color.selectedSpan.borderColor),
  7015. color: color.selectedSpan.color,
  7016. ':hover': {
  7017. background: color.selectedSpan.backgroundColor_hover,
  7018. border: '1px solid ' + String(color.selectedSpan.borderColor),
  7019. color: color.selectedSpan.color_active
  7020. },
  7021. ':active': {
  7022. background: color.selectedSpan.backgroundColor_active,
  7023. border: '1px solid ' + String(color.selectedSpan.borderColor),
  7024. color: color.selectedSpan.color_active
  7025. }
  7026. },
  7027. CalendarDay__last_in_range: {
  7028. borderRight: color.core.primary
  7029. },
  7030. CalendarDay__selected: {
  7031. background: color.selected.backgroundColor,
  7032. border: '1px solid ' + String(color.selected.borderColor),
  7033. color: color.selected.color,
  7034. ':hover': {
  7035. background: color.selected.backgroundColor_hover,
  7036. border: '1px solid ' + String(color.selected.borderColor),
  7037. color: color.selected.color_active
  7038. },
  7039. ':active': {
  7040. background: color.selected.backgroundColor_active,
  7041. border: '1px solid ' + String(color.selected.borderColor),
  7042. color: color.selected.color_active
  7043. }
  7044. },
  7045. CalendarDay__hovered_span: {
  7046. background: color.hoveredSpan.backgroundColor,
  7047. border: '1px solid ' + String(color.hoveredSpan.borderColor),
  7048. color: color.hoveredSpan.color,
  7049. ':hover': {
  7050. background: color.hoveredSpan.backgroundColor_hover,
  7051. border: '1px solid ' + String(color.hoveredSpan.borderColor),
  7052. color: color.hoveredSpan.color_active
  7053. },
  7054. ':active': {
  7055. background: color.hoveredSpan.backgroundColor_active,
  7056. border: '1px solid ' + String(color.hoveredSpan.borderColor),
  7057. color: color.hoveredSpan.color_active
  7058. }
  7059. },
  7060. CalendarDay__blocked_calendar: {
  7061. background: color.blocked_calendar.backgroundColor,
  7062. border: '1px solid ' + String(color.blocked_calendar.borderColor),
  7063. color: color.blocked_calendar.color,
  7064. ':hover': {
  7065. background: color.blocked_calendar.backgroundColor_hover,
  7066. border: '1px solid ' + String(color.blocked_calendar.borderColor),
  7067. color: color.blocked_calendar.color_active
  7068. },
  7069. ':active': {
  7070. background: color.blocked_calendar.backgroundColor_active,
  7071. border: '1px solid ' + String(color.blocked_calendar.borderColor),
  7072. color: color.blocked_calendar.color_active
  7073. }
  7074. },
  7075. CalendarDay__blocked_out_of_range: {
  7076. background: color.blocked_out_of_range.backgroundColor,
  7077. border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
  7078. color: color.blocked_out_of_range.color,
  7079. ':hover': {
  7080. background: color.blocked_out_of_range.backgroundColor_hover,
  7081. border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
  7082. color: color.blocked_out_of_range.color_active
  7083. },
  7084. ':active': {
  7085. background: color.blocked_out_of_range.backgroundColor_active,
  7086. border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
  7087. color: color.blocked_out_of_range.color_active
  7088. }
  7089. },
  7090. CalendarDay__selected_start: {},
  7091. CalendarDay__selected_end: {},
  7092. CalendarDay__today: {},
  7093. CalendarDay__firstDayOfWeek: {},
  7094. CalendarDay__lastDayOfWeek: {}
  7095. };
  7096. })(CalendarDay);
  7097. /***/ }),
  7098. /***/ "NMb1":
  7099. /***/ (function(module, exports) {
  7100. (function() { module.exports = window["wp"]["deprecated"]; }());
  7101. /***/ }),
  7102. /***/ "NTP4":
  7103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7104. "use strict";
  7105. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  7106. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  7107. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  7108. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  7109. /**
  7110. * WordPress dependencies
  7111. */
  7112. const upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  7113. xmlns: "http://www.w3.org/2000/svg",
  7114. viewBox: "0 0 24 24"
  7115. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  7116. d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
  7117. }));
  7118. /* harmony default export */ __webpack_exports__["a"] = (upload);
  7119. /***/ }),
  7120. /***/ "NWDH":
  7121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7122. "use strict";
  7123. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  7124. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  7125. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  7126. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  7127. /**
  7128. * WordPress dependencies
  7129. */
  7130. const chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  7131. viewBox: "0 0 24 24",
  7132. xmlns: "http://www.w3.org/2000/svg"
  7133. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  7134. d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
  7135. }));
  7136. /* harmony default export */ __webpack_exports__["a"] = (chevronDown);
  7137. /***/ }),
  7138. /***/ "Nho6":
  7139. /***/ (function(module, exports, __webpack_require__) {
  7140. "use strict";
  7141. Object.defineProperty(exports, "__esModule", {
  7142. value: true
  7143. });
  7144. exports['default'] = isAfterDay;
  7145. var _moment = __webpack_require__("wy2R");
  7146. var _moment2 = _interopRequireDefault(_moment);
  7147. var _isBeforeDay = __webpack_require__("h6xH");
  7148. var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
  7149. var _isSameDay = __webpack_require__("pRvc");
  7150. var _isSameDay2 = _interopRequireDefault(_isSameDay);
  7151. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  7152. function isAfterDay(a, b) {
  7153. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  7154. return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b);
  7155. }
  7156. /***/ }),
  7157. /***/ "Nloh":
  7158. /***/ (function(module, exports, __webpack_require__) {
  7159. "use strict";
  7160. Object.defineProperty(exports, "__esModule", {
  7161. value: true
  7162. });
  7163. exports.PureDayPicker = exports.defaultProps = undefined;
  7164. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  7165. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7166. var _object = __webpack_require__("Koq/");
  7167. var _object2 = _interopRequireDefault(_object);
  7168. var _react = __webpack_require__("cDcd");
  7169. var _react2 = _interopRequireDefault(_react);
  7170. var _propTypes = __webpack_require__("17x9");
  7171. var _propTypes2 = _interopRequireDefault(_propTypes);
  7172. var _reactAddonsShallowCompare = __webpack_require__("YZDV");
  7173. var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
  7174. var _airbnbPropTypes = __webpack_require__("Hsqg");
  7175. var _reactWithStyles = __webpack_require__("TG4+");
  7176. var _moment = __webpack_require__("wy2R");
  7177. var _moment2 = _interopRequireDefault(_moment);
  7178. var _throttle = __webpack_require__("DzJC");
  7179. var _throttle2 = _interopRequireDefault(_throttle);
  7180. var _isTouchDevice = __webpack_require__("LTAC");
  7181. var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
  7182. var _reactOutsideClickHandler = __webpack_require__("3gBW");
  7183. var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
  7184. var _defaultPhrases = __webpack_require__("vV+G");
  7185. var _getPhrasePropTypes = __webpack_require__("yc2e");
  7186. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  7187. var _CalendarMonthGrid = __webpack_require__("Thzv");
  7188. var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
  7189. var _DayPickerNavigation = __webpack_require__("zfJ5");
  7190. var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
  7191. var _DayPickerKeyboardShortcuts = __webpack_require__("1+Kn");
  7192. var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
  7193. var _getNumberOfCalendarMonthWeeks = __webpack_require__("0Dl3");
  7194. var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
  7195. var _getCalendarMonthWidth = __webpack_require__("m2ax");
  7196. var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
  7197. var _calculateDimension = __webpack_require__("ixyq");
  7198. var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
  7199. var _getActiveElement = __webpack_require__("+51k");
  7200. var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
  7201. var _isDayVisible = __webpack_require__("IgE5");
  7202. var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
  7203. var _ModifiersShape = __webpack_require__("J7JS");
  7204. var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
  7205. var _ScrollableOrientationShape = __webpack_require__("aE6U");
  7206. var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
  7207. var _DayOfWeekShape = __webpack_require__("2S2E");
  7208. var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
  7209. var _CalendarInfoPositionShape = __webpack_require__("oR9Z");
  7210. var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
  7211. var _constants = __webpack_require__("Fv1B");
  7212. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  7213. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  7214. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7215. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7216. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7217. var MONTH_PADDING = 23;
  7218. var PREV_TRANSITION = 'prev';
  7219. var NEXT_TRANSITION = 'next';
  7220. var MONTH_SELECTION_TRANSITION = 'month_selection';
  7221. var YEAR_SELECTION_TRANSITION = 'year_selection';
  7222. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  7223. // calendar presentation props
  7224. enableOutsideDays: _propTypes2['default'].bool,
  7225. numberOfMonths: _propTypes2['default'].number,
  7226. orientation: _ScrollableOrientationShape2['default'],
  7227. withPortal: _propTypes2['default'].bool,
  7228. onOutsideClick: _propTypes2['default'].func,
  7229. hidden: _propTypes2['default'].bool,
  7230. initialVisibleMonth: _propTypes2['default'].func,
  7231. firstDayOfWeek: _DayOfWeekShape2['default'],
  7232. renderCalendarInfo: _propTypes2['default'].func,
  7233. calendarInfoPosition: _CalendarInfoPositionShape2['default'],
  7234. hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
  7235. daySize: _airbnbPropTypes.nonNegativeInteger,
  7236. isRTL: _propTypes2['default'].bool,
  7237. verticalHeight: _airbnbPropTypes.nonNegativeInteger,
  7238. noBorder: _propTypes2['default'].bool,
  7239. transitionDuration: _airbnbPropTypes.nonNegativeInteger,
  7240. verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
  7241. horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
  7242. // navigation props
  7243. navPrev: _propTypes2['default'].node,
  7244. navNext: _propTypes2['default'].node,
  7245. noNavButtons: _propTypes2['default'].bool,
  7246. onPrevMonthClick: _propTypes2['default'].func,
  7247. onNextMonthClick: _propTypes2['default'].func,
  7248. onMonthChange: _propTypes2['default'].func,
  7249. onYearChange: _propTypes2['default'].func,
  7250. onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
  7251. // month props
  7252. renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  7253. renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  7254. // day props
  7255. modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
  7256. renderCalendarDay: _propTypes2['default'].func,
  7257. renderDayContents: _propTypes2['default'].func,
  7258. onDayClick: _propTypes2['default'].func,
  7259. onDayMouseEnter: _propTypes2['default'].func,
  7260. onDayMouseLeave: _propTypes2['default'].func,
  7261. // accessibility props
  7262. isFocused: _propTypes2['default'].bool,
  7263. getFirstFocusableDay: _propTypes2['default'].func,
  7264. onBlur: _propTypes2['default'].func,
  7265. showKeyboardShortcuts: _propTypes2['default'].bool,
  7266. // internationalization
  7267. monthFormat: _propTypes2['default'].string,
  7268. weekDayFormat: _propTypes2['default'].string,
  7269. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
  7270. dayAriaLabelFormat: _propTypes2['default'].string
  7271. }));
  7272. var defaultProps = exports.defaultProps = {
  7273. // calendar presentation props
  7274. enableOutsideDays: false,
  7275. numberOfMonths: 2,
  7276. orientation: _constants.HORIZONTAL_ORIENTATION,
  7277. withPortal: false,
  7278. onOutsideClick: function () {
  7279. function onOutsideClick() {}
  7280. return onOutsideClick;
  7281. }(),
  7282. hidden: false,
  7283. initialVisibleMonth: function () {
  7284. function initialVisibleMonth() {
  7285. return (0, _moment2['default'])();
  7286. }
  7287. return initialVisibleMonth;
  7288. }(),
  7289. firstDayOfWeek: null,
  7290. renderCalendarInfo: null,
  7291. calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
  7292. hideKeyboardShortcutsPanel: false,
  7293. daySize: _constants.DAY_SIZE,
  7294. isRTL: false,
  7295. verticalHeight: null,
  7296. noBorder: false,
  7297. transitionDuration: undefined,
  7298. verticalBorderSpacing: undefined,
  7299. horizontalMonthPadding: 13,
  7300. // navigation props
  7301. navPrev: null,
  7302. navNext: null,
  7303. noNavButtons: false,
  7304. onPrevMonthClick: function () {
  7305. function onPrevMonthClick() {}
  7306. return onPrevMonthClick;
  7307. }(),
  7308. onNextMonthClick: function () {
  7309. function onNextMonthClick() {}
  7310. return onNextMonthClick;
  7311. }(),
  7312. onMonthChange: function () {
  7313. function onMonthChange() {}
  7314. return onMonthChange;
  7315. }(),
  7316. onYearChange: function () {
  7317. function onYearChange() {}
  7318. return onYearChange;
  7319. }(),
  7320. onMultiplyScrollableMonths: function () {
  7321. function onMultiplyScrollableMonths() {}
  7322. return onMultiplyScrollableMonths;
  7323. }(),
  7324. // month props
  7325. renderMonthText: null,
  7326. renderMonthElement: null,
  7327. // day props
  7328. modifiers: {},
  7329. renderCalendarDay: undefined,
  7330. renderDayContents: null,
  7331. onDayClick: function () {
  7332. function onDayClick() {}
  7333. return onDayClick;
  7334. }(),
  7335. onDayMouseEnter: function () {
  7336. function onDayMouseEnter() {}
  7337. return onDayMouseEnter;
  7338. }(),
  7339. onDayMouseLeave: function () {
  7340. function onDayMouseLeave() {}
  7341. return onDayMouseLeave;
  7342. }(),
  7343. // accessibility props
  7344. isFocused: false,
  7345. getFirstFocusableDay: null,
  7346. onBlur: function () {
  7347. function onBlur() {}
  7348. return onBlur;
  7349. }(),
  7350. showKeyboardShortcuts: false,
  7351. // internationalization
  7352. monthFormat: 'MMMM YYYY',
  7353. weekDayFormat: 'dd',
  7354. phrases: _defaultPhrases.DayPickerPhrases,
  7355. dayAriaLabelFormat: undefined
  7356. };
  7357. var DayPicker = function (_React$Component) {
  7358. _inherits(DayPicker, _React$Component);
  7359. function DayPicker(props) {
  7360. _classCallCheck(this, DayPicker);
  7361. var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
  7362. var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
  7363. var focusedDate = currentMonth.clone().startOf('month');
  7364. if (props.getFirstFocusableDay) {
  7365. focusedDate = props.getFirstFocusableDay(currentMonth);
  7366. }
  7367. var horizontalMonthPadding = props.horizontalMonthPadding;
  7368. var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
  7369. _this.hasSetInitialVisibleMonth = !props.hidden;
  7370. _this.state = {
  7371. currentMonth: currentMonth,
  7372. monthTransition: null,
  7373. translationValue: translationValue,
  7374. scrollableMonthMultiple: 1,
  7375. calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
  7376. focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
  7377. nextFocusedDate: null,
  7378. showKeyboardShortcuts: props.showKeyboardShortcuts,
  7379. onKeyboardShortcutsPanelClose: function () {
  7380. function onKeyboardShortcutsPanelClose() {}
  7381. return onKeyboardShortcutsPanelClose;
  7382. }(),
  7383. isTouchDevice: (0, _isTouchDevice2['default'])(),
  7384. withMouseInteractions: true,
  7385. calendarInfoWidth: 0,
  7386. monthTitleHeight: null,
  7387. hasSetHeight: false
  7388. };
  7389. _this.setCalendarMonthWeeks(currentMonth);
  7390. _this.calendarMonthGridHeight = 0;
  7391. _this.setCalendarInfoWidthTimeout = null;
  7392. _this.onKeyDown = _this.onKeyDown.bind(_this);
  7393. _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
  7394. _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
  7395. _this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
  7396. _this.onMonthChange = _this.onMonthChange.bind(_this);
  7397. _this.onYearChange = _this.onYearChange.bind(_this);
  7398. _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
  7399. _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
  7400. _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
  7401. _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
  7402. _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
  7403. _this.setContainerRef = _this.setContainerRef.bind(_this);
  7404. _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
  7405. _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
  7406. return _this;
  7407. }
  7408. _createClass(DayPicker, [{
  7409. key: 'componentDidMount',
  7410. value: function () {
  7411. function componentDidMount() {
  7412. var currentMonth = this.state.currentMonth;
  7413. if (this.calendarInfo) {
  7414. this.setState({
  7415. isTouchDevice: (0, _isTouchDevice2['default'])(),
  7416. calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
  7417. });
  7418. } else {
  7419. this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
  7420. }
  7421. this.setCalendarMonthWeeks(currentMonth);
  7422. }
  7423. return componentDidMount;
  7424. }()
  7425. }, {
  7426. key: 'componentWillReceiveProps',
  7427. value: function () {
  7428. function componentWillReceiveProps(nextProps) {
  7429. var hidden = nextProps.hidden,
  7430. isFocused = nextProps.isFocused,
  7431. showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
  7432. onBlur = nextProps.onBlur,
  7433. renderMonthText = nextProps.renderMonthText,
  7434. horizontalMonthPadding = nextProps.horizontalMonthPadding;
  7435. var currentMonth = this.state.currentMonth;
  7436. if (!hidden) {
  7437. if (!this.hasSetInitialVisibleMonth) {
  7438. this.hasSetInitialVisibleMonth = true;
  7439. this.setState({
  7440. currentMonth: nextProps.initialVisibleMonth()
  7441. });
  7442. }
  7443. }
  7444. var _props = this.props,
  7445. daySize = _props.daySize,
  7446. prevIsFocused = _props.isFocused,
  7447. prevRenderMonthText = _props.renderMonthText;
  7448. if (nextProps.daySize !== daySize) {
  7449. this.setState({
  7450. calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
  7451. });
  7452. }
  7453. if (isFocused !== prevIsFocused) {
  7454. if (isFocused) {
  7455. var focusedDate = this.getFocusedDay(currentMonth);
  7456. var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
  7457. if (nextProps.showKeyboardShortcuts) {
  7458. // the ? shortcut came from the input and we should return input there once it is close
  7459. onKeyboardShortcutsPanelClose = onBlur;
  7460. }
  7461. this.setState({
  7462. showKeyboardShortcuts: showKeyboardShortcuts,
  7463. onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
  7464. focusedDate: focusedDate,
  7465. withMouseInteractions: false
  7466. });
  7467. } else {
  7468. this.setState({ focusedDate: null });
  7469. }
  7470. }
  7471. if (renderMonthText !== prevRenderMonthText) {
  7472. this.setState({
  7473. monthTitleHeight: null
  7474. });
  7475. }
  7476. }
  7477. return componentWillReceiveProps;
  7478. }()
  7479. }, {
  7480. key: 'shouldComponentUpdate',
  7481. value: function () {
  7482. function shouldComponentUpdate(nextProps, nextState) {
  7483. return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
  7484. }
  7485. return shouldComponentUpdate;
  7486. }()
  7487. }, {
  7488. key: 'componentWillUpdate',
  7489. value: function () {
  7490. function componentWillUpdate() {
  7491. var _this2 = this;
  7492. var transitionDuration = this.props.transitionDuration;
  7493. // Calculating the dimensions trigger a DOM repaint which
  7494. // breaks the CSS transition.
  7495. // The setTimeout will wait until the transition ends.
  7496. if (this.calendarInfo) {
  7497. this.setCalendarInfoWidthTimeout = setTimeout(function () {
  7498. var calendarInfoWidth = _this2.state.calendarInfoWidth;
  7499. var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
  7500. if (calendarInfoWidth !== calendarInfoPanelWidth) {
  7501. _this2.setState({
  7502. calendarInfoWidth: calendarInfoPanelWidth
  7503. });
  7504. }
  7505. }, transitionDuration);
  7506. }
  7507. }
  7508. return componentWillUpdate;
  7509. }()
  7510. }, {
  7511. key: 'componentDidUpdate',
  7512. value: function () {
  7513. function componentDidUpdate(prevProps) {
  7514. var _props2 = this.props,
  7515. orientation = _props2.orientation,
  7516. daySize = _props2.daySize,
  7517. isFocused = _props2.isFocused,
  7518. numberOfMonths = _props2.numberOfMonths;
  7519. var _state = this.state,
  7520. focusedDate = _state.focusedDate,
  7521. monthTitleHeight = _state.monthTitleHeight;
  7522. if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
  7523. var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
  7524. var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
  7525. var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
  7526. this.adjustDayPickerHeight(newMonthHeight);
  7527. }
  7528. if (!prevProps.isFocused && isFocused && !focusedDate) {
  7529. this.container.focus();
  7530. }
  7531. }
  7532. return componentDidUpdate;
  7533. }()
  7534. }, {
  7535. key: 'componentWillUnmount',
  7536. value: function () {
  7537. function componentWillUnmount() {
  7538. clearTimeout(this.setCalendarInfoWidthTimeout);
  7539. }
  7540. return componentWillUnmount;
  7541. }()
  7542. }, {
  7543. key: 'onKeyDown',
  7544. value: function () {
  7545. function onKeyDown(e) {
  7546. e.stopPropagation();
  7547. if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
  7548. this.throttledKeyDown(e);
  7549. }
  7550. }
  7551. return onKeyDown;
  7552. }()
  7553. }, {
  7554. key: 'onFinalKeyDown',
  7555. value: function () {
  7556. function onFinalKeyDown(e) {
  7557. this.setState({ withMouseInteractions: false });
  7558. var _props3 = this.props,
  7559. onBlur = _props3.onBlur,
  7560. isRTL = _props3.isRTL;
  7561. var _state2 = this.state,
  7562. focusedDate = _state2.focusedDate,
  7563. showKeyboardShortcuts = _state2.showKeyboardShortcuts;
  7564. if (!focusedDate) return;
  7565. var newFocusedDate = focusedDate.clone();
  7566. var didTransitionMonth = false;
  7567. // focus might be anywhere when the keyboard shortcuts panel is opened so we want to
  7568. // return it to wherever it was before when the panel was opened
  7569. var activeElement = (0, _getActiveElement2['default'])();
  7570. var onKeyboardShortcutsPanelClose = function () {
  7571. function onKeyboardShortcutsPanelClose() {
  7572. if (activeElement) activeElement.focus();
  7573. }
  7574. return onKeyboardShortcutsPanelClose;
  7575. }();
  7576. switch (e.key) {
  7577. case 'ArrowUp':
  7578. e.preventDefault();
  7579. newFocusedDate.subtract(1, 'week');
  7580. didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
  7581. break;
  7582. case 'ArrowLeft':
  7583. e.preventDefault();
  7584. if (isRTL) {
  7585. newFocusedDate.add(1, 'day');
  7586. } else {
  7587. newFocusedDate.subtract(1, 'day');
  7588. }
  7589. didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
  7590. break;
  7591. case 'Home':
  7592. e.preventDefault();
  7593. newFocusedDate.startOf('week');
  7594. didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
  7595. break;
  7596. case 'PageUp':
  7597. e.preventDefault();
  7598. newFocusedDate.subtract(1, 'month');
  7599. didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
  7600. break;
  7601. case 'ArrowDown':
  7602. e.preventDefault();
  7603. newFocusedDate.add(1, 'week');
  7604. didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
  7605. break;
  7606. case 'ArrowRight':
  7607. e.preventDefault();
  7608. if (isRTL) {
  7609. newFocusedDate.subtract(1, 'day');
  7610. } else {
  7611. newFocusedDate.add(1, 'day');
  7612. }
  7613. didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
  7614. break;
  7615. case 'End':
  7616. e.preventDefault();
  7617. newFocusedDate.endOf('week');
  7618. didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
  7619. break;
  7620. case 'PageDown':
  7621. e.preventDefault();
  7622. newFocusedDate.add(1, 'month');
  7623. didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
  7624. break;
  7625. case '?':
  7626. this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
  7627. break;
  7628. case 'Escape':
  7629. if (showKeyboardShortcuts) {
  7630. this.closeKeyboardShortcutsPanel();
  7631. } else {
  7632. onBlur();
  7633. }
  7634. break;
  7635. default:
  7636. break;
  7637. }
  7638. // If there was a month transition, do not update the focused date until the transition has
  7639. // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
  7640. // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
  7641. if (!didTransitionMonth) {
  7642. this.setState({
  7643. focusedDate: newFocusedDate
  7644. });
  7645. }
  7646. }
  7647. return onFinalKeyDown;
  7648. }()
  7649. }, {
  7650. key: 'onPrevMonthClick',
  7651. value: function () {
  7652. function onPrevMonthClick(nextFocusedDate, e) {
  7653. var _props4 = this.props,
  7654. daySize = _props4.daySize,
  7655. isRTL = _props4.isRTL,
  7656. numberOfMonths = _props4.numberOfMonths;
  7657. var _state3 = this.state,
  7658. calendarMonthWidth = _state3.calendarMonthWidth,
  7659. monthTitleHeight = _state3.monthTitleHeight;
  7660. if (e) e.preventDefault();
  7661. var translationValue = void 0;
  7662. if (this.isVertical()) {
  7663. var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
  7664. translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
  7665. } else if (this.isHorizontal()) {
  7666. translationValue = calendarMonthWidth;
  7667. if (isRTL) {
  7668. translationValue = -2 * calendarMonthWidth;
  7669. }
  7670. var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
  7671. var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
  7672. var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
  7673. this.adjustDayPickerHeight(newMonthHeight);
  7674. }
  7675. this.setState({
  7676. monthTransition: PREV_TRANSITION,
  7677. translationValue: translationValue,
  7678. focusedDate: null,
  7679. nextFocusedDate: nextFocusedDate
  7680. });
  7681. }
  7682. return onPrevMonthClick;
  7683. }()
  7684. }, {
  7685. key: 'onMonthChange',
  7686. value: function () {
  7687. function onMonthChange(currentMonth) {
  7688. this.setCalendarMonthWeeks(currentMonth);
  7689. this.calculateAndSetDayPickerHeight();
  7690. // Translation value is a hack to force an invisible transition that
  7691. // properly rerenders the CalendarMonthGrid
  7692. this.setState({
  7693. monthTransition: MONTH_SELECTION_TRANSITION,
  7694. translationValue: 0.00001,
  7695. focusedDate: null,
  7696. nextFocusedDate: currentMonth,
  7697. currentMonth: currentMonth
  7698. });
  7699. }
  7700. return onMonthChange;
  7701. }()
  7702. }, {
  7703. key: 'onYearChange',
  7704. value: function () {
  7705. function onYearChange(currentMonth) {
  7706. this.setCalendarMonthWeeks(currentMonth);
  7707. this.calculateAndSetDayPickerHeight();
  7708. // Translation value is a hack to force an invisible transition that
  7709. // properly rerenders the CalendarMonthGrid
  7710. this.setState({
  7711. monthTransition: YEAR_SELECTION_TRANSITION,
  7712. translationValue: 0.0001,
  7713. focusedDate: null,
  7714. nextFocusedDate: currentMonth,
  7715. currentMonth: currentMonth
  7716. });
  7717. }
  7718. return onYearChange;
  7719. }()
  7720. }, {
  7721. key: 'onNextMonthClick',
  7722. value: function () {
  7723. function onNextMonthClick(nextFocusedDate, e) {
  7724. var _props5 = this.props,
  7725. isRTL = _props5.isRTL,
  7726. numberOfMonths = _props5.numberOfMonths,
  7727. daySize = _props5.daySize;
  7728. var _state4 = this.state,
  7729. calendarMonthWidth = _state4.calendarMonthWidth,
  7730. monthTitleHeight = _state4.monthTitleHeight;
  7731. if (e) e.preventDefault();
  7732. var translationValue = void 0;
  7733. if (this.isVertical()) {
  7734. var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
  7735. var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
  7736. translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
  7737. }
  7738. if (this.isHorizontal()) {
  7739. translationValue = -calendarMonthWidth;
  7740. if (isRTL) {
  7741. translationValue = 0;
  7742. }
  7743. var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
  7744. var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
  7745. var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
  7746. this.adjustDayPickerHeight(newMonthHeight);
  7747. }
  7748. this.setState({
  7749. monthTransition: NEXT_TRANSITION,
  7750. translationValue: translationValue,
  7751. focusedDate: null,
  7752. nextFocusedDate: nextFocusedDate
  7753. });
  7754. }
  7755. return onNextMonthClick;
  7756. }()
  7757. }, {
  7758. key: 'getFirstDayOfWeek',
  7759. value: function () {
  7760. function getFirstDayOfWeek() {
  7761. var firstDayOfWeek = this.props.firstDayOfWeek;
  7762. if (firstDayOfWeek == null) {
  7763. return _moment2['default'].localeData().firstDayOfWeek();
  7764. }
  7765. return firstDayOfWeek;
  7766. }
  7767. return getFirstDayOfWeek;
  7768. }()
  7769. }, {
  7770. key: 'getFirstVisibleIndex',
  7771. value: function () {
  7772. function getFirstVisibleIndex() {
  7773. var orientation = this.props.orientation;
  7774. var monthTransition = this.state.monthTransition;
  7775. if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
  7776. var firstVisibleMonthIndex = 1;
  7777. if (monthTransition === PREV_TRANSITION) {
  7778. firstVisibleMonthIndex -= 1;
  7779. } else if (monthTransition === NEXT_TRANSITION) {
  7780. firstVisibleMonthIndex += 1;
  7781. }
  7782. return firstVisibleMonthIndex;
  7783. }
  7784. return getFirstVisibleIndex;
  7785. }()
  7786. }, {
  7787. key: 'getFocusedDay',
  7788. value: function () {
  7789. function getFocusedDay(newMonth) {
  7790. var _props6 = this.props,
  7791. getFirstFocusableDay = _props6.getFirstFocusableDay,
  7792. numberOfMonths = _props6.numberOfMonths;
  7793. var focusedDate = void 0;
  7794. if (getFirstFocusableDay) {
  7795. focusedDate = getFirstFocusableDay(newMonth);
  7796. }
  7797. if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
  7798. focusedDate = newMonth.clone().startOf('month');
  7799. }
  7800. return focusedDate;
  7801. }
  7802. return getFocusedDay;
  7803. }()
  7804. }, {
  7805. key: 'setMonthTitleHeight',
  7806. value: function () {
  7807. function setMonthTitleHeight(monthTitleHeight) {
  7808. var _this3 = this;
  7809. this.setState({
  7810. monthTitleHeight: monthTitleHeight
  7811. }, function () {
  7812. _this3.calculateAndSetDayPickerHeight();
  7813. });
  7814. }
  7815. return setMonthTitleHeight;
  7816. }()
  7817. }, {
  7818. key: 'setCalendarMonthWeeks',
  7819. value: function () {
  7820. function setCalendarMonthWeeks(currentMonth) {
  7821. var numberOfMonths = this.props.numberOfMonths;
  7822. this.calendarMonthWeeks = [];
  7823. var month = currentMonth.clone().subtract(1, 'months');
  7824. var firstDayOfWeek = this.getFirstDayOfWeek();
  7825. for (var i = 0; i < numberOfMonths + 2; i += 1) {
  7826. var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
  7827. this.calendarMonthWeeks.push(numberOfWeeks);
  7828. month = month.add(1, 'months');
  7829. }
  7830. }
  7831. return setCalendarMonthWeeks;
  7832. }()
  7833. }, {
  7834. key: 'setContainerRef',
  7835. value: function () {
  7836. function setContainerRef(ref) {
  7837. this.container = ref;
  7838. }
  7839. return setContainerRef;
  7840. }()
  7841. }, {
  7842. key: 'setCalendarInfoRef',
  7843. value: function () {
  7844. function setCalendarInfoRef(ref) {
  7845. this.calendarInfo = ref;
  7846. }
  7847. return setCalendarInfoRef;
  7848. }()
  7849. }, {
  7850. key: 'setTransitionContainerRef',
  7851. value: function () {
  7852. function setTransitionContainerRef(ref) {
  7853. this.transitionContainer = ref;
  7854. }
  7855. return setTransitionContainerRef;
  7856. }()
  7857. }, {
  7858. key: 'maybeTransitionNextMonth',
  7859. value: function () {
  7860. function maybeTransitionNextMonth(newFocusedDate) {
  7861. var numberOfMonths = this.props.numberOfMonths;
  7862. var _state5 = this.state,
  7863. currentMonth = _state5.currentMonth,
  7864. focusedDate = _state5.focusedDate;
  7865. var newFocusedDateMonth = newFocusedDate.month();
  7866. var focusedDateMonth = focusedDate.month();
  7867. var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
  7868. if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
  7869. this.onNextMonthClick(newFocusedDate);
  7870. return true;
  7871. }
  7872. return false;
  7873. }
  7874. return maybeTransitionNextMonth;
  7875. }()
  7876. }, {
  7877. key: 'maybeTransitionPrevMonth',
  7878. value: function () {
  7879. function maybeTransitionPrevMonth(newFocusedDate) {
  7880. var numberOfMonths = this.props.numberOfMonths;
  7881. var _state6 = this.state,
  7882. currentMonth = _state6.currentMonth,
  7883. focusedDate = _state6.focusedDate;
  7884. var newFocusedDateMonth = newFocusedDate.month();
  7885. var focusedDateMonth = focusedDate.month();
  7886. var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
  7887. if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
  7888. this.onPrevMonthClick(newFocusedDate);
  7889. return true;
  7890. }
  7891. return false;
  7892. }
  7893. return maybeTransitionPrevMonth;
  7894. }()
  7895. }, {
  7896. key: 'multiplyScrollableMonths',
  7897. value: function () {
  7898. function multiplyScrollableMonths(e) {
  7899. var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
  7900. if (e) e.preventDefault();
  7901. if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
  7902. this.setState(function (_ref) {
  7903. var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
  7904. return {
  7905. scrollableMonthMultiple: scrollableMonthMultiple + 1
  7906. };
  7907. });
  7908. }
  7909. return multiplyScrollableMonths;
  7910. }()
  7911. }, {
  7912. key: 'isHorizontal',
  7913. value: function () {
  7914. function isHorizontal() {
  7915. var orientation = this.props.orientation;
  7916. return orientation === _constants.HORIZONTAL_ORIENTATION;
  7917. }
  7918. return isHorizontal;
  7919. }()
  7920. }, {
  7921. key: 'isVertical',
  7922. value: function () {
  7923. function isVertical() {
  7924. var orientation = this.props.orientation;
  7925. return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
  7926. }
  7927. return isVertical;
  7928. }()
  7929. }, {
  7930. key: 'updateStateAfterMonthTransition',
  7931. value: function () {
  7932. function updateStateAfterMonthTransition() {
  7933. var _this4 = this;
  7934. var _props7 = this.props,
  7935. onPrevMonthClick = _props7.onPrevMonthClick,
  7936. onNextMonthClick = _props7.onNextMonthClick,
  7937. numberOfMonths = _props7.numberOfMonths,
  7938. onMonthChange = _props7.onMonthChange,
  7939. onYearChange = _props7.onYearChange,
  7940. isRTL = _props7.isRTL;
  7941. var _state7 = this.state,
  7942. currentMonth = _state7.currentMonth,
  7943. monthTransition = _state7.monthTransition,
  7944. focusedDate = _state7.focusedDate,
  7945. nextFocusedDate = _state7.nextFocusedDate,
  7946. withMouseInteractions = _state7.withMouseInteractions,
  7947. calendarMonthWidth = _state7.calendarMonthWidth;
  7948. if (!monthTransition) return;
  7949. var newMonth = currentMonth.clone();
  7950. var firstDayOfWeek = this.getFirstDayOfWeek();
  7951. if (monthTransition === PREV_TRANSITION) {
  7952. newMonth.subtract(1, 'month');
  7953. if (onPrevMonthClick) onPrevMonthClick(newMonth);
  7954. var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
  7955. var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
  7956. this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
  7957. } else if (monthTransition === NEXT_TRANSITION) {
  7958. newMonth.add(1, 'month');
  7959. if (onNextMonthClick) onNextMonthClick(newMonth);
  7960. var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
  7961. var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
  7962. this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
  7963. } else if (monthTransition === MONTH_SELECTION_TRANSITION) {
  7964. if (onMonthChange) onMonthChange(newMonth);
  7965. } else if (monthTransition === YEAR_SELECTION_TRANSITION) {
  7966. if (onYearChange) onYearChange(newMonth);
  7967. }
  7968. var newFocusedDate = null;
  7969. if (nextFocusedDate) {
  7970. newFocusedDate = nextFocusedDate;
  7971. } else if (!focusedDate && !withMouseInteractions) {
  7972. newFocusedDate = this.getFocusedDay(newMonth);
  7973. }
  7974. this.setState({
  7975. currentMonth: newMonth,
  7976. monthTransition: null,
  7977. translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
  7978. nextFocusedDate: null,
  7979. focusedDate: newFocusedDate
  7980. }, function () {
  7981. // we don't want to focus on the relevant calendar day after a month transition
  7982. // if the user is navigating around using a mouse
  7983. if (withMouseInteractions) {
  7984. var activeElement = (0, _getActiveElement2['default'])();
  7985. if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
  7986. activeElement.blur();
  7987. }
  7988. }
  7989. });
  7990. }
  7991. return updateStateAfterMonthTransition;
  7992. }()
  7993. }, {
  7994. key: 'adjustDayPickerHeight',
  7995. value: function () {
  7996. function adjustDayPickerHeight(newMonthHeight) {
  7997. var _this5 = this;
  7998. var monthHeight = newMonthHeight + MONTH_PADDING;
  7999. if (monthHeight !== this.calendarMonthGridHeight) {
  8000. this.transitionContainer.style.height = String(monthHeight) + 'px';
  8001. if (!this.calendarMonthGridHeight) {
  8002. setTimeout(function () {
  8003. _this5.setState({ hasSetHeight: true });
  8004. }, 0);
  8005. }
  8006. this.calendarMonthGridHeight = monthHeight;
  8007. }
  8008. }
  8009. return adjustDayPickerHeight;
  8010. }()
  8011. }, {
  8012. key: 'calculateAndSetDayPickerHeight',
  8013. value: function () {
  8014. function calculateAndSetDayPickerHeight() {
  8015. var _props8 = this.props,
  8016. daySize = _props8.daySize,
  8017. numberOfMonths = _props8.numberOfMonths;
  8018. var monthTitleHeight = this.state.monthTitleHeight;
  8019. var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
  8020. var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
  8021. var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
  8022. if (this.isHorizontal()) {
  8023. this.adjustDayPickerHeight(newMonthHeight);
  8024. }
  8025. }
  8026. return calculateAndSetDayPickerHeight;
  8027. }()
  8028. }, {
  8029. key: 'openKeyboardShortcutsPanel',
  8030. value: function () {
  8031. function openKeyboardShortcutsPanel(onCloseCallBack) {
  8032. this.setState({
  8033. showKeyboardShortcuts: true,
  8034. onKeyboardShortcutsPanelClose: onCloseCallBack
  8035. });
  8036. }
  8037. return openKeyboardShortcutsPanel;
  8038. }()
  8039. }, {
  8040. key: 'closeKeyboardShortcutsPanel',
  8041. value: function () {
  8042. function closeKeyboardShortcutsPanel() {
  8043. var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
  8044. if (onKeyboardShortcutsPanelClose) {
  8045. onKeyboardShortcutsPanelClose();
  8046. }
  8047. this.setState({
  8048. onKeyboardShortcutsPanelClose: null,
  8049. showKeyboardShortcuts: false
  8050. });
  8051. }
  8052. return closeKeyboardShortcutsPanel;
  8053. }()
  8054. }, {
  8055. key: 'renderNavigation',
  8056. value: function () {
  8057. function renderNavigation() {
  8058. var _this6 = this;
  8059. var _props9 = this.props,
  8060. navPrev = _props9.navPrev,
  8061. navNext = _props9.navNext,
  8062. noNavButtons = _props9.noNavButtons,
  8063. orientation = _props9.orientation,
  8064. phrases = _props9.phrases,
  8065. isRTL = _props9.isRTL;
  8066. if (noNavButtons) {
  8067. return null;
  8068. }
  8069. var onNextMonthClick = void 0;
  8070. if (orientation === _constants.VERTICAL_SCROLLABLE) {
  8071. onNextMonthClick = this.multiplyScrollableMonths;
  8072. } else {
  8073. onNextMonthClick = function () {
  8074. function onNextMonthClick(e) {
  8075. _this6.onNextMonthClick(null, e);
  8076. }
  8077. return onNextMonthClick;
  8078. }();
  8079. }
  8080. return _react2['default'].createElement(_DayPickerNavigation2['default'], {
  8081. onPrevMonthClick: function () {
  8082. function onPrevMonthClick(e) {
  8083. _this6.onPrevMonthClick(null, e);
  8084. }
  8085. return onPrevMonthClick;
  8086. }(),
  8087. onNextMonthClick: onNextMonthClick,
  8088. navPrev: navPrev,
  8089. navNext: navNext,
  8090. orientation: orientation,
  8091. phrases: phrases,
  8092. isRTL: isRTL
  8093. });
  8094. }
  8095. return renderNavigation;
  8096. }()
  8097. }, {
  8098. key: 'renderWeekHeader',
  8099. value: function () {
  8100. function renderWeekHeader(index) {
  8101. var _props10 = this.props,
  8102. daySize = _props10.daySize,
  8103. horizontalMonthPadding = _props10.horizontalMonthPadding,
  8104. orientation = _props10.orientation,
  8105. weekDayFormat = _props10.weekDayFormat,
  8106. styles = _props10.styles;
  8107. var calendarMonthWidth = this.state.calendarMonthWidth;
  8108. var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
  8109. var horizontalStyle = {
  8110. left: index * calendarMonthWidth
  8111. };
  8112. var verticalStyle = {
  8113. marginLeft: -calendarMonthWidth / 2
  8114. };
  8115. var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
  8116. if (this.isHorizontal()) {
  8117. weekHeaderStyle = horizontalStyle;
  8118. } else if (this.isVertical() && !verticalScrollable) {
  8119. weekHeaderStyle = verticalStyle;
  8120. }
  8121. var firstDayOfWeek = this.getFirstDayOfWeek();
  8122. var header = [];
  8123. for (var i = 0; i < 7; i += 1) {
  8124. header.push(_react2['default'].createElement(
  8125. 'li',
  8126. _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
  8127. _react2['default'].createElement(
  8128. 'small',
  8129. null,
  8130. (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
  8131. )
  8132. ));
  8133. }
  8134. return _react2['default'].createElement(
  8135. 'div',
  8136. _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
  8137. key: 'week-' + String(index)
  8138. }),
  8139. _react2['default'].createElement(
  8140. 'ul',
  8141. (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
  8142. header
  8143. )
  8144. );
  8145. }
  8146. return renderWeekHeader;
  8147. }()
  8148. }, {
  8149. key: 'render',
  8150. value: function () {
  8151. function render() {
  8152. var _this7 = this;
  8153. var _state8 = this.state,
  8154. calendarMonthWidth = _state8.calendarMonthWidth,
  8155. currentMonth = _state8.currentMonth,
  8156. monthTransition = _state8.monthTransition,
  8157. translationValue = _state8.translationValue,
  8158. scrollableMonthMultiple = _state8.scrollableMonthMultiple,
  8159. focusedDate = _state8.focusedDate,
  8160. showKeyboardShortcuts = _state8.showKeyboardShortcuts,
  8161. isTouch = _state8.isTouchDevice,
  8162. hasSetHeight = _state8.hasSetHeight,
  8163. calendarInfoWidth = _state8.calendarInfoWidth,
  8164. monthTitleHeight = _state8.monthTitleHeight;
  8165. var _props11 = this.props,
  8166. enableOutsideDays = _props11.enableOutsideDays,
  8167. numberOfMonths = _props11.numberOfMonths,
  8168. orientation = _props11.orientation,
  8169. modifiers = _props11.modifiers,
  8170. withPortal = _props11.withPortal,
  8171. onDayClick = _props11.onDayClick,
  8172. onDayMouseEnter = _props11.onDayMouseEnter,
  8173. onDayMouseLeave = _props11.onDayMouseLeave,
  8174. firstDayOfWeek = _props11.firstDayOfWeek,
  8175. renderMonthText = _props11.renderMonthText,
  8176. renderCalendarDay = _props11.renderCalendarDay,
  8177. renderDayContents = _props11.renderDayContents,
  8178. renderCalendarInfo = _props11.renderCalendarInfo,
  8179. renderMonthElement = _props11.renderMonthElement,
  8180. calendarInfoPosition = _props11.calendarInfoPosition,
  8181. hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
  8182. onOutsideClick = _props11.onOutsideClick,
  8183. monthFormat = _props11.monthFormat,
  8184. daySize = _props11.daySize,
  8185. isFocused = _props11.isFocused,
  8186. isRTL = _props11.isRTL,
  8187. styles = _props11.styles,
  8188. theme = _props11.theme,
  8189. phrases = _props11.phrases,
  8190. verticalHeight = _props11.verticalHeight,
  8191. dayAriaLabelFormat = _props11.dayAriaLabelFormat,
  8192. noBorder = _props11.noBorder,
  8193. transitionDuration = _props11.transitionDuration,
  8194. verticalBorderSpacing = _props11.verticalBorderSpacing,
  8195. horizontalMonthPadding = _props11.horizontalMonthPadding;
  8196. var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
  8197. var isHorizontal = this.isHorizontal();
  8198. var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
  8199. var weekHeaders = [];
  8200. for (var i = 0; i < numOfWeekHeaders; i += 1) {
  8201. weekHeaders.push(this.renderWeekHeader(i));
  8202. }
  8203. var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
  8204. var height = void 0;
  8205. if (isHorizontal) {
  8206. height = this.calendarMonthGridHeight;
  8207. } else if (this.isVertical() && !verticalScrollable && !withPortal) {
  8208. // If the user doesn't set a desired height,
  8209. // we default back to this kind of made-up value that generally looks good
  8210. height = verticalHeight || 1.75 * calendarMonthWidth;
  8211. }
  8212. var isCalendarMonthGridAnimating = monthTransition !== null;
  8213. var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
  8214. var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
  8215. if (this.isVertical()) {
  8216. keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
  8217. }
  8218. var shouldAnimateHeight = isHorizontal && hasSetHeight;
  8219. var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
  8220. var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
  8221. var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
  8222. var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
  8223. var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
  8224. var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
  8225. 'div',
  8226. _extends({
  8227. ref: this.setCalendarInfoRef
  8228. }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
  8229. renderCalendarInfo()
  8230. );
  8231. var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
  8232. var firstVisibleMonthIndex = this.getFirstVisibleIndex();
  8233. var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
  8234. // Adding `1px` because of whitespace between 2 inline-block
  8235. var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
  8236. var transitionContainerStyle = {
  8237. width: isHorizontal && wrapperHorizontalWidth,
  8238. height: height
  8239. };
  8240. var dayPickerWrapperStyle = {
  8241. width: isHorizontal && wrapperHorizontalWidth
  8242. };
  8243. var dayPickerStyle = {
  8244. width: isHorizontal && fullHorizontalWidth,
  8245. // These values are to center the datepicker (approximately) on the page
  8246. marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
  8247. marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
  8248. };
  8249. return _react2['default'].createElement(
  8250. 'div',
  8251. _extends({
  8252. role: 'application',
  8253. 'aria-label': phrases.calendarLabel
  8254. }, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
  8255. _react2['default'].createElement(
  8256. _reactOutsideClickHandler2['default'],
  8257. { onOutsideClick: onOutsideClick },
  8258. (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
  8259. _react2['default'].createElement(
  8260. 'div',
  8261. (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
  8262. _react2['default'].createElement(
  8263. 'div',
  8264. _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
  8265. 'aria-hidden': 'true',
  8266. role: 'presentation'
  8267. }),
  8268. weekHeaders
  8269. ),
  8270. _react2['default'].createElement(
  8271. 'div',
  8272. _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
  8273. ref: this.setContainerRef,
  8274. onClick: function () {
  8275. function onClick(e) {
  8276. e.stopPropagation();
  8277. }
  8278. return onClick;
  8279. }(),
  8280. onKeyDown: this.onKeyDown,
  8281. onMouseUp: function () {
  8282. function onMouseUp() {
  8283. _this7.setState({ withMouseInteractions: true });
  8284. }
  8285. return onMouseUp;
  8286. }(),
  8287. role: 'region',
  8288. tabIndex: -1
  8289. }),
  8290. !verticalScrollable && this.renderNavigation(),
  8291. _react2['default'].createElement(
  8292. 'div',
  8293. _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
  8294. ref: this.setTransitionContainerRef
  8295. }),
  8296. _react2['default'].createElement(_CalendarMonthGrid2['default'], {
  8297. setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
  8298. translationValue: translationValue,
  8299. enableOutsideDays: enableOutsideDays,
  8300. firstVisibleMonthIndex: firstVisibleMonthIndex,
  8301. initialMonth: currentMonth,
  8302. isAnimating: isCalendarMonthGridAnimating,
  8303. modifiers: modifiers,
  8304. orientation: orientation,
  8305. numberOfMonths: numberOfMonths * scrollableMonthMultiple,
  8306. onDayClick: onDayClick,
  8307. onDayMouseEnter: onDayMouseEnter,
  8308. onDayMouseLeave: onDayMouseLeave,
  8309. onMonthChange: this.onMonthChange,
  8310. onYearChange: this.onYearChange,
  8311. renderMonthText: renderMonthText,
  8312. renderCalendarDay: renderCalendarDay,
  8313. renderDayContents: renderDayContents,
  8314. renderMonthElement: renderMonthElement,
  8315. onMonthTransitionEnd: this.updateStateAfterMonthTransition,
  8316. monthFormat: monthFormat,
  8317. daySize: daySize,
  8318. firstDayOfWeek: firstDayOfWeek,
  8319. isFocused: shouldFocusDate,
  8320. focusedDate: focusedDate,
  8321. phrases: phrases,
  8322. isRTL: isRTL,
  8323. dayAriaLabelFormat: dayAriaLabelFormat,
  8324. transitionDuration: transitionDuration,
  8325. verticalBorderSpacing: verticalBorderSpacing,
  8326. horizontalMonthPadding: horizontalMonthPadding
  8327. }),
  8328. verticalScrollable && this.renderNavigation()
  8329. ),
  8330. !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
  8331. block: this.isVertical() && !withPortal,
  8332. buttonLocation: keyboardShortcutButtonLocation,
  8333. showKeyboardShortcutsPanel: showKeyboardShortcuts,
  8334. openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
  8335. closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
  8336. phrases: phrases
  8337. })
  8338. )
  8339. ),
  8340. (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
  8341. )
  8342. );
  8343. }
  8344. return render;
  8345. }()
  8346. }]);
  8347. return DayPicker;
  8348. }(_react2['default'].Component);
  8349. DayPicker.propTypes = propTypes;
  8350. DayPicker.defaultProps = defaultProps;
  8351. exports.PureDayPicker = DayPicker;
  8352. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
  8353. var _ref2$reactDates = _ref2.reactDates,
  8354. color = _ref2$reactDates.color,
  8355. font = _ref2$reactDates.font,
  8356. noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
  8357. spacing = _ref2$reactDates.spacing,
  8358. zIndex = _ref2$reactDates.zIndex;
  8359. return {
  8360. DayPicker: {
  8361. background: color.background,
  8362. position: 'relative',
  8363. textAlign: 'left'
  8364. },
  8365. DayPicker__horizontal: {
  8366. background: color.background
  8367. },
  8368. DayPicker__verticalScrollable: {
  8369. height: '100%'
  8370. },
  8371. DayPicker__hidden: {
  8372. visibility: 'hidden'
  8373. },
  8374. DayPicker__withBorder: {
  8375. boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
  8376. borderRadius: 3
  8377. },
  8378. DayPicker_portal__horizontal: {
  8379. boxShadow: 'none',
  8380. position: 'absolute',
  8381. left: '50%',
  8382. top: '50%'
  8383. },
  8384. DayPicker_portal__vertical: {
  8385. position: 'initial'
  8386. },
  8387. DayPicker_focusRegion: {
  8388. outline: 'none'
  8389. },
  8390. DayPicker_calendarInfo__horizontal: {
  8391. display: 'inline-block',
  8392. verticalAlign: 'top'
  8393. },
  8394. DayPicker_wrapper__horizontal: {
  8395. display: 'inline-block',
  8396. verticalAlign: 'top'
  8397. },
  8398. DayPicker_weekHeaders: {
  8399. position: 'relative'
  8400. },
  8401. DayPicker_weekHeaders__horizontal: {
  8402. marginLeft: spacing.dayPickerHorizontalPadding
  8403. },
  8404. DayPicker_weekHeader: {
  8405. color: color.placeholderText,
  8406. position: 'absolute',
  8407. top: 62,
  8408. zIndex: zIndex + 2,
  8409. textAlign: 'left'
  8410. },
  8411. DayPicker_weekHeader__vertical: {
  8412. left: '50%'
  8413. },
  8414. DayPicker_weekHeader__verticalScrollable: {
  8415. top: 0,
  8416. display: 'table-row',
  8417. borderBottom: '1px solid ' + String(color.core.border),
  8418. background: color.background,
  8419. marginLeft: 0,
  8420. left: 0,
  8421. width: '100%',
  8422. textAlign: 'center'
  8423. },
  8424. DayPicker_weekHeader_ul: {
  8425. listStyle: 'none',
  8426. margin: '1px 0',
  8427. paddingLeft: 0,
  8428. paddingRight: 0,
  8429. fontSize: font.size
  8430. },
  8431. DayPicker_weekHeader_li: {
  8432. display: 'inline-block',
  8433. textAlign: 'center'
  8434. },
  8435. DayPicker_transitionContainer: {
  8436. position: 'relative',
  8437. overflow: 'hidden',
  8438. borderRadius: 3
  8439. },
  8440. DayPicker_transitionContainer__horizontal: {
  8441. transition: 'height 0.2s ease-in-out'
  8442. },
  8443. DayPicker_transitionContainer__vertical: {
  8444. width: '100%'
  8445. },
  8446. DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
  8447. paddingTop: 20,
  8448. height: '100%',
  8449. position: 'absolute',
  8450. top: 0,
  8451. bottom: 0,
  8452. right: 0,
  8453. left: 0,
  8454. overflowY: 'scroll'
  8455. }, noScrollBarOnVerticalScrollable && {
  8456. '-webkitOverflowScrolling': 'touch',
  8457. '::-webkit-scrollbar': {
  8458. '-webkit-appearance': 'none',
  8459. display: 'none'
  8460. }
  8461. })
  8462. };
  8463. })(DayPicker);
  8464. /***/ }),
  8465. /***/ "NykK":
  8466. /***/ (function(module, exports, __webpack_require__) {
  8467. var Symbol = __webpack_require__("nmnc"),
  8468. getRawTag = __webpack_require__("AP2z"),
  8469. objectToString = __webpack_require__("KfNM");
  8470. /** `Object#toString` result references. */
  8471. var nullTag = '[object Null]',
  8472. undefinedTag = '[object Undefined]';
  8473. /** Built-in value references. */
  8474. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  8475. /**
  8476. * The base implementation of `getTag` without fallbacks for buggy environments.
  8477. *
  8478. * @private
  8479. * @param {*} value The value to query.
  8480. * @returns {string} Returns the `toStringTag`.
  8481. */
  8482. function baseGetTag(value) {
  8483. if (value == null) {
  8484. return value === undefined ? undefinedTag : nullTag;
  8485. }
  8486. return (symToStringTag && symToStringTag in Object(value))
  8487. ? getRawTag(value)
  8488. : objectToString(value);
  8489. }
  8490. module.exports = baseGetTag;
  8491. /***/ }),
  8492. /***/ "Nym8":
  8493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8494. "use strict";
  8495. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; });
  8496. /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs");
  8497. /**
  8498. * Returns `element.ownerDocument.activeElement`.
  8499. */
  8500. function getActiveElement(element) {
  8501. var _getDocument = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element),
  8502. activeElement = _getDocument.activeElement;
  8503. if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) {
  8504. // In IE11, activeElement might be an empty object if we're interacting
  8505. // with elements inside of an iframe.
  8506. return null;
  8507. }
  8508. return activeElement;
  8509. }
  8510. /***/ }),
  8511. /***/ "Ohaz":
  8512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8513. "use strict";
  8514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getNamespace; });
  8515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getConnectedNamespace; });
  8516. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tQ+x");
  8517. /**
  8518. * Internal dependencies
  8519. */
  8520. /**
  8521. * Creates a dedicated context namespace HTML attribute for components.
  8522. * ns is short for "namespace"
  8523. *
  8524. * @example
  8525. * ```jsx
  8526. * <div {...ns('Container')} />
  8527. * ```
  8528. *
  8529. * @param {string} componentName The name for the component.
  8530. * @return {Record<string, any>} A props object with the namespaced HTML attribute.
  8531. */
  8532. function getNamespace(componentName) {
  8533. return {
  8534. [_constants__WEBPACK_IMPORTED_MODULE_0__[/* COMPONENT_NAMESPACE */ "a"]]: componentName
  8535. };
  8536. }
  8537. /**
  8538. * Creates a dedicated connected context namespace HTML attribute for components.
  8539. * ns is short for "namespace"
  8540. *
  8541. * @example
  8542. * ```jsx
  8543. * <div {...cns()} />
  8544. * ```
  8545. *
  8546. * @return {Record<string, any>} A props object with the namespaced HTML attribute.
  8547. */
  8548. function getConnectedNamespace() {
  8549. return {
  8550. [_constants__WEBPACK_IMPORTED_MODULE_0__[/* CONNECTED_NAMESPACE */ "b"]]: true
  8551. };
  8552. }
  8553. /***/ }),
  8554. /***/ "PJYZ":
  8555. /***/ (function(module, exports) {
  8556. function _assertThisInitialized(self) {
  8557. if (self === void 0) {
  8558. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  8559. }
  8560. return self;
  8561. }
  8562. module.exports = _assertThisInitialized;
  8563. module.exports["default"] = module.exports, module.exports.__esModule = true;
  8564. /***/ }),
  8565. /***/ "PcHe":
  8566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8567. "use strict";
  8568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasFocusWithin; });
  8569. /* harmony import */ var _getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Nym8");
  8570. /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("utzN");
  8571. /**
  8572. * Checks if `element` has focus within. Elements that are referenced by
  8573. * `aria-activedescendant` are also considered.
  8574. *
  8575. * @example
  8576. * import { hasFocusWithin } from "reakit-utils";
  8577. *
  8578. * hasFocusWithin(document.getElementById("id"));
  8579. */
  8580. function hasFocusWithin(element) {
  8581. var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element);
  8582. if (!activeElement) return false;
  8583. if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* contains */ "a"])(element, activeElement)) return true;
  8584. var activeDescendant = activeElement.getAttribute("aria-activedescendant");
  8585. if (!activeDescendant) return false;
  8586. if (activeDescendant === element.id) return true;
  8587. return !!element.querySelector("#" + activeDescendant);
  8588. }
  8589. /***/ }),
  8590. /***/ "Pjai":
  8591. /***/ (function(module, exports, __webpack_require__) {
  8592. "use strict";
  8593. var ToPrimitive = __webpack_require__("vLdR");
  8594. // http://262.ecma-international.org/5.1/#sec-9.3
  8595. module.exports = function ToNumber(value) {
  8596. var prim = ToPrimitive(value, Number);
  8597. if (typeof prim !== 'string') {
  8598. return +prim; // eslint-disable-line no-implicit-coercion
  8599. }
  8600. // eslint-disable-next-line no-control-regex
  8601. var trimmed = prim.replace(/^[ \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\u0085]+|[ \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\u0085]+$/g, '');
  8602. if ((/^0[ob]|^[+-]0x/).test(trimmed)) {
  8603. return NaN;
  8604. }
  8605. return +trimmed; // eslint-disable-line no-implicit-coercion
  8606. };
  8607. /***/ }),
  8608. /***/ "Pq96":
  8609. /***/ (function(module, exports, __webpack_require__) {
  8610. "use strict";
  8611. Object.defineProperty(exports, "__esModule", {
  8612. value: true
  8613. });
  8614. exports['default'] = isPrevMonth;
  8615. var _moment = __webpack_require__("wy2R");
  8616. var _moment2 = _interopRequireDefault(_moment);
  8617. var _isSameMonth = __webpack_require__("ulUS");
  8618. var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
  8619. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  8620. function isPrevMonth(a, b) {
  8621. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  8622. return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b);
  8623. }
  8624. /***/ }),
  8625. /***/ "PrET":
  8626. /***/ (function(module, exports, __webpack_require__) {
  8627. "use strict";
  8628. var bind = __webpack_require__("D3zA");
  8629. var GetIntrinsic = __webpack_require__("AM7I");
  8630. var $apply = GetIntrinsic('%Function.prototype.apply%');
  8631. var $call = GetIntrinsic('%Function.prototype.call%');
  8632. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  8633. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  8634. if ($defineProperty) {
  8635. try {
  8636. $defineProperty({}, 'a', { value: 1 });
  8637. } catch (e) {
  8638. // IE 8 has a broken defineProperty
  8639. $defineProperty = null;
  8640. }
  8641. }
  8642. module.exports = function callBind() {
  8643. return $reflectApply(bind, $call, arguments);
  8644. };
  8645. var applyBind = function applyBind() {
  8646. return $reflectApply(bind, $apply, arguments);
  8647. };
  8648. if ($defineProperty) {
  8649. $defineProperty(module.exports, 'apply', { value: applyBind });
  8650. } else {
  8651. module.exports.apply = applyBind;
  8652. }
  8653. /***/ }),
  8654. /***/ "Ptb8":
  8655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8656. "use strict";
  8657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isObject; });
  8658. /**
  8659. * Checks whether `arg` is an object or not.
  8660. *
  8661. * @returns {boolean}
  8662. */
  8663. function isObject(arg) {
  8664. return typeof arg === "object" && arg != null;
  8665. }
  8666. /***/ }),
  8667. /***/ "Q4Sy":
  8668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8669. "use strict";
  8670. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  8671. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  8672. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  8673. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  8674. /**
  8675. * WordPress dependencies
  8676. */
  8677. const plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  8678. xmlns: "http://www.w3.org/2000/svg",
  8679. viewBox: "0 0 24 24"
  8680. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  8681. d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
  8682. }));
  8683. /* harmony default export */ __webpack_exports__["a"] = (plus);
  8684. /***/ }),
  8685. /***/ "QEu6":
  8686. /***/ (function(module, exports, __webpack_require__) {
  8687. "use strict";
  8688. Object.defineProperty(exports, "__esModule", {
  8689. value: true
  8690. });
  8691. var CHANNEL = exports.CHANNEL = '__direction__';
  8692. var DIRECTIONS = exports.DIRECTIONS = {
  8693. LTR: 'ltr',
  8694. RTL: 'rtl'
  8695. };
  8696. /***/ }),
  8697. /***/ "QIyF":
  8698. /***/ (function(module, exports, __webpack_require__) {
  8699. var root = __webpack_require__("Kz5y");
  8700. /**
  8701. * Gets the timestamp of the number of milliseconds that have elapsed since
  8702. * the Unix epoch (1 January 1970 00:00:00 UTC).
  8703. *
  8704. * @static
  8705. * @memberOf _
  8706. * @since 2.4.0
  8707. * @category Date
  8708. * @returns {number} Returns the timestamp.
  8709. * @example
  8710. *
  8711. * _.defer(function(stamp) {
  8712. * console.log(_.now() - stamp);
  8713. * }, _.now());
  8714. * // => Logs the number of milliseconds it took for the deferred invocation.
  8715. */
  8716. var now = function() {
  8717. return root.Date.now();
  8718. };
  8719. module.exports = now;
  8720. /***/ }),
  8721. /***/ "Qmvf":
  8722. /***/ (function(module, exports, __webpack_require__) {
  8723. "use strict";
  8724. var GetIntrinsic = __webpack_require__("rZ7t");
  8725. var has = __webpack_require__("oNNP");
  8726. var $TypeError = GetIntrinsic('%TypeError%');
  8727. module.exports = function IsPropertyDescriptor(ES, Desc) {
  8728. if (ES.Type(Desc) !== 'Object') {
  8729. return false;
  8730. }
  8731. var allowed = {
  8732. '[[Configurable]]': true,
  8733. '[[Enumerable]]': true,
  8734. '[[Get]]': true,
  8735. '[[Set]]': true,
  8736. '[[Value]]': true,
  8737. '[[Writable]]': true
  8738. };
  8739. for (var key in Desc) { // eslint-disable-line no-restricted-syntax
  8740. if (has(Desc, key) && !allowed[key]) {
  8741. return false;
  8742. }
  8743. }
  8744. if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {
  8745. throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
  8746. }
  8747. return true;
  8748. };
  8749. /***/ }),
  8750. /***/ "R/b7":
  8751. /***/ (function(module, exports, __webpack_require__) {
  8752. "use strict";
  8753. var abs = __webpack_require__("In1I");
  8754. var floor = __webpack_require__("4HRn");
  8755. var $isNaN = __webpack_require__("HwJD");
  8756. var $isFinite = __webpack_require__("ald4");
  8757. // https://ecma-international.org/ecma-262/6.0/#sec-isinteger
  8758. module.exports = function IsInteger(argument) {
  8759. if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
  8760. return false;
  8761. }
  8762. var absValue = abs(argument);
  8763. return floor(absValue) === absValue;
  8764. };
  8765. /***/ }),
  8766. /***/ "RDTF":
  8767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8768. "use strict";
  8769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; });
  8770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; });
  8771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; });
  8772. function _defineProperty(obj, key, value) {
  8773. if (key in obj) {
  8774. Object.defineProperty(obj, key, {
  8775. value: value,
  8776. enumerable: true,
  8777. configurable: true,
  8778. writable: true
  8779. });
  8780. } else {
  8781. obj[key] = value;
  8782. }
  8783. return obj;
  8784. }
  8785. function ownKeys(object, enumerableOnly) {
  8786. var keys = Object.keys(object);
  8787. if (Object.getOwnPropertySymbols) {
  8788. var symbols = Object.getOwnPropertySymbols(object);
  8789. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  8790. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  8791. });
  8792. keys.push.apply(keys, symbols);
  8793. }
  8794. return keys;
  8795. }
  8796. function _objectSpread2(target) {
  8797. for (var i = 1; i < arguments.length; i++) {
  8798. var source = arguments[i] != null ? arguments[i] : {};
  8799. if (i % 2) {
  8800. ownKeys(Object(source), true).forEach(function (key) {
  8801. _defineProperty(target, key, source[key]);
  8802. });
  8803. } else if (Object.getOwnPropertyDescriptors) {
  8804. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  8805. } else {
  8806. ownKeys(Object(source)).forEach(function (key) {
  8807. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  8808. });
  8809. }
  8810. }
  8811. return target;
  8812. }
  8813. function _objectWithoutPropertiesLoose(source, excluded) {
  8814. if (source == null) return {};
  8815. var target = {};
  8816. var sourceKeys = Object.keys(source);
  8817. var key, i;
  8818. for (i = 0; i < sourceKeys.length; i++) {
  8819. key = sourceKeys[i];
  8820. if (excluded.indexOf(key) >= 0) continue;
  8821. target[key] = source[key];
  8822. }
  8823. return target;
  8824. }
  8825. function _unsupportedIterableToArray(o, minLen) {
  8826. if (!o) return;
  8827. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  8828. var n = Object.prototype.toString.call(o).slice(8, -1);
  8829. if (n === "Object" && o.constructor) n = o.constructor.name;
  8830. if (n === "Map" || n === "Set") return Array.from(o);
  8831. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  8832. }
  8833. function _arrayLikeToArray(arr, len) {
  8834. if (len == null || len > arr.length) len = arr.length;
  8835. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  8836. return arr2;
  8837. }
  8838. function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  8839. var it;
  8840. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  8841. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  8842. if (it) o = it;
  8843. var i = 0;
  8844. return function () {
  8845. if (i >= o.length) return {
  8846. done: true
  8847. };
  8848. return {
  8849. done: false,
  8850. value: o[i++]
  8851. };
  8852. };
  8853. }
  8854. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  8855. }
  8856. it = o[Symbol.iterator]();
  8857. return it.next.bind(it);
  8858. }
  8859. /***/ }),
  8860. /***/ "RMJe":
  8861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8862. "use strict";
  8863. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  8864. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  8865. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  8866. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  8867. /**
  8868. * WordPress dependencies
  8869. */
  8870. const check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  8871. xmlns: "http://www.w3.org/2000/svg",
  8872. viewBox: "0 0 24 24"
  8873. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  8874. d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"
  8875. }));
  8876. /* harmony default export */ __webpack_exports__["a"] = (check);
  8877. /***/ }),
  8878. /***/ "RxS6":
  8879. /***/ (function(module, exports) {
  8880. (function() { module.exports = window["wp"]["keycodes"]; }());
  8881. /***/ }),
  8882. /***/ "S0jC":
  8883. /***/ (function(module, exports, __webpack_require__) {
  8884. "use strict";
  8885. module.exports = __webpack_require__("laOf");
  8886. /***/ }),
  8887. /***/ "SB3u":
  8888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8889. "use strict";
  8890. // ESM COMPAT FLAG
  8891. __webpack_require__.r(__webpack_exports__);
  8892. // EXPORTS
  8893. __webpack_require__.d(__webpack_exports__, "SVG", function() { return /* reexport */ external_wp_primitives_["SVG"]; });
  8894. __webpack_require__.d(__webpack_exports__, "Path", function() { return /* reexport */ external_wp_primitives_["Path"]; });
  8895. __webpack_require__.d(__webpack_exports__, "Circle", function() { return /* reexport */ external_wp_primitives_["Circle"]; });
  8896. __webpack_require__.d(__webpack_exports__, "Polygon", function() { return /* reexport */ external_wp_primitives_["Polygon"]; });
  8897. __webpack_require__.d(__webpack_exports__, "Rect", function() { return /* reexport */ external_wp_primitives_["Rect"]; });
  8898. __webpack_require__.d(__webpack_exports__, "G", function() { return /* reexport */ external_wp_primitives_["G"]; });
  8899. __webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return /* reexport */ external_wp_primitives_["HorizontalRule"]; });
  8900. __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return /* reexport */ external_wp_primitives_["BlockQuotation"]; });
  8901. __webpack_require__.d(__webpack_exports__, "__experimentalAlignmentMatrixControl", function() { return /* reexport */ AlignmentMatrixControl; });
  8902. __webpack_require__.d(__webpack_exports__, "Animate", function() { return /* reexport */ animate["a" /* default */]; });
  8903. __webpack_require__.d(__webpack_exports__, "__unstableGetAnimateClassName", function() { return /* reexport */ animate["b" /* getAnimateClassName */]; });
  8904. __webpack_require__.d(__webpack_exports__, "AnglePickerControl", function() { return /* reexport */ AnglePickerControl; });
  8905. __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ Autocomplete; });
  8906. __webpack_require__.d(__webpack_exports__, "__unstableUseAutocompleteProps", function() { return /* reexport */ useAutocompleteProps; });
  8907. __webpack_require__.d(__webpack_exports__, "BaseControl", function() { return /* reexport */ base_control; });
  8908. __webpack_require__.d(__webpack_exports__, "__experimentalBoxControl", function() { return /* reexport */ BoxControl; });
  8909. __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ build_module_button["a" /* default */]; });
  8910. __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return /* reexport */ button_group; });
  8911. __webpack_require__.d(__webpack_exports__, "Card", function() { return /* reexport */ card; });
  8912. __webpack_require__.d(__webpack_exports__, "CardBody", function() { return /* reexport */ card_body; });
  8913. __webpack_require__.d(__webpack_exports__, "CardDivider", function() { return /* reexport */ divider; });
  8914. __webpack_require__.d(__webpack_exports__, "CardFooter", function() { return /* reexport */ footer; });
  8915. __webpack_require__.d(__webpack_exports__, "CardHeader", function() { return /* reexport */ card_header; });
  8916. __webpack_require__.d(__webpack_exports__, "CardMedia", function() { return /* reexport */ media; });
  8917. __webpack_require__.d(__webpack_exports__, "CheckboxControl", function() { return /* reexport */ CheckboxControl; });
  8918. __webpack_require__.d(__webpack_exports__, "ClipboardButton", function() { return /* reexport */ ClipboardButton; });
  8919. __webpack_require__.d(__webpack_exports__, "__experimentalColorEdit", function() { return /* reexport */ ColorEdit; });
  8920. __webpack_require__.d(__webpack_exports__, "ColorIndicator", function() { return /* reexport */ color_indicator; });
  8921. __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ ColorPalette; });
  8922. __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return /* reexport */ color_picker_ColorPicker; });
  8923. __webpack_require__.d(__webpack_exports__, "ComboboxControl", function() { return /* reexport */ combobox_control; });
  8924. __webpack_require__.d(__webpack_exports__, "__unstableComposite", function() { return /* reexport */ Composite; });
  8925. __webpack_require__.d(__webpack_exports__, "__unstableCompositeGroup", function() { return /* reexport */ CompositeGroup; });
  8926. __webpack_require__.d(__webpack_exports__, "__unstableCompositeItem", function() { return /* reexport */ CompositeItem["a" /* CompositeItem */]; });
  8927. __webpack_require__.d(__webpack_exports__, "__unstableUseCompositeState", function() { return /* reexport */ useCompositeState; });
  8928. __webpack_require__.d(__webpack_exports__, "CustomSelectControl", function() { return /* reexport */ CustomSelectControl; });
  8929. __webpack_require__.d(__webpack_exports__, "Dashicon", function() { return /* reexport */ dashicon["a" /* default */]; });
  8930. __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return /* reexport */ date_time; });
  8931. __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return /* reexport */ date_time_date; });
  8932. __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return /* reexport */ time; });
  8933. __webpack_require__.d(__webpack_exports__, "__experimentalDimensionControl", function() { return /* reexport */ dimension_control; });
  8934. __webpack_require__.d(__webpack_exports__, "Disabled", function() { return /* reexport */ build_module_disabled; });
  8935. __webpack_require__.d(__webpack_exports__, "__unstableDisclosureContent", function() { return /* reexport */ DisclosureContent; });
  8936. __webpack_require__.d(__webpack_exports__, "__experimentalDivider", function() { return /* reexport */ divider_component; });
  8937. __webpack_require__.d(__webpack_exports__, "Draggable", function() { return /* reexport */ Draggable; });
  8938. __webpack_require__.d(__webpack_exports__, "DropZone", function() { return /* reexport */ DropZoneComponent; });
  8939. __webpack_require__.d(__webpack_exports__, "DropZoneProvider", function() { return /* reexport */ DropZoneProvider; });
  8940. __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return /* reexport */ Dropdown; });
  8941. __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ dropdown_menu; });
  8942. __webpack_require__.d(__webpack_exports__, "DuotoneSwatch", function() { return /* reexport */ duotone_swatch; });
  8943. __webpack_require__.d(__webpack_exports__, "DuotonePicker", function() { return /* reexport */ duotone_picker; });
  8944. __webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return /* reexport */ external_link; });
  8945. __webpack_require__.d(__webpack_exports__, "Flex", function() { return /* reexport */ flex_component; });
  8946. __webpack_require__.d(__webpack_exports__, "FlexBlock", function() { return /* reexport */ flex_block_component; });
  8947. __webpack_require__.d(__webpack_exports__, "FlexItem", function() { return /* reexport */ flex_item_component; });
  8948. __webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return /* reexport */ focal_point_picker; });
  8949. __webpack_require__.d(__webpack_exports__, "FocusableIframe", function() { return /* reexport */ FocusableIframe; });
  8950. __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ font_size_picker; });
  8951. __webpack_require__.d(__webpack_exports__, "FormFileUpload", function() { return /* reexport */ form_file_upload; });
  8952. __webpack_require__.d(__webpack_exports__, "FormToggle", function() { return /* reexport */ form_toggle; });
  8953. __webpack_require__.d(__webpack_exports__, "FormTokenField", function() { return /* reexport */ form_token_field; });
  8954. __webpack_require__.d(__webpack_exports__, "__experimentalGradientPicker", function() { return /* reexport */ GradientPicker; });
  8955. __webpack_require__.d(__webpack_exports__, "__experimentalCustomGradientPicker", function() { return /* reexport */ CustomGradientPicker; });
  8956. __webpack_require__.d(__webpack_exports__, "__experimentalGrid", function() { return /* reexport */ grid_component; });
  8957. __webpack_require__.d(__webpack_exports__, "Guide", function() { return /* reexport */ Guide; });
  8958. __webpack_require__.d(__webpack_exports__, "GuidePage", function() { return /* reexport */ GuidePage; });
  8959. __webpack_require__.d(__webpack_exports__, "__experimentalHeading", function() { return /* reexport */ heading_component; });
  8960. __webpack_require__.d(__webpack_exports__, "__experimentalHStack", function() { return /* reexport */ h_stack_component; });
  8961. __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ components_build_module_icon["a" /* default */]; });
  8962. __webpack_require__.d(__webpack_exports__, "IconButton", function() { return /* reexport */ deprecated; });
  8963. __webpack_require__.d(__webpack_exports__, "__experimentalInputControl", function() { return /* reexport */ input_control; });
  8964. __webpack_require__.d(__webpack_exports__, "KeyboardShortcuts", function() { return /* reexport */ keyboard_shortcuts; });
  8965. __webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return /* reexport */ menu_group; });
  8966. __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return /* reexport */ menu_item; });
  8967. __webpack_require__.d(__webpack_exports__, "MenuItemsChoice", function() { return /* reexport */ MenuItemsChoice; });
  8968. __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ modal; });
  8969. __webpack_require__.d(__webpack_exports__, "ScrollLock", function() { return /* reexport */ scroll_lock["a" /* default */]; });
  8970. __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return /* reexport */ navigable_container_menu; });
  8971. __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return /* reexport */ tabbable; });
  8972. __webpack_require__.d(__webpack_exports__, "__experimentalNavigation", function() { return /* reexport */ Navigation; });
  8973. __webpack_require__.d(__webpack_exports__, "__experimentalNavigationBackButton", function() { return /* reexport */ back_button; });
  8974. __webpack_require__.d(__webpack_exports__, "__experimentalNavigationGroup", function() { return /* reexport */ NavigationGroup; });
  8975. __webpack_require__.d(__webpack_exports__, "__experimentalNavigationItem", function() { return /* reexport */ NavigationItem; });
  8976. __webpack_require__.d(__webpack_exports__, "__experimentalNavigationMenu", function() { return /* reexport */ NavigationMenu; });
  8977. __webpack_require__.d(__webpack_exports__, "Notice", function() { return /* reexport */ build_module_notice; });
  8978. __webpack_require__.d(__webpack_exports__, "__experimentalNumberControl", function() { return /* reexport */ number_control; });
  8979. __webpack_require__.d(__webpack_exports__, "NoticeList", function() { return /* reexport */ list; });
  8980. __webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ panel; });
  8981. __webpack_require__.d(__webpack_exports__, "PanelBody", function() { return /* reexport */ panel_body; });
  8982. __webpack_require__.d(__webpack_exports__, "PanelHeader", function() { return /* reexport */ panel_header; });
  8983. __webpack_require__.d(__webpack_exports__, "PanelRow", function() { return /* reexport */ panel_row; });
  8984. __webpack_require__.d(__webpack_exports__, "Placeholder", function() { return /* reexport */ build_module_placeholder; });
  8985. __webpack_require__.d(__webpack_exports__, "Popover", function() { return /* reexport */ build_module_popover["a" /* default */]; });
  8986. __webpack_require__.d(__webpack_exports__, "QueryControls", function() { return /* reexport */ QueryControls; });
  8987. __webpack_require__.d(__webpack_exports__, "__experimentalRadio", function() { return /* reexport */ build_module_radio; });
  8988. __webpack_require__.d(__webpack_exports__, "__experimentalRadioGroup", function() { return /* reexport */ radio_group; });
  8989. __webpack_require__.d(__webpack_exports__, "RadioControl", function() { return /* reexport */ RadioControl; });
  8990. __webpack_require__.d(__webpack_exports__, "RangeControl", function() { return /* reexport */ range_control; });
  8991. __webpack_require__.d(__webpack_exports__, "ResizableBox", function() { return /* reexport */ resizable_box; });
  8992. __webpack_require__.d(__webpack_exports__, "ResponsiveWrapper", function() { return /* reexport */ responsive_wrapper; });
  8993. __webpack_require__.d(__webpack_exports__, "SandBox", function() { return /* reexport */ Sandbox; });
  8994. __webpack_require__.d(__webpack_exports__, "SelectControl", function() { return /* reexport */ select_control; });
  8995. __webpack_require__.d(__webpack_exports__, "Snackbar", function() { return /* reexport */ snackbar["a" /* default */]; });
  8996. __webpack_require__.d(__webpack_exports__, "SnackbarList", function() { return /* reexport */ snackbar_list; });
  8997. __webpack_require__.d(__webpack_exports__, "__experimentalSpacer", function() { return /* reexport */ spacer_component; });
  8998. __webpack_require__.d(__webpack_exports__, "Spinner", function() { return /* reexport */ Spinner; });
  8999. __webpack_require__.d(__webpack_exports__, "TabPanel", function() { return /* reexport */ TabPanel; });
  9000. __webpack_require__.d(__webpack_exports__, "__experimentalText", function() { return /* reexport */ text_component; });
  9001. __webpack_require__.d(__webpack_exports__, "TextControl", function() { return /* reexport */ text_control; });
  9002. __webpack_require__.d(__webpack_exports__, "TextareaControl", function() { return /* reexport */ TextareaControl; });
  9003. __webpack_require__.d(__webpack_exports__, "TextHighlight", function() { return /* reexport */ text_highlight; });
  9004. __webpack_require__.d(__webpack_exports__, "Tip", function() { return /* reexport */ tip; });
  9005. __webpack_require__.d(__webpack_exports__, "ToggleControl", function() { return /* reexport */ ToggleControl; });
  9006. __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ toolbar; });
  9007. __webpack_require__.d(__webpack_exports__, "ToolbarButton", function() { return /* reexport */ toolbar_button; });
  9008. __webpack_require__.d(__webpack_exports__, "ToolbarDropdownMenu", function() { return /* reexport */ toolbar_dropdown_menu; });
  9009. __webpack_require__.d(__webpack_exports__, "__experimentalToolbarContext", function() { return /* reexport */ toolbar_context["a" /* default */]; });
  9010. __webpack_require__.d(__webpack_exports__, "ToolbarGroup", function() { return /* reexport */ toolbar_group; });
  9011. __webpack_require__.d(__webpack_exports__, "ToolbarItem", function() { return /* reexport */ toolbar_item["a" /* default */]; });
  9012. __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ build_module_tooltip["a" /* default */]; });
  9013. __webpack_require__.d(__webpack_exports__, "__experimentalTreeGrid", function() { return /* reexport */ tree_grid; });
  9014. __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridRow", function() { return /* reexport */ tree_grid_row; });
  9015. __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridCell", function() { return /* reexport */ tree_grid_cell; });
  9016. __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridItem", function() { return /* reexport */ tree_grid_item; });
  9017. __webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return /* reexport */ TreeSelect; });
  9018. __webpack_require__.d(__webpack_exports__, "__experimentalTruncate", function() { return /* reexport */ truncate_component; });
  9019. __webpack_require__.d(__webpack_exports__, "__experimentalUnitControl", function() { return /* reexport */ unit_control; });
  9020. __webpack_require__.d(__webpack_exports__, "__experimentalUseCustomUnits", function() { return /* reexport */ useCustomUnits; });
  9021. __webpack_require__.d(__webpack_exports__, "VisuallyHidden", function() { return /* reexport */ visually_hidden["a" /* default */]; });
  9022. __webpack_require__.d(__webpack_exports__, "__experimentalVStack", function() { return /* reexport */ v_stack_component; });
  9023. __webpack_require__.d(__webpack_exports__, "IsolatedEventContainer", function() { return /* reexport */ isolated_event_container; });
  9024. __webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return /* reexport */ slot_fill["d" /* createSlotFill */]; });
  9025. __webpack_require__.d(__webpack_exports__, "Slot", function() { return /* reexport */ slot_fill["c" /* Slot */]; });
  9026. __webpack_require__.d(__webpack_exports__, "Fill", function() { return /* reexport */ slot_fill["a" /* Fill */]; });
  9027. __webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return /* reexport */ slot_fill["b" /* Provider */]; });
  9028. __webpack_require__.d(__webpack_exports__, "__experimentalUseSlot", function() { return /* reexport */ use_slot["a" /* default */]; });
  9029. __webpack_require__.d(__webpack_exports__, "__experimentalStyleProvider", function() { return /* reexport */ StyleProvider; });
  9030. __webpack_require__.d(__webpack_exports__, "navigateRegions", function() { return /* reexport */ navigate_regions; });
  9031. __webpack_require__.d(__webpack_exports__, "__unstableUseNavigateRegions", function() { return /* reexport */ useNavigateRegions; });
  9032. __webpack_require__.d(__webpack_exports__, "withConstrainedTabbing", function() { return /* reexport */ with_constrained_tabbing; });
  9033. __webpack_require__.d(__webpack_exports__, "withFallbackStyles", function() { return /* reexport */ with_fallback_styles; });
  9034. __webpack_require__.d(__webpack_exports__, "withFilters", function() { return /* reexport */ withFilters; });
  9035. __webpack_require__.d(__webpack_exports__, "withFocusOutside", function() { return /* reexport */ with_focus_outside; });
  9036. __webpack_require__.d(__webpack_exports__, "withFocusReturn", function() { return /* reexport */ with_focus_return; });
  9037. __webpack_require__.d(__webpack_exports__, "FocusReturnProvider", function() { return /* reexport */ with_focus_return_Provider; });
  9038. __webpack_require__.d(__webpack_exports__, "withNotices", function() { return /* reexport */ with_notices; });
  9039. __webpack_require__.d(__webpack_exports__, "withSpokenMessages", function() { return /* reexport */ with_spoken_messages; });
  9040. __webpack_require__.d(__webpack_exports__, "__unstableWithNext", function() { return /* reexport */ with_next["a" /* withNext */]; });
  9041. __webpack_require__.d(__webpack_exports__, "__unstableComponentSystemProvider", function() { return /* reexport */ ComponentSystemProvider; });
  9042. // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js
  9043. var text_styles_namespaceObject = {};
  9044. __webpack_require__.r(text_styles_namespaceObject);
  9045. __webpack_require__.d(text_styles_namespaceObject, "Text", function() { return Text; });
  9046. __webpack_require__.d(text_styles_namespaceObject, "block", function() { return styles_block; });
  9047. __webpack_require__.d(text_styles_namespaceObject, "positive", function() { return positive; });
  9048. __webpack_require__.d(text_styles_namespaceObject, "destructive", function() { return destructive; });
  9049. __webpack_require__.d(text_styles_namespaceObject, "muted", function() { return styles_muted; });
  9050. __webpack_require__.d(text_styles_namespaceObject, "highlighterText", function() { return highlighterText; });
  9051. __webpack_require__.d(text_styles_namespaceObject, "upperCase", function() { return styles_upperCase; });
  9052. // EXTERNAL MODULE: external ["wp","primitives"]
  9053. var external_wp_primitives_ = __webpack_require__("Tqx9");
  9054. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  9055. var esm_extends = __webpack_require__("wx14");
  9056. // EXTERNAL MODULE: external ["wp","element"]
  9057. var external_wp_element_ = __webpack_require__("GRId");
  9058. // EXTERNAL MODULE: external "lodash"
  9059. var external_lodash_ = __webpack_require__("YLtl");
  9060. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  9061. var classnames = __webpack_require__("TSYQ");
  9062. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  9063. // EXTERNAL MODULE: external ["wp","i18n"]
  9064. var external_wp_i18n_ = __webpack_require__("l3Sj");
  9065. // EXTERNAL MODULE: external ["wp","compose"]
  9066. var external_wp_compose_ = __webpack_require__("K9lf");
  9067. // EXTERNAL MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js
  9068. var CompositeItem = __webpack_require__("kTC8");
  9069. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js + 1 modules
  9070. var build_module_tooltip = __webpack_require__("W/NR");
  9071. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js + 2 modules
  9072. var visually_hidden = __webpack_require__("ldlY");
  9073. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js
  9074. /**
  9075. * External dependencies
  9076. */
  9077. /**
  9078. * WordPress dependencies
  9079. */
  9080. const GRID = [['top left', 'top center', 'top right'], ['center left', 'center center', 'center right'], ['bottom left', 'bottom center', 'bottom right']]; // Stored as map as i18n __() only accepts strings (not variables)
  9081. const ALIGNMENT_LABEL = {
  9082. 'top left': Object(external_wp_i18n_["__"])('Top Left'),
  9083. 'top center': Object(external_wp_i18n_["__"])('Top Center'),
  9084. 'top right': Object(external_wp_i18n_["__"])('Top Right'),
  9085. 'center left': Object(external_wp_i18n_["__"])('Center Left'),
  9086. 'center center': Object(external_wp_i18n_["__"])('Center Center'),
  9087. 'center right': Object(external_wp_i18n_["__"])('Center Right'),
  9088. 'bottom left': Object(external_wp_i18n_["__"])('Bottom Left'),
  9089. 'bottom center': Object(external_wp_i18n_["__"])('Bottom Center'),
  9090. 'bottom right': Object(external_wp_i18n_["__"])('Bottom Right')
  9091. }; // Transforms GRID into a flat Array of values
  9092. const ALIGNMENTS = Object(external_lodash_["flattenDeep"])(GRID);
  9093. /**
  9094. * Parses and transforms an incoming value to better match the alignment values
  9095. *
  9096. * @param {string} value An alignment value to parse.
  9097. *
  9098. * @return {string} The parsed value.
  9099. */
  9100. function transformValue(value) {
  9101. const nextValue = value === 'center' ? 'center center' : value;
  9102. return nextValue.replace('-', ' ');
  9103. }
  9104. /**
  9105. * Creates an item ID based on a prefix ID and an alignment value.
  9106. *
  9107. * @param {string} prefixId An ID to prefix.
  9108. * @param {string} value An alignment value.
  9109. *
  9110. * @return {string} The item id.
  9111. */
  9112. function utils_getItemId(prefixId, value) {
  9113. const valueId = transformValue(value).replace(' ', '-');
  9114. return `${prefixId}-${valueId}`;
  9115. }
  9116. /**
  9117. * Retrieves the alignment index from a value.
  9118. *
  9119. * @param {string} alignment Value to check.
  9120. *
  9121. * @return {number} The index of a matching alignment.
  9122. */
  9123. function getAlignmentIndex(alignment = 'center') {
  9124. const item = transformValue(alignment).replace('-', ' ');
  9125. const index = ALIGNMENTS.indexOf(item);
  9126. return index > -1 ? index : undefined;
  9127. }
  9128. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
  9129. var defineProperty = __webpack_require__("lSNA");
  9130. var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
  9131. // EXTERNAL MODULE: external "React"
  9132. var external_React_ = __webpack_require__("cDcd");
  9133. var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
  9134. // EXTERNAL MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
  9135. var is_prop_valid_browser_esm = __webpack_require__("9uj6");
  9136. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
  9137. function _setPrototypeOf(o, p) {
  9138. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  9139. o.__proto__ = p;
  9140. return o;
  9141. };
  9142. return _setPrototypeOf(o, p);
  9143. }
  9144. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
  9145. function _inheritsLoose(subClass, superClass) {
  9146. subClass.prototype = Object.create(superClass.prototype);
  9147. subClass.prototype.constructor = subClass;
  9148. _setPrototypeOf(subClass, superClass);
  9149. }
  9150. // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js + 2 modules
  9151. var cache_browser_esm = __webpack_require__("TqVZ");
  9152. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js
  9153. var inheritsLoose = __webpack_require__("VbXa");
  9154. // EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js
  9155. var utils_browser_esm = __webpack_require__("SIPS");
  9156. // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules
  9157. var serialize_browser_esm = __webpack_require__("MiSq");
  9158. // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js
  9159. var emotion_element_57a3a7a3_browser_esm_hasOwnProperty = Object.prototype.hasOwnProperty;
  9160. var EmotionCacheContext = /*#__PURE__*/Object(external_React_["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case
  9161. // because this module is primarily intended for the browser and node
  9162. // but it's also required in react native and similar environments sometimes
  9163. // and we could have a special build just for that
  9164. // but this is much easier and the native packages
  9165. // might use a different theme context in the future anyway
  9166. typeof HTMLElement !== 'undefined' ? Object(cache_browser_esm["a" /* default */])() : null);
  9167. var ThemeContext = /*#__PURE__*/Object(external_React_["createContext"])({});
  9168. var CacheProvider = EmotionCacheContext.Provider;
  9169. var emotion_element_57a3a7a3_browser_esm_withEmotionCache = function withEmotionCache(func) {
  9170. var render = function render(props, ref) {
  9171. return /*#__PURE__*/Object(external_React_["createElement"])(EmotionCacheContext.Consumer, null, function (cache) {
  9172. return func(props, cache, ref);
  9173. });
  9174. }; // $FlowFixMe
  9175. return /*#__PURE__*/Object(external_React_["forwardRef"])(render);
  9176. };
  9177. // thus we only need to replace what is a valid character for JS, but not for CSS
  9178. var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
  9179. return identifier.replace(/\$/g, '-');
  9180. };
  9181. var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
  9182. var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
  9183. var createEmotionProps = function createEmotionProps(type, props) {
  9184. if (false) {}
  9185. var newProps = {};
  9186. for (var key in props) {
  9187. if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key)) {
  9188. newProps[key] = props[key];
  9189. }
  9190. }
  9191. newProps[typePropName] = type; // TODO: check if this still works with all of those different JSX functions
  9192. if (false) { var match, error; }
  9193. return newProps;
  9194. };
  9195. var emotion_element_57a3a7a3_browser_esm_render = function render(cache, props, theme, ref) {
  9196. var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works
  9197. // not passing the registered cache to serializeStyles because it would
  9198. // make certain babel optimisations not possible
  9199. if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
  9200. cssProp = cache.registered[cssProp];
  9201. }
  9202. var type = props[typePropName];
  9203. var registeredStyles = [cssProp];
  9204. var className = '';
  9205. if (typeof props.className === 'string') {
  9206. className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(cache.registered, registeredStyles, props.className);
  9207. } else if (props.className != null) {
  9208. className = props.className + " ";
  9209. }
  9210. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(registeredStyles);
  9211. if (false) { var labelFromStack; }
  9212. var rules = Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, typeof type === 'string');
  9213. className += cache.key + "-" + serialized.name;
  9214. var newProps = {};
  9215. for (var key in props) {
  9216. if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || false)) {
  9217. newProps[key] = props[key];
  9218. }
  9219. }
  9220. newProps.ref = ref;
  9221. newProps.className = className;
  9222. var ele = /*#__PURE__*/Object(external_React_["createElement"])(type, newProps);
  9223. return ele;
  9224. }; // eslint-disable-next-line no-undef
  9225. var Emotion = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache, ref) {
  9226. if (typeof props.css === 'function') {
  9227. return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
  9228. return emotion_element_57a3a7a3_browser_esm_render(cache, props, theme, ref);
  9229. });
  9230. }
  9231. return emotion_element_57a3a7a3_browser_esm_render(cache, props, null, ref);
  9232. });
  9233. if (false) {}
  9234. // EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js
  9235. var sheet_browser_esm = __webpack_require__("z9I/");
  9236. // CONCATENATED MODULE: ./node_modules/@emotion/css/dist/css.browser.esm.js
  9237. function css_browser_esm_css() {
  9238. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  9239. args[_key] = arguments[_key];
  9240. }
  9241. return Object(serialize_browser_esm["a" /* serializeStyles */])(args);
  9242. }
  9243. /* harmony default export */ var css_browser_esm = (css_browser_esm_css);
  9244. // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js
  9245. var core_browser_esm_jsx = function jsx(type, props) {
  9246. var args = arguments;
  9247. if (props == null || !emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, 'css')) {
  9248. // $FlowFixMe
  9249. return external_React_["createElement"].apply(undefined, args);
  9250. }
  9251. var argsLength = args.length;
  9252. var createElementArgArray = new Array(argsLength);
  9253. createElementArgArray[0] = Emotion;
  9254. createElementArgArray[1] = createEmotionProps(type, props);
  9255. for (var i = 2; i < argsLength; i++) {
  9256. createElementArgArray[i] = args[i];
  9257. } // $FlowFixMe
  9258. return external_React_["createElement"].apply(null, createElementArgArray);
  9259. };
  9260. var warnedAboutCssPropForGlobal = false;
  9261. var Global = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache) {
  9262. if (false) {}
  9263. var styles = props.styles;
  9264. if (typeof styles === 'function') {
  9265. return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
  9266. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles(theme)]);
  9267. return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, {
  9268. serialized: serialized,
  9269. cache: cache
  9270. });
  9271. });
  9272. }
  9273. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles]);
  9274. return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, {
  9275. serialized: serialized,
  9276. cache: cache
  9277. });
  9278. });
  9279. // maintain place over rerenders.
  9280. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
  9281. // initial client-side render from SSR, use place of hydrating tag
  9282. var core_browser_esm_InnerGlobal = /*#__PURE__*/function (_React$Component) {
  9283. _inheritsLoose(InnerGlobal, _React$Component);
  9284. function InnerGlobal(props, context, updater) {
  9285. return _React$Component.call(this, props, context, updater) || this;
  9286. }
  9287. var _proto = InnerGlobal.prototype;
  9288. _proto.componentDidMount = function componentDidMount() {
  9289. this.sheet = new sheet_browser_esm["a" /* StyleSheet */]({
  9290. key: this.props.cache.key + "-global",
  9291. nonce: this.props.cache.sheet.nonce,
  9292. container: this.props.cache.sheet.container
  9293. }); // $FlowFixMe
  9294. var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]");
  9295. if (node !== null) {
  9296. this.sheet.tags.push(node);
  9297. }
  9298. if (this.props.cache.sheet.tags.length) {
  9299. this.sheet.before = this.props.cache.sheet.tags[0];
  9300. }
  9301. this.insertStyles();
  9302. };
  9303. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  9304. if (prevProps.serialized.name !== this.props.serialized.name) {
  9305. this.insertStyles();
  9306. }
  9307. };
  9308. _proto.insertStyles = function insertStyles$1() {
  9309. if (this.props.serialized.next !== undefined) {
  9310. // insert keyframes
  9311. Object(utils_browser_esm["b" /* insertStyles */])(this.props.cache, this.props.serialized.next, true);
  9312. }
  9313. if (this.sheet.tags.length) {
  9314. // if this doesn't exist then it will be null so the style element will be appended
  9315. var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling;
  9316. this.sheet.before = element;
  9317. this.sheet.flush();
  9318. }
  9319. this.props.cache.insert("", this.props.serialized, this.sheet, false);
  9320. };
  9321. _proto.componentWillUnmount = function componentWillUnmount() {
  9322. this.sheet.flush();
  9323. };
  9324. _proto.render = function render() {
  9325. return null;
  9326. };
  9327. return InnerGlobal;
  9328. }(external_React_["Component"]);
  9329. var core_browser_esm_keyframes = function keyframes() {
  9330. var insertable = css_browser_esm.apply(void 0, arguments);
  9331. var name = "animation-" + insertable.name; // $FlowFixMe
  9332. return {
  9333. name: name,
  9334. styles: "@keyframes " + name + "{" + insertable.styles + "}",
  9335. anim: 1,
  9336. toString: function toString() {
  9337. return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
  9338. }
  9339. };
  9340. };
  9341. var core_browser_esm_classnames = function classnames(args) {
  9342. var len = args.length;
  9343. var i = 0;
  9344. var cls = '';
  9345. for (; i < len; i++) {
  9346. var arg = args[i];
  9347. if (arg == null) continue;
  9348. var toAdd = void 0;
  9349. switch (typeof arg) {
  9350. case 'boolean':
  9351. break;
  9352. case 'object':
  9353. {
  9354. if (Array.isArray(arg)) {
  9355. toAdd = classnames(arg);
  9356. } else {
  9357. toAdd = '';
  9358. for (var k in arg) {
  9359. if (arg[k] && k) {
  9360. toAdd && (toAdd += ' ');
  9361. toAdd += k;
  9362. }
  9363. }
  9364. }
  9365. break;
  9366. }
  9367. default:
  9368. {
  9369. toAdd = arg;
  9370. }
  9371. }
  9372. if (toAdd) {
  9373. cls && (cls += ' ');
  9374. cls += toAdd;
  9375. }
  9376. }
  9377. return cls;
  9378. };
  9379. function merge(registered, css, className) {
  9380. var registeredStyles = [];
  9381. var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className);
  9382. if (registeredStyles.length < 2) {
  9383. return className;
  9384. }
  9385. return rawClassName + css(registeredStyles);
  9386. }
  9387. var ClassNames = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context) {
  9388. return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
  9389. var hasRendered = false;
  9390. var css = function css() {
  9391. if (hasRendered && "production" !== 'production') {
  9392. throw new Error('css can only be used during render');
  9393. }
  9394. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  9395. args[_key] = arguments[_key];
  9396. }
  9397. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, context.registered);
  9398. {
  9399. Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, false);
  9400. }
  9401. return context.key + "-" + serialized.name;
  9402. };
  9403. var cx = function cx() {
  9404. if (hasRendered && "production" !== 'production') {
  9405. throw new Error('cx can only be used during render');
  9406. }
  9407. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  9408. args[_key2] = arguments[_key2];
  9409. }
  9410. return merge(context.registered, css, core_browser_esm_classnames(args));
  9411. };
  9412. var content = {
  9413. css: css,
  9414. cx: cx,
  9415. theme: theme
  9416. };
  9417. var ele = props.children(content);
  9418. hasRendered = true;
  9419. return ele;
  9420. });
  9421. });
  9422. // CONCATENATED MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js
  9423. var testOmitPropsOnStringTag = is_prop_valid_browser_esm["default"];
  9424. var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
  9425. return key !== 'theme' && key !== 'innerRef';
  9426. };
  9427. var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
  9428. return typeof tag === 'string' && // 96 is one less than the char code
  9429. // for "a" so this is checking that
  9430. // it's a lowercase character
  9431. tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
  9432. };
  9433. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  9434. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  9435. var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
  9436. var styled_base_browser_esm_createStyled = function createStyled(tag, options) {
  9437. if (false) {}
  9438. var identifierName;
  9439. var shouldForwardProp;
  9440. var targetClassName;
  9441. if (options !== undefined) {
  9442. identifierName = options.label;
  9443. targetClassName = options.target;
  9444. shouldForwardProp = tag.__emotion_forwardProp && options.shouldForwardProp ? function (propName) {
  9445. return tag.__emotion_forwardProp(propName) && // $FlowFixMe
  9446. options.shouldForwardProp(propName);
  9447. } : options.shouldForwardProp;
  9448. }
  9449. var isReal = tag.__emotion_real === tag;
  9450. var baseTag = isReal && tag.__emotion_base || tag;
  9451. if (typeof shouldForwardProp !== 'function' && isReal) {
  9452. shouldForwardProp = tag.__emotion_forwardProp;
  9453. }
  9454. var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
  9455. var shouldUseAs = !defaultShouldForwardProp('as');
  9456. return function () {
  9457. var args = arguments;
  9458. var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
  9459. if (identifierName !== undefined) {
  9460. styles.push("label:" + identifierName + ";");
  9461. }
  9462. if (args[0] == null || args[0].raw === undefined) {
  9463. styles.push.apply(styles, args);
  9464. } else {
  9465. if (false) {}
  9466. styles.push(args[0][0]);
  9467. var len = args.length;
  9468. var i = 1;
  9469. for (; i < len; i++) {
  9470. if (false) {}
  9471. styles.push(args[i], args[0][i]);
  9472. }
  9473. } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
  9474. var Styled = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context, ref) {
  9475. return Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
  9476. var finalTag = shouldUseAs && props.as || baseTag;
  9477. var className = '';
  9478. var classInterpolations = [];
  9479. var mergedProps = props;
  9480. if (props.theme == null) {
  9481. mergedProps = {};
  9482. for (var key in props) {
  9483. mergedProps[key] = props[key];
  9484. }
  9485. mergedProps.theme = theme;
  9486. }
  9487. if (typeof props.className === 'string') {
  9488. className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(context.registered, classInterpolations, props.className);
  9489. } else if (props.className != null) {
  9490. className = props.className + " ";
  9491. }
  9492. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(styles.concat(classInterpolations), context.registered, mergedProps);
  9493. var rules = Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, typeof finalTag === 'string');
  9494. className += context.key + "-" + serialized.name;
  9495. if (targetClassName !== undefined) {
  9496. className += " " + targetClassName;
  9497. }
  9498. var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
  9499. var newProps = {};
  9500. for (var _key in props) {
  9501. if (shouldUseAs && _key === 'as') continue;
  9502. if ( // $FlowFixMe
  9503. finalShouldForwardProp(_key)) {
  9504. newProps[_key] = props[_key];
  9505. }
  9506. }
  9507. newProps.className = className;
  9508. newProps.ref = ref || props.innerRef;
  9509. if (false) {}
  9510. var ele = Object(external_React_["createElement"])(finalTag, newProps);
  9511. return ele;
  9512. });
  9513. });
  9514. Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
  9515. Styled.defaultProps = tag.defaultProps;
  9516. Styled.__emotion_real = Styled;
  9517. Styled.__emotion_base = baseTag;
  9518. Styled.__emotion_styles = styles;
  9519. Styled.__emotion_forwardProp = shouldForwardProp;
  9520. Object.defineProperty(Styled, 'toString', {
  9521. value: function value() {
  9522. if (targetClassName === undefined && "production" !== 'production') {
  9523. return 'NO_COMPONENT_SELECTOR';
  9524. } // $FlowFixMe: coerce undefined to string
  9525. return "." + targetClassName;
  9526. }
  9527. });
  9528. Styled.withComponent = function (nextTag, nextOptions) {
  9529. return createStyled(nextTag, nextOptions !== undefined ? _objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles);
  9530. };
  9531. return Styled;
  9532. };
  9533. };
  9534. /* harmony default export */ var styled_base_browser_esm = (styled_base_browser_esm_createStyled);
  9535. // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js
  9536. var tinycolor = __webpack_require__("Zss7");
  9537. var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor);
  9538. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js
  9539. /**
  9540. * External dependencies
  9541. */
  9542. /**
  9543. * Generating a CSS compliant rgba() color value.
  9544. *
  9545. * @param {string} hexValue The hex value to convert to rgba().
  9546. * @param {number} alpha The alpha value for opacity.
  9547. * @return {string} The converted rgba() color value.
  9548. *
  9549. * @example
  9550. * rgba( '#000000', 0.5 )
  9551. * // rgba(0, 0, 0, 0.5)
  9552. */
  9553. function rgba(hexValue = '', alpha = 1) {
  9554. const {
  9555. r,
  9556. g,
  9557. b
  9558. } = tinycolor_default()(hexValue).toRgb();
  9559. return `rgba(${r}, ${g}, ${b}, ${alpha})`;
  9560. }
  9561. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js
  9562. /**
  9563. * External dependencies
  9564. */
  9565. /**
  9566. * Internal dependencies
  9567. */
  9568. const BASE = {
  9569. black: '#000',
  9570. white: '#fff'
  9571. };
  9572. /**
  9573. * TODO: Continue to update values as "G2" design evolves.
  9574. *
  9575. * "G2" refers to the movement to advance the interface of the block editor.
  9576. * https://github.com/WordPress/gutenberg/issues/18667
  9577. */
  9578. const G2 = {
  9579. blue: {
  9580. medium: {
  9581. focus: '#007cba',
  9582. focusDark: '#fff'
  9583. }
  9584. },
  9585. gray: {
  9586. 900: '#1e1e1e',
  9587. 700: '#757575',
  9588. // Meets 4.6:1 text contrast against white.
  9589. 600: '#949494',
  9590. // Meets 3:1 UI or large text contrast against white.
  9591. 400: '#ccc',
  9592. 200: '#ddd',
  9593. // Used for most borders.
  9594. 100: '#f0f0f0'
  9595. },
  9596. darkGray: {
  9597. primary: '#1e1e1e',
  9598. heading: '#050505'
  9599. },
  9600. mediumGray: {
  9601. text: '#757575'
  9602. },
  9603. lightGray: {
  9604. ui: '#949494',
  9605. secondary: '#ccc',
  9606. tertiary: '#e7e8e9'
  9607. }
  9608. };
  9609. const DARK_GRAY = {
  9610. 900: '#191e23',
  9611. 800: '#23282d',
  9612. 700: '#32373c',
  9613. 600: '#40464d',
  9614. 500: '#555d66',
  9615. // Use this most of the time for dark items.
  9616. 400: '#606a73',
  9617. 300: '#6c7781',
  9618. // Lightest gray that can be used for AA text contrast.
  9619. 200: '#7e8993',
  9620. 150: '#8d96a0',
  9621. // Lightest gray that can be used for AA non-text contrast.
  9622. 100: '#8f98a1',
  9623. placeholder: rgba(G2.gray[900], 0.62)
  9624. };
  9625. const DARK_OPACITY = {
  9626. 900: rgba('#000510', 0.9),
  9627. 800: rgba('#00000a', 0.85),
  9628. 700: rgba('#06060b', 0.8),
  9629. 600: rgba('#000913', 0.75),
  9630. 500: rgba('#0a1829', 0.7),
  9631. 400: rgba('#0a1829', 0.65),
  9632. 300: rgba('#0e1c2e', 0.62),
  9633. 200: rgba('#162435', 0.55),
  9634. 100: rgba('#223443', 0.5),
  9635. backgroundFill: rgba(DARK_GRAY[700], 0.7)
  9636. };
  9637. const DARK_OPACITY_LIGHT = {
  9638. 900: rgba('#304455', 0.45),
  9639. 800: rgba('#425863', 0.4),
  9640. 700: rgba('#667886', 0.35),
  9641. 600: rgba('#7b86a2', 0.3),
  9642. 500: rgba('#9197a2', 0.25),
  9643. 400: rgba('#95959c', 0.2),
  9644. 300: rgba('#829493', 0.15),
  9645. 200: rgba('#8b8b96', 0.1),
  9646. 100: rgba('#747474', 0.05)
  9647. };
  9648. const LIGHT_GRAY = {
  9649. 900: '#a2aab2',
  9650. 800: '#b5bcc2',
  9651. 700: '#ccd0d4',
  9652. 600: '#d7dade',
  9653. 500: '#e2e4e7',
  9654. // Good for "grayed" items and borders.
  9655. 400: '#e8eaeb',
  9656. // Good for "readonly" input fields and special text selection.
  9657. 300: '#edeff0',
  9658. 200: '#f3f4f5',
  9659. 100: '#f8f9f9',
  9660. placeholder: rgba(BASE.white, 0.65)
  9661. };
  9662. const LIGHT_OPACITY_LIGHT = {
  9663. 900: rgba(BASE.white, 0.5),
  9664. 800: rgba(BASE.white, 0.45),
  9665. 700: rgba(BASE.white, 0.4),
  9666. 600: rgba(BASE.white, 0.35),
  9667. 500: rgba(BASE.white, 0.3),
  9668. 400: rgba(BASE.white, 0.25),
  9669. 300: rgba(BASE.white, 0.2),
  9670. 200: rgba(BASE.white, 0.15),
  9671. 100: rgba(BASE.white, 0.1),
  9672. backgroundFill: rgba(LIGHT_GRAY[300], 0.8)
  9673. }; // Additional colors.
  9674. // Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
  9675. const BLUE = {
  9676. wordpress: {
  9677. 700: '#00669b'
  9678. },
  9679. dark: {
  9680. 900: '#0071a1'
  9681. },
  9682. medium: {
  9683. 900: '#006589',
  9684. 800: '#00739c',
  9685. 700: '#007fac',
  9686. 600: '#008dbe',
  9687. 500: '#00a0d2',
  9688. 400: '#33b3db',
  9689. 300: '#66c6e4',
  9690. 200: '#bfe7f3',
  9691. 100: '#e5f5fa',
  9692. highlight: '#b3e7fe',
  9693. focus: '#007cba'
  9694. }
  9695. };
  9696. const ALERT = {
  9697. yellow: '#f0b849',
  9698. red: '#d94f4f',
  9699. green: '#4ab866'
  9700. };
  9701. const ADMIN = {
  9702. theme: `var( --wp-admin-theme-color, ${BLUE.wordpress[700]})`,
  9703. themeDark10: `var( --wp-admin-theme-color-darker-10, ${BLUE.medium.focus})`
  9704. }; // Namespaced values for raw colors hex codes
  9705. const UI = {
  9706. theme: ADMIN.theme,
  9707. background: BASE.white,
  9708. backgroundDisabled: LIGHT_GRAY[200],
  9709. border: G2.gray[700],
  9710. borderFocus: ADMIN.themeDark10,
  9711. borderDisabled: G2.gray[400],
  9712. borderLight: G2.gray[200],
  9713. label: DARK_GRAY[500],
  9714. textDisabled: DARK_GRAY[150],
  9715. textDark: BASE.white,
  9716. textLight: BASE.black
  9717. };
  9718. const COLORS = { ...BASE,
  9719. darkGray: Object(external_lodash_["merge"])({}, DARK_GRAY, G2.darkGray),
  9720. darkOpacity: DARK_OPACITY,
  9721. darkOpacityLight: DARK_OPACITY_LIGHT,
  9722. mediumGray: G2.mediumGray,
  9723. gray: G2.gray,
  9724. lightGray: Object(external_lodash_["merge"])({}, LIGHT_GRAY, G2.lightGray),
  9725. lightGrayLight: LIGHT_OPACITY_LIGHT,
  9726. blue: Object(external_lodash_["merge"])({}, BLUE, G2.blue),
  9727. alert: ALERT,
  9728. admin: ADMIN,
  9729. ui: UI
  9730. };
  9731. /* harmony default export */ var colors_values = (COLORS);
  9732. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js
  9733. /**
  9734. * Allows users to opt-out of animations via OS-level preferences.
  9735. *
  9736. * @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name
  9737. * @return {string} Generated CSS code for the reduced style
  9738. */
  9739. function reduceMotion(prop = 'transition') {
  9740. let style;
  9741. switch (prop) {
  9742. case 'transition':
  9743. style = 'transition-duration: 0ms;';
  9744. break;
  9745. case 'animation':
  9746. style = 'animation-duration: 1ms;';
  9747. break;
  9748. default:
  9749. style = `
  9750. animation-duration: 1ms;
  9751. transition-duration: 0ms;
  9752. `;
  9753. }
  9754. return `
  9755. @media ( prefers-reduced-motion: reduce ) {
  9756. ${style};
  9757. }
  9758. `;
  9759. }
  9760. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js
  9761. function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  9762. /**
  9763. * Internal dependencies
  9764. */
  9765. var alignment_matrix_control_styles_ref = true ? {
  9766. name: "1xiracb",
  9767. styles: "border-radius:2px;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );outline:none;"
  9768. } : undefined;
  9769. const rootBase = () => {
  9770. return alignment_matrix_control_styles_ref;
  9771. };
  9772. const rootSize = ({
  9773. size = 92
  9774. }) => {
  9775. return /*#__PURE__*/css_browser_esm("grid-template-rows:repeat( 3,calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : undefined));
  9776. };
  9777. const Root = styled_base_browser_esm("div", {
  9778. target: "e1od1u4s0",
  9779. label: "Root"
  9780. })(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", rootSize, ";" + ( true ? "" : undefined));
  9781. const Row = styled_base_browser_esm("div", {
  9782. target: "e1od1u4s1",
  9783. label: "Row"
  9784. })( true ? {
  9785. name: "1177s8r",
  9786. styles: "box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );"
  9787. } : undefined);
  9788. const pointActive = ({
  9789. isActive
  9790. }) => {
  9791. const boxShadow = isActive ? `0 0 0 2px ${COLORS.black}` : null;
  9792. const pointColor = isActive ? COLORS.black : COLORS.lightGray[800];
  9793. const pointColorHover = isActive ? COLORS.black : COLORS.blue.medium.focus;
  9794. return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:", pointColor, ";*:hover > &{color:", pointColorHover, ";}" + ( true ? "" : undefined));
  9795. };
  9796. const pointBase = props => {
  9797. return /*#__PURE__*/css_browser_esm("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", pointActive(props), true ? "" : undefined);
  9798. };
  9799. const Point = styled_base_browser_esm("span", {
  9800. target: "e1od1u4s2",
  9801. label: "Point"
  9802. })("height:6px;width:6px;", pointBase, true ? "" : undefined);
  9803. const Cell = styled_base_browser_esm("span", {
  9804. target: "e1od1u4s3",
  9805. label: "Cell"
  9806. })( true ? {
  9807. name: "10ro24i",
  9808. styles: "appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0;"
  9809. } : undefined);
  9810. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js
  9811. /**
  9812. * Internal dependencies
  9813. */
  9814. /**
  9815. * Internal dependencies
  9816. */
  9817. function cell_Cell({
  9818. isActive = false,
  9819. value,
  9820. ...props
  9821. }) {
  9822. const tooltipText = ALIGNMENT_LABEL[value];
  9823. return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
  9824. text: tooltipText
  9825. }, Object(external_wp_element_["createElement"])(CompositeItem["a" /* CompositeItem */], Object(esm_extends["a" /* default */])({
  9826. as: Cell,
  9827. role: "gridcell"
  9828. }, props), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], null, value), Object(external_wp_element_["createElement"])(Point, {
  9829. isActive: isActive,
  9830. role: "presentation"
  9831. })));
  9832. }
  9833. // EXTERNAL MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js
  9834. var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("BZp5");
  9835. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js
  9836. var useIsomorphicEffect = __webpack_require__("AXvK");
  9837. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/useSealedState.js
  9838. /**
  9839. * React custom hook that returns the very first value passed to `initialState`,
  9840. * even if it changes between re-renders.
  9841. */
  9842. function useSealedState(initialState) {
  9843. var _React$useState = Object(external_React_["useState"])(initialState),
  9844. sealed = _React$useState[0];
  9845. return sealed;
  9846. }
  9847. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getDocument.js
  9848. var getDocument = __webpack_require__("ouKs");
  9849. // CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js
  9850. function groupItems(items) {
  9851. var groups = [[]];
  9852. var _loop = function _loop() {
  9853. var item = _step.value;
  9854. var group = groups.find(function (g) {
  9855. return !g[0] || g[0].groupId === item.groupId;
  9856. });
  9857. if (group) {
  9858. group.push(item);
  9859. } else {
  9860. groups.push([item]);
  9861. }
  9862. };
  9863. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
  9864. _loop();
  9865. }
  9866. return groups;
  9867. }
  9868. function flatten(grid) {
  9869. var flattened = [];
  9870. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(grid), _step; !(_step = _iterator()).done;) {
  9871. var row = _step.value;
  9872. flattened.push.apply(flattened, row);
  9873. }
  9874. return flattened;
  9875. }
  9876. function reverse(array) {
  9877. return array.slice().reverse();
  9878. }
  9879. // EXTERNAL MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js
  9880. var getCurrentId_5aa9849e = __webpack_require__("iYXd");
  9881. // CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js
  9882. function findEnabledItemById(items, id) {
  9883. if (!id) return undefined;
  9884. return items === null || items === void 0 ? void 0 : items.find(function (item) {
  9885. return item.id === id && !item.disabled;
  9886. });
  9887. }
  9888. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/applyState.js
  9889. function isUpdater(argument) {
  9890. return typeof argument === "function";
  9891. }
  9892. /**
  9893. * Receives a `setState` argument and calls it with `currentValue` if it's a
  9894. * function. Otherwise return the argument as the new value.
  9895. *
  9896. * @example
  9897. * import { applyState } from "reakit-utils";
  9898. *
  9899. * applyState((value) => value + 1, 1); // 2
  9900. * applyState(2, 1); // 2
  9901. */
  9902. function applyState(argument, currentValue) {
  9903. if (isUpdater(argument)) {
  9904. return argument(currentValue);
  9905. }
  9906. return argument;
  9907. }
  9908. // EXTERNAL MODULE: ./node_modules/reakit/es/Id/IdProvider.js
  9909. var IdProvider = __webpack_require__("KCH1");
  9910. // CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js
  9911. function unstable_useIdState(initialState) {
  9912. if (initialState === void 0) {
  9913. initialState = {};
  9914. }
  9915. var _useSealedState = useSealedState(initialState),
  9916. initialBaseId = _useSealedState.baseId;
  9917. var generateId = Object(external_React_["useContext"])(IdProvider["a" /* unstable_IdContext */]);
  9918. var idCountRef = Object(external_React_["useRef"])(0);
  9919. var _React$useState = Object(external_React_["useState"])(function () {
  9920. return initialBaseId || generateId();
  9921. }),
  9922. baseId = _React$useState[0],
  9923. setBaseId = _React$useState[1];
  9924. return {
  9925. baseId: baseId,
  9926. setBaseId: setBaseId,
  9927. unstable_idCountRef: idCountRef
  9928. };
  9929. }
  9930. // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js
  9931. function isElementPreceding(element1, element2) {
  9932. return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING);
  9933. }
  9934. function findDOMIndex(items, item) {
  9935. return items.findIndex(function (currentItem) {
  9936. if (!currentItem.ref.current || !item.ref.current) {
  9937. return false;
  9938. }
  9939. return isElementPreceding(item.ref.current, currentItem.ref.current);
  9940. });
  9941. }
  9942. function getMaxLength(rows) {
  9943. var maxLength = 0;
  9944. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(rows), _step; !(_step = _iterator()).done;) {
  9945. var length = _step.value.length;
  9946. if (length > maxLength) {
  9947. maxLength = length;
  9948. }
  9949. }
  9950. return maxLength;
  9951. }
  9952. /**
  9953. * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2]
  9954. */
  9955. function verticalizeItems(items) {
  9956. var groups = groupItems(items);
  9957. var maxLength = getMaxLength(groups);
  9958. var verticalized = [];
  9959. for (var i = 0; i < maxLength; i += 1) {
  9960. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
  9961. var group = _step.value;
  9962. if (group[i]) {
  9963. verticalized.push(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, group[i]), {}, {
  9964. // If there's no groupId, it means that it's not a grid composite,
  9965. // but a single row instead. So, instead of verticalizing it, that
  9966. // is, assigning a different groupId based on the column index, we
  9967. // keep it undefined so they will be part of the same group.
  9968. // It's useful when using up/down on one-dimensional composites.
  9969. groupId: group[i].groupId ? "" + i : undefined
  9970. }));
  9971. }
  9972. }
  9973. }
  9974. return verticalized;
  9975. }
  9976. function createEmptyItem(groupId) {
  9977. return {
  9978. id: "__EMPTY_ITEM__",
  9979. disabled: true,
  9980. ref: {
  9981. current: null
  9982. },
  9983. groupId: groupId
  9984. };
  9985. }
  9986. /**
  9987. * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]]
  9988. */
  9989. function fillGroups(groups, currentId, shift) {
  9990. var maxLength = getMaxLength(groups);
  9991. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
  9992. var group = _step.value;
  9993. for (var i = 0; i < maxLength; i += 1) {
  9994. var item = group[i];
  9995. if (!item || shift && item.disabled) {
  9996. var isFrist = i === 0;
  9997. var previousItem = isFrist && shift ? Object(getCurrentId_5aa9849e["a" /* f */])(group) : group[i - 1];
  9998. group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId);
  9999. }
  10000. }
  10001. }
  10002. return groups;
  10003. }
  10004. var nullItem = {
  10005. id: null,
  10006. ref: {
  10007. current: null
  10008. }
  10009. };
  10010. function placeItemsAfter(items, id, shouldInsertNullItem) {
  10011. var index = items.findIndex(function (item) {
  10012. return item.id === id;
  10013. });
  10014. return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index));
  10015. }
  10016. function getItemsInGroup(items, groupId) {
  10017. return items.filter(function (item) {
  10018. return item.groupId === groupId;
  10019. });
  10020. }
  10021. var map = {
  10022. horizontal: "vertical",
  10023. vertical: "horizontal"
  10024. };
  10025. function getOppositeOrientation(orientation) {
  10026. return orientation && map[orientation];
  10027. }
  10028. function addItemAtIndex(array, item, index) {
  10029. if (!(index in array)) {
  10030. return [].concat(array, [item]);
  10031. }
  10032. return [].concat(array.slice(0, index), [item], array.slice(index));
  10033. }
  10034. function sortBasedOnDOMPosition(items) {
  10035. var pairs = items.map(function (item, index) {
  10036. return [index, item];
  10037. });
  10038. var isOrderDifferent = false;
  10039. pairs.sort(function (_ref, _ref2) {
  10040. var indexA = _ref[0],
  10041. a = _ref[1];
  10042. var indexB = _ref2[0],
  10043. b = _ref2[1];
  10044. var elementA = a.ref.current;
  10045. var elementB = b.ref.current;
  10046. if (!elementA || !elementB) return 0; // a before b
  10047. if (isElementPreceding(elementA, elementB)) {
  10048. if (indexA > indexB) {
  10049. isOrderDifferent = true;
  10050. }
  10051. return -1;
  10052. } // a after b
  10053. if (indexA < indexB) {
  10054. isOrderDifferent = true;
  10055. }
  10056. return 1;
  10057. });
  10058. if (isOrderDifferent) {
  10059. return pairs.map(function (_ref3) {
  10060. var _ = _ref3[0],
  10061. item = _ref3[1];
  10062. return item;
  10063. });
  10064. }
  10065. return items;
  10066. }
  10067. function setItemsBasedOnDOMPosition(items, setItems) {
  10068. var sortedItems = sortBasedOnDOMPosition(items);
  10069. if (items !== sortedItems) {
  10070. setItems(sortedItems);
  10071. }
  10072. }
  10073. function getCommonParent(items) {
  10074. var _firstItem$ref$curren;
  10075. var firstItem = items[0],
  10076. nextItems = items.slice(1);
  10077. var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement;
  10078. var _loop = function _loop() {
  10079. var parent = parentElement;
  10080. if (nextItems.every(function (item) {
  10081. return parent.contains(item.ref.current);
  10082. })) {
  10083. return {
  10084. v: parentElement
  10085. };
  10086. }
  10087. parentElement = parentElement.parentElement;
  10088. };
  10089. while (parentElement) {
  10090. var _ret = _loop();
  10091. if (typeof _ret === "object") return _ret.v;
  10092. }
  10093. return Object(getDocument["a" /* getDocument */])(parentElement).body;
  10094. } // istanbul ignore next: JSDOM doesn't support IntersectionObverser
  10095. // See https://github.com/jsdom/jsdom/issues/2032
  10096. function useIntersectionObserver(items, setItems) {
  10097. var previousItems = Object(external_React_["useRef"])([]);
  10098. Object(external_React_["useEffect"])(function () {
  10099. var callback = function callback() {
  10100. var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered.
  10101. if (hasPreviousItems) {
  10102. setItemsBasedOnDOMPosition(items, setItems);
  10103. }
  10104. previousItems.current = items;
  10105. };
  10106. var root = getCommonParent(items);
  10107. var observer = new IntersectionObserver(callback, {
  10108. root: root
  10109. });
  10110. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
  10111. var item = _step.value;
  10112. if (item.ref.current) {
  10113. observer.observe(item.ref.current);
  10114. }
  10115. }
  10116. return function () {
  10117. observer.disconnect();
  10118. };
  10119. }, [items]);
  10120. }
  10121. function useTimeoutObserver(items, setItems) {
  10122. Object(external_React_["useEffect"])(function () {
  10123. var callback = function callback() {
  10124. return setItemsBasedOnDOMPosition(items, setItems);
  10125. };
  10126. var timeout = setTimeout(callback, 250);
  10127. return function () {
  10128. return clearTimeout(timeout);
  10129. };
  10130. });
  10131. }
  10132. function useSortBasedOnDOMPosition(items, setItems) {
  10133. if (typeof IntersectionObserver === "function") {
  10134. useIntersectionObserver(items, setItems);
  10135. } else {
  10136. useTimeoutObserver(items, setItems);
  10137. }
  10138. }
  10139. function CompositeState_reducer(state, action) {
  10140. var virtual = state.unstable_virtual,
  10141. rtl = state.rtl,
  10142. orientation = state.orientation,
  10143. items = state.items,
  10144. groups = state.groups,
  10145. currentId = state.currentId,
  10146. loop = state.loop,
  10147. wrap = state.wrap,
  10148. pastIds = state.pastIds,
  10149. shift = state.shift,
  10150. moves = state.unstable_moves,
  10151. includesBaseElement = state.unstable_includesBaseElement,
  10152. initialVirtual = state.initialVirtual,
  10153. initialRTL = state.initialRTL,
  10154. initialOrientation = state.initialOrientation,
  10155. initialCurrentId = state.initialCurrentId,
  10156. initialLoop = state.initialLoop,
  10157. initialWrap = state.initialWrap,
  10158. initialShift = state.initialShift,
  10159. hasSetCurrentId = state.hasSetCurrentId;
  10160. switch (action.type) {
  10161. case "registerGroup":
  10162. {
  10163. var _group = action.group; // If there are no groups yet, just add it as the first one
  10164. if (groups.length === 0) {
  10165. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10166. groups: [_group]
  10167. });
  10168. } // Finds the group index based on DOM position
  10169. var index = findDOMIndex(groups, _group);
  10170. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10171. groups: addItemAtIndex(groups, _group, index)
  10172. });
  10173. }
  10174. case "unregisterGroup":
  10175. {
  10176. var _id = action.id;
  10177. var nextGroups = groups.filter(function (group) {
  10178. return group.id !== _id;
  10179. }); // The group isn't registered, so do nothing
  10180. if (nextGroups.length === groups.length) {
  10181. return state;
  10182. }
  10183. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10184. groups: nextGroups
  10185. });
  10186. }
  10187. case "registerItem":
  10188. {
  10189. var _item = action.item; // Finds the item group based on the DOM hierarchy
  10190. var _group2 = groups.find(function (r) {
  10191. var _r$ref$current;
  10192. return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current);
  10193. }); // Group will be null if it's a one-dimensional composite
  10194. var nextItem = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  10195. groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id
  10196. }, _item);
  10197. var _index = findDOMIndex(items, nextItem);
  10198. var nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10199. items: addItemAtIndex(items, nextItem, _index)
  10200. });
  10201. if (!hasSetCurrentId && !moves && initialCurrentId === undefined) {
  10202. var _findFirstEnabledItem;
  10203. // Sets currentId to the first enabled item. This runs whenever an item
  10204. // is registered because the first enabled item may be registered
  10205. // asynchronously.
  10206. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, nextState), {}, {
  10207. currentId: (_findFirstEnabledItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id
  10208. });
  10209. }
  10210. return nextState;
  10211. }
  10212. case "unregisterItem":
  10213. {
  10214. var _id2 = action.id;
  10215. var nextItems = items.filter(function (item) {
  10216. return item.id !== _id2;
  10217. }); // The item isn't registered, so do nothing
  10218. if (nextItems.length === items.length) {
  10219. return state;
  10220. } // Filters out the item that is being removed from the pastIds list
  10221. var nextPastIds = pastIds.filter(function (pastId) {
  10222. return pastId !== _id2;
  10223. });
  10224. var _nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10225. pastIds: nextPastIds,
  10226. items: nextItems
  10227. }); // If the current item is the item that is being removed, focus pastId
  10228. if (currentId && currentId === _id2) {
  10229. var nextId = includesBaseElement ? null : Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
  10230. currentId: nextPastIds[0]
  10231. }));
  10232. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
  10233. currentId: nextId
  10234. });
  10235. }
  10236. return _nextState;
  10237. }
  10238. case "move":
  10239. {
  10240. var _id3 = action.id; // move() does nothing
  10241. if (_id3 === undefined) {
  10242. return state;
  10243. } // Removes the current item and the item that is receiving focus from the
  10244. // pastIds list
  10245. var filteredPastIds = pastIds.filter(function (pastId) {
  10246. return pastId !== currentId && pastId !== _id3;
  10247. }); // If there's a currentId, add it to the pastIds list so it can be focused
  10248. // if the new item gets removed or disabled
  10249. var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds;
  10250. var _nextState2 = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10251. pastIds: _nextPastIds
  10252. }); // move(null) will focus the composite element itself, not an item
  10253. if (_id3 === null) {
  10254. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
  10255. unstable_moves: moves + 1,
  10256. currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _id3)
  10257. });
  10258. }
  10259. var _item2 = findEnabledItemById(items, _id3);
  10260. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
  10261. unstable_moves: _item2 ? moves + 1 : moves,
  10262. currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id)
  10263. });
  10264. }
  10265. case "next":
  10266. {
  10267. // If there's no item focused, we just move the first one
  10268. if (currentId == null) {
  10269. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10270. type: "first"
  10271. }));
  10272. } // RTL doesn't make sense on vertical navigation
  10273. var isHorizontal = orientation !== "vertical";
  10274. var isRTL = rtl && isHorizontal;
  10275. var allItems = isRTL ? reverse(items) : items;
  10276. var currentItem = allItems.find(function (item) {
  10277. return item.id === currentId;
  10278. }); // If there's no item focused, we just move the first one
  10279. if (!currentItem) {
  10280. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10281. type: "first"
  10282. }));
  10283. }
  10284. var isGrid = !!currentItem.groupId;
  10285. var currentIndex = allItems.indexOf(currentItem);
  10286. var _nextItems = allItems.slice(currentIndex + 1);
  10287. var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End
  10288. if (action.allTheWay) {
  10289. // We reverse so we can get the last enabled item in the group. If it's
  10290. // RTL, nextItems and nextItemsInGroup are already reversed and don't
  10291. // have the items before the current one anymore. So we have to get
  10292. // items in group again with allItems.
  10293. var _nextItem2 = Object(getCurrentId_5aa9849e["a" /* f */])(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup));
  10294. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10295. type: "move",
  10296. id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id
  10297. }));
  10298. }
  10299. var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous
  10300. // call, which is inherently horizontal. up/down will call next with
  10301. // orientation set to vertical by default (see below on up/down cases).
  10302. isGrid ? orientation || "horizontal" : orientation);
  10303. var canLoop = loop && loop !== oppositeOrientation;
  10304. var canWrap = isGrid && wrap && wrap !== oppositeOrientation;
  10305. var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling
  10306. // next directly, hasNullItem will only be true if it's not a grid and
  10307. // loop is set to true, which means that pressing right or down keys on
  10308. // grids will never focus the composite element. On one-dimensional
  10309. // composites that don't loop, pressing right or down keys also doesn't
  10310. // focus the composite element.
  10311. action.hasNullItem || !isGrid && canLoop && includesBaseElement;
  10312. if (canLoop) {
  10313. var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1]
  10314. var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem);
  10315. var _nextItem3 = Object(getCurrentId_5aa9849e["a" /* f */])(sortedItems, currentId);
  10316. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10317. type: "move",
  10318. id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id
  10319. }));
  10320. }
  10321. if (canWrap) {
  10322. var _nextItem4 = Object(getCurrentId_5aa9849e["a" /* f */])( // We can use nextItems, which contains all the next items, including
  10323. // items from other groups, to wrap between groups. However, if there
  10324. // is a null item (the composite element), we'll only use the next
  10325. // items in the group. So moving next from the last item will focus
  10326. // the composite element (null). On grid composites, horizontal
  10327. // navigation never focuses the composite element, only vertical.
  10328. hasNullItem ? nextItemsInGroup : _nextItems, currentId);
  10329. var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id;
  10330. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10331. type: "move",
  10332. id: _nextId
  10333. }));
  10334. }
  10335. var _nextItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextItemsInGroup, currentId);
  10336. if (!_nextItem && hasNullItem) {
  10337. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10338. type: "move",
  10339. id: null
  10340. }));
  10341. }
  10342. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10343. type: "move",
  10344. id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id
  10345. }));
  10346. }
  10347. case "previous":
  10348. {
  10349. // If currentId is initially set to null, the composite element will be
  10350. // focusable while navigating with arrow keys. But, if it's a grid, we
  10351. // don't want to focus the composite element with horizontal navigation.
  10352. var _isGrid = !!groups.length;
  10353. var _hasNullItem = !_isGrid && includesBaseElement;
  10354. var _nextState3 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10355. items: reverse(items)
  10356. }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10357. type: "next",
  10358. hasNullItem: _hasNullItem
  10359. }));
  10360. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState3), {}, {
  10361. items: items
  10362. });
  10363. }
  10364. case "down":
  10365. {
  10366. var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it
  10367. // with disabled fake items. Then, we reorganize the items list so
  10368. // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2].
  10369. var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift)));
  10370. var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop
  10371. // is true or vertical.
  10372. var _hasNullItem2 = _canLoop && includesBaseElement;
  10373. var _nextState4 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10374. orientation: "vertical",
  10375. items: verticalItems
  10376. }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10377. type: "next",
  10378. hasNullItem: _hasNullItem2
  10379. }));
  10380. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState4), {}, {
  10381. orientation: orientation,
  10382. items: items
  10383. });
  10384. }
  10385. case "up":
  10386. {
  10387. var _shouldShift = shift && !action.allTheWay;
  10388. var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the
  10389. // composite element when the up arrow key is pressed in the first row.
  10390. var _hasNullItem3 = includesBaseElement;
  10391. var _nextState5 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10392. orientation: "vertical",
  10393. items: _verticalItems
  10394. }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10395. type: "next",
  10396. hasNullItem: _hasNullItem3
  10397. }));
  10398. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState5), {}, {
  10399. orientation: orientation,
  10400. items: items
  10401. });
  10402. }
  10403. case "first":
  10404. {
  10405. var firstItem = Object(getCurrentId_5aa9849e["a" /* f */])(items);
  10406. return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10407. type: "move",
  10408. id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id
  10409. }));
  10410. }
  10411. case "last":
  10412. {
  10413. var _nextState6 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10414. items: reverse(items)
  10415. }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
  10416. type: "first"
  10417. }));
  10418. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState6), {}, {
  10419. items: items
  10420. });
  10421. }
  10422. case "sort":
  10423. {
  10424. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10425. items: sortBasedOnDOMPosition(items),
  10426. groups: sortBasedOnDOMPosition(groups)
  10427. });
  10428. }
  10429. case "setVirtual":
  10430. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10431. unstable_virtual: applyState(action.virtual, virtual)
  10432. });
  10433. case "setRTL":
  10434. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10435. rtl: applyState(action.rtl, rtl)
  10436. });
  10437. case "setOrientation":
  10438. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10439. orientation: applyState(action.orientation, orientation)
  10440. });
  10441. case "setCurrentId":
  10442. {
  10443. var nextCurrentId = Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10444. currentId: applyState(action.currentId, currentId)
  10445. }));
  10446. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10447. currentId: nextCurrentId,
  10448. hasSetCurrentId: true
  10449. });
  10450. }
  10451. case "setLoop":
  10452. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10453. loop: applyState(action.loop, loop)
  10454. });
  10455. case "setWrap":
  10456. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10457. wrap: applyState(action.wrap, wrap)
  10458. });
  10459. case "setShift":
  10460. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10461. shift: applyState(action.shift, shift)
  10462. });
  10463. case "setIncludesBaseElement":
  10464. {
  10465. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10466. unstable_includesBaseElement: applyState(action.includesBaseElement, includesBaseElement)
  10467. });
  10468. }
  10469. case "reset":
  10470. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10471. unstable_virtual: initialVirtual,
  10472. rtl: initialRTL,
  10473. orientation: initialOrientation,
  10474. currentId: Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10475. currentId: initialCurrentId
  10476. })),
  10477. loop: initialLoop,
  10478. wrap: initialWrap,
  10479. shift: initialShift,
  10480. unstable_moves: 0,
  10481. pastIds: []
  10482. });
  10483. case "setItems":
  10484. {
  10485. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
  10486. items: action.items
  10487. });
  10488. }
  10489. default:
  10490. throw new Error();
  10491. }
  10492. }
  10493. function useAction(fn) {
  10494. return Object(external_React_["useCallback"])(fn, []);
  10495. }
  10496. function useIsUnmountedRef() {
  10497. var isUnmountedRef = Object(external_React_["useRef"])(false);
  10498. Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () {
  10499. return function () {
  10500. isUnmountedRef.current = true;
  10501. };
  10502. }, []);
  10503. return isUnmountedRef;
  10504. }
  10505. function useCompositeState(initialState) {
  10506. if (initialState === void 0) {
  10507. initialState = {};
  10508. }
  10509. var _useSealedState = useSealedState(initialState),
  10510. _useSealedState$unsta = _useSealedState.unstable_virtual,
  10511. virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta,
  10512. _useSealedState$rtl = _useSealedState.rtl,
  10513. rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl,
  10514. orientation = _useSealedState.orientation,
  10515. currentId = _useSealedState.currentId,
  10516. _useSealedState$loop = _useSealedState.loop,
  10517. loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop,
  10518. _useSealedState$wrap = _useSealedState.wrap,
  10519. wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap,
  10520. _useSealedState$shift = _useSealedState.shift,
  10521. shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift,
  10522. unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement,
  10523. sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]);
  10524. var idState = unstable_useIdState(sealed);
  10525. var _React$useReducer = Object(external_React_["useReducer"])(CompositeState_reducer, {
  10526. unstable_virtual: virtual,
  10527. rtl: rtl,
  10528. orientation: orientation,
  10529. items: [],
  10530. groups: [],
  10531. currentId: currentId,
  10532. loop: loop,
  10533. wrap: wrap,
  10534. shift: shift,
  10535. unstable_moves: 0,
  10536. pastIds: [],
  10537. unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null,
  10538. initialVirtual: virtual,
  10539. initialRTL: rtl,
  10540. initialOrientation: orientation,
  10541. initialCurrentId: currentId,
  10542. initialLoop: loop,
  10543. initialWrap: wrap,
  10544. initialShift: shift
  10545. }),
  10546. _React$useReducer$ = _React$useReducer[0],
  10547. pastIds = _React$useReducer$.pastIds,
  10548. initialVirtual = _React$useReducer$.initialVirtual,
  10549. initialRTL = _React$useReducer$.initialRTL,
  10550. initialOrientation = _React$useReducer$.initialOrientation,
  10551. initialCurrentId = _React$useReducer$.initialCurrentId,
  10552. initialLoop = _React$useReducer$.initialLoop,
  10553. initialWrap = _React$useReducer$.initialWrap,
  10554. initialShift = _React$useReducer$.initialShift,
  10555. hasSetCurrentId = _React$useReducer$.hasSetCurrentId,
  10556. state = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]),
  10557. dispatch = _React$useReducer[1];
  10558. var _React$useState = Object(external_React_["useState"])(false),
  10559. hasActiveWidget = _React$useState[0],
  10560. setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We
  10561. // store the unmounted state here so we don't update the state if it's true.
  10562. // This only happens in a very specific situation.
  10563. // See https://github.com/reakit/reakit/issues/650
  10564. var isUnmountedRef = useIsUnmountedRef();
  10565. var setItems = Object(external_React_["useCallback"])(function (items) {
  10566. return dispatch({
  10567. type: "setItems",
  10568. items: items
  10569. });
  10570. }, []);
  10571. useSortBasedOnDOMPosition(state.items, setItems);
  10572. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, idState), state), {}, {
  10573. unstable_hasActiveWidget: hasActiveWidget,
  10574. unstable_setHasActiveWidget: setHasActiveWidget,
  10575. registerItem: useAction(function (item) {
  10576. if (isUnmountedRef.current) return;
  10577. dispatch({
  10578. type: "registerItem",
  10579. item: item
  10580. });
  10581. }),
  10582. unregisterItem: useAction(function (id) {
  10583. if (isUnmountedRef.current) return;
  10584. dispatch({
  10585. type: "unregisterItem",
  10586. id: id
  10587. });
  10588. }),
  10589. registerGroup: useAction(function (group) {
  10590. if (isUnmountedRef.current) return;
  10591. dispatch({
  10592. type: "registerGroup",
  10593. group: group
  10594. });
  10595. }),
  10596. unregisterGroup: useAction(function (id) {
  10597. if (isUnmountedRef.current) return;
  10598. dispatch({
  10599. type: "unregisterGroup",
  10600. id: id
  10601. });
  10602. }),
  10603. move: useAction(function (id) {
  10604. return dispatch({
  10605. type: "move",
  10606. id: id
  10607. });
  10608. }),
  10609. next: useAction(function (allTheWay) {
  10610. return dispatch({
  10611. type: "next",
  10612. allTheWay: allTheWay
  10613. });
  10614. }),
  10615. previous: useAction(function (allTheWay) {
  10616. return dispatch({
  10617. type: "previous",
  10618. allTheWay: allTheWay
  10619. });
  10620. }),
  10621. up: useAction(function (allTheWay) {
  10622. return dispatch({
  10623. type: "up",
  10624. allTheWay: allTheWay
  10625. });
  10626. }),
  10627. down: useAction(function (allTheWay) {
  10628. return dispatch({
  10629. type: "down",
  10630. allTheWay: allTheWay
  10631. });
  10632. }),
  10633. first: useAction(function () {
  10634. return dispatch({
  10635. type: "first"
  10636. });
  10637. }),
  10638. last: useAction(function () {
  10639. return dispatch({
  10640. type: "last"
  10641. });
  10642. }),
  10643. sort: useAction(function () {
  10644. return dispatch({
  10645. type: "sort"
  10646. });
  10647. }),
  10648. unstable_setVirtual: useAction(function (value) {
  10649. return dispatch({
  10650. type: "setVirtual",
  10651. virtual: value
  10652. });
  10653. }),
  10654. setRTL: useAction(function (value) {
  10655. return dispatch({
  10656. type: "setRTL",
  10657. rtl: value
  10658. });
  10659. }),
  10660. setOrientation: useAction(function (value) {
  10661. return dispatch({
  10662. type: "setOrientation",
  10663. orientation: value
  10664. });
  10665. }),
  10666. setCurrentId: useAction(function (value) {
  10667. return dispatch({
  10668. type: "setCurrentId",
  10669. currentId: value
  10670. });
  10671. }),
  10672. setLoop: useAction(function (value) {
  10673. return dispatch({
  10674. type: "setLoop",
  10675. loop: value
  10676. });
  10677. }),
  10678. setWrap: useAction(function (value) {
  10679. return dispatch({
  10680. type: "setWrap",
  10681. wrap: value
  10682. });
  10683. }),
  10684. setShift: useAction(function (value) {
  10685. return dispatch({
  10686. type: "setShift",
  10687. shift: value
  10688. });
  10689. }),
  10690. unstable_setIncludesBaseElement: useAction(function (value) {
  10691. return dispatch({
  10692. type: "setIncludesBaseElement",
  10693. includesBaseElement: value
  10694. });
  10695. }),
  10696. reset: useAction(function () {
  10697. return dispatch({
  10698. type: "reset"
  10699. });
  10700. })
  10701. });
  10702. }
  10703. // EXTERNAL MODULE: ./node_modules/reakit-system/es/createComponent.js + 3 modules
  10704. var createComponent = __webpack_require__("hE48");
  10705. // EXTERNAL MODULE: ./node_modules/reakit-system/es/createHook.js + 4 modules
  10706. var createHook = __webpack_require__("qdes");
  10707. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useForkRef.js
  10708. var useForkRef = __webpack_require__("aU41");
  10709. // EXTERNAL MODULE: ./node_modules/reakit-warning/es/index.js + 1 modules
  10710. var es = __webpack_require__("KA1K");
  10711. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useLiveRef.js
  10712. var useLiveRef = __webpack_require__("eNtd");
  10713. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js
  10714. var isSelfTarget = __webpack_require__("k2cL");
  10715. // EXTERNAL MODULE: ./node_modules/reakit/es/Role/Role.js
  10716. var Role = __webpack_require__("zGFp");
  10717. // EXTERNAL MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js
  10718. var Tabbable = __webpack_require__("G3V0");
  10719. // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js
  10720. var useCreateElement = __webpack_require__("IVEb");
  10721. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js
  10722. var es_rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("I/A+");
  10723. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/createEvent.js
  10724. var createEvent = __webpack_require__("khzz");
  10725. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireBlurEvent.js
  10726. function createFocusEvent(element, type, eventInit) {
  10727. if (eventInit === void 0) {
  10728. eventInit = {};
  10729. }
  10730. if (typeof FocusEvent === "function") {
  10731. return new FocusEvent(type, eventInit);
  10732. }
  10733. return Object(createEvent["a" /* createEvent */])(element, type, eventInit);
  10734. }
  10735. /**
  10736. * Creates and dispatches a blur event in a way that also works on IE 11.
  10737. *
  10738. * @example
  10739. * import { fireBlurEvent } from "reakit-utils";
  10740. *
  10741. * fireBlurEvent(document.getElementById("id"));
  10742. */
  10743. function fireBlurEvent(element, eventInit) {
  10744. var event = createFocusEvent(element, "blur", eventInit);
  10745. var defaultAllowed = element.dispatchEvent(event);
  10746. var bubbleInit = Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, eventInit), {}, {
  10747. bubbles: true
  10748. });
  10749. element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit));
  10750. return defaultAllowed;
  10751. }
  10752. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getWindow.js
  10753. var getWindow = __webpack_require__("SyVe");
  10754. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js
  10755. function createKeyboardEvent(element, type, eventInit) {
  10756. if (eventInit === void 0) {
  10757. eventInit = {};
  10758. }
  10759. if (typeof KeyboardEvent === "function") {
  10760. return new KeyboardEvent(type, eventInit);
  10761. } // IE 11 doesn't support Event constructors
  10762. var event = Object(getDocument["a" /* getDocument */])(element).createEvent("KeyboardEvent");
  10763. event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, Object(getWindow["a" /* getWindow */])(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey);
  10764. return event;
  10765. }
  10766. /**
  10767. * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11.
  10768. *
  10769. * @example
  10770. * import { fireKeyboardEvent } from "reakit-utils";
  10771. *
  10772. * fireKeyboardEvent(document.getElementById("id"), "keydown", {
  10773. * key: "ArrowDown",
  10774. * shiftKey: true,
  10775. * });
  10776. */
  10777. function fireKeyboardEvent(element, type, eventInit) {
  10778. return element.dispatchEvent(createKeyboardEvent(element, type, eventInit));
  10779. }
  10780. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/canUseDOM.js
  10781. var canUseDOM = __webpack_require__("+ipW");
  10782. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
  10783. var getActiveElement = __webpack_require__("Nym8");
  10784. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js
  10785. var isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
  10786. /**
  10787. * Cross-browser method that returns the next active element (the element that
  10788. * is receiving focus) after a blur event is dispatched. It receives the blur
  10789. * event object as the argument.
  10790. *
  10791. * @example
  10792. * import { getNextActiveElementOnBlur } from "reakit-utils";
  10793. *
  10794. * const element = document.getElementById("id");
  10795. * element.addEventListener("blur", (event) => {
  10796. * const nextActiveElement = getNextActiveElementOnBlur(event);
  10797. * });
  10798. */
  10799. function getNextActiveElementOnBlur(event) {
  10800. // IE 11 doesn't support event.relatedTarget on blur.
  10801. // document.activeElement points the the next active element.
  10802. // On modern browsers, document.activeElement points to the current target.
  10803. if (isIE11) {
  10804. var activeElement = Object(getActiveElement["a" /* getActiveElement */])(event.currentTarget);
  10805. return activeElement;
  10806. }
  10807. return event.relatedTarget;
  10808. }
  10809. // EXTERNAL MODULE: ./node_modules/reakit/es/__keys-6742f591.js
  10810. var _keys_6742f591 = __webpack_require__("TFuP");
  10811. // EXTERNAL MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js
  10812. var userFocus_e16425e3 = __webpack_require__("Mih7");
  10813. // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js
  10814. var Composite_isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
  10815. function canProxyKeyboardEvent(event) {
  10816. if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return false;
  10817. if (event.metaKey) return false;
  10818. if (event.key === "Tab") return false;
  10819. return true;
  10820. }
  10821. function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) {
  10822. var eventHandlerRef = Object(useLiveRef["a" /* useLiveRef */])(htmlEventHandler);
  10823. return Object(external_React_["useCallback"])(function (event) {
  10824. var _eventHandlerRef$curr;
  10825. (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event);
  10826. if (event.defaultPrevented) return;
  10827. if (virtual && canProxyKeyboardEvent(event)) {
  10828. var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current;
  10829. if (currentElement) {
  10830. if (!fireKeyboardEvent(currentElement, event.type, event)) {
  10831. event.preventDefault();
  10832. } // The event will be triggered on the composite item and then
  10833. // propagated up to this composite element again, so we can pretend
  10834. // that it wasn't called on this component in the first place.
  10835. if (event.currentTarget.contains(currentElement)) {
  10836. event.stopPropagation();
  10837. }
  10838. }
  10839. }
  10840. }, [virtual, currentItem]);
  10841. } // istanbul ignore next
  10842. function useActiveElementRef(elementRef) {
  10843. var activeElementRef = Object(external_React_["useRef"])(null);
  10844. Object(external_React_["useEffect"])(function () {
  10845. var document = Object(getDocument["a" /* getDocument */])(elementRef.current);
  10846. var onFocus = function onFocus(event) {
  10847. var target = event.target;
  10848. activeElementRef.current = target;
  10849. };
  10850. document.addEventListener("focus", onFocus, true);
  10851. return function () {
  10852. document.removeEventListener("focus", onFocus, true);
  10853. };
  10854. }, []);
  10855. return activeElementRef;
  10856. }
  10857. function findFirstEnabledItemInTheLastRow(items) {
  10858. return Object(getCurrentId_5aa9849e["a" /* f */])(flatten(reverse(groupItems(items))));
  10859. }
  10860. function isItem(items, element) {
  10861. return items === null || items === void 0 ? void 0 : items.some(function (item) {
  10862. return !!element && item.ref.current === element;
  10863. });
  10864. }
  10865. function useScheduleUserFocus(currentItem) {
  10866. var currentItemRef = Object(useLiveRef["a" /* useLiveRef */])(currentItem);
  10867. var _React$useReducer = Object(external_React_["useReducer"])(function (n) {
  10868. return n + 1;
  10869. }, 0),
  10870. scheduled = _React$useReducer[0],
  10871. schedule = _React$useReducer[1];
  10872. Object(external_React_["useEffect"])(function () {
  10873. var _currentItemRef$curre;
  10874. var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current;
  10875. if (scheduled && currentElement) {
  10876. Object(userFocus_e16425e3["c" /* u */])(currentElement);
  10877. }
  10878. }, [scheduled]);
  10879. return schedule;
  10880. }
  10881. var useComposite = Object(createHook["a" /* createHook */])({
  10882. name: "Composite",
  10883. compose: [Tabbable["a" /* useTabbable */]],
  10884. keys: _keys_6742f591["a" /* C */],
  10885. useOptions: function useOptions(options) {
  10886. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, options), {}, {
  10887. currentId: Object(getCurrentId_5aa9849e["b" /* g */])(options)
  10888. });
  10889. },
  10890. useProps: function useProps(options, _ref) {
  10891. var htmlRef = _ref.ref,
  10892. htmlOnFocusCapture = _ref.onFocusCapture,
  10893. htmlOnFocus = _ref.onFocus,
  10894. htmlOnBlurCapture = _ref.onBlurCapture,
  10895. htmlOnKeyDown = _ref.onKeyDown,
  10896. htmlOnKeyDownCapture = _ref.onKeyDownCapture,
  10897. htmlOnKeyUpCapture = _ref.onKeyUpCapture,
  10898. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]);
  10899. var ref = Object(external_React_["useRef"])(null);
  10900. var currentItem = findEnabledItemById(options.items, options.currentId);
  10901. var previousElementRef = Object(external_React_["useRef"])(null);
  10902. var onFocusCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocusCapture);
  10903. var onFocusRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocus);
  10904. var onBlurCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnBlurCapture);
  10905. var onKeyDownRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnKeyDown);
  10906. var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element
  10907. // ref instead.
  10908. var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined;
  10909. Object(external_React_["useEffect"])(function () {
  10910. var element = ref.current;
  10911. if (options.unstable_moves && !currentItem) {
  10912. false ? undefined : void 0; // If composite.move(null) has been called, the composite container
  10913. // will receive focus.
  10914. element === null || element === void 0 ? void 0 : element.focus();
  10915. }
  10916. }, [options.unstable_moves, currentItem]);
  10917. var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture);
  10918. var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture);
  10919. var onFocusCapture = Object(external_React_["useCallback"])(function (event) {
  10920. var _onFocusCaptureRef$cu;
  10921. (_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event);
  10922. if (event.defaultPrevented) return;
  10923. if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active
  10924. // element ref instead.
  10925. var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget;
  10926. var previousActiveElementWasItem = isItem(options.items, previousActiveElement);
  10927. if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && previousActiveElementWasItem) {
  10928. // Composite has been focused as a result of an item receiving focus.
  10929. // The composite item will move focus back to the composite
  10930. // container. In this case, we don't want to propagate this
  10931. // additional event nor call the onFocus handler passed to
  10932. // <Composite onFocus={...} />.
  10933. event.stopPropagation(); // We keep track of the previous active item element so we can
  10934. // manually fire a blur event on it later when the focus is moved to
  10935. // another item on the onBlurCapture event below.
  10936. previousElementRef.current = previousActiveElement;
  10937. }
  10938. }, [options.unstable_virtual, options.items]);
  10939. var onFocus = Object(external_React_["useCallback"])(function (event) {
  10940. var _onFocusRef$current;
  10941. (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event);
  10942. if (event.defaultPrevented) return;
  10943. if (options.unstable_virtual) {
  10944. if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
  10945. // This means that the composite element has been focused while the
  10946. // composite item has not. For example, by clicking on the
  10947. // composite element without touching any item, or by tabbing into
  10948. // the composite element. In this case, we want to trigger focus on
  10949. // the item, just like it would happen with roving tabindex.
  10950. // When it receives focus, the composite item will put focus back
  10951. // on the composite element, in which case hasItemWithFocus will be
  10952. // true.
  10953. scheduleUserFocus();
  10954. }
  10955. } else if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
  10956. var _options$setCurrentId;
  10957. // When the roving tabindex composite gets intentionally focused (for
  10958. // example, by clicking directly on it, and not on an item), we make
  10959. // sure to set the current id to null (which means the composite
  10960. // itself is focused).
  10961. (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null);
  10962. }
  10963. }, [options.unstable_virtual, options.setCurrentId]);
  10964. var onBlurCapture = Object(external_React_["useCallback"])(function (event) {
  10965. var _onBlurCaptureRef$cur;
  10966. (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event);
  10967. if (event.defaultPrevented) return;
  10968. if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite
  10969. // container (this component) to the composite item that is being
  10970. // selected. Then we move focus back to the composite container. This
  10971. // is so we can provide the same API as the roving tabindex method,
  10972. // which means people can attach onFocus/onBlur handlers on the
  10973. // CompositeItem component regardless of whether it's virtual or not.
  10974. // This sequence of blurring and focusing items and composite may be
  10975. // confusing, so we ignore intermediate focus and blurs by stopping its
  10976. // propagation and not calling the passed onBlur handler (htmlOnBlur).
  10977. var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null;
  10978. var nextActiveElement = getNextActiveElementOnBlur(event);
  10979. var nextActiveElementIsItem = isItem(options.items, nextActiveElement);
  10980. if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && nextActiveElementIsItem) {
  10981. // This is an intermediate blur event: blurring the composite
  10982. // container to focus an item (nextActiveElement).
  10983. if (nextActiveElement === currentElement) {
  10984. // The next active element will be the same as the current item in
  10985. // the state in two scenarios:
  10986. // - Moving focus with keyboard: the state is updated before the
  10987. // blur event is triggered, so here the current item is already
  10988. // pointing to the next active element.
  10989. // - Clicking on the current active item with a pointer: this
  10990. // will trigger blur on the composite element and then the next
  10991. // active element will be the same as the current item. Clicking on
  10992. // an item other than the current one doesn't end up here as the
  10993. // currentItem state will be updated only after it.
  10994. if (previousElementRef.current && previousElementRef.current !== nextActiveElement) {
  10995. // If there's a previous active item and it's not a click action,
  10996. // then we fire a blur event on it so it will work just like if
  10997. // it had DOM focus before (like when using roving tabindex).
  10998. fireBlurEvent(previousElementRef.current, event);
  10999. }
  11000. } else if (currentElement) {
  11001. // This will be true when the next active element is not the
  11002. // current element, but there's a current item. This will only
  11003. // happen when clicking with a pointer on a different item, when
  11004. // there's already an item selected, in which case currentElement
  11005. // is the item that is getting blurred, and nextActiveElement is
  11006. // the item that is being clicked.
  11007. fireBlurEvent(currentElement, event);
  11008. } // We want to ignore intermediate blur events, so we stop its
  11009. // propagation and return early so onFocus will not be called.
  11010. event.stopPropagation();
  11011. } else {
  11012. var targetIsItem = isItem(options.items, event.target);
  11013. if (!targetIsItem && currentElement) {
  11014. // If target is not a composite item, it may be the composite
  11015. // element itself (isSelfTarget) or a tabbable element inside the
  11016. // composite widget. This may be triggered by clicking outside the
  11017. // composite widget or by tabbing out of it. In either cases we
  11018. // want to fire a blur event on the current item.
  11019. fireBlurEvent(currentElement, event);
  11020. }
  11021. }
  11022. }, [options.unstable_virtual, options.items, currentItem]);
  11023. var onKeyDown = Object(external_React_["useCallback"])(function (event) {
  11024. var _onKeyDownRef$current, _options$groups;
  11025. (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
  11026. if (event.defaultPrevented) return;
  11027. if (options.currentId !== null) return;
  11028. if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return;
  11029. var isVertical = options.orientation !== "horizontal";
  11030. var isHorizontal = options.orientation !== "vertical";
  11031. var isGrid = !!((_options$groups = options.groups) !== null && _options$groups !== void 0 && _options$groups.length);
  11032. var up = function up() {
  11033. if (isGrid) {
  11034. var item = findFirstEnabledItemInTheLastRow(options.items);
  11035. if (item !== null && item !== void 0 && item.id) {
  11036. var _options$move;
  11037. (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id);
  11038. }
  11039. } else {
  11040. var _options$last;
  11041. (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options);
  11042. }
  11043. };
  11044. var keyMap = {
  11045. ArrowUp: (isGrid || isVertical) && up,
  11046. ArrowRight: (isGrid || isHorizontal) && options.first,
  11047. ArrowDown: (isGrid || isVertical) && options.first,
  11048. ArrowLeft: (isGrid || isHorizontal) && options.last,
  11049. Home: options.first,
  11050. End: options.last,
  11051. PageUp: options.first,
  11052. PageDown: options.last
  11053. };
  11054. var action = keyMap[event.key];
  11055. if (action) {
  11056. event.preventDefault();
  11057. action();
  11058. }
  11059. }, [options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]);
  11060. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  11061. ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef),
  11062. id: options.baseId,
  11063. onFocus: onFocus,
  11064. onFocusCapture: onFocusCapture,
  11065. onBlurCapture: onBlurCapture,
  11066. onKeyDownCapture: onKeyDownCapture,
  11067. onKeyDown: onKeyDown,
  11068. onKeyUpCapture: onKeyUpCapture,
  11069. "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined
  11070. }, htmlProps);
  11071. },
  11072. useComposeProps: function useComposeProps(options, htmlProps) {
  11073. htmlProps = Object(Role["a" /* useRole */])(options, htmlProps, true);
  11074. var tabbableHTMLProps = Object(Tabbable["a" /* useTabbable */])(options, htmlProps, true);
  11075. if (options.unstable_virtual || options.currentId === null) {
  11076. // Composite will only be tabbable by default if the focus is managed
  11077. // using aria-activedescendant, which requires DOM focus on the container
  11078. // element (the composite)
  11079. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  11080. tabIndex: 0
  11081. }, tabbableHTMLProps);
  11082. }
  11083. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, htmlProps), {}, {
  11084. ref: tabbableHTMLProps.ref
  11085. });
  11086. }
  11087. });
  11088. var Composite = Object(createComponent["a" /* createComponent */])({
  11089. as: "div",
  11090. useHook: useComposite,
  11091. useCreateElement: function useCreateElement$1(type, props, children) {
  11092. false ? undefined : void 0;
  11093. return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
  11094. }
  11095. });
  11096. // EXTERNAL MODULE: ./node_modules/reakit/es/Id/Id.js
  11097. var Id = __webpack_require__("ym77");
  11098. // CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js
  11099. // Automatically generated
  11100. var GROUP_KEYS = [];
  11101. var useGroup = Object(createHook["a" /* createHook */])({
  11102. name: "Group",
  11103. compose: Role["a" /* useRole */],
  11104. keys: GROUP_KEYS,
  11105. useProps: function useProps(_, htmlProps) {
  11106. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  11107. role: "group"
  11108. }, htmlProps);
  11109. }
  11110. });
  11111. var Group = Object(createComponent["a" /* createComponent */])({
  11112. as: "div",
  11113. useHook: useGroup
  11114. });
  11115. // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js
  11116. var useCompositeGroup = Object(createHook["a" /* createHook */])({
  11117. name: "CompositeGroup",
  11118. compose: [useGroup, Id["a" /* unstable_useId */]],
  11119. keys: _keys_6742f591["b" /* a */],
  11120. propsAreEqual: function propsAreEqual(prev, next) {
  11121. if (!next.id || prev.id !== next.id) {
  11122. return useGroup.unstable_propsAreEqual(prev, next);
  11123. }
  11124. var prevCurrentId = prev.currentId,
  11125. prevMoves = prev.unstable_moves,
  11126. prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(prev, ["currentId", "unstable_moves"]);
  11127. var nextCurrentId = next.currentId,
  11128. nextMoves = next.unstable_moves,
  11129. nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(next, ["currentId", "unstable_moves"]);
  11130. if (prev.items && next.items) {
  11131. var prevCurrentItem = findEnabledItemById(prev.items, prevCurrentId);
  11132. var nextCurrentItem = findEnabledItemById(next.items, nextCurrentId);
  11133. var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId;
  11134. var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId;
  11135. if (next.id === nextGroupId || next.id === prevGroupId) {
  11136. return false;
  11137. }
  11138. }
  11139. return useGroup.unstable_propsAreEqual(prevProps, nextProps);
  11140. },
  11141. useProps: function useProps(options, _ref) {
  11142. var htmlRef = _ref.ref,
  11143. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref"]);
  11144. var ref = Object(external_React_["useRef"])(null);
  11145. var id = options.id; // We need this to be called before CompositeItems' register
  11146. Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () {
  11147. var _options$registerGrou;
  11148. if (!id) return undefined;
  11149. (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, {
  11150. id: id,
  11151. ref: ref
  11152. });
  11153. return function () {
  11154. var _options$unregisterGr;
  11155. (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id);
  11156. };
  11157. }, [id, options.registerGroup, options.unregisterGroup]);
  11158. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  11159. ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef)
  11160. }, htmlProps);
  11161. }
  11162. });
  11163. var CompositeGroup = Object(createComponent["a" /* createComponent */])({
  11164. as: "div",
  11165. useHook: useCompositeGroup
  11166. });
  11167. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js
  11168. function alignment_matrix_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  11169. /**
  11170. * Internal dependencies
  11171. */
  11172. const alignment_matrix_control_icon_styles_rootSize = () => {
  11173. const padding = 1.5;
  11174. const size = 24;
  11175. return /*#__PURE__*/css_browser_esm({
  11176. gridTemplateRows: `repeat( 3, calc( ${size - padding * 2}px / 3))`,
  11177. padding,
  11178. maxHeight: size,
  11179. maxWidth: size
  11180. }, true ? "" : undefined);
  11181. };
  11182. const rootPointerEvents = ({
  11183. disablePointerEvents
  11184. }) => {
  11185. return /*#__PURE__*/css_browser_esm({
  11186. pointerEvents: disablePointerEvents ? 'none' : null
  11187. }, true ? "" : undefined);
  11188. };
  11189. const alignment_matrix_control_icon_styles_Wrapper = styled_base_browser_esm("div", {
  11190. target: "elqsdmc0",
  11191. label: "Wrapper"
  11192. })( true ? {
  11193. name: "co61ta",
  11194. styles: "box-sizing:border-box;padding:2px;"
  11195. } : undefined);
  11196. const alignment_matrix_control_icon_styles_Root = styled_base_browser_esm("div", {
  11197. target: "elqsdmc1",
  11198. label: "Root"
  11199. })("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", rootPointerEvents, ";" + ( true ? "" : undefined));
  11200. const alignment_matrix_control_icon_styles_pointActive = ({
  11201. isActive
  11202. }) => {
  11203. const boxShadow = isActive ? `0 0 0 1px currentColor` : null;
  11204. return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:currentColor;*:hover > &{color:currentColor;}" + ( true ? "" : undefined));
  11205. };
  11206. const alignment_matrix_control_icon_styles_Point = styled_base_browser_esm("span", {
  11207. target: "elqsdmc2",
  11208. label: "Point"
  11209. })("height:2px;width:2px;", pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : undefined));
  11210. const alignment_matrix_control_icon_styles_Cell = Cell;
  11211. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js
  11212. /**
  11213. * External dependencies
  11214. */
  11215. /**
  11216. * Internal dependencies
  11217. */
  11218. const BASE_SIZE = 24;
  11219. function AlignmentMatrixControlIcon({
  11220. className,
  11221. disablePointerEvents = true,
  11222. size = BASE_SIZE,
  11223. style = {},
  11224. value = 'center',
  11225. ...props
  11226. }) {
  11227. const alignIndex = getAlignmentIndex(value);
  11228. const scale = (size / BASE_SIZE).toFixed(2);
  11229. const classes = classnames_default()('component-alignment-matrix-control-icon', className);
  11230. const styles = { ...style,
  11231. transform: `scale(${scale})`
  11232. };
  11233. return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Root, Object(esm_extends["a" /* default */])({}, props, {
  11234. className: classes,
  11235. disablePointerEvents: disablePointerEvents,
  11236. role: "presentation",
  11237. size: size,
  11238. style: styles
  11239. }), ALIGNMENTS.map((align, index) => {
  11240. const isActive = alignIndex === index;
  11241. return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Cell, {
  11242. key: align
  11243. }, Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Point, {
  11244. isActive: isActive
  11245. }));
  11246. }));
  11247. }
  11248. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js
  11249. /**
  11250. * External dependencies
  11251. */
  11252. /**
  11253. * WordPress dependencies
  11254. */
  11255. /**
  11256. * Internal dependencies
  11257. */
  11258. function useBaseId(id) {
  11259. const instanceId = Object(external_wp_compose_["useInstanceId"])(AlignmentMatrixControl, 'alignment-matrix-control');
  11260. return id || instanceId;
  11261. }
  11262. function AlignmentMatrixControl({
  11263. className,
  11264. id,
  11265. label = Object(external_wp_i18n_["__"])('Alignment Matrix Control'),
  11266. defaultValue = 'center center',
  11267. value,
  11268. onChange = external_lodash_["noop"],
  11269. width = 92,
  11270. ...props
  11271. }) {
  11272. const [immutableDefaultValue] = Object(external_wp_element_["useState"])(value !== null && value !== void 0 ? value : defaultValue);
  11273. const baseId = useBaseId(id);
  11274. const initialCurrentId = utils_getItemId(baseId, immutableDefaultValue);
  11275. const composite = useCompositeState({
  11276. baseId,
  11277. currentId: initialCurrentId,
  11278. rtl: Object(external_wp_i18n_["isRTL"])()
  11279. });
  11280. const handleOnChange = nextValue => {
  11281. onChange(nextValue);
  11282. };
  11283. Object(external_wp_element_["useEffect"])(() => {
  11284. if (typeof value !== 'undefined') {
  11285. composite.setCurrentId(utils_getItemId(baseId, value));
  11286. }
  11287. }, [value, composite.setCurrentId]);
  11288. const classes = classnames_default()('component-alignment-matrix-control', className);
  11289. return Object(external_wp_element_["createElement"])(Composite, Object(esm_extends["a" /* default */])({}, props, composite, {
  11290. "aria-label": label,
  11291. as: Root,
  11292. className: classes,
  11293. role: "grid",
  11294. width: width
  11295. }), GRID.map((cells, index) => Object(external_wp_element_["createElement"])(CompositeGroup, Object(esm_extends["a" /* default */])({}, composite, {
  11296. as: Row,
  11297. role: "row",
  11298. key: index
  11299. }), cells.map(cell => {
  11300. const cellId = utils_getItemId(baseId, cell);
  11301. const isActive = composite.currentId === cellId;
  11302. return Object(external_wp_element_["createElement"])(cell_Cell, Object(esm_extends["a" /* default */])({}, composite, {
  11303. id: cellId,
  11304. isActive: isActive,
  11305. key: cell,
  11306. value: cell,
  11307. onFocus: () => handleOnChange(cell),
  11308. tabIndex: isActive ? 0 : -1
  11309. }));
  11310. }))));
  11311. }
  11312. AlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;
  11313. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
  11314. var animate = __webpack_require__("L8Kx");
  11315. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-values.js
  11316. /* harmony default export */ var font_values = ({
  11317. 'default.fontFamily': "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
  11318. 'default.fontSize': '13px',
  11319. 'helpText.fontSize': '12px',
  11320. mobileTextMinFontSize: '16px'
  11321. });
  11322. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font.js
  11323. /**
  11324. * External dependencies
  11325. */
  11326. /**
  11327. * Internal dependencies
  11328. */
  11329. /**
  11330. *
  11331. * @param {keyof FONT} value Path of value from `FONT`
  11332. * @return {string} Font rule value
  11333. */
  11334. function font(value) {
  11335. return Object(external_lodash_["get"])(font_values, value, '');
  11336. }
  11337. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/space.js
  11338. const SPACE_GRID_BASE = 8;
  11339. /**
  11340. * Creates a spacing CSS value (px) based on grid system values.
  11341. *
  11342. * @param {number} [value=1] Multiplier against the grid base value (8)
  11343. * @return {string} The spacing value (px).
  11344. */
  11345. function space(value = 1) {
  11346. if (isNaN(value)) return `${SPACE_GRID_BASE}px`;
  11347. return `${SPACE_GRID_BASE * value}px`;
  11348. }
  11349. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js
  11350. /**
  11351. * Internal dependencies
  11352. */
  11353. const base_control_styles_Wrapper = styled_base_browser_esm("div", {
  11354. target: "e1puf3u0",
  11355. label: "Wrapper"
  11356. })("font-family:", font('default.fontFamily'), ";font-size:", font('default.fontSize'), ";" + ( true ? "" : undefined));
  11357. const StyledField = styled_base_browser_esm("div", {
  11358. target: "e1puf3u1",
  11359. label: "StyledField"
  11360. })("margin-bottom:", space(1), ";.components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : undefined));
  11361. const StyledLabel = styled_base_browser_esm("label", {
  11362. target: "e1puf3u2",
  11363. label: "StyledLabel"
  11364. })("display:inline-block;margin-bottom:", space(1), ";" + ( true ? "" : undefined));
  11365. const StyledHelp = styled_base_browser_esm("p", {
  11366. target: "e1puf3u3",
  11367. label: "StyledHelp"
  11368. })("font-size:", font('helpText.fontSize'), ";font-style:normal;color:", COLORS.mediumGray.text, ";" + ( true ? "" : undefined));
  11369. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/index.js
  11370. /**
  11371. * External dependencies
  11372. */
  11373. /**
  11374. * Internal dependencies
  11375. */
  11376. /**
  11377. * @typedef Props
  11378. * @property {string} id The id of the element to which labels and help text are being generated.
  11379. * That element should be passed as a child.
  11380. * @property {import('react').ReactNode} help If this property is added, a help text will be
  11381. * generated using help property as the content.
  11382. * @property {import('react').ReactNode} label If this property is added, a label will be generated
  11383. * using label property as the content.
  11384. * @property {boolean} [hideLabelFromVision] If true, the label will only be visible to screen readers.
  11385. * @property {string} [className] The class that will be added with "components-base-control" to the
  11386. * classes of the wrapper div. If no className is passed only
  11387. * components-base-control is used.
  11388. * @property {import('react').ReactNode} [children] The content to be displayed within
  11389. * the BaseControl.
  11390. */
  11391. /**
  11392. * @param {Props} props
  11393. * @return {JSX.Element} Element
  11394. */
  11395. function BaseControl({
  11396. id,
  11397. label,
  11398. hideLabelFromVision,
  11399. help,
  11400. className,
  11401. children
  11402. }) {
  11403. return Object(external_wp_element_["createElement"])(base_control_styles_Wrapper, {
  11404. className: classnames_default()('components-base-control', className)
  11405. }, Object(external_wp_element_["createElement"])(StyledField, {
  11406. className: "components-base-control__field"
  11407. }, label && id && (hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  11408. as: "label",
  11409. htmlFor: id
  11410. }, label) : Object(external_wp_element_["createElement"])(StyledLabel, {
  11411. className: "components-base-control__label",
  11412. htmlFor: id
  11413. }, label)), label && !id && (hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  11414. as: "label"
  11415. }, label) : Object(external_wp_element_["createElement"])(BaseControl.VisualLabel, null, label)), children), !!help && Object(external_wp_element_["createElement"])(StyledHelp, {
  11416. id: id + '__help',
  11417. className: "components-base-control__help"
  11418. }, help));
  11419. }
  11420. /**
  11421. * @typedef VisualLabelProps
  11422. * @property {string} [className] Class name
  11423. * @property {import('react').ReactNode} [children] Children
  11424. */
  11425. /**
  11426. * @param {VisualLabelProps} Props
  11427. * @return {JSX.Element} Element
  11428. */
  11429. BaseControl.VisualLabel = ({
  11430. className,
  11431. children
  11432. }) => {
  11433. className = classnames_default()('components-base-control__label', className);
  11434. return Object(external_wp_element_["createElement"])("span", {
  11435. className: className
  11436. }, children);
  11437. };
  11438. /* harmony default export */ var base_control = (BaseControl);
  11439. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-connect.js
  11440. var context_connect = __webpack_require__("7Jlx");
  11441. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/view/component.js
  11442. /**
  11443. * `View` is a core component that renders everything in the library.
  11444. * It is the principle component in the entire library.
  11445. *
  11446. * @example
  11447. * ```jsx
  11448. * import { View } from `@wordpress/components`;
  11449. *
  11450. * function Example() {
  11451. * return (
  11452. * <View>
  11453. * Code is Poetry
  11454. * </View>
  11455. * );
  11456. * }
  11457. * ```
  11458. */
  11459. const View = styled_base_browser_esm("div", {
  11460. target: "em57xhy0",
  11461. label: "View"
  11462. })( true ? "" : undefined);
  11463. View.displayName = 'View';
  11464. /* harmony default export */ var component = (View);
  11465. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/create-component.js
  11466. /**
  11467. * External dependencies
  11468. */
  11469. // eslint-disable-next-line no-restricted-imports
  11470. /**
  11471. * Internal dependencies
  11472. */
  11473. // eslint-disable-next-line no-duplicate-imports
  11474. /**
  11475. * Factory that creates a React component from a hook
  11476. *
  11477. * @param options
  11478. * @param options.as The element to render for the component.
  11479. * @param options.name The name of the component.
  11480. * @param options.useHook The hook to use for the component
  11481. * @param options.memo Whether to memo the component.
  11482. * @return A polymorphic component that uses the hook to process props.
  11483. */
  11484. const create_component_createComponent = ({
  11485. as,
  11486. name,
  11487. useHook,
  11488. memo = false
  11489. }) => {
  11490. function Component(props, forwardedRef) {
  11491. const otherProps = useHook(props);
  11492. return Object(external_wp_element_["createElement"])(component, Object(esm_extends["a" /* default */])({
  11493. as: as || 'div'
  11494. }, otherProps, {
  11495. ref: forwardedRef
  11496. }));
  11497. }
  11498. Component.displayName = name;
  11499. return Object(context_connect["a" /* contextConnect */])(Component, name, {
  11500. memo
  11501. });
  11502. };
  11503. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/use-context-system.js
  11504. var use_context_system = __webpack_require__("C6yU");
  11505. // EXTERNAL MODULE: ./node_modules/emotion/dist/emotion.esm.js + 1 modules
  11506. var emotion_esm = __webpack_require__("kDDq");
  11507. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js
  11508. /**
  11509. * WordPress dependencies
  11510. */
  11511. const FlexContext = Object(external_wp_element_["createContext"])({
  11512. flexItemDisplay: undefined
  11513. });
  11514. const useFlexContext = () => Object(external_wp_element_["useContext"])(FlexContext);
  11515. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles.js
  11516. function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  11517. const Flex = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11518. name: "142v397-Flex",
  11519. styles: "display:flex;;label:Flex;"
  11520. } : undefined);
  11521. const Item = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11522. name: "1636tkh-Item",
  11523. styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0;;label:Item;"
  11524. } : undefined);
  11525. const block = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11526. name: "jhhyjf-block",
  11527. styles: "flex:1;;label:block;"
  11528. } : undefined);
  11529. /**
  11530. * Workaround to optimize DOM rendering.
  11531. * We'll enhance alignment with naive parent flex assumptions.
  11532. *
  11533. * Trade-off:
  11534. * Far less DOM less. However, UI rendering is not as reliable.
  11535. */
  11536. /**
  11537. * Improves stability of width/height rendering.
  11538. * https://github.com/ItsJonQ/g2/pull/149
  11539. */
  11540. const ItemsColumn = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11541. name: "1u16kd2-ItemsColumn",
  11542. styles: "> *{min-height:0;};label:ItemsColumn;"
  11543. } : undefined);
  11544. const ItemsRow = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11545. name: "1yewyqa-ItemsRow",
  11546. styles: "> *{min-width:0;};label:ItemsRow;"
  11547. } : undefined);
  11548. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js
  11549. /**
  11550. * Internal dependencies
  11551. */
  11552. /**
  11553. * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexItemProps, 'div'>} props
  11554. */
  11555. function useFlexItem(props) {
  11556. const {
  11557. className,
  11558. display: displayProp,
  11559. isBlock = false,
  11560. ...otherProps
  11561. } = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexItem');
  11562. const sx = {};
  11563. const contextDisplay = useFlexContext().flexItemDisplay;
  11564. sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  11565. display: displayProp || contextDisplay
  11566. }, true ? "" : undefined);
  11567. const classes = Object(emotion_esm["b" /* cx */])(Item, sx.Base, isBlock && block, className);
  11568. return { ...otherProps,
  11569. className: classes
  11570. };
  11571. }
  11572. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js
  11573. /**
  11574. * Internal dependencies
  11575. */
  11576. /**
  11577. * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexBlockProps, 'div'>} props
  11578. */
  11579. function useFlexBlock(props) {
  11580. const otherProps = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexBlock');
  11581. const flexItemProps = useFlexItem({
  11582. isBlock: true,
  11583. ...otherProps
  11584. });
  11585. return flexItemProps;
  11586. }
  11587. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js
  11588. /**
  11589. * Internal dependencies
  11590. */
  11591. /**
  11592. * `FlexBlock` is a primitive layout component that adaptively resizes content within layout containers like `Flex`.
  11593. *
  11594. * @example
  11595. * ```jsx
  11596. * <Flex>
  11597. * <FlexBlock>...</FlexBlock>
  11598. * </Flex>
  11599. * ```
  11600. */
  11601. const FlexBlock = create_component_createComponent({
  11602. as: 'div',
  11603. useHook: useFlexBlock,
  11604. name: 'FlexBlock'
  11605. });
  11606. /* harmony default export */ var flex_block_component = (FlexBlock);
  11607. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js
  11608. /**
  11609. * Internal dependencies
  11610. */
  11611. /**
  11612. * `FlexItem` is a primitive layout component that aligns content within layout containers like `Flex`.
  11613. *
  11614. * @example
  11615. * ```jsx
  11616. * <Flex>
  11617. * <FlexItem>...</FlexItem>
  11618. * </Flex>
  11619. * ```
  11620. */
  11621. const FlexItem = create_component_createComponent({
  11622. as: 'div',
  11623. useHook: useFlexItem,
  11624. name: 'FlexItem'
  11625. });
  11626. /* harmony default export */ var flex_item_component = (FlexItem);
  11627. // EXTERNAL MODULE: external ["wp","deprecated"]
  11628. var external_wp_deprecated_ = __webpack_require__("NMb1");
  11629. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
  11630. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-responsive-value.js
  11631. /**
  11632. * WordPress dependencies
  11633. */
  11634. const breakpoints = ['40em', '52em', '64em'];
  11635. const useBreakpointIndex = (options = {}) => {
  11636. const {
  11637. defaultIndex = 0
  11638. } = options;
  11639. if (typeof defaultIndex !== 'number') {
  11640. throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
  11641. } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) {
  11642. throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
  11643. }
  11644. const [value, setValue] = Object(external_wp_element_["useState"])(defaultIndex);
  11645. Object(external_wp_element_["useEffect"])(() => {
  11646. const getIndex = () => breakpoints.filter(bp => {
  11647. return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
  11648. }).length;
  11649. const onResize = () => {
  11650. const newValue = getIndex();
  11651. if (value !== newValue) {
  11652. setValue(newValue);
  11653. }
  11654. };
  11655. onResize();
  11656. if (typeof document !== 'undefined') {
  11657. // Disable reason: We don't really care about what document we listen to, we just want to know that we're resizing.
  11658. /* eslint-disable @wordpress/no-global-event-listener */
  11659. document.addEventListener('resize', onResize);
  11660. }
  11661. return () => {
  11662. if (typeof document !== 'undefined') {
  11663. document.removeEventListener('resize', onResize);
  11664. /* eslint-enable @wordpress/no-global-event-listener */
  11665. }
  11666. };
  11667. }, [value]);
  11668. return value;
  11669. };
  11670. function useResponsiveValue(values, options = {}) {
  11671. const index = useBreakpointIndex(options); // Allow calling the function with a "normal" value without having to check on the outside.
  11672. if (!Array.isArray(values) && typeof values !== 'function') return values;
  11673. const array = values || [];
  11674. /* eslint-disable jsdoc/no-undefined-types */
  11675. return (
  11676. /** @type {T[]} */
  11677. array[
  11678. /* eslint-enable jsdoc/no-undefined-types */
  11679. index >= array.length ? array.length - 1 : index]
  11680. );
  11681. }
  11682. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/space.js
  11683. /**
  11684. * External dependencies
  11685. */
  11686. // eslint-disable-next-line no-restricted-imports
  11687. /**
  11688. * Internal dependencies
  11689. */
  11690. const GRID_BASE = '4px';
  11691. function space_space(value) {
  11692. return typeof value === 'number' ? `calc(${GRID_BASE} * ${value})` : value;
  11693. }
  11694. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/hook.js
  11695. /**
  11696. * WordPress dependencies
  11697. */
  11698. /**
  11699. * Internal dependencies
  11700. */
  11701. /**
  11702. *
  11703. * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props
  11704. * @return {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} Props with the deprecated props removed.
  11705. */
  11706. function useDeprecatedProps({
  11707. isReversed,
  11708. ...otherProps
  11709. }) {
  11710. if (typeof isReversed !== 'undefined') {
  11711. external_wp_deprecated_default()('Flex isReversed', {
  11712. alternative: 'Flex direction="row-reverse" or "column-reverse"',
  11713. since: '5.9'
  11714. });
  11715. return { ...otherProps,
  11716. direction: isReversed ? 'row-reverse' : 'row'
  11717. };
  11718. }
  11719. return otherProps;
  11720. }
  11721. /**
  11722. * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props
  11723. */
  11724. function useFlex(props) {
  11725. const {
  11726. align = 'center',
  11727. className,
  11728. direction: directionProp = 'row',
  11729. expanded = true,
  11730. gap = 2,
  11731. justify = 'space-between',
  11732. wrap = false,
  11733. ...otherProps
  11734. } = Object(use_context_system["a" /* useContextSystem */])(useDeprecatedProps(props), 'Flex');
  11735. const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];
  11736. const direction = useResponsiveValue(directionAsArray);
  11737. const isColumn = typeof direction === 'string' && !!direction.includes('column');
  11738. const isReverse = typeof direction === 'string' && direction.includes('reverse');
  11739. const classes = Object(external_wp_element_["useMemo"])(() => {
  11740. const sx = {};
  11741. sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  11742. alignItems: isColumn ? 'normal' : align,
  11743. flexDirection: direction,
  11744. flexWrap: wrap ? 'wrap' : undefined,
  11745. justifyContent: justify,
  11746. height: isColumn && expanded ? '100%' : undefined,
  11747. width: !isColumn && expanded ? '100%' : undefined,
  11748. marginBottom: wrap ? `calc(${space_space(gap)} * -1)` : undefined
  11749. }, true ? "" : undefined);
  11750. sx.Items = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  11751. /**
  11752. * Workaround to optimize DOM rendering.
  11753. * We'll enhance alignment with naive parent flex assumptions.
  11754. *
  11755. * Trade-off:
  11756. * Far less DOM less. However, UI rendering is not as reliable.
  11757. */
  11758. '> * + *:not(marquee)': {
  11759. marginTop: isColumn ? space_space(gap) : undefined,
  11760. marginRight: !isColumn && isReverse ? space_space(gap) : undefined,
  11761. marginLeft: !isColumn && !isReverse ? space_space(gap) : undefined
  11762. }
  11763. }, true ? "" : undefined);
  11764. sx.WrapItems = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  11765. '> *:not(marquee)': {
  11766. marginBottom: space_space(gap),
  11767. marginLeft: !isColumn && isReverse ? space_space(gap) : undefined,
  11768. marginRight: !isColumn && !isReverse ? space_space(gap) : undefined
  11769. },
  11770. '> *:last-child:not(marquee)': {
  11771. marginLeft: !isColumn && isReverse ? 0 : undefined,
  11772. marginRight: !isColumn && !isReverse ? 0 : undefined
  11773. }
  11774. }, true ? "" : undefined);
  11775. return Object(emotion_esm["b" /* cx */])(Flex, sx.Base, wrap ? sx.WrapItems : sx.Items, isColumn ? ItemsColumn : ItemsRow, className);
  11776. }, [align, className, direction, expanded, gap, isColumn, isReverse, justify, wrap]);
  11777. return { ...otherProps,
  11778. className: classes,
  11779. isColumn
  11780. };
  11781. }
  11782. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/component.js
  11783. /**
  11784. * Internal dependencies
  11785. */
  11786. /**
  11787. * @param {import('../../ui/context').ViewOwnProps<import('../types').FlexProps, 'div'>} props
  11788. * @param {import('react').Ref<any>} forwardedRef
  11789. */
  11790. function component_Flex(props, forwardedRef) {
  11791. const {
  11792. children,
  11793. isColumn,
  11794. ...otherProps
  11795. } = useFlex(props);
  11796. return Object(external_wp_element_["createElement"])(FlexContext.Provider, {
  11797. value: {
  11798. flexItemDisplay: isColumn ? 'block' : undefined
  11799. }
  11800. }, Object(external_wp_element_["createElement"])(component, Object(esm_extends["a" /* default */])({}, otherProps, {
  11801. ref: forwardedRef
  11802. }), children));
  11803. }
  11804. /**
  11805. * `Flex` is a primitive layout component that adaptively aligns child content
  11806. * horizontally or vertically. `Flex` powers components like `HStack` and
  11807. * `VStack`.
  11808. *
  11809. * `Flex` is used with any of it's two sub-components, `FlexItem` and `FlexBlock`.
  11810. *
  11811. * @example
  11812. * ```jsx
  11813. * import {
  11814. * __experimentalFlex as Flex,
  11815. * __experimentalFlexBlock as FlexBlock,
  11816. * __experimentalFlexItem as FlexItem,
  11817. * __experimentalText as Text
  11818. * } from `@wordpress/components`;
  11819. *
  11820. * function Example() {
  11821. * return (
  11822. * <Flex>
  11823. * <FlexItem>
  11824. * <Text>Code</Text>
  11825. * </FlexItem>
  11826. * <FlexBlock>
  11827. * <Text>Poetry</Text>
  11828. * </FlexBlock>
  11829. * </Flex>
  11830. * );
  11831. * }
  11832. * ```
  11833. *
  11834. */
  11835. const ConnectedFlex = Object(context_connect["a" /* contextConnect */])(component_Flex, 'Flex');
  11836. /* harmony default export */ var flex_component = (ConnectedFlex);
  11837. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/styles.js
  11838. function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  11839. const Truncate = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  11840. name: "w4wjp3-Truncate",
  11841. styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;;label:Truncate;"
  11842. } : undefined);
  11843. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/utils.js
  11844. /**
  11845. * External dependencies
  11846. */
  11847. const TRUNCATE_ELLIPSIS = '…';
  11848. const TRUNCATE_TYPE = {
  11849. auto: 'auto',
  11850. head: 'head',
  11851. middle: 'middle',
  11852. tail: 'tail',
  11853. none: 'none'
  11854. };
  11855. const TRUNCATE_DEFAULT_PROPS = {
  11856. ellipsis: TRUNCATE_ELLIPSIS,
  11857. ellipsizeMode: TRUNCATE_TYPE.auto,
  11858. limit: 0,
  11859. numberOfLines: 0
  11860. }; // Source
  11861. // https://github.com/kahwee/truncate-middle
  11862. /**
  11863. * @param {string} word
  11864. * @param {number} headLength
  11865. * @param {number} tailLength
  11866. * @param {string} ellipsis
  11867. */
  11868. function truncateMiddle(word, headLength, tailLength, ellipsis) {
  11869. if (typeof word !== 'string') {
  11870. return '';
  11871. }
  11872. const wordLength = word.length; // Setting default values
  11873. // eslint-disable-next-line no-bitwise
  11874. const frontLength = ~~headLength; // will cast to integer
  11875. // eslint-disable-next-line no-bitwise
  11876. const backLength = ~~tailLength;
  11877. /* istanbul ignore next */
  11878. const truncateStr = !Object(external_lodash_["isNil"])(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS;
  11879. if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) {
  11880. return word;
  11881. } else if (backLength === 0) {
  11882. return word.slice(0, frontLength) + truncateStr;
  11883. }
  11884. return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
  11885. }
  11886. /**
  11887. *
  11888. * @param {string} words
  11889. * @param {typeof TRUNCATE_DEFAULT_PROPS} props
  11890. */
  11891. function truncateContent(words = '', props) {
  11892. const mergedProps = { ...TRUNCATE_DEFAULT_PROPS,
  11893. ...props
  11894. };
  11895. const {
  11896. ellipsis,
  11897. ellipsizeMode,
  11898. limit
  11899. } = mergedProps;
  11900. if (ellipsizeMode === TRUNCATE_TYPE.none) {
  11901. return words;
  11902. }
  11903. let truncateHead;
  11904. let truncateTail;
  11905. switch (ellipsizeMode) {
  11906. case TRUNCATE_TYPE.head:
  11907. truncateHead = 0;
  11908. truncateTail = limit;
  11909. break;
  11910. case TRUNCATE_TYPE.middle:
  11911. truncateHead = Math.floor(limit / 2);
  11912. truncateTail = Math.floor(limit / 2);
  11913. break;
  11914. default:
  11915. truncateHead = limit;
  11916. truncateTail = 0;
  11917. }
  11918. const truncatedContent = ellipsizeMode !== TRUNCATE_TYPE.auto ? truncateMiddle(words, truncateHead, truncateTail, ellipsis) : words;
  11919. return truncatedContent;
  11920. }
  11921. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/hook.js
  11922. /**
  11923. * WordPress dependencies
  11924. */
  11925. /**
  11926. * Internal dependencies
  11927. */
  11928. /**
  11929. * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'span'>} props
  11930. */
  11931. function useTruncate(props) {
  11932. const {
  11933. className,
  11934. children,
  11935. ellipsis = TRUNCATE_ELLIPSIS,
  11936. ellipsizeMode = TRUNCATE_TYPE.auto,
  11937. limit = 0,
  11938. numberOfLines = 0,
  11939. ...otherProps
  11940. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Truncate');
  11941. const truncatedContent = truncateContent(typeof children === 'string' ?
  11942. /** @type {string} */
  11943. children : '', {
  11944. ellipsis,
  11945. ellipsizeMode,
  11946. limit,
  11947. numberOfLines
  11948. });
  11949. const shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto;
  11950. const classes = Object(external_wp_element_["useMemo"])(() => {
  11951. const sx = {};
  11952. sx.numberOfLines = /*#__PURE__*/Object(emotion_esm["a" /* css */])("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : undefined));
  11953. return Object(emotion_esm["b" /* cx */])(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && sx.numberOfLines, className);
  11954. }, [className, numberOfLines, shouldTruncate]);
  11955. return { ...otherProps,
  11956. className: classes,
  11957. children: truncatedContent
  11958. };
  11959. }
  11960. // EXTERNAL MODULE: ./node_modules/memize/index.js
  11961. var memize = __webpack_require__("4eJC");
  11962. var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
  11963. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/colors.js
  11964. /**
  11965. * External dependencies
  11966. */
  11967. /** @type {HTMLDivElement} */
  11968. let colorComputationNode;
  11969. /**
  11970. * @return {HTMLDivElement | undefined} The HTML element for color computation.
  11971. */
  11972. function getColorComputationNode() {
  11973. if (typeof document === 'undefined') return;
  11974. if (!colorComputationNode) {
  11975. // Create a temporary element for style computation.
  11976. const el = document.createElement('div');
  11977. el.setAttribute('data-g2-color-computation-node', ''); // Inject for window computed style.
  11978. document.body.appendChild(el);
  11979. colorComputationNode = el;
  11980. }
  11981. return colorComputationNode;
  11982. }
  11983. /**
  11984. * @param {string | unknown} value
  11985. *
  11986. * @return {boolean} Whether the value is a valid color.
  11987. */
  11988. function isColor(value) {
  11989. if (typeof value !== 'string') return false;
  11990. const test = tinycolor_default()(value);
  11991. return test.isValid();
  11992. }
  11993. /**
  11994. * Retrieves the computed background color. This is useful for getting the
  11995. * value of a CSS variable color.
  11996. *
  11997. * @param {string | unknown} backgroundColor The background color to compute.
  11998. *
  11999. * @return {string} The computed background color.
  12000. */
  12001. function _getComputedBackgroundColor(backgroundColor) {
  12002. var _window;
  12003. if (typeof backgroundColor !== 'string') return '';
  12004. if (isColor(backgroundColor)) return backgroundColor;
  12005. if (!backgroundColor.includes('var(')) return '';
  12006. if (typeof document === 'undefined') return ''; // Attempts to gracefully handle CSS variables color values.
  12007. const el = getColorComputationNode();
  12008. if (!el) return '';
  12009. el.style.background = backgroundColor; // Grab the style
  12010. const computedColor = (_window = window) === null || _window === void 0 ? void 0 : _window.getComputedStyle(el).background; // Reset
  12011. el.style.background = '';
  12012. return computedColor || '';
  12013. }
  12014. const getComputedBackgroundColor = memize_default()(_getComputedBackgroundColor);
  12015. /**
  12016. * Get the text shade optimized for readability, based on a background color.
  12017. *
  12018. * @param {string | unknown} backgroundColor The background color.
  12019. *
  12020. * @return {string} The optimized text color (black or white).
  12021. */
  12022. function getOptimalTextColor(backgroundColor) {
  12023. const background = getComputedBackgroundColor(backgroundColor);
  12024. const isReadableWithBlackText = tinycolor_default.a.isReadable(background, '#000000');
  12025. return isReadableWithBlackText ? '#000000' : '#ffffff';
  12026. }
  12027. /**
  12028. * Get the text shade optimized for readability, based on a background color.
  12029. *
  12030. * @param {string | unknown} backgroundColor The background color.
  12031. *
  12032. * @return {string} The optimized text shade (dark or light).
  12033. */
  12034. function getOptimalTextShade(backgroundColor) {
  12035. const result = getOptimalTextColor(backgroundColor);
  12036. return result === '#000000' ? 'dark' : 'light';
  12037. }
  12038. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/config-values.js
  12039. /**
  12040. * Internal dependencies
  12041. */
  12042. const CONTROL_HEIGHT = '30px';
  12043. const CARD_PADDING_X = space_space(3);
  12044. const CARD_PADDING_Y = space_space(3);
  12045. /* harmony default export */ var config_values = ({
  12046. colorDivider: 'rgba(0, 0, 0, 0.1)',
  12047. colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',
  12048. colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',
  12049. colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',
  12050. elevationIntensity: 1,
  12051. radiusBlockUi: '2px',
  12052. borderWidth: '1px',
  12053. borderWidthFocus: '1.5px',
  12054. borderWidthTab: '4px',
  12055. spinnerSize: '18px',
  12056. fontSize: '13px',
  12057. fontSizeH1: 'calc(2.44 * 13px)',
  12058. fontSizeH2: 'calc(1.95 * 13px)',
  12059. fontSizeH3: 'calc(1.56 * 13px)',
  12060. fontSizeH4: 'calc(1.25 * 13px)',
  12061. fontSizeH5: '13px',
  12062. fontSizeH6: 'calc(0.8 * 13px)',
  12063. fontSizeInputMobile: '16px',
  12064. fontSizeMobile: '15px',
  12065. fontSizeSmall: 'calc(0.92 * 13px)',
  12066. fontSizeXSmall: 'calc(0.75 * 13px)',
  12067. fontLineHeightBase: '1.2',
  12068. fontWeight: 'normal',
  12069. fontWeightHeading: '600',
  12070. gridBase: '4px',
  12071. controlHeight: CONTROL_HEIGHT,
  12072. controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,
  12073. controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,
  12074. controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,
  12075. cardBorderRadius: '2px',
  12076. cardPaddingX: CARD_PADDING_X,
  12077. cardPaddingY: CARD_PADDING_Y,
  12078. cardPadding: `${CARD_PADDING_X} ${CARD_PADDING_Y}`,
  12079. cardHeaderFooterPaddingY: space_space(1),
  12080. cardHeaderHeight: '44px',
  12081. surfaceBackgroundColor: COLORS.white,
  12082. surfaceBackgroundSubtleColor: '#F3F3F3',
  12083. surfaceBackgroundTintColor: '#F5F5F5',
  12084. surfaceBorderColor: 'rgba(0, 0, 0, 0.1)',
  12085. surfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',
  12086. surfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',
  12087. surfaceBackgroundTertiaryColor: COLORS.white,
  12088. surfaceColor: COLORS.white,
  12089. transitionDuration: '200ms',
  12090. transitionDurationFast: '160ms',
  12091. transitionDurationFaster: '120ms',
  12092. transitionDurationFastest: '100ms',
  12093. transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',
  12094. transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)'
  12095. });
  12096. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles.js
  12097. function text_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  12098. /**
  12099. * Internal dependencies
  12100. */
  12101. const Text = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.black, ";line-height:", config_values.fontLineHeightBase, ";margin:0;;label:Text;" + ( true ? "" : undefined));
  12102. const styles_block = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  12103. name: "w2ur5d-block",
  12104. styles: "display:block;;label:block;"
  12105. } : undefined);
  12106. const positive = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.alert.green, ";;label:positive;" + ( true ? "" : undefined));
  12107. const destructive = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.alert.red, ";;label:destructive;" + ( true ? "" : undefined));
  12108. const styles_muted = /*#__PURE__*/Object(emotion_esm["a" /* css */])("color:", COLORS.mediumGray.text, ";;label:muted;" + ( true ? "" : undefined));
  12109. const highlighterText = /*#__PURE__*/Object(emotion_esm["a" /* css */])("mark{background:", COLORS.alert.yellow, ";border-radius:2px;box-shadow:0 0 0 1px rgba( 0,0,0,0.05 ) inset,0 -1px 0 rgba( 0,0,0,0.1 ) inset;};label:highlighterText;" + ( true ? "" : undefined));
  12110. const styles_upperCase = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  12111. name: "a0nhhd-upperCase",
  12112. styles: "text-transform:uppercase;;label:upperCase;"
  12113. } : undefined);
  12114. // EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js
  12115. var dist = __webpack_require__("5V/u");
  12116. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/utils.js
  12117. /**
  12118. * External dependencies
  12119. */
  12120. /**
  12121. * WordPress dependencies
  12122. */
  12123. /**
  12124. * Source:
  12125. * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js
  12126. */
  12127. /* eslint-disable jsdoc/valid-types */
  12128. /**
  12129. * @typedef Options
  12130. * @property {string} [activeClassName=''] Classname for active highlighted areas.
  12131. * @property {number} [activeIndex=-1] The index of the active highlighted area.
  12132. * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area.
  12133. * @property {boolean} [autoEscape] Whether to automatically escape text.
  12134. * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner.
  12135. * @property {string} children Children to highlight.
  12136. * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`.
  12137. * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).
  12138. * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.
  12139. * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.
  12140. * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.
  12141. * @property {string[]} [searchWords=[]] Words to search for and highlight.
  12142. * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.
  12143. * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.
  12144. */
  12145. /**
  12146. * Maps props to lowercase names.
  12147. *
  12148. * @template {Record<string, unknown>} T
  12149. * @param {T} object Props to map.
  12150. * @return {{[K in keyof T as Lowercase<string & K>]: T[K]}} The mapped props.
  12151. */
  12152. /* eslint-enable jsdoc/valid-types */
  12153. const lowercaseProps = object => {
  12154. /** @type {any} */
  12155. const mapped = {};
  12156. for (const key in object) {
  12157. mapped[key.toLowerCase()] = object[key];
  12158. }
  12159. return mapped;
  12160. };
  12161. const memoizedLowercaseProps = memize_default()(lowercaseProps);
  12162. /**
  12163. *
  12164. * @param {Options} options
  12165. */
  12166. function createHighlighterText({
  12167. activeClassName = '',
  12168. activeIndex = -1,
  12169. activeStyle,
  12170. autoEscape,
  12171. caseSensitive = false,
  12172. children,
  12173. findChunks,
  12174. highlightClassName = '',
  12175. highlightStyle = {},
  12176. highlightTag = 'mark',
  12177. sanitize,
  12178. searchWords = [],
  12179. unhighlightClassName = '',
  12180. unhighlightStyle
  12181. }) {
  12182. if (!children) return null;
  12183. if (typeof children !== 'string') return children;
  12184. const textToHighlight = children;
  12185. const chunks = Object(dist["findAll"])({
  12186. autoEscape,
  12187. caseSensitive,
  12188. findChunks,
  12189. sanitize,
  12190. searchWords,
  12191. textToHighlight
  12192. });
  12193. const HighlightTag = highlightTag;
  12194. let highlightIndex = -1;
  12195. let highlightClassNames = '';
  12196. let highlightStyles;
  12197. const textContent = chunks.map((chunk, index) => {
  12198. const text = textToHighlight.substr(chunk.start, chunk.end - chunk.start);
  12199. if (chunk.highlight) {
  12200. highlightIndex++;
  12201. let highlightClass;
  12202. if (typeof highlightClassName === 'object') {
  12203. if (!caseSensitive) {
  12204. highlightClassName = memoizedLowercaseProps(highlightClassName);
  12205. highlightClass = highlightClassName[text.toLowerCase()];
  12206. } else {
  12207. highlightClass = highlightClassName[text];
  12208. }
  12209. } else {
  12210. highlightClass = highlightClassName;
  12211. }
  12212. const isActive = highlightIndex === +activeIndex;
  12213. highlightClassNames = `${highlightClass} ${isActive ? activeClassName : ''}`;
  12214. highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle;
  12215. /** @type {Record<string, any>} */
  12216. const props = {
  12217. children: text,
  12218. className: highlightClassNames,
  12219. key: index,
  12220. style: highlightStyles
  12221. }; // Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)
  12222. // Only pass through the highlightIndex attribute for custom components.
  12223. if (typeof HighlightTag !== 'string') {
  12224. props.highlightIndex = highlightIndex;
  12225. }
  12226. return Object(external_wp_element_["createElement"])(HighlightTag, props);
  12227. }
  12228. return Object(external_wp_element_["createElement"])('span', {
  12229. children: text,
  12230. className: unhighlightClassName,
  12231. key: index,
  12232. style: unhighlightStyle
  12233. });
  12234. });
  12235. return textContent;
  12236. }
  12237. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/font-size.js
  12238. /**
  12239. * External dependencies
  12240. */
  12241. // eslint-disable-next-line no-restricted-imports
  12242. /**
  12243. * Internal dependencies
  12244. */
  12245. const BASE_FONT_SIZE = 13;
  12246. const PRESET_FONT_SIZES = {
  12247. body: BASE_FONT_SIZE,
  12248. caption: 10,
  12249. footnote: 11,
  12250. largeTitle: 28,
  12251. subheadline: 12,
  12252. title: 20
  12253. };
  12254. const HEADING_FONT_SIZES = [1, 2, 3, 4, 5, 6].flatMap(n => [n, n.toString()]);
  12255. function getFontSize(size = BASE_FONT_SIZE) {
  12256. if (size in PRESET_FONT_SIZES) {
  12257. return getFontSize(PRESET_FONT_SIZES[size]);
  12258. }
  12259. if (typeof size !== 'number') {
  12260. const parsed = parseFloat(size);
  12261. if (Number.isNaN(parsed)) return size;
  12262. size = parsed;
  12263. }
  12264. const ratio = `(${size} / ${BASE_FONT_SIZE})`;
  12265. return `calc(${ratio} * ${config_values.fontSize})`;
  12266. }
  12267. function getHeadingFontSize(size = 3) {
  12268. if (!HEADING_FONT_SIZES.includes(size)) {
  12269. return getFontSize(size);
  12270. }
  12271. const headingSize = `fontSizeH${size}`;
  12272. return config_values[headingSize];
  12273. }
  12274. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/get-line-height.js
  12275. /**
  12276. * External dependencies
  12277. */
  12278. // eslint-disable-next-line no-restricted-imports
  12279. /**
  12280. * Internal dependencies
  12281. */
  12282. function getLineHeight(adjustLineHeightForInnerControls, lineHeight) {
  12283. if (lineHeight) return lineHeight;
  12284. if (!adjustLineHeightForInnerControls) return;
  12285. let value = `calc(${config_values.controlHeight} + ${space_space(2)})`;
  12286. switch (adjustLineHeightForInnerControls) {
  12287. case 'large':
  12288. value = `calc(${config_values.controlHeightLarge} + ${space_space(2)})`;
  12289. break;
  12290. case 'small':
  12291. value = `calc(${config_values.controlHeightSmall} + ${space_space(2)})`;
  12292. break;
  12293. case 'xSmall':
  12294. value = `calc(${config_values.controlHeightXSmall} + ${space_space(2)})`;
  12295. break;
  12296. default:
  12297. break;
  12298. }
  12299. return value;
  12300. }
  12301. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/hook.js
  12302. function hook_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  12303. /**
  12304. * WordPress dependencies
  12305. */
  12306. /**
  12307. * Internal dependencies
  12308. */
  12309. /**
  12310. * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'span'>} props
  12311. */
  12312. function useText(props) {
  12313. const {
  12314. adjustLineHeightForInnerControls,
  12315. align,
  12316. children,
  12317. className,
  12318. color,
  12319. ellipsizeMode,
  12320. isDestructive = false,
  12321. display,
  12322. highlightEscape = false,
  12323. highlightCaseSensitive = false,
  12324. highlightWords,
  12325. highlightSanitize,
  12326. isBlock = false,
  12327. letterSpacing,
  12328. lineHeight: lineHeightProp,
  12329. optimizeReadabilityFor,
  12330. size,
  12331. truncate = false,
  12332. upperCase = false,
  12333. variant,
  12334. weight = config_values.fontWeight,
  12335. ...otherProps
  12336. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Text');
  12337. /** @type {import('react').ReactNode} */
  12338. let content = children;
  12339. const isHighlighter = Array.isArray(highlightWords);
  12340. const isCaption = size === 'caption';
  12341. if (isHighlighter) {
  12342. if (typeof children !== 'string') {
  12343. throw new TypeError('`children` of `Text` must only be `string` types when `highlightWords` is defined');
  12344. }
  12345. content = createHighlighterText({
  12346. autoEscape: highlightEscape,
  12347. // Disable reason: We need to disable this otherwise it erases the cast
  12348. // eslint-disable-next-line object-shorthand
  12349. children:
  12350. /** @type {string} */
  12351. children,
  12352. caseSensitive: highlightCaseSensitive,
  12353. searchWords: highlightWords,
  12354. sanitize: highlightSanitize
  12355. });
  12356. }
  12357. const classes = Object(external_wp_element_["useMemo"])(() => {
  12358. const sx = {};
  12359. const lineHeight = getLineHeight(adjustLineHeightForInnerControls, lineHeightProp);
  12360. sx.Base = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  12361. color,
  12362. display,
  12363. fontSize: getFontSize(size),
  12364. /* eslint-disable jsdoc/valid-types */
  12365. fontWeight:
  12366. /** @type {import('react').CSSProperties['fontWeight']} */
  12367. weight,
  12368. /* eslint-enable jsdoc/valid-types */
  12369. lineHeight,
  12370. letterSpacing,
  12371. textAlign: align
  12372. }, true ? "" : undefined);
  12373. sx.upperCase = /*#__PURE__*/Object(emotion_esm["a" /* css */])( true ? {
  12374. name: "1lejymi",
  12375. styles: "text-transform:uppercase;"
  12376. } : undefined);
  12377. sx.optimalTextColor = null;
  12378. if (optimizeReadabilityFor) {
  12379. const isOptimalTextColorDark = getOptimalTextShade(optimizeReadabilityFor) === 'dark';
  12380. sx.optimalTextColor = isOptimalTextColorDark ? /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  12381. color: COLORS.black
  12382. }, true ? "" : undefined) : /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  12383. color: COLORS.white
  12384. }, true ? "" : undefined);
  12385. }
  12386. return Object(emotion_esm["b" /* cx */])(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && styles_muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className);
  12387. }, [adjustLineHeightForInnerControls, align, className, color, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]);
  12388. /** @type {undefined | 'auto' | 'none'} */
  12389. let finalEllipsizeMode;
  12390. if (truncate === true) {
  12391. finalEllipsizeMode = 'auto';
  12392. }
  12393. if (truncate === false) {
  12394. finalEllipsizeMode = 'none';
  12395. }
  12396. const finalComponentProps = { ...otherProps,
  12397. className: classes,
  12398. children,
  12399. ellipsizeMode: ellipsizeMode || finalEllipsizeMode
  12400. };
  12401. const truncateProps = useTruncate(finalComponentProps);
  12402. /**
  12403. * Enhance child `<Link />` components to inherit font size.
  12404. */
  12405. if (!truncate && Array.isArray(children)) {
  12406. content = external_wp_element_["Children"].map(children, child => {
  12407. // @ts-ignore
  12408. if (!Object(external_lodash_["isPlainObject"])(child) || !('props' in child)) {
  12409. return child;
  12410. }
  12411. const isLink = Object(context_connect["b" /* hasConnectNamespace */])(child, ['Link']);
  12412. if (isLink) {
  12413. return Object(external_wp_element_["cloneElement"])(child, {
  12414. size: child.props.size || 'inherit'
  12415. });
  12416. }
  12417. return child;
  12418. });
  12419. }
  12420. return { ...truncateProps,
  12421. children: truncate ? truncateProps.children : content
  12422. };
  12423. }
  12424. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/component.js
  12425. /**
  12426. * Internal dependencies
  12427. */
  12428. /**
  12429. * `Text` is a core component that renders text in the library, using the
  12430. * library's typography system.
  12431. *
  12432. * `Text` can be used to render any text-content, like an HTML `p` or `span`.
  12433. *
  12434. * @example
  12435. *
  12436. * ```jsx
  12437. * import { __experimentalText as Text } from `@wordpress/components`;
  12438. *
  12439. * function Example() {
  12440. * return <Text>Code is Poetry</Text>;
  12441. * }
  12442. * ```
  12443. */
  12444. const component_Text = create_component_createComponent({
  12445. as: 'span',
  12446. useHook: useText,
  12447. name: 'Text'
  12448. });
  12449. /* harmony default export */ var text_component = (component_Text);
  12450. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js
  12451. /**
  12452. * External dependencies
  12453. */
  12454. /**
  12455. * WordPress dependencies
  12456. */
  12457. const LOWER_LEFT_REGEXP = new RegExp(/-left/g);
  12458. const LOWER_RIGHT_REGEXP = new RegExp(/-right/g);
  12459. const UPPER_LEFT_REGEXP = new RegExp(/Left/g);
  12460. const UPPER_RIGHT_REGEXP = new RegExp(/Right/g);
  12461. /**
  12462. * Flips a CSS property from left <-> right.
  12463. *
  12464. * @param {string} key The CSS property name.
  12465. *
  12466. * @return {string} The flipped CSS property name, if applicable.
  12467. */
  12468. function getConvertedKey(key) {
  12469. if (key === 'left') {
  12470. return 'right';
  12471. }
  12472. if (key === 'right') {
  12473. return 'left';
  12474. }
  12475. if (LOWER_LEFT_REGEXP.test(key)) {
  12476. return key.replace(LOWER_LEFT_REGEXP, '-right');
  12477. }
  12478. if (LOWER_RIGHT_REGEXP.test(key)) {
  12479. return key.replace(LOWER_RIGHT_REGEXP, '-left');
  12480. }
  12481. if (UPPER_LEFT_REGEXP.test(key)) {
  12482. return key.replace(UPPER_LEFT_REGEXP, 'Right');
  12483. }
  12484. if (UPPER_RIGHT_REGEXP.test(key)) {
  12485. return key.replace(UPPER_RIGHT_REGEXP, 'Left');
  12486. }
  12487. return key;
  12488. }
  12489. /**
  12490. * An incredibly basic ltr -> rtl converter for style properties
  12491. *
  12492. * @param {import('react').CSSProperties} ltrStyles
  12493. *
  12494. * @return {import('react').CSSProperties} Converted ltr -> rtl styles
  12495. */
  12496. const convertLTRToRTL = (ltrStyles = {}) => {
  12497. return Object(external_lodash_["mapKeys"])(ltrStyles, (_value, key) => getConvertedKey(key));
  12498. };
  12499. /**
  12500. * A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects.
  12501. *
  12502. * @param {import('react').CSSProperties} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable.
  12503. * @param {import('react').CSSProperties} [rtlStyles] Rtl styles. Renders if provided.
  12504. *
  12505. * @return {Function} A function to output CSS styles for Emotion's renderer
  12506. */
  12507. function rtl_rtl(ltrStyles = {}, rtlStyles) {
  12508. return () => {
  12509. if (rtlStyles) {
  12510. // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css
  12511. return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/css_browser_esm(rtlStyles, true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined);
  12512. } // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css
  12513. return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/css_browser_esm(convertLTRToRTL(ltrStyles), true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined);
  12514. };
  12515. }
  12516. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js
  12517. function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  12518. /**
  12519. * External dependencies
  12520. */
  12521. /**
  12522. * Internal dependencies
  12523. */
  12524. var input_control_styles_ref = true ? {
  12525. name: "1dacand",
  12526. styles: "padding-top:0;"
  12527. } : undefined;
  12528. const rootFloatLabelStyles = () => {
  12529. return input_control_styles_ref;
  12530. };
  12531. var input_control_styles_ref2 = true ? {
  12532. name: "r6z5ec",
  12533. styles: "z-index:1;"
  12534. } : undefined;
  12535. const rootFocusedStyles = ({
  12536. isFocused
  12537. }) => {
  12538. if (!isFocused) return '';
  12539. return input_control_styles_ref2;
  12540. };
  12541. var input_control_styles_ref3 = true ? {
  12542. name: "uz6002",
  12543. styles: "align-items:flex-start;flex-direction:column;"
  12544. } : undefined;
  12545. var input_control_styles_ref4 = true ? {
  12546. name: "53hdd7",
  12547. styles: "align-items:flex-start;flex-direction:column-reverse;"
  12548. } : undefined;
  12549. var input_control_styles_ref5 = true ? {
  12550. name: "x4dmss",
  12551. styles: "justify-content:space-between;"
  12552. } : undefined;
  12553. const rootLabelPositionStyles = ({
  12554. labelPosition
  12555. }) => {
  12556. switch (labelPosition) {
  12557. case 'top':
  12558. return input_control_styles_ref3;
  12559. case 'bottom':
  12560. return input_control_styles_ref4;
  12561. case 'edge':
  12562. return input_control_styles_ref5;
  12563. default:
  12564. return '';
  12565. }
  12566. };
  12567. const input_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  12568. target: "e1cr7zh10",
  12569. label: "Root"
  12570. })("position:relative;border-radius:2px;", rootFloatLabelStyles, " ", rootFocusedStyles, " ", rootLabelPositionStyles, true ? "" : undefined);
  12571. const containerDisabledStyles = ({
  12572. disabled
  12573. }) => {
  12574. const backgroundColor = disabled ? COLORS.ui.backgroundDisabled : COLORS.ui.background;
  12575. return /*#__PURE__*/css_browser_esm({
  12576. backgroundColor
  12577. }, true ? "" : undefined);
  12578. }; // Normalizes the margins from the <Flex /> (components/ui/flex/) container.
  12579. var input_control_styles_ref6 = true ? {
  12580. name: "1ibawvu",
  12581. styles: "margin:0 !important;"
  12582. } : undefined;
  12583. const containerMarginStyles = ({
  12584. hideLabel
  12585. }) => {
  12586. return hideLabel ? input_control_styles_ref6 : null;
  12587. };
  12588. var input_control_styles_ref7 = true ? {
  12589. name: "8atqhb",
  12590. styles: "width:100%;"
  12591. } : undefined;
  12592. const containerWidthStyles = ({
  12593. __unstableInputWidth,
  12594. labelPosition
  12595. }) => {
  12596. if (!__unstableInputWidth) return input_control_styles_ref7;
  12597. if (labelPosition === 'side') return '';
  12598. if (labelPosition === 'edge') {
  12599. return /*#__PURE__*/css_browser_esm({
  12600. flex: `0 0 ${__unstableInputWidth}`
  12601. }, true ? "" : undefined);
  12602. }
  12603. return /*#__PURE__*/css_browser_esm({
  12604. width: __unstableInputWidth
  12605. }, true ? "" : undefined);
  12606. };
  12607. const Container = styled_base_browser_esm("div", {
  12608. target: "e1cr7zh11",
  12609. label: "Container"
  12610. })("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", containerDisabledStyles, " ", containerMarginStyles, " ", containerWidthStyles, true ? "" : undefined);
  12611. const disabledStyles = ({
  12612. disabled
  12613. }) => {
  12614. if (!disabled) return '';
  12615. return /*#__PURE__*/css_browser_esm({
  12616. color: COLORS.ui.textDisabled
  12617. }, true ? "" : undefined);
  12618. };
  12619. const fontSizeStyles = ({
  12620. size
  12621. }) => {
  12622. const sizes = {
  12623. default: '13px',
  12624. small: '11px'
  12625. };
  12626. const fontSize = sizes[size];
  12627. const fontSizeMobile = '16px';
  12628. if (!fontSize) return '';
  12629. return /*#__PURE__*/css_browser_esm("font-size:", fontSizeMobile, ";@media ( min-width:600px ){font-size:", fontSize, ";}" + ( true ? "" : undefined));
  12630. };
  12631. const sizeStyles = ({
  12632. size
  12633. }) => {
  12634. const sizes = {
  12635. default: {
  12636. height: 30,
  12637. lineHeight: 1,
  12638. minHeight: 30
  12639. },
  12640. small: {
  12641. height: 24,
  12642. lineHeight: 1,
  12643. minHeight: 24
  12644. }
  12645. };
  12646. const style = sizes[size] || sizes.default;
  12647. return /*#__PURE__*/css_browser_esm(style, true ? "" : undefined);
  12648. };
  12649. var input_control_styles_ref8 = true ? {
  12650. name: "103r1kr",
  12651. styles: "&::-webkit-input-placeholder{line-height:normal;}"
  12652. } : undefined;
  12653. const placeholderStyles = () => {
  12654. return input_control_styles_ref8;
  12655. };
  12656. const dragStyles = ({
  12657. isDragging,
  12658. dragCursor
  12659. }) => {
  12660. let defaultArrowStyles = '';
  12661. let activeDragCursorStyles = '';
  12662. if (isDragging) {
  12663. defaultArrowStyles = /*#__PURE__*/css_browser_esm("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}" + ( true ? "" : undefined));
  12664. }
  12665. if (isDragging && dragCursor) {
  12666. activeDragCursorStyles = /*#__PURE__*/css_browser_esm("&:active{cursor:", dragCursor, ";}" + ( true ? "" : undefined));
  12667. }
  12668. return /*#__PURE__*/css_browser_esm(defaultArrowStyles, " ", activeDragCursorStyles, true ? "" : undefined);
  12669. }; // TODO: Resolve need to use &&& to increase specificity
  12670. // https://github.com/WordPress/gutenberg/issues/18483
  12671. const input_control_styles_Input = styled_base_browser_esm("input", {
  12672. target: "e1cr7zh12",
  12673. label: "Input"
  12674. })("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:", COLORS.black, ";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", placeholderStyles, "}" + ( true ? "" : undefined));
  12675. var input_control_styles_ref9 = true ? {
  12676. name: "8uhtka",
  12677. styles: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
  12678. } : undefined;
  12679. const labelTruncation = () => {
  12680. return input_control_styles_ref9;
  12681. };
  12682. const labelPadding = ({
  12683. labelPosition
  12684. }) => {
  12685. let paddingBottom = 4;
  12686. if (labelPosition === 'edge' || labelPosition === 'side') {
  12687. paddingBottom = 0;
  12688. }
  12689. return /*#__PURE__*/css_browser_esm({
  12690. paddingTop: 0,
  12691. paddingBottom
  12692. }, true ? "" : undefined);
  12693. };
  12694. const BaseLabel = /*#__PURE__*/styled_base_browser_esm(text_component, {
  12695. target: "e1cr7zh13",
  12696. label: "BaseLabel"
  12697. })("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;", labelPadding, " ", labelTruncation, "}" + ( true ? "" : undefined));
  12698. const Label = props => Object(external_wp_element_["createElement"])(BaseLabel, Object(esm_extends["a" /* default */])({}, props, {
  12699. as: "label"
  12700. }));
  12701. const LabelWrapper = /*#__PURE__*/styled_base_browser_esm(flex_item_component, {
  12702. target: "e1cr7zh14",
  12703. label: "LabelWrapper"
  12704. })( true ? {
  12705. name: "120o8im",
  12706. styles: "max-width:calc( 100% - 10px );"
  12707. } : undefined);
  12708. const backdropFocusedStyles = ({
  12709. disabled,
  12710. isFocused
  12711. }) => {
  12712. let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;
  12713. let boxShadow = null;
  12714. if (isFocused) {
  12715. boxShadow = `0 0 0 1px ${COLORS.ui.borderFocus} inset`;
  12716. }
  12717. if (disabled) {
  12718. borderColor = COLORS.ui.borderDisabled;
  12719. }
  12720. return /*#__PURE__*/css_browser_esm({
  12721. boxShadow,
  12722. borderColor,
  12723. borderStyle: 'solid',
  12724. borderWidth: 1
  12725. }, true ? "" : undefined);
  12726. };
  12727. const BackdropUI = styled_base_browser_esm("div", {
  12728. target: "e1cr7zh15",
  12729. label: "BackdropUI"
  12730. })("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", backdropFocusedStyles, " ", rtl_rtl({
  12731. paddingLeft: 2
  12732. }), "}" + ( true ? "" : undefined));
  12733. const Prefix = styled_base_browser_esm("span", {
  12734. target: "e1cr7zh16",
  12735. label: "Prefix"
  12736. })( true ? {
  12737. name: "1pxuk39",
  12738. styles: "box-sizing:border-box;display:block;"
  12739. } : undefined);
  12740. const Suffix = styled_base_browser_esm("span", {
  12741. target: "e1cr7zh17",
  12742. label: "Suffix"
  12743. })( true ? {
  12744. name: "1pxuk39",
  12745. styles: "box-sizing:border-box;display:block;"
  12746. } : undefined);
  12747. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/backdrop.js
  12748. /**
  12749. * WordPress dependencies
  12750. */
  12751. /**
  12752. * Internal dependencies
  12753. */
  12754. function Backdrop({
  12755. disabled = false,
  12756. isFocused = false
  12757. }) {
  12758. return Object(external_wp_element_["createElement"])(BackdropUI, {
  12759. "aria-hidden": "true",
  12760. className: "components-input-control__backdrop",
  12761. disabled: disabled,
  12762. isFocused: isFocused
  12763. });
  12764. }
  12765. const MemoizedBackdrop = Object(external_wp_element_["memo"])(Backdrop);
  12766. /* harmony default export */ var backdrop = (MemoizedBackdrop);
  12767. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/label.js
  12768. /**
  12769. * Internal dependencies
  12770. */
  12771. function label_Label({
  12772. children,
  12773. hideLabelFromVision,
  12774. htmlFor,
  12775. ...props
  12776. }) {
  12777. if (!children) return null;
  12778. if (hideLabelFromVision) {
  12779. return Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  12780. as: "label",
  12781. htmlFor: htmlFor
  12782. }, children);
  12783. }
  12784. return Object(external_wp_element_["createElement"])(Label, Object(esm_extends["a" /* default */])({
  12785. htmlFor: htmlFor
  12786. }, props), children);
  12787. }
  12788. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-base.js
  12789. /**
  12790. * WordPress dependencies
  12791. */
  12792. /**
  12793. * Internal dependencies
  12794. */
  12795. function useUniqueId(idProp) {
  12796. const instanceId = Object(external_wp_compose_["useInstanceId"])(InputBase);
  12797. const id = `input-base-control-${instanceId}`;
  12798. return idProp || id;
  12799. } // Adapter to map props for the new ui/flex compopnent.
  12800. function getUIFlexProps({
  12801. labelPosition
  12802. }) {
  12803. const props = {};
  12804. switch (labelPosition) {
  12805. case 'top':
  12806. props.direction = 'column';
  12807. props.gap = 0;
  12808. break;
  12809. case 'bottom':
  12810. props.direction = 'column-reverse';
  12811. props.gap = 0;
  12812. break;
  12813. case 'edge':
  12814. props.justify = 'space-between';
  12815. break;
  12816. }
  12817. return props;
  12818. }
  12819. function InputBase({
  12820. __unstableInputWidth,
  12821. children,
  12822. className,
  12823. disabled = false,
  12824. hideLabelFromVision = false,
  12825. labelPosition,
  12826. id: idProp,
  12827. isFocused = false,
  12828. label,
  12829. prefix,
  12830. size = 'default',
  12831. suffix,
  12832. ...props
  12833. }, ref) {
  12834. const id = useUniqueId(idProp);
  12835. const hideLabel = hideLabelFromVision || !label;
  12836. return Object(external_wp_element_["createElement"])(input_control_styles_Root, Object(esm_extends["a" /* default */])({}, props, getUIFlexProps({
  12837. labelPosition
  12838. }), {
  12839. className: className,
  12840. isFocused: isFocused,
  12841. labelPosition: labelPosition,
  12842. ref: ref,
  12843. __unstableVersion: "next"
  12844. }), Object(external_wp_element_["createElement"])(LabelWrapper, null, Object(external_wp_element_["createElement"])(label_Label, {
  12845. className: "components-input-control__label",
  12846. hideLabelFromVision: hideLabelFromVision,
  12847. labelPosition: labelPosition,
  12848. htmlFor: id,
  12849. size: size
  12850. }, label)), Object(external_wp_element_["createElement"])(Container, {
  12851. __unstableInputWidth: __unstableInputWidth,
  12852. className: "components-input-control__container",
  12853. disabled: disabled,
  12854. hideLabel: hideLabel,
  12855. isFocused: isFocused,
  12856. labelPosition: labelPosition
  12857. }, prefix && Object(external_wp_element_["createElement"])(Prefix, {
  12858. className: "components-input-control__prefix"
  12859. }, prefix), children, suffix && Object(external_wp_element_["createElement"])(Suffix, {
  12860. className: "components-input-control__suffix"
  12861. }, suffix), Object(external_wp_element_["createElement"])(backdrop, {
  12862. "aria-hidden": "true",
  12863. disabled: disabled,
  12864. isFocused: isFocused,
  12865. label: label,
  12866. size: size
  12867. })));
  12868. }
  12869. /* harmony default export */ var input_base = (Object(external_wp_element_["forwardRef"])(InputBase));
  12870. // CONCATENATED MODULE: ./node_modules/react-use-gesture/dist/reactusegesture.esm.js
  12871. // vector add
  12872. function addV(v1, v2) {
  12873. return v1.map(function (v, i) {
  12874. return v + v2[i];
  12875. });
  12876. } // vector substract
  12877. function subV(v1, v2) {
  12878. return v1.map(function (v, i) {
  12879. return v - v2[i];
  12880. });
  12881. }
  12882. /**
  12883. * Calculates distance
  12884. * @param movement the difference between current and initial vectors
  12885. * @returns distance
  12886. */
  12887. function calculateDistance(movement) {
  12888. return Math.hypot.apply(Math, movement);
  12889. }
  12890. function calculateAllGeometry(movement, delta) {
  12891. if (delta === void 0) {
  12892. delta = movement;
  12893. }
  12894. var dl = calculateDistance(delta);
  12895. var alpha = dl === 0 ? 0 : 1 / dl;
  12896. var direction = delta.map(function (v) {
  12897. return alpha * v;
  12898. });
  12899. var distance = calculateDistance(movement);
  12900. return {
  12901. distance: distance,
  12902. direction: direction
  12903. };
  12904. }
  12905. /**
  12906. * Calculates all kinematics
  12907. * @template T the expected vector type
  12908. * @param movement the difference between current and initial vectors
  12909. * @param delta the difference between current and previous vectors
  12910. * @param delta_t the time difference between current and previous timestamps
  12911. * @returns all kinematics
  12912. */
  12913. function calculateAllKinematics(movement, delta, dt) {
  12914. var dl = calculateDistance(delta);
  12915. var alpha = dl === 0 ? 0 : 1 / dl;
  12916. var beta = dt === 0 ? 0 : 1 / dt;
  12917. var velocity = beta * dl;
  12918. var velocities = delta.map(function (v) {
  12919. return beta * v;
  12920. });
  12921. var direction = delta.map(function (v) {
  12922. return alpha * v;
  12923. });
  12924. var distance = calculateDistance(movement);
  12925. return {
  12926. velocities: velocities,
  12927. velocity: velocity,
  12928. distance: distance,
  12929. direction: direction
  12930. };
  12931. }
  12932. /**
  12933. * Because IE doesn't support `Math.sign` function, so we use the polyfill version of the function.
  12934. * This polyfill function is suggested by Mozilla:
  12935. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign#Polyfill
  12936. * @param x target number
  12937. */
  12938. function sign(x) {
  12939. if (Math.sign) return Math.sign(x);
  12940. return Number(x > 0) - Number(x < 0) || +x;
  12941. }
  12942. function minMax(value, min, max) {
  12943. return Math.max(min, Math.min(value, max));
  12944. } // Based on @aholachek ;)
  12945. // https://twitter.com/chpwn/status/285540192096497664
  12946. // iOS constant = 0.55
  12947. // https://medium.com/@nathangitter/building-fluid-interfaces-ios-swift-9732bb934bf5
  12948. function rubberband2(distance, constant) {
  12949. // default constant from the article is 0.7
  12950. return Math.pow(distance, constant * 5);
  12951. }
  12952. function rubberband(distance, dimension, constant) {
  12953. if (dimension === 0 || Math.abs(dimension) === Infinity) return rubberband2(distance, constant);
  12954. return distance * dimension * constant / (dimension + constant * distance);
  12955. }
  12956. function rubberbandIfOutOfBounds(position, min, max, constant) {
  12957. if (constant === void 0) {
  12958. constant = 0.15;
  12959. }
  12960. if (constant === 0) return minMax(position, min, max);
  12961. if (position < min) return -rubberband(min - position, max - min, constant) + min;
  12962. if (position > max) return +rubberband(position - max, max - min, constant) + max;
  12963. return position;
  12964. }
  12965. function _defineProperties(target, props) {
  12966. for (var i = 0; i < props.length; i++) {
  12967. var descriptor = props[i];
  12968. descriptor.enumerable = descriptor.enumerable || false;
  12969. descriptor.configurable = true;
  12970. if ("value" in descriptor) descriptor.writable = true;
  12971. Object.defineProperty(target, descriptor.key, descriptor);
  12972. }
  12973. }
  12974. function _createClass(Constructor, protoProps, staticProps) {
  12975. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  12976. if (staticProps) _defineProperties(Constructor, staticProps);
  12977. return Constructor;
  12978. }
  12979. function _extends() {
  12980. _extends = Object.assign || function (target) {
  12981. for (var i = 1; i < arguments.length; i++) {
  12982. var source = arguments[i];
  12983. for (var key in source) {
  12984. if (Object.prototype.hasOwnProperty.call(source, key)) {
  12985. target[key] = source[key];
  12986. }
  12987. }
  12988. }
  12989. return target;
  12990. };
  12991. return _extends.apply(this, arguments);
  12992. }
  12993. function reactusegesture_esm_inheritsLoose(subClass, superClass) {
  12994. subClass.prototype = Object.create(superClass.prototype);
  12995. subClass.prototype.constructor = subClass;
  12996. subClass.__proto__ = superClass;
  12997. }
  12998. function _objectWithoutPropertiesLoose(source, excluded) {
  12999. if (source == null) return {};
  13000. var target = {};
  13001. var sourceKeys = Object.keys(source);
  13002. var key, i;
  13003. for (i = 0; i < sourceKeys.length; i++) {
  13004. key = sourceKeys[i];
  13005. if (excluded.indexOf(key) >= 0) continue;
  13006. target[key] = source[key];
  13007. }
  13008. return target;
  13009. }
  13010. function _assertThisInitialized(self) {
  13011. if (self === void 0) {
  13012. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  13013. }
  13014. return self;
  13015. }
  13016. function _unsupportedIterableToArray(o, minLen) {
  13017. if (!o) return;
  13018. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  13019. var n = Object.prototype.toString.call(o).slice(8, -1);
  13020. if (n === "Object" && o.constructor) n = o.constructor.name;
  13021. if (n === "Map" || n === "Set") return Array.from(o);
  13022. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  13023. }
  13024. function _arrayLikeToArray(arr, len) {
  13025. if (len == null || len > arr.length) len = arr.length;
  13026. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  13027. return arr2;
  13028. }
  13029. function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  13030. var it;
  13031. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  13032. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  13033. if (it) o = it;
  13034. var i = 0;
  13035. return function () {
  13036. if (i >= o.length) return {
  13037. done: true
  13038. };
  13039. return {
  13040. done: false,
  13041. value: o[i++]
  13042. };
  13043. };
  13044. }
  13045. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  13046. }
  13047. it = o[Symbol.iterator]();
  13048. return it.next.bind(it);
  13049. }
  13050. function noop() {}
  13051. /**
  13052. * TODO Beware that only optimized cases are covered in tests =)
  13053. * TODO Need to cover general case as well
  13054. *
  13055. * @param fns
  13056. */
  13057. function chainFns() {
  13058. for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
  13059. fns[_key] = arguments[_key];
  13060. }
  13061. if (fns.length === 0) return noop;
  13062. if (fns.length === 1) return fns[0];
  13063. return function () {
  13064. var result;
  13065. for (var _iterator = _createForOfIteratorHelperLoose(fns), _step; !(_step = _iterator()).done;) {
  13066. var fn = _step.value;
  13067. result = fn.apply(this, arguments) || result;
  13068. }
  13069. return result;
  13070. };
  13071. }
  13072. /**
  13073. * Expects a simple value or 2D vector (an array with 2 elements) and
  13074. * always returns 2D vector. If simple value is passed, returns a
  13075. * vector with this value as both coordinates.
  13076. *
  13077. * @param value
  13078. */
  13079. function ensureVector(value, fallback) {
  13080. if (value === undefined) {
  13081. if (fallback === undefined) {
  13082. throw new Error('Must define fallback value if undefined is expected');
  13083. }
  13084. value = fallback;
  13085. }
  13086. if (Array.isArray(value)) return value;
  13087. return [value, value];
  13088. }
  13089. /**
  13090. * Helper for defining a default value
  13091. *
  13092. * @param value
  13093. * @param fallback
  13094. */
  13095. function assignDefault(value, fallback) {
  13096. return Object.assign({}, fallback, value || {});
  13097. }
  13098. /**
  13099. * Resolves getters (functions) by calling them
  13100. * If simple value is given it just passes through
  13101. *
  13102. * @param v
  13103. */
  13104. function valueFn(v) {
  13105. if (typeof v === 'function') {
  13106. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  13107. args[_key2 - 1] = arguments[_key2];
  13108. }
  13109. // @ts-ignore
  13110. return v.apply(void 0, args);
  13111. } else {
  13112. return v;
  13113. }
  13114. }
  13115. function resolveWith(config, resolvers) {
  13116. if (config === void 0) {
  13117. config = {};
  13118. }
  13119. var result = {};
  13120. for (var _i = 0, _Object$entries = Object.entries(resolvers); _i < _Object$entries.length; _i++) {
  13121. var _Object$entries$_i = _Object$entries[_i],
  13122. key = _Object$entries$_i[0],
  13123. resolver = _Object$entries$_i[1];
  13124. switch (typeof resolver) {
  13125. case 'function':
  13126. result[key] = resolver.call(result, config[key], key, config);
  13127. break;
  13128. case 'object':
  13129. result[key] = resolveWith(config[key], resolver);
  13130. break;
  13131. case 'boolean':
  13132. if (resolver) result[key] = config[key];
  13133. break;
  13134. }
  13135. }
  13136. return result;
  13137. }
  13138. /**
  13139. * Whether the browser supports GestureEvent (ie Safari)
  13140. * @returns true if the browser supports gesture event
  13141. */
  13142. function supportsGestureEvents() {
  13143. try {
  13144. // TODO [TS] possibly find GestureEvent definitions?
  13145. // @ts-ignore: no type definitions for webkit GestureEvents
  13146. return 'constructor' in GestureEvent;
  13147. } catch (e) {
  13148. return false;
  13149. }
  13150. }
  13151. function supportsTouchEvents() {
  13152. return typeof window !== 'undefined' && 'ontouchstart' in window;
  13153. }
  13154. function supportsPointerEvents() {
  13155. return typeof window !== 'undefined' && 'onpointerdown' in window;
  13156. }
  13157. function getEventTouches(event) {
  13158. if ('pointerId' in event) return null;
  13159. return event.type === 'touchend' ? event.changedTouches : event.targetTouches;
  13160. }
  13161. function getTouchIds(event) {
  13162. return Array.from(getEventTouches(event)).map(function (t) {
  13163. return t.identifier;
  13164. });
  13165. }
  13166. function getGenericEventData(event) {
  13167. var buttons = 'buttons' in event ? event.buttons : 0;
  13168. var shiftKey = event.shiftKey,
  13169. altKey = event.altKey,
  13170. metaKey = event.metaKey,
  13171. ctrlKey = event.ctrlKey; // TODO check if this might create some overrides?
  13172. return {
  13173. buttons: buttons,
  13174. shiftKey: shiftKey,
  13175. altKey: altKey,
  13176. metaKey: metaKey,
  13177. ctrlKey: ctrlKey
  13178. };
  13179. }
  13180. var identity = function identity(xy) {
  13181. return xy;
  13182. };
  13183. /**
  13184. * Gets pointer event values.
  13185. * @param event
  13186. * @returns pointer event values
  13187. */
  13188. function getPointerEventValues(event, transform) {
  13189. if (transform === void 0) {
  13190. transform = identity;
  13191. }
  13192. var touchEvents = getEventTouches(event);
  13193. var _ref = touchEvents ? touchEvents[0] : event,
  13194. clientX = _ref.clientX,
  13195. clientY = _ref.clientY;
  13196. return transform([clientX, clientY]);
  13197. }
  13198. /**
  13199. * Gets two touches event data
  13200. * @param event
  13201. * @returns two touches event data
  13202. */
  13203. function getTwoTouchesEventValues(event, pointerIds, transform) {
  13204. if (transform === void 0) {
  13205. transform = identity;
  13206. }
  13207. var _Array$from$filter = Array.from(event.touches).filter(function (t) {
  13208. return pointerIds.includes(t.identifier);
  13209. }),
  13210. A = _Array$from$filter[0],
  13211. B = _Array$from$filter[1];
  13212. if (!A || !B) throw Error("The event doesn't have two pointers matching the pointerIds");
  13213. var dx = B.clientX - A.clientX;
  13214. var dy = B.clientY - A.clientY;
  13215. var cx = (B.clientX + A.clientX) / 2;
  13216. var cy = (B.clientY + A.clientY) / 2; // const e: any = 'nativeEvent' in event ? event.nativeEvent : event
  13217. var distance = Math.hypot(dx, dy); // FIXME rotation has inconsistant values so we're not using it atm
  13218. // const angle = (e.rotation as number) ?? -(Math.atan2(dx, dy) * 180) / Math.PI
  13219. var angle = -(Math.atan2(dx, dy) * 180) / Math.PI;
  13220. var values = transform([distance, angle]);
  13221. var origin = transform([cx, cy]);
  13222. return {
  13223. values: values,
  13224. origin: origin
  13225. };
  13226. }
  13227. /**
  13228. * Gets scroll event values
  13229. * @param event
  13230. * @returns scroll event values
  13231. */
  13232. function getScrollEventValues(event, transform) {
  13233. if (transform === void 0) {
  13234. transform = identity;
  13235. }
  13236. // If the currentTarget is the window then we return the scrollX/Y position.
  13237. // If not (ie the currentTarget is a DOM element), then we return scrollLeft/Top
  13238. var _event$currentTarget = event.currentTarget,
  13239. scrollX = _event$currentTarget.scrollX,
  13240. scrollY = _event$currentTarget.scrollY,
  13241. scrollLeft = _event$currentTarget.scrollLeft,
  13242. scrollTop = _event$currentTarget.scrollTop;
  13243. return transform([scrollX || scrollLeft || 0, scrollY || scrollTop || 0]);
  13244. } // wheel delta defaults from https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
  13245. var LINE_HEIGHT = 40;
  13246. var PAGE_HEIGHT = 800;
  13247. /**
  13248. * Gets wheel event values.
  13249. * @param event
  13250. * @returns wheel event values
  13251. */
  13252. function getWheelEventValues(event, transform) {
  13253. if (transform === void 0) {
  13254. transform = identity;
  13255. }
  13256. var deltaX = event.deltaX,
  13257. deltaY = event.deltaY,
  13258. deltaMode = event.deltaMode; // normalize wheel values, especially for Firefox
  13259. if (deltaMode === 1) {
  13260. deltaX *= LINE_HEIGHT;
  13261. deltaY *= LINE_HEIGHT;
  13262. } else if (deltaMode === 2) {
  13263. deltaX *= PAGE_HEIGHT;
  13264. deltaY *= PAGE_HEIGHT;
  13265. }
  13266. return transform([deltaX, deltaY]);
  13267. }
  13268. /**
  13269. * Gets webkit gesture event values.
  13270. * @param event
  13271. * @returns webkit gesture event values
  13272. */
  13273. function getWebkitGestureEventValues(event, transform) {
  13274. if (transform === void 0) {
  13275. transform = identity;
  13276. }
  13277. return transform([event.scale, event.rotation]);
  13278. }
  13279. var DEFAULT_DRAG_DELAY = 180;
  13280. var DEFAULT_RUBBERBAND = 0.15;
  13281. var DEFAULT_SWIPE_VELOCITY = 0.5;
  13282. var DEFAULT_SWIPE_DISTANCE = 50;
  13283. var DEFAULT_SWIPE_DURATION = 250;
  13284. var InternalGestureOptionsNormalizers = {
  13285. threshold: function threshold(value) {
  13286. if (value === void 0) {
  13287. value = 0;
  13288. }
  13289. return ensureVector(value);
  13290. },
  13291. rubberband: function rubberband(value) {
  13292. if (value === void 0) {
  13293. value = 0;
  13294. }
  13295. switch (value) {
  13296. case true:
  13297. return ensureVector(DEFAULT_RUBBERBAND);
  13298. case false:
  13299. return ensureVector(0);
  13300. default:
  13301. return ensureVector(value);
  13302. }
  13303. },
  13304. enabled: function enabled(value) {
  13305. if (value === void 0) {
  13306. value = true;
  13307. }
  13308. return value;
  13309. },
  13310. triggerAllEvents: function triggerAllEvents(value) {
  13311. if (value === void 0) {
  13312. value = false;
  13313. }
  13314. return value;
  13315. },
  13316. initial: function initial(value) {
  13317. if (value === void 0) {
  13318. value = 0;
  13319. }
  13320. if (typeof value === 'function') return value;
  13321. return ensureVector(value);
  13322. },
  13323. transform: true
  13324. };
  13325. var InternalCoordinatesOptionsNormalizers = /*#__PURE__*/_extends({}, InternalGestureOptionsNormalizers, {
  13326. axis: true,
  13327. lockDirection: function lockDirection(value) {
  13328. if (value === void 0) {
  13329. value = false;
  13330. }
  13331. return value;
  13332. },
  13333. bounds: function bounds(value) {
  13334. if (value === void 0) {
  13335. value = {};
  13336. }
  13337. if (typeof value === 'function') return function (state) {
  13338. return InternalCoordinatesOptionsNormalizers.bounds(value(state));
  13339. };
  13340. var _value2 = value,
  13341. _value2$left = _value2.left,
  13342. left = _value2$left === void 0 ? -Infinity : _value2$left,
  13343. _value2$right = _value2.right,
  13344. right = _value2$right === void 0 ? Infinity : _value2$right,
  13345. _value2$top = _value2.top,
  13346. top = _value2$top === void 0 ? -Infinity : _value2$top,
  13347. _value2$bottom = _value2.bottom,
  13348. bottom = _value2$bottom === void 0 ? Infinity : _value2$bottom;
  13349. return [[left, right], [top, bottom]];
  13350. }
  13351. });
  13352. var isBrowser = typeof window !== 'undefined' && window.document && window.document.createElement;
  13353. var InternalGenericOptionsNormalizers = {
  13354. enabled: function enabled(value) {
  13355. if (value === void 0) {
  13356. value = true;
  13357. }
  13358. return value;
  13359. },
  13360. domTarget: true,
  13361. window: /*#__PURE__*/function (_window) {
  13362. function window(_x) {
  13363. return _window.apply(this, arguments);
  13364. }
  13365. window.toString = function () {
  13366. return _window.toString();
  13367. };
  13368. return window;
  13369. }(function (value) {
  13370. if (value === void 0) {
  13371. value = isBrowser ? window : undefined;
  13372. }
  13373. return value;
  13374. }),
  13375. eventOptions: function eventOptions(_temp) {
  13376. var _ref = _temp === void 0 ? {} : _temp,
  13377. _ref$passive = _ref.passive,
  13378. passive = _ref$passive === void 0 ? true : _ref$passive,
  13379. _ref$capture = _ref.capture,
  13380. capture = _ref$capture === void 0 ? false : _ref$capture;
  13381. return {
  13382. passive: passive,
  13383. capture: capture
  13384. };
  13385. },
  13386. transform: true
  13387. };
  13388. var InternalDistanceAngleOptionsNormalizers = /*#__PURE__*/_extends({}, InternalGestureOptionsNormalizers, {
  13389. bounds: function bounds(_value, _key, _ref2) {
  13390. var _ref2$distanceBounds = _ref2.distanceBounds,
  13391. distanceBounds = _ref2$distanceBounds === void 0 ? {} : _ref2$distanceBounds,
  13392. _ref2$angleBounds = _ref2.angleBounds,
  13393. angleBounds = _ref2$angleBounds === void 0 ? {} : _ref2$angleBounds;
  13394. var _distanceBounds = function _distanceBounds(state) {
  13395. var D = assignDefault(valueFn(distanceBounds, state), {
  13396. min: -Infinity,
  13397. max: Infinity
  13398. });
  13399. return [D.min, D.max];
  13400. };
  13401. var _angleBounds = function _angleBounds(state) {
  13402. var A = assignDefault(valueFn(angleBounds, state), {
  13403. min: -Infinity,
  13404. max: Infinity
  13405. });
  13406. return [A.min, A.max];
  13407. };
  13408. if (typeof distanceBounds !== 'function' && typeof angleBounds !== 'function') return [_distanceBounds(), _angleBounds()];
  13409. return function (state) {
  13410. return [_distanceBounds(state), _angleBounds(state)];
  13411. };
  13412. }
  13413. });
  13414. var InternalDragOptionsNormalizers = /*#__PURE__*/_extends({}, InternalCoordinatesOptionsNormalizers, {
  13415. useTouch: function useTouch(value) {
  13416. if (value === void 0) {
  13417. value = false;
  13418. }
  13419. var supportsTouch = supportsTouchEvents();
  13420. var supportsPointer = supportsPointerEvents();
  13421. if (value && supportsTouch) return true;
  13422. if (supportsTouch && !supportsPointer) return true;
  13423. return false;
  13424. },
  13425. experimental_preventWindowScrollY: function experimental_preventWindowScrollY(value) {
  13426. if (value === void 0) {
  13427. value = false;
  13428. }
  13429. return value;
  13430. },
  13431. threshold: function threshold(v, _k, _ref3) {
  13432. var _ref3$filterTaps = _ref3.filterTaps,
  13433. filterTaps = _ref3$filterTaps === void 0 ? false : _ref3$filterTaps,
  13434. _ref3$lockDirection = _ref3.lockDirection,
  13435. lockDirection = _ref3$lockDirection === void 0 ? false : _ref3$lockDirection,
  13436. _ref3$axis = _ref3.axis,
  13437. axis = _ref3$axis === void 0 ? undefined : _ref3$axis;
  13438. var A = ensureVector(v, filterTaps ? 3 : lockDirection ? 1 : axis ? 1 : 0);
  13439. this.filterTaps = filterTaps;
  13440. return A;
  13441. },
  13442. swipeVelocity: function swipeVelocity(v) {
  13443. if (v === void 0) {
  13444. v = DEFAULT_SWIPE_VELOCITY;
  13445. }
  13446. return ensureVector(v);
  13447. },
  13448. swipeDistance: function swipeDistance(v) {
  13449. if (v === void 0) {
  13450. v = DEFAULT_SWIPE_DISTANCE;
  13451. }
  13452. return ensureVector(v);
  13453. },
  13454. swipeDuration: function swipeDuration(value) {
  13455. if (value === void 0) {
  13456. value = DEFAULT_SWIPE_DURATION;
  13457. }
  13458. return value;
  13459. },
  13460. delay: function delay(value) {
  13461. if (value === void 0) {
  13462. value = 0;
  13463. }
  13464. switch (value) {
  13465. case true:
  13466. return DEFAULT_DRAG_DELAY;
  13467. case false:
  13468. return 0;
  13469. default:
  13470. return value;
  13471. }
  13472. }
  13473. });
  13474. function getInternalGenericOptions(config) {
  13475. if (config === void 0) {
  13476. config = {};
  13477. }
  13478. // TODO warn when passive is set to true and domTarget is undefined
  13479. return resolveWith(config, InternalGenericOptionsNormalizers);
  13480. }
  13481. function getInternalCoordinatesOptions(config) {
  13482. if (config === void 0) {
  13483. config = {};
  13484. }
  13485. return resolveWith(config, InternalCoordinatesOptionsNormalizers);
  13486. }
  13487. function getInternalDistanceAngleOptions(config) {
  13488. if (config === void 0) {
  13489. config = {};
  13490. }
  13491. return resolveWith(config, InternalDistanceAngleOptionsNormalizers);
  13492. }
  13493. function getInternalDragOptions(config) {
  13494. if (config === void 0) {
  13495. config = {};
  13496. }
  13497. return resolveWith(config, InternalDragOptionsNormalizers);
  13498. }
  13499. function _buildMoveConfig(_ref) {
  13500. var domTarget = _ref.domTarget,
  13501. eventOptions = _ref.eventOptions,
  13502. window = _ref.window,
  13503. enabled = _ref.enabled,
  13504. rest = _objectWithoutPropertiesLoose(_ref, ["domTarget", "eventOptions", "window", "enabled"]);
  13505. var opts = getInternalGenericOptions({
  13506. domTarget: domTarget,
  13507. eventOptions: eventOptions,
  13508. window: window,
  13509. enabled: enabled
  13510. });
  13511. opts.move = getInternalCoordinatesOptions(rest);
  13512. return opts;
  13513. }
  13514. function _buildHoverConfig(_ref2) {
  13515. var domTarget = _ref2.domTarget,
  13516. eventOptions = _ref2.eventOptions,
  13517. window = _ref2.window,
  13518. enabled = _ref2.enabled,
  13519. rest = _objectWithoutPropertiesLoose(_ref2, ["domTarget", "eventOptions", "window", "enabled"]);
  13520. var opts = getInternalGenericOptions({
  13521. domTarget: domTarget,
  13522. eventOptions: eventOptions,
  13523. window: window,
  13524. enabled: enabled
  13525. });
  13526. opts.hover = _extends({
  13527. enabled: true
  13528. }, rest);
  13529. return opts;
  13530. }
  13531. function _buildDragConfig(_ref3) {
  13532. var domTarget = _ref3.domTarget,
  13533. eventOptions = _ref3.eventOptions,
  13534. window = _ref3.window,
  13535. enabled = _ref3.enabled,
  13536. rest = _objectWithoutPropertiesLoose(_ref3, ["domTarget", "eventOptions", "window", "enabled"]);
  13537. var opts = getInternalGenericOptions({
  13538. domTarget: domTarget,
  13539. eventOptions: eventOptions,
  13540. window: window,
  13541. enabled: enabled
  13542. });
  13543. opts.drag = getInternalDragOptions(rest);
  13544. return opts;
  13545. }
  13546. function _buildPinchConfig(_ref4) {
  13547. var domTarget = _ref4.domTarget,
  13548. eventOptions = _ref4.eventOptions,
  13549. window = _ref4.window,
  13550. enabled = _ref4.enabled,
  13551. rest = _objectWithoutPropertiesLoose(_ref4, ["domTarget", "eventOptions", "window", "enabled"]);
  13552. var opts = getInternalGenericOptions({
  13553. domTarget: domTarget,
  13554. eventOptions: eventOptions,
  13555. window: window,
  13556. enabled: enabled
  13557. });
  13558. opts.pinch = getInternalDistanceAngleOptions(rest);
  13559. return opts;
  13560. }
  13561. function _buildScrollConfig(_ref5) {
  13562. var domTarget = _ref5.domTarget,
  13563. eventOptions = _ref5.eventOptions,
  13564. window = _ref5.window,
  13565. enabled = _ref5.enabled,
  13566. rest = _objectWithoutPropertiesLoose(_ref5, ["domTarget", "eventOptions", "window", "enabled"]);
  13567. var opts = getInternalGenericOptions({
  13568. domTarget: domTarget,
  13569. eventOptions: eventOptions,
  13570. window: window,
  13571. enabled: enabled
  13572. });
  13573. opts.scroll = getInternalCoordinatesOptions(rest);
  13574. return opts;
  13575. }
  13576. function _buildWheelConfig(_ref6) {
  13577. var domTarget = _ref6.domTarget,
  13578. eventOptions = _ref6.eventOptions,
  13579. window = _ref6.window,
  13580. enabled = _ref6.enabled,
  13581. rest = _objectWithoutPropertiesLoose(_ref6, ["domTarget", "eventOptions", "window", "enabled"]);
  13582. var opts = getInternalGenericOptions({
  13583. domTarget: domTarget,
  13584. eventOptions: eventOptions,
  13585. window: window,
  13586. enabled: enabled
  13587. });
  13588. opts.wheel = getInternalCoordinatesOptions(rest);
  13589. return opts;
  13590. }
  13591. function buildComplexConfig(config, actions) {
  13592. if (config === void 0) {
  13593. config = {};
  13594. }
  13595. if (actions === void 0) {
  13596. actions = new Set();
  13597. }
  13598. var _config = config,
  13599. drag = _config.drag,
  13600. wheel = _config.wheel,
  13601. move = _config.move,
  13602. scroll = _config.scroll,
  13603. pinch = _config.pinch,
  13604. hover = _config.hover,
  13605. eventOptions = _config.eventOptions,
  13606. window = _config.window,
  13607. transform = _config.transform,
  13608. domTarget = _config.domTarget,
  13609. enabled = _config.enabled;
  13610. var mergedConfig = getInternalGenericOptions({
  13611. domTarget: domTarget,
  13612. eventOptions: eventOptions,
  13613. transform: transform,
  13614. window: window,
  13615. enabled: enabled
  13616. });
  13617. if (actions.has('onDrag')) mergedConfig.drag = getInternalDragOptions(drag);
  13618. if (actions.has('onWheel')) mergedConfig.wheel = getInternalCoordinatesOptions(wheel);
  13619. if (actions.has('onScroll')) mergedConfig.scroll = getInternalCoordinatesOptions(scroll);
  13620. if (actions.has('onMove')) mergedConfig.move = getInternalCoordinatesOptions(move);
  13621. if (actions.has('onPinch')) mergedConfig.pinch = getInternalDistanceAngleOptions(pinch);
  13622. if (actions.has('onHover')) mergedConfig.hover = _extends({
  13623. enabled: true
  13624. }, hover);
  13625. return mergedConfig;
  13626. }
  13627. function getInitial(mixed) {
  13628. return _extends({
  13629. _active: false,
  13630. _blocked: false,
  13631. _intentional: [false, false],
  13632. _movement: [0, 0],
  13633. _initial: [0, 0],
  13634. _bounds: [[-Infinity, Infinity], [-Infinity, Infinity]],
  13635. _threshold: [0, 0],
  13636. _lastEventType: undefined,
  13637. _dragStarted: false,
  13638. _dragPreventScroll: false,
  13639. _dragIsTap: true,
  13640. _dragDelayed: false,
  13641. event: undefined,
  13642. intentional: false,
  13643. values: [0, 0],
  13644. velocities: [0, 0],
  13645. delta: [0, 0],
  13646. movement: [0, 0],
  13647. offset: [0, 0],
  13648. lastOffset: [0, 0],
  13649. direction: [0, 0],
  13650. initial: [0, 0],
  13651. previous: [0, 0],
  13652. first: false,
  13653. last: false,
  13654. active: false,
  13655. timeStamp: 0,
  13656. startTime: 0,
  13657. elapsedTime: 0,
  13658. cancel: noop,
  13659. canceled: false,
  13660. memo: undefined,
  13661. args: undefined
  13662. }, mixed);
  13663. }
  13664. function getInitialState() {
  13665. var shared = {
  13666. hovering: false,
  13667. scrolling: false,
  13668. wheeling: false,
  13669. dragging: false,
  13670. moving: false,
  13671. pinching: false,
  13672. touches: 0,
  13673. buttons: 0,
  13674. down: false,
  13675. shiftKey: false,
  13676. altKey: false,
  13677. metaKey: false,
  13678. ctrlKey: false,
  13679. locked: false
  13680. };
  13681. var drag = getInitial({
  13682. _pointerId: undefined,
  13683. axis: undefined,
  13684. xy: [0, 0],
  13685. vxvy: [0, 0],
  13686. velocity: 0,
  13687. distance: 0,
  13688. tap: false,
  13689. swipe: [0, 0]
  13690. });
  13691. var pinch = getInitial({
  13692. // @ts-expect-error when used _pointerIds we can assert its type will be [number, number]
  13693. _pointerIds: [],
  13694. da: [0, 0],
  13695. vdva: [0, 0],
  13696. // @ts-expect-error origin can never be passed as undefined in userland
  13697. origin: undefined,
  13698. turns: 0
  13699. });
  13700. var wheel = getInitial({
  13701. axis: undefined,
  13702. xy: [0, 0],
  13703. vxvy: [0, 0],
  13704. velocity: 0,
  13705. distance: 0
  13706. });
  13707. var move = getInitial({
  13708. axis: undefined,
  13709. xy: [0, 0],
  13710. vxvy: [0, 0],
  13711. velocity: 0,
  13712. distance: 0
  13713. });
  13714. var scroll = getInitial({
  13715. axis: undefined,
  13716. xy: [0, 0],
  13717. vxvy: [0, 0],
  13718. velocity: 0,
  13719. distance: 0
  13720. });
  13721. return {
  13722. shared: shared,
  13723. drag: drag,
  13724. pinch: pinch,
  13725. wheel: wheel,
  13726. move: move,
  13727. scroll: scroll
  13728. };
  13729. }
  13730. var RecognizersMap = /*#__PURE__*/new Map();
  13731. var identity$1 = function identity(xy) {
  13732. return xy;
  13733. };
  13734. /**
  13735. * @private
  13736. * Recognizer abstract class.
  13737. */
  13738. var Recognizer = /*#__PURE__*/function () {
  13739. /**
  13740. * Creates an instance of a gesture recognizer.
  13741. * @param stateKey drag, move, pinch, etc.
  13742. * @param controller the controller attached to the gesture
  13743. * @param [args] the args that should be passed to the gesture handler
  13744. */
  13745. function Recognizer(controller, args) {
  13746. var _this = this;
  13747. if (args === void 0) {
  13748. args = [];
  13749. }
  13750. this.controller = controller;
  13751. this.args = args;
  13752. this.debounced = true; // Convenience method to set a timeout for a given gesture
  13753. this.setTimeout = function (callback, ms) {
  13754. var _window;
  13755. if (ms === void 0) {
  13756. ms = 140;
  13757. }
  13758. clearTimeout(_this.controller.timeouts[_this.stateKey]);
  13759. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  13760. args[_key - 2] = arguments[_key];
  13761. }
  13762. _this.controller.timeouts[_this.stateKey] = (_window = window).setTimeout.apply(_window, [callback, ms].concat(args));
  13763. }; // Convenience method to clear a timeout for a given gesture
  13764. this.clearTimeout = function () {
  13765. clearTimeout(_this.controller.timeouts[_this.stateKey]);
  13766. };
  13767. /**
  13768. * Fires the gesture handler
  13769. */
  13770. this.fireGestureHandler = function (forceFlag) {
  13771. if (forceFlag === void 0) {
  13772. forceFlag = false;
  13773. }
  13774. /**
  13775. * If the gesture has been blocked (this can happen when the gesture has started in an unwanted direction),
  13776. * clean everything and don't do anything.
  13777. */
  13778. if (_this.state._blocked) {
  13779. // we need debounced gestures to end by themselves
  13780. if (!_this.debounced) {
  13781. _this.state._active = false;
  13782. _this.clean();
  13783. }
  13784. return null;
  13785. } // If the gesture has no intentional dimension, don't fire the handler.
  13786. if (!forceFlag && !_this.state.intentional && !_this.config.triggerAllEvents) return null;
  13787. if (_this.state.intentional) {
  13788. var prev_active = _this.state.active;
  13789. var next_active = _this.state._active;
  13790. _this.state.active = next_active;
  13791. _this.state.first = next_active && !prev_active;
  13792. _this.state.last = prev_active && !next_active;
  13793. _this.controller.state.shared[_this.ingKey] = next_active; // Sets dragging, pinching, etc. to the gesture active state
  13794. }
  13795. var touches = _this.controller.pointerIds.size || _this.controller.touchIds.size;
  13796. var down = _this.controller.state.shared.buttons > 0 || touches > 0;
  13797. var state = _extends({}, _this.controller.state.shared, _this.state, _this.mapStateValues(_this.state), {
  13798. locked: !!document.pointerLockElement,
  13799. touches: touches,
  13800. down: down
  13801. }); // @ts-expect-error
  13802. var newMemo = _this.handler(state); // Sets memo to the returned value of the handler (unless it's not undefined)
  13803. _this.state.memo = newMemo !== void 0 ? newMemo : _this.state.memo;
  13804. return state;
  13805. };
  13806. this.controller = controller;
  13807. this.args = args;
  13808. } // Returns the gesture config
  13809. var _proto = Recognizer.prototype;
  13810. // Convenience method to update the shared state
  13811. _proto.updateSharedState = function updateSharedState(sharedState) {
  13812. Object.assign(this.controller.state.shared, sharedState);
  13813. } // Convenience method to update the gesture state
  13814. ;
  13815. _proto.updateGestureState = function updateGestureState(gestureState) {
  13816. Object.assign(this.state, gestureState);
  13817. }
  13818. /**
  13819. * Returns state properties depending on the movement and state.
  13820. *
  13821. * Should be overriden for custom behavior, doesn't do anything in the implementation
  13822. * below.
  13823. */
  13824. ;
  13825. _proto.checkIntentionality = function checkIntentionality(_intentional, _movement) {
  13826. return {
  13827. _intentional: _intentional,
  13828. _blocked: false
  13829. };
  13830. }
  13831. /**
  13832. * Returns basic movement properties for the gesture based on the next values and current state.
  13833. */
  13834. ;
  13835. _proto.getMovement = function getMovement(values) {
  13836. var rubberband = this.config.rubberband;
  13837. var _this$state = this.state,
  13838. _bounds = _this$state._bounds,
  13839. _initial = _this$state._initial,
  13840. _active = _this$state._active,
  13841. wasIntentional = _this$state._intentional,
  13842. lastOffset = _this$state.lastOffset,
  13843. prevMovement = _this$state.movement,
  13844. _T = _this$state._threshold;
  13845. var M = this.getInternalMovement(values, this.state);
  13846. var i0 = wasIntentional[0] === false ? getIntentionalDisplacement(M[0], _T[0]) : wasIntentional[0];
  13847. var i1 = wasIntentional[1] === false ? getIntentionalDisplacement(M[1], _T[1]) : wasIntentional[1]; // Get gesture specific state properties based on intentionality and movement.
  13848. var intentionalityCheck = this.checkIntentionality([i0, i1], M);
  13849. if (intentionalityCheck._blocked) {
  13850. return _extends({}, intentionalityCheck, {
  13851. _movement: M,
  13852. delta: [0, 0]
  13853. });
  13854. }
  13855. var _intentional = intentionalityCheck._intentional;
  13856. var _movement = M;
  13857. /**
  13858. * The movement sent to the handler has 0 in its dimensions when intentionality is false.
  13859. * It is calculated from the actual movement minus the threshold.
  13860. */
  13861. var movement = [_intentional[0] !== false ? M[0] - _intentional[0] : 0, _intentional[1] !== false ? M[1] - _intentional[1] : 0];
  13862. var offset = addV(movement, lastOffset);
  13863. /**
  13864. * Rubberband should be 0 when the gesture is no longer active, so that movement
  13865. * and offset can return within their bounds.
  13866. */
  13867. var _rubberband = _active ? rubberband : [0, 0];
  13868. movement = computeRubberband(_bounds, addV(movement, _initial), _rubberband);
  13869. return _extends({}, intentionalityCheck, {
  13870. intentional: _intentional[0] !== false || _intentional[1] !== false,
  13871. _initial: _initial,
  13872. _movement: _movement,
  13873. movement: movement,
  13874. values: values,
  13875. offset: computeRubberband(_bounds, offset, _rubberband),
  13876. delta: subV(movement, prevMovement)
  13877. });
  13878. } // Cleans the gesture. Can be overriden by gestures.
  13879. ;
  13880. _proto.clean = function clean() {
  13881. this.clearTimeout();
  13882. };
  13883. _createClass(Recognizer, [{
  13884. key: "config",
  13885. get: function get() {
  13886. return this.controller.config[this.stateKey];
  13887. } // Is the gesture enabled
  13888. }, {
  13889. key: "enabled",
  13890. get: function get() {
  13891. return this.controller.config.enabled && this.config.enabled;
  13892. } // Returns the controller state for a given gesture
  13893. }, {
  13894. key: "state",
  13895. get: function get() {
  13896. return this.controller.state[this.stateKey];
  13897. } // Returns the gesture handler
  13898. }, {
  13899. key: "handler",
  13900. get: function get() {
  13901. return this.controller.handlers[this.stateKey];
  13902. }
  13903. }, {
  13904. key: "transform",
  13905. get: function get() {
  13906. return this.config.transform || this.controller.config.transform || identity$1;
  13907. }
  13908. }]);
  13909. return Recognizer;
  13910. }(); //--------------------------------------------
  13911. function getIntentionalDisplacement(movement, threshold) {
  13912. if (Math.abs(movement) >= threshold) {
  13913. return sign(movement) * threshold;
  13914. } else {
  13915. return false;
  13916. }
  13917. }
  13918. function computeRubberband(bounds, _ref, _ref2) {
  13919. var Vx = _ref[0],
  13920. Vy = _ref[1];
  13921. var Rx = _ref2[0],
  13922. Ry = _ref2[1];
  13923. var _bounds$ = bounds[0],
  13924. X1 = _bounds$[0],
  13925. X2 = _bounds$[1],
  13926. _bounds$2 = bounds[1],
  13927. Y1 = _bounds$2[0],
  13928. Y2 = _bounds$2[1];
  13929. return [rubberbandIfOutOfBounds(Vx, X1, X2, Rx), rubberbandIfOutOfBounds(Vy, Y1, Y2, Ry)];
  13930. }
  13931. /**
  13932. * Returns a generic, common payload for all gestures from an event.
  13933. */
  13934. function getGenericPayload(_ref3, event, isStartEvent) {
  13935. var state = _ref3.state;
  13936. var timeStamp = event.timeStamp,
  13937. _lastEventType = event.type;
  13938. var previous = state.values;
  13939. var elapsedTime = isStartEvent ? 0 : timeStamp - state.startTime;
  13940. return {
  13941. _lastEventType: _lastEventType,
  13942. event: event,
  13943. timeStamp: timeStamp,
  13944. elapsedTime: elapsedTime,
  13945. previous: previous
  13946. };
  13947. }
  13948. /**
  13949. * Returns the reinitialized start state for the gesture.
  13950. * Should be common to all gestures.
  13951. */
  13952. function getStartGestureState(_ref4, values, event, initial) {
  13953. var state = _ref4.state,
  13954. config = _ref4.config,
  13955. stateKey = _ref4.stateKey,
  13956. args = _ref4.args,
  13957. transform = _ref4.transform;
  13958. var offset = state.offset;
  13959. var startTime = event.timeStamp;
  13960. var initialFn = config.initial,
  13961. bounds = config.bounds,
  13962. threshold = config.threshold; // the _threshold is the difference between a [0,0] offset converted to
  13963. // its new space coordinates
  13964. var _threshold = subV(transform(threshold), transform([0, 0])).map(Math.abs);
  13965. var _state = _extends({}, getInitialState()[stateKey], {
  13966. _active: true,
  13967. args: args,
  13968. values: values,
  13969. initial: initial != null ? initial : values,
  13970. _threshold: _threshold,
  13971. offset: offset,
  13972. lastOffset: offset,
  13973. startTime: startTime
  13974. });
  13975. return _extends({}, _state, {
  13976. _initial: valueFn(initialFn, _state),
  13977. _bounds: valueFn(bounds, _state)
  13978. });
  13979. }
  13980. /**
  13981. * The controller will keep track of the state for all gestures and also keep
  13982. * track of timeouts, and window listeners.
  13983. */
  13984. var Controller = function Controller(classes) {
  13985. var _this = this;
  13986. this.classes = classes;
  13987. this.pointerIds = new Set(); // register Pointer Events pointerIds
  13988. this.touchIds = new Set(); // register Touch Events identifiers
  13989. this.supportsTouchEvents = supportsTouchEvents();
  13990. this.supportsGestureEvents = supportsGestureEvents();
  13991. this.bind = function () {
  13992. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  13993. args[_key] = arguments[_key];
  13994. }
  13995. var bindings = {};
  13996. for (var _iterator = _createForOfIteratorHelperLoose(_this.classes), _step; !(_step = _iterator()).done;) {
  13997. var RecognizerClass = _step.value;
  13998. new RecognizerClass(_this, args).addBindings(bindings);
  13999. } // // we also add event bindings for native handlers
  14000. var _loop = function _loop(eventKey) {
  14001. addBindings(bindings, eventKey, function (event) {
  14002. return _this.nativeRefs[eventKey](_extends({}, _this.state.shared, {
  14003. event: event,
  14004. args: args
  14005. }));
  14006. });
  14007. };
  14008. for (var eventKey in _this.nativeRefs) {
  14009. _loop(eventKey);
  14010. }
  14011. if (_this.config.domTarget) {
  14012. // If config.domTarget is set we add event listeners to it and return the clean function.
  14013. return updateDomListeners(_this, bindings);
  14014. } else {
  14015. // If not, we return an object that contains gesture handlers mapped to react handler event keys.
  14016. return getPropsListener(_this, bindings);
  14017. }
  14018. };
  14019. this.effect = function () {
  14020. if (_this.config.domTarget) _this.bind();
  14021. return _this.clean;
  14022. };
  14023. /**
  14024. * Function ran on component unmount: cleans timeouts and removes dom listeners set by the bind function.
  14025. */
  14026. this.clean = function () {
  14027. var domTarget = getDomTargetFromConfig(_this.config);
  14028. var eventOptions = _this.config.eventOptions;
  14029. if (domTarget) removeListeners(domTarget, takeAll(_this.domListeners), eventOptions);
  14030. Object.values(_this.timeouts).forEach(clearTimeout);
  14031. clearAllWindowListeners(_this);
  14032. };
  14033. this.classes = classes;
  14034. this.state = getInitialState();
  14035. this.timeouts = {};
  14036. this.domListeners = [];
  14037. this.windowListeners = {};
  14038. };
  14039. function addEventIds(controller, event) {
  14040. if ('pointerId' in event) {
  14041. controller.pointerIds.add(event.pointerId);
  14042. } else {
  14043. controller.touchIds = new Set(getTouchIds(event));
  14044. }
  14045. }
  14046. function removeEventIds(controller, event) {
  14047. if ('pointerId' in event) {
  14048. controller.pointerIds["delete"](event.pointerId);
  14049. } else {
  14050. getTouchIds(event).forEach(function (id) {
  14051. return controller.touchIds["delete"](id);
  14052. });
  14053. }
  14054. }
  14055. function clearAllWindowListeners(controller) {
  14056. var _controller$config = controller.config,
  14057. el = _controller$config.window,
  14058. eventOptions = _controller$config.eventOptions,
  14059. windowListeners = controller.windowListeners;
  14060. if (!el) return;
  14061. for (var stateKey in windowListeners) {
  14062. var handlers = windowListeners[stateKey];
  14063. removeListeners(el, handlers, eventOptions);
  14064. }
  14065. controller.windowListeners = {};
  14066. }
  14067. function clearWindowListeners(_ref, stateKey, options) {
  14068. var config = _ref.config,
  14069. windowListeners = _ref.windowListeners;
  14070. if (options === void 0) {
  14071. options = config.eventOptions;
  14072. }
  14073. if (!config.window) return;
  14074. removeListeners(config.window, windowListeners[stateKey], options);
  14075. delete windowListeners[stateKey];
  14076. }
  14077. function updateWindowListeners(_ref2, stateKey, listeners, options) {
  14078. var config = _ref2.config,
  14079. windowListeners = _ref2.windowListeners;
  14080. if (listeners === void 0) {
  14081. listeners = [];
  14082. }
  14083. if (options === void 0) {
  14084. options = config.eventOptions;
  14085. }
  14086. if (!config.window) return;
  14087. removeListeners(config.window, windowListeners[stateKey], options);
  14088. addListeners(config.window, windowListeners[stateKey] = listeners, options);
  14089. }
  14090. function updateDomListeners(_ref3, bindings) {
  14091. var config = _ref3.config,
  14092. domListeners = _ref3.domListeners;
  14093. var domTarget = getDomTargetFromConfig(config);
  14094. if (!domTarget) throw new Error('domTarget must be defined');
  14095. var eventOptions = config.eventOptions;
  14096. removeListeners(domTarget, takeAll(domListeners), eventOptions);
  14097. for (var _i = 0, _Object$entries = Object.entries(bindings); _i < _Object$entries.length; _i++) {
  14098. var _Object$entries$_i = _Object$entries[_i],
  14099. key = _Object$entries$_i[0],
  14100. fns = _Object$entries$_i[1];
  14101. var name = key.slice(2).toLowerCase();
  14102. domListeners.push([name, chainFns.apply(void 0, fns)]);
  14103. }
  14104. addListeners(domTarget, domListeners, eventOptions);
  14105. }
  14106. function getPropsListener(_ref4, bindings) {
  14107. var config = _ref4.config;
  14108. var props = {};
  14109. var captureString = config.eventOptions.capture ? 'Capture' : '';
  14110. for (var _i2 = 0, _Object$entries2 = Object.entries(bindings); _i2 < _Object$entries2.length; _i2++) {
  14111. var _Object$entries2$_i = _Object$entries2[_i2],
  14112. event = _Object$entries2$_i[0],
  14113. fns = _Object$entries2$_i[1];
  14114. var fnsArray = Array.isArray(fns) ? fns : [fns];
  14115. var key = event + captureString;
  14116. props[key] = chainFns.apply(void 0, fnsArray);
  14117. }
  14118. return props;
  14119. }
  14120. function takeAll(array) {
  14121. if (array === void 0) {
  14122. array = [];
  14123. }
  14124. return array.splice(0, array.length);
  14125. }
  14126. function getDomTargetFromConfig(_ref5) {
  14127. var domTarget = _ref5.domTarget;
  14128. return domTarget && 'current' in domTarget ? domTarget.current : domTarget;
  14129. }
  14130. /**
  14131. * bindings is an object which keys match ReactEventHandlerKeys.
  14132. * Since a recognizer might want to bind a handler function to an event key already used by a previously
  14133. * added recognizer, we need to make sure that each event key is an array of all the functions mapped for
  14134. * that key.
  14135. */
  14136. function addBindings(bindings, name, fn) {
  14137. if (!bindings[name]) bindings[name] = [];
  14138. bindings[name].push(fn);
  14139. }
  14140. function addListeners(el, listeners, options) {
  14141. if (listeners === void 0) {
  14142. listeners = [];
  14143. }
  14144. if (options === void 0) {
  14145. options = {};
  14146. }
  14147. for (var _iterator2 = _createForOfIteratorHelperLoose(listeners), _step2; !(_step2 = _iterator2()).done;) {
  14148. var _step2$value = _step2.value,
  14149. eventName = _step2$value[0],
  14150. eventHandler = _step2$value[1];
  14151. el.addEventListener(eventName, eventHandler, options);
  14152. }
  14153. }
  14154. function removeListeners(el, listeners, options) {
  14155. if (listeners === void 0) {
  14156. listeners = [];
  14157. }
  14158. if (options === void 0) {
  14159. options = {};
  14160. }
  14161. for (var _iterator3 = _createForOfIteratorHelperLoose(listeners), _step3; !(_step3 = _iterator3()).done;) {
  14162. var _step3$value = _step3.value,
  14163. eventName = _step3$value[0],
  14164. eventHandler = _step3$value[1];
  14165. el.removeEventListener(eventName, eventHandler, options);
  14166. }
  14167. }
  14168. /* eslint-disable react-hooks/exhaustive-deps */
  14169. /**
  14170. * Utility hook called by all gesture hooks and that will be responsible for the internals.
  14171. *
  14172. * @param handlers
  14173. * @param classes
  14174. * @param config
  14175. * @param nativeHandlers - native handlers such as onClick, onMouseDown, etc.
  14176. */
  14177. function useRecognizers(handlers, config, nativeHandlers) {
  14178. if (nativeHandlers === void 0) {
  14179. nativeHandlers = {};
  14180. }
  14181. var classes = resolveClasses(handlers);
  14182. var controller = external_React_default.a.useMemo(function () {
  14183. return new Controller(classes);
  14184. }, []);
  14185. controller.config = config;
  14186. controller.handlers = handlers;
  14187. controller.nativeRefs = nativeHandlers;
  14188. external_React_default.a.useEffect(controller.effect, []); // @ts-ignore
  14189. if (controller.config.domTarget) return deprecationNoticeForDomTarget; // @ts-ignore
  14190. return controller.bind;
  14191. }
  14192. function deprecationNoticeForDomTarget() {
  14193. if (false) {}
  14194. }
  14195. function resolveClasses(internalHandlers) {
  14196. var classes = new Set();
  14197. if (internalHandlers.drag) classes.add(RecognizersMap.get('drag'));
  14198. if (internalHandlers.wheel) classes.add(RecognizersMap.get('wheel'));
  14199. if (internalHandlers.scroll) classes.add(RecognizersMap.get('scroll'));
  14200. if (internalHandlers.move) classes.add(RecognizersMap.get('move'));
  14201. if (internalHandlers.pinch) classes.add(RecognizersMap.get('pinch'));
  14202. if (internalHandlers.hover) classes.add(RecognizersMap.get('hover'));
  14203. return classes;
  14204. }
  14205. /**
  14206. * @private
  14207. * Abstract class for coordinates-based gesture recongizers
  14208. */
  14209. var CoordinatesRecognizer = /*#__PURE__*/function (_Recognizer) {
  14210. reactusegesture_esm_inheritsLoose(CoordinatesRecognizer, _Recognizer);
  14211. function CoordinatesRecognizer() {
  14212. return _Recognizer.apply(this, arguments) || this;
  14213. }
  14214. var _proto = CoordinatesRecognizer.prototype;
  14215. /**
  14216. * Returns the real movement (without taking intentionality into account)
  14217. */
  14218. _proto.getInternalMovement = function getInternalMovement(values, state) {
  14219. return subV(values, state.initial);
  14220. }
  14221. /**
  14222. * In coordinates-based gesture, this function will detect the first intentional axis,
  14223. * lock the gesture axis if lockDirection is specified in the config, block the gesture
  14224. * if the first intentional axis doesn't match the specified axis in config.
  14225. */
  14226. ;
  14227. _proto.checkIntentionality = function checkIntentionality(_intentional, _movement) {
  14228. if (_intentional[0] === false && _intentional[1] === false) {
  14229. return {
  14230. _intentional: _intentional,
  14231. axis: this.state.axis
  14232. };
  14233. }
  14234. var _movement$map = _movement.map(Math.abs),
  14235. absX = _movement$map[0],
  14236. absY = _movement$map[1];
  14237. var axis = this.state.axis || (absX > absY ? 'x' : absX < absY ? 'y' : undefined);
  14238. if (!this.config.axis && !this.config.lockDirection) return {
  14239. _intentional: _intentional,
  14240. _blocked: false,
  14241. axis: axis
  14242. };
  14243. if (!axis) return {
  14244. _intentional: [false, false],
  14245. _blocked: false,
  14246. axis: axis
  14247. };
  14248. if (!!this.config.axis && axis !== this.config.axis) return {
  14249. _intentional: _intentional,
  14250. _blocked: true,
  14251. axis: axis
  14252. };
  14253. _intentional[axis === 'x' ? 1 : 0] = false;
  14254. return {
  14255. _intentional: _intentional,
  14256. _blocked: false,
  14257. axis: axis
  14258. };
  14259. };
  14260. _proto.getKinematics = function getKinematics(values, event) {
  14261. var state = this.getMovement(values);
  14262. if (!state._blocked) {
  14263. var dt = event.timeStamp - this.state.timeStamp;
  14264. Object.assign(state, calculateAllKinematics(state.movement, state.delta, dt));
  14265. }
  14266. return state;
  14267. };
  14268. _proto.mapStateValues = function mapStateValues(state) {
  14269. return {
  14270. xy: state.values,
  14271. vxvy: state.velocities
  14272. };
  14273. };
  14274. return CoordinatesRecognizer;
  14275. }(Recognizer);
  14276. var TAP_DISTANCE_THRESHOLD = 3;
  14277. function persistEvent(event) {
  14278. 'persist' in event && typeof event.persist === 'function' && event.persist();
  14279. }
  14280. var DragRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
  14281. reactusegesture_esm_inheritsLoose(DragRecognizer, _CoordinatesRecognize);
  14282. function DragRecognizer() {
  14283. var _this;
  14284. _this = _CoordinatesRecognize.apply(this, arguments) || this;
  14285. _this.ingKey = 'dragging';
  14286. _this.stateKey = 'drag'; // TODO add back when setPointerCapture is widely wupported
  14287. // https://caniuse.com/#search=setPointerCapture
  14288. _this.setPointerCapture = function (event) {
  14289. // don't perform pointere capture when user wants to use touch events or
  14290. // when a pointerLockElement exists as this would throw an error
  14291. if (_this.config.useTouch || document.pointerLockElement) return;
  14292. var target = event.target,
  14293. pointerId = event.pointerId;
  14294. if (target && 'setPointerCapture' in target) {
  14295. // this would work in the DOM but doesn't with react three fiber
  14296. // target.addEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions)
  14297. // @ts-expect-error
  14298. target.setPointerCapture(pointerId);
  14299. }
  14300. _this.updateGestureState({
  14301. _dragTarget: target,
  14302. _dragPointerId: pointerId
  14303. });
  14304. };
  14305. _this.releasePointerCapture = function () {
  14306. if (_this.config.useTouch || document.pointerLockElement) return;
  14307. var _this$state = _this.state,
  14308. _dragTarget = _this$state._dragTarget,
  14309. _dragPointerId = _this$state._dragPointerId;
  14310. if (_dragPointerId && _dragTarget && 'releasePointerCapture' in _dragTarget) {
  14311. // this would work in the DOM but doesn't with react three fiber
  14312. // target.removeEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions)
  14313. if (!('hasPointerCapture' in _dragTarget) || _dragTarget.hasPointerCapture(_dragPointerId)) try {
  14314. _dragTarget.releasePointerCapture(_dragPointerId);
  14315. } catch (e) {}
  14316. }
  14317. };
  14318. _this.preventScroll = function (event) {
  14319. if (_this.state._dragPreventScroll && event.cancelable) {
  14320. event.preventDefault();
  14321. }
  14322. };
  14323. _this.getEventId = function (event) {
  14324. if (_this.config.useTouch) return event.changedTouches[0].identifier;
  14325. return event.pointerId;
  14326. };
  14327. _this.isValidEvent = function (event) {
  14328. // if we were using pointer events only event.isPrimary === 1 would suffice
  14329. return _this.state._pointerId === _this.getEventId(event);
  14330. };
  14331. _this.shouldPreventWindowScrollY = _this.config.experimental_preventWindowScrollY && _this.controller.supportsTouchEvents;
  14332. _this.setUpWindowScrollDetection = function (event) {
  14333. persistEvent(event); // we add window listeners that will prevent the scroll when the user has started dragging
  14334. updateWindowListeners(_this.controller, _this.stateKey, [['touchmove', _this.preventScroll], ['touchend', _this.clean.bind(_assertThisInitialized(_this))], ['touchcancel', _this.clean.bind(_assertThisInitialized(_this))]], {
  14335. passive: false
  14336. });
  14337. _this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), 250, event);
  14338. };
  14339. _this.setUpDelayedDragTrigger = function (event) {
  14340. _this.state._dragDelayed = true;
  14341. persistEvent(event);
  14342. _this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), _this.config.delay, event);
  14343. };
  14344. _this.setStartState = function (event) {
  14345. var values = getPointerEventValues(event, _this.transform);
  14346. _this.updateSharedState(getGenericEventData(event));
  14347. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), {
  14348. _pointerId: _this.getEventId(event)
  14349. }));
  14350. _this.updateGestureState(_this.getMovement(values));
  14351. };
  14352. _this.onDragStart = function (event) {
  14353. addEventIds(_this.controller, event);
  14354. if (!_this.enabled || _this.state._active) return;
  14355. _this.setStartState(event);
  14356. _this.setPointerCapture(event);
  14357. if (_this.shouldPreventWindowScrollY) _this.setUpWindowScrollDetection(event);else if (_this.config.delay > 0) _this.setUpDelayedDragTrigger(event);else _this.startDrag(event, true); // we pass the values to the startDrag event
  14358. };
  14359. _this.onDragChange = function (event) {
  14360. if ( // if the gesture was canceled or
  14361. _this.state.canceled || // if onDragStart wasn't fired or
  14362. !_this.state._active || // if the event pointerId doesn't match the one that initiated the drag
  14363. !_this.isValidEvent(event) || // if the event has the same timestamp as the previous event
  14364. // note that checking type equality is ONLY for tests ¯\_(ツ)_/¯
  14365. _this.state._lastEventType === event.type && event.timeStamp === _this.state.timeStamp) return;
  14366. var values;
  14367. if (document.pointerLockElement) {
  14368. var movementX = event.movementX,
  14369. movementY = event.movementY;
  14370. values = addV(_this.transform([movementX, movementY]), _this.state.values);
  14371. } else values = getPointerEventValues(event, _this.transform);
  14372. var kinematics = _this.getKinematics(values, event); // if startDrag hasn't fired
  14373. if (!_this.state._dragStarted) {
  14374. // If the gesture isn't active then respond to the event only if
  14375. // it's been delayed via the `delay` option, in which case start
  14376. // the gesture immediately.
  14377. if (_this.state._dragDelayed) {
  14378. _this.startDrag(event);
  14379. return;
  14380. } // if the user wants to prevent vertical window scroll when user starts dragging
  14381. if (_this.shouldPreventWindowScrollY) {
  14382. if (!_this.state._dragPreventScroll && kinematics.axis) {
  14383. // if the user is dragging horizontally then we should allow the drag
  14384. if (kinematics.axis === 'x') {
  14385. _this.startDrag(event);
  14386. } else {
  14387. _this.state._active = false;
  14388. return;
  14389. }
  14390. } else return;
  14391. } else return;
  14392. }
  14393. var genericEventData = getGenericEventData(event);
  14394. _this.updateSharedState(genericEventData);
  14395. var genericPayload = getGenericPayload(_assertThisInitialized(_this), event); // This verifies if the drag can be assimilated to a tap by checking
  14396. // if the real distance of the drag (ie not accounting for the threshold) is
  14397. // greater than the TAP_DISTANCE_THRESHOLD.
  14398. var realDistance = calculateDistance(kinematics._movement);
  14399. var _dragIsTap = _this.state._dragIsTap;
  14400. if (_dragIsTap && realDistance >= TAP_DISTANCE_THRESHOLD) _dragIsTap = false;
  14401. _this.updateGestureState(_extends({}, genericPayload, kinematics, {
  14402. _dragIsTap: _dragIsTap
  14403. }));
  14404. _this.fireGestureHandler();
  14405. };
  14406. _this.onDragEnd = function (event) {
  14407. removeEventIds(_this.controller, event); // if the event pointerId doesn't match the one that initiated the drag
  14408. // we don't want to end the drag
  14409. if (!_this.isValidEvent(event)) return;
  14410. _this.clean(); // if the gesture is no longer active (ie canceled)
  14411. // don't do anything
  14412. if (!_this.state._active) return;
  14413. _this.state._active = false;
  14414. var tap = _this.state._dragIsTap;
  14415. var _this$state$velocitie = _this.state.velocities,
  14416. vx = _this$state$velocitie[0],
  14417. vy = _this$state$velocitie[1];
  14418. var _this$state$movement = _this.state.movement,
  14419. mx = _this$state$movement[0],
  14420. my = _this$state$movement[1];
  14421. var _this$state$_intentio = _this.state._intentional,
  14422. ix = _this$state$_intentio[0],
  14423. iy = _this$state$_intentio[1];
  14424. var _this$config$swipeVel = _this.config.swipeVelocity,
  14425. svx = _this$config$swipeVel[0],
  14426. svy = _this$config$swipeVel[1];
  14427. var _this$config$swipeDis = _this.config.swipeDistance,
  14428. sx = _this$config$swipeDis[0],
  14429. sy = _this$config$swipeDis[1];
  14430. var sd = _this.config.swipeDuration;
  14431. var endState = _extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values));
  14432. var swipe = [0, 0];
  14433. if (endState.elapsedTime < sd) {
  14434. if (ix !== false && Math.abs(vx) > svx && Math.abs(mx) > sx) swipe[0] = sign(vx);
  14435. if (iy !== false && Math.abs(vy) > svy && Math.abs(my) > sy) swipe[1] = sign(vy);
  14436. }
  14437. _this.updateSharedState({
  14438. buttons: 0
  14439. });
  14440. _this.updateGestureState(_extends({}, endState, {
  14441. tap: tap,
  14442. swipe: swipe
  14443. }));
  14444. _this.fireGestureHandler(_this.config.filterTaps && tap === true);
  14445. };
  14446. _this.clean = function () {
  14447. _CoordinatesRecognize.prototype.clean.call(_assertThisInitialized(_this));
  14448. _this.state._dragStarted = false;
  14449. _this.releasePointerCapture();
  14450. clearWindowListeners(_this.controller, _this.stateKey);
  14451. };
  14452. _this.onCancel = function () {
  14453. if (_this.state.canceled) return;
  14454. _this.updateGestureState({
  14455. canceled: true,
  14456. _active: false
  14457. });
  14458. _this.updateSharedState({
  14459. buttons: 0
  14460. });
  14461. setTimeout(function () {
  14462. return _this.fireGestureHandler();
  14463. }, 0);
  14464. };
  14465. _this.onClick = function (event) {
  14466. if (!_this.state._dragIsTap) event.stopPropagation();
  14467. };
  14468. return _this;
  14469. }
  14470. var _proto = DragRecognizer.prototype;
  14471. _proto.startDrag = function startDrag(event, onDragIsStart) {
  14472. if (onDragIsStart === void 0) {
  14473. onDragIsStart = false;
  14474. }
  14475. // startDrag can happen after a timeout, so we need to check if the gesture is still active
  14476. // as the user might have lift up the pointer in between.
  14477. if ( // if the gesture isn't active (probably means)
  14478. !this.state._active || // if the drag has already started we should ignore subsequent attempts
  14479. this.state._dragStarted) return;
  14480. if (!onDragIsStart) this.setStartState(event);
  14481. this.updateGestureState({
  14482. _dragStarted: true,
  14483. _dragPreventScroll: true,
  14484. cancel: this.onCancel
  14485. });
  14486. this.clearTimeout();
  14487. this.fireGestureHandler();
  14488. };
  14489. _proto.addBindings = function addBindings$1(bindings) {
  14490. if (this.config.useTouch) {
  14491. addBindings(bindings, 'onTouchStart', this.onDragStart);
  14492. addBindings(bindings, 'onTouchMove', this.onDragChange); // this is needed for react-three-fiber
  14493. addBindings(bindings, 'onTouchEnd', this.onDragEnd);
  14494. addBindings(bindings, 'onTouchCancel', this.onDragEnd);
  14495. } else {
  14496. addBindings(bindings, 'onPointerDown', this.onDragStart);
  14497. addBindings(bindings, 'onPointerMove', this.onDragChange); // this is needed for react-three-fiber
  14498. addBindings(bindings, 'onPointerUp', this.onDragEnd);
  14499. addBindings(bindings, 'onPointerCancel', this.onDragEnd);
  14500. }
  14501. if (this.config.filterTaps) {
  14502. var handler = this.controller.config.eventOptions.capture ? 'onClick' : 'onClickCapture';
  14503. addBindings(bindings, handler, this.onClick);
  14504. }
  14505. };
  14506. return DragRecognizer;
  14507. }(CoordinatesRecognizer);
  14508. /**
  14509. * Inlined from https://github.com/alexreardon/memoize-one
  14510. */
  14511. function memoizeOne(resultFn, isEqual) {
  14512. var lastThis;
  14513. var lastArgs = [];
  14514. var lastResult;
  14515. var calledOnce = false;
  14516. function memoized() {
  14517. for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) {
  14518. newArgs[_key] = arguments[_key];
  14519. }
  14520. if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
  14521. return lastResult;
  14522. }
  14523. lastResult = resultFn.apply(this, newArgs);
  14524. calledOnce = true;
  14525. lastThis = this;
  14526. lastArgs = newArgs;
  14527. return lastResult;
  14528. }
  14529. return memoized;
  14530. }
  14531. /**
  14532. * Taken from https://github.com/FormidableLabs/react-fast-compare
  14533. *
  14534. * Dropped comments and ArrayBuffer handling
  14535. */
  14536. function equal(a, b) {
  14537. if (a === b) return true;
  14538. if (a && b && typeof a == 'object' && typeof b == 'object') {
  14539. if (a.constructor !== b.constructor) return false;
  14540. var length, i, keys;
  14541. if (Array.isArray(a)) {
  14542. length = a.length;
  14543. if (length !== b.length) return false;
  14544. for (i = length; i-- !== 0;) {
  14545. if (!equal(a[i], b[i])) return false;
  14546. }
  14547. return true;
  14548. }
  14549. var it;
  14550. if (typeof Map === 'function' && a instanceof Map && b instanceof Map) {
  14551. if (a.size !== b.size) return false;
  14552. it = a.entries();
  14553. while (!(i = it.next()).done) {
  14554. if (!b.has(i.value[0])) return false;
  14555. }
  14556. it = a.entries();
  14557. while (!(i = it.next()).done) {
  14558. if (!equal(i.value[1], b.get(i.value[0]))) return false;
  14559. }
  14560. return true;
  14561. }
  14562. if (typeof Set === 'function' && a instanceof Set && b instanceof Set) {
  14563. if (a.size !== b.size) return false;
  14564. it = a.entries();
  14565. while (!(i = it.next()).done) {
  14566. if (!b.has(i.value[0])) return false;
  14567. }
  14568. return true;
  14569. }
  14570. if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
  14571. if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
  14572. if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
  14573. keys = Object.keys(a);
  14574. length = keys.length;
  14575. if (length !== Object.keys(b).length) return false;
  14576. for (i = length; i-- !== 0;) {
  14577. if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
  14578. }
  14579. if (typeof Element !== 'undefined' && a instanceof Element) return false;
  14580. for (i = length; i-- !== 0;) {
  14581. if (keys[i] === '_owner' && a.$$typeof) continue;
  14582. if (!equal(a[keys[i]], b[keys[i]])) return false;
  14583. }
  14584. return true;
  14585. } // true if both NaN, false otherwise — NaN !== NaN → true
  14586. // eslint-disable-next-line no-self-compare
  14587. return a !== a && b !== b;
  14588. }
  14589. function isEqual(a, b) {
  14590. try {
  14591. return equal(a, b);
  14592. } catch (error) {
  14593. if ((error.message || '').match(/stack|recursion/i)) {
  14594. // eslint-disable-next-line no-console
  14595. console.warn('react-fast-compare cannot handle circular refs');
  14596. return false;
  14597. }
  14598. throw error;
  14599. }
  14600. }
  14601. /**
  14602. * Drag hook.
  14603. *
  14604. * @param handler - the function fired every time the drag gesture updates
  14605. * @param [config={}] - the config object including generic options and drag options
  14606. */
  14607. function useDrag(handler, config) {
  14608. if (config === void 0) {
  14609. config = {};
  14610. }
  14611. RecognizersMap.set('drag', DragRecognizer);
  14612. var buildDragConfig = Object(external_React_["useRef"])();
  14613. if (!buildDragConfig.current) {
  14614. buildDragConfig.current = memoizeOne(_buildDragConfig, isEqual);
  14615. }
  14616. return useRecognizers({
  14617. drag: handler
  14618. }, buildDragConfig.current(config));
  14619. }
  14620. /**
  14621. * @private
  14622. * Abstract class for distance/angle-based gesture recongizers
  14623. */
  14624. var DistanceAngleRecognizer = /*#__PURE__*/function (_Recognizer) {
  14625. reactusegesture_esm_inheritsLoose(DistanceAngleRecognizer, _Recognizer);
  14626. function DistanceAngleRecognizer() {
  14627. return _Recognizer.apply(this, arguments) || this;
  14628. }
  14629. var _proto = DistanceAngleRecognizer.prototype;
  14630. _proto.getInternalMovement = function getInternalMovement(values, state) {
  14631. var prev_a = state.values[1]; // not be defined if ctrl+wheel is used for zoom only
  14632. var d = values[0],
  14633. _values$ = values[1],
  14634. a = _values$ === void 0 ? prev_a : _values$;
  14635. var delta_a = a - prev_a;
  14636. var next_turns = state.turns;
  14637. if (Math.abs(delta_a) > 270) next_turns += sign(delta_a);
  14638. return subV([d, a - 360 * next_turns], state.initial);
  14639. };
  14640. _proto.getKinematics = function getKinematics(values, event) {
  14641. var state = this.getMovement(values);
  14642. var turns = (values[1] - state._movement[1] - this.state.initial[1]) / 360;
  14643. var dt = event.timeStamp - this.state.timeStamp;
  14644. var _calculateAllKinemati = calculateAllKinematics(state.movement, state.delta, dt),
  14645. kinematics = _objectWithoutPropertiesLoose(_calculateAllKinemati, ["distance", "velocity"]);
  14646. return _extends({
  14647. turns: turns
  14648. }, state, kinematics);
  14649. };
  14650. _proto.mapStateValues = function mapStateValues(state) {
  14651. return {
  14652. da: state.values,
  14653. vdva: state.velocities
  14654. };
  14655. };
  14656. return DistanceAngleRecognizer;
  14657. }(Recognizer);
  14658. var ZOOM_CONSTANT = 7;
  14659. var WEBKIT_DISTANCE_SCALE_FACTOR = 260;
  14660. var PinchRecognizer = /*#__PURE__*/function (_DistanceAngleRecogni) {
  14661. reactusegesture_esm_inheritsLoose(PinchRecognizer, _DistanceAngleRecogni);
  14662. function PinchRecognizer() {
  14663. var _this;
  14664. _this = _DistanceAngleRecogni.apply(this, arguments) || this;
  14665. _this.ingKey = 'pinching';
  14666. _this.stateKey = 'pinch';
  14667. _this.onPinchStart = function (event) {
  14668. addEventIds(_this.controller, event);
  14669. var touchIds = _this.controller.touchIds;
  14670. if (!_this.enabled) return;
  14671. if (_this.state._active) {
  14672. // check that the pointerIds that initiated the gesture
  14673. // are still enabled. This is useful for when the page
  14674. // loses track of the pointers (minifying gesture on iPad).
  14675. if (_this.state._pointerIds.every(function (id) {
  14676. return touchIds.has(id);
  14677. })) return; // something was wrong with the pointers but we let it go.
  14678. } // until we reach two fingers on the target don't react
  14679. if (touchIds.size < 2) return;
  14680. var _pointerIds = Array.from(touchIds).slice(0, 2);
  14681. var _getTwoTouchesEventVa = getTwoTouchesEventValues(event, _pointerIds, _this.transform),
  14682. values = _getTwoTouchesEventVa.values,
  14683. origin = _getTwoTouchesEventVa.origin;
  14684. _this.updateSharedState(getGenericEventData(event));
  14685. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), {
  14686. _pointerIds: _pointerIds,
  14687. cancel: _this.onCancel,
  14688. origin: origin
  14689. }));
  14690. _this.updateGestureState(_this.getMovement(values));
  14691. _this.fireGestureHandler();
  14692. };
  14693. _this.onPinchChange = function (event) {
  14694. var _this$state = _this.state,
  14695. canceled = _this$state.canceled,
  14696. _active = _this$state._active;
  14697. if (canceled || !_active || // if the event has the same timestamp as the previous event
  14698. event.timeStamp === _this.state.timeStamp) return;
  14699. var genericEventData = getGenericEventData(event);
  14700. _this.updateSharedState(genericEventData);
  14701. try {
  14702. var _getTwoTouchesEventVa2 = getTwoTouchesEventValues(event, _this.state._pointerIds, _this.transform),
  14703. values = _getTwoTouchesEventVa2.values,
  14704. origin = _getTwoTouchesEventVa2.origin;
  14705. var kinematics = _this.getKinematics(values, event);
  14706. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), kinematics, {
  14707. origin: origin
  14708. }));
  14709. _this.fireGestureHandler();
  14710. } catch (e) {
  14711. _this.onPinchEnd(event);
  14712. }
  14713. };
  14714. _this.onPinchEnd = function (event) {
  14715. removeEventIds(_this.controller, event);
  14716. var pointerIds = getTouchIds(event); // if none of the lifted pointerIds is in the state pointerIds don't do anything
  14717. if (_this.state._pointerIds.every(function (id) {
  14718. return !pointerIds.includes(id);
  14719. })) return;
  14720. _this.clean();
  14721. if (!_this.state._active) return;
  14722. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values), {
  14723. _active: false
  14724. }));
  14725. _this.fireGestureHandler();
  14726. };
  14727. _this.onCancel = function () {
  14728. if (_this.state.canceled) return;
  14729. _this.updateGestureState({
  14730. _active: false,
  14731. canceled: true
  14732. });
  14733. setTimeout(function () {
  14734. return _this.fireGestureHandler();
  14735. }, 0);
  14736. };
  14737. /**
  14738. * PINCH WITH WEBKIT GESTURES
  14739. */
  14740. _this.onGestureStart = function (event) {
  14741. if (!_this.enabled) return;
  14742. event.preventDefault();
  14743. var values = getWebkitGestureEventValues(event, _this.transform);
  14744. _this.updateSharedState(getGenericEventData(event));
  14745. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), {
  14746. origin: [event.clientX, event.clientY],
  14747. cancel: _this.onCancel
  14748. }));
  14749. _this.updateGestureState(_this.getMovement(values));
  14750. _this.fireGestureHandler();
  14751. };
  14752. _this.onGestureChange = function (event) {
  14753. var _this$state2 = _this.state,
  14754. canceled = _this$state2.canceled,
  14755. _active = _this$state2._active;
  14756. if (canceled || !_active) return;
  14757. event.preventDefault();
  14758. var genericEventData = getGenericEventData(event);
  14759. _this.updateSharedState(genericEventData); // this normalizes the values of the Safari's WebKitEvent by calculating
  14760. // the delta and then multiplying it by a constant.
  14761. var values = getWebkitGestureEventValues(event, _this.transform);
  14762. values[0] = (values[0] - _this.state.event.scale) * WEBKIT_DISTANCE_SCALE_FACTOR + _this.state.values[0];
  14763. var kinematics = _this.getKinematics(values, event);
  14764. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), kinematics, {
  14765. origin: [event.clientX, event.clientY]
  14766. }));
  14767. _this.fireGestureHandler();
  14768. };
  14769. _this.onGestureEnd = function (event) {
  14770. _this.clean();
  14771. if (!_this.state._active) return;
  14772. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values), {
  14773. _active: false,
  14774. origin: [event.clientX, event.clientY]
  14775. }));
  14776. _this.fireGestureHandler();
  14777. };
  14778. /**
  14779. * PINCH WITH WHEEL
  14780. */
  14781. _this.wheelShouldRun = function (event) {
  14782. return _this.enabled && event.ctrlKey;
  14783. };
  14784. _this.getWheelValuesFromEvent = function (event) {
  14785. var _getWheelEventValues = getWheelEventValues(event, _this.transform),
  14786. delta_d = _getWheelEventValues[1];
  14787. var _this$state$values = _this.state.values,
  14788. prev_d = _this$state$values[0],
  14789. prev_a = _this$state$values[1]; // ZOOM_CONSTANT is based on Safari trackpad natural zooming
  14790. var _delta_d = -delta_d * ZOOM_CONSTANT; // new distance is the previous state distance added to the delta
  14791. var d = prev_d + _delta_d;
  14792. var a = prev_a !== void 0 ? prev_a : 0;
  14793. return {
  14794. values: [d, a],
  14795. origin: [event.clientX, event.clientY],
  14796. delta: [_delta_d, a]
  14797. };
  14798. };
  14799. _this.onWheel = function (event) {
  14800. if (!_this.wheelShouldRun(event)) return;
  14801. _this.setTimeout(_this.onWheelEnd);
  14802. if (!_this.state._active) _this.onWheelStart(event);else _this.onWheelChange(event);
  14803. };
  14804. _this.onWheelStart = function (event) {
  14805. var _this$getWheelValuesF = _this.getWheelValuesFromEvent(event),
  14806. values = _this$getWheelValuesF.values,
  14807. delta = _this$getWheelValuesF.delta,
  14808. origin = _this$getWheelValuesF.origin;
  14809. if (event.cancelable) event.preventDefault();else if (false) {}
  14810. _this.updateSharedState(getGenericEventData(event));
  14811. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true), {
  14812. offset: values,
  14813. delta: delta,
  14814. origin: origin
  14815. }));
  14816. _this.updateGestureState(_this.getMovement(values));
  14817. _this.fireGestureHandler();
  14818. };
  14819. _this.onWheelChange = function (event) {
  14820. if (event.cancelable) event.preventDefault();
  14821. _this.updateSharedState(getGenericEventData(event));
  14822. var _this$getWheelValuesF2 = _this.getWheelValuesFromEvent(event),
  14823. values = _this$getWheelValuesF2.values,
  14824. origin = _this$getWheelValuesF2.origin,
  14825. delta = _this$getWheelValuesF2.delta;
  14826. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event), {
  14827. origin: origin,
  14828. delta: delta
  14829. }));
  14830. _this.fireGestureHandler();
  14831. };
  14832. _this.onWheelEnd = function () {
  14833. _this.clean();
  14834. if (!_this.state._active) return;
  14835. _this.state._active = false;
  14836. _this.updateGestureState(_this.getMovement(_this.state.values));
  14837. _this.fireGestureHandler();
  14838. };
  14839. return _this;
  14840. }
  14841. var _proto = PinchRecognizer.prototype;
  14842. _proto.addBindings = function addBindings$1(bindings) {
  14843. // Only try to use gesture events when they are supported and domTarget is set
  14844. // as React doesn't support gesture handlers.
  14845. if (this.controller.config.domTarget && !this.controller.supportsTouchEvents && this.controller.supportsGestureEvents) {
  14846. addBindings(bindings, 'onGestureStart', this.onGestureStart);
  14847. addBindings(bindings, 'onGestureChange', this.onGestureChange);
  14848. addBindings(bindings, 'onGestureEnd', this.onGestureEnd);
  14849. } else {
  14850. addBindings(bindings, 'onTouchStart', this.onPinchStart);
  14851. addBindings(bindings, 'onTouchMove', this.onPinchChange);
  14852. addBindings(bindings, 'onTouchEnd', this.onPinchEnd);
  14853. addBindings(bindings, 'onTouchCancel', this.onPinchEnd);
  14854. addBindings(bindings, 'onWheel', this.onWheel);
  14855. }
  14856. };
  14857. return PinchRecognizer;
  14858. }(DistanceAngleRecognizer);
  14859. /**
  14860. * Pinch hook.
  14861. *
  14862. * @param handler - the function fired every time the pinch gesture updates
  14863. * @param [config={}] - the config object including generic options and pinch options
  14864. */
  14865. function usePinch(handler, config) {
  14866. if (config === void 0) {
  14867. config = {};
  14868. }
  14869. RecognizersMap.set('pinch', PinchRecognizer);
  14870. var buildPinchConfig = Object(external_React_["useRef"])();
  14871. if (!buildPinchConfig.current) {
  14872. buildPinchConfig.current = memoizeOne(_buildPinchConfig, isEqual);
  14873. }
  14874. return useRecognizers({
  14875. pinch: handler
  14876. }, buildPinchConfig.current(config));
  14877. }
  14878. var WheelRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
  14879. reactusegesture_esm_inheritsLoose(WheelRecognizer, _CoordinatesRecognize);
  14880. function WheelRecognizer() {
  14881. var _this;
  14882. _this = _CoordinatesRecognize.apply(this, arguments) || this;
  14883. _this.ingKey = 'wheeling';
  14884. _this.stateKey = 'wheel';
  14885. _this.debounced = true;
  14886. _this.handleEvent = function (event) {
  14887. if (event.ctrlKey && 'pinch' in _this.controller.handlers) return;
  14888. if (!_this.enabled) return;
  14889. _this.setTimeout(_this.onEnd);
  14890. _this.updateSharedState(getGenericEventData(event));
  14891. var values = addV(getWheelEventValues(event, _this.transform), _this.state.values);
  14892. if (!_this.state._active) {
  14893. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true)));
  14894. var movement = _this.getMovement(values);
  14895. var geometry = calculateAllGeometry(movement.delta);
  14896. _this.updateGestureState(movement);
  14897. _this.updateGestureState(geometry);
  14898. } else {
  14899. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
  14900. }
  14901. _this.fireGestureHandler();
  14902. };
  14903. _this.onEnd = function () {
  14904. _this.clean();
  14905. if (!_this.state._active) return;
  14906. var movement = _this.getMovement(_this.state.values);
  14907. _this.updateGestureState(movement);
  14908. _this.updateGestureState({
  14909. _active: false,
  14910. velocities: [0, 0],
  14911. velocity: 0
  14912. });
  14913. _this.fireGestureHandler();
  14914. };
  14915. return _this;
  14916. }
  14917. var _proto = WheelRecognizer.prototype;
  14918. _proto.addBindings = function addBindings$1(bindings) {
  14919. addBindings(bindings, 'onWheel', this.handleEvent);
  14920. };
  14921. return WheelRecognizer;
  14922. }(CoordinatesRecognizer);
  14923. /**
  14924. * Wheel hook.
  14925. *
  14926. * @param handler - the function fired every time the wheel gesture updates
  14927. * @param the config object including generic options and wheel options
  14928. */
  14929. function useWheel(handler, config) {
  14930. if (config === void 0) {
  14931. config = {};
  14932. }
  14933. RecognizersMap.set('wheel', WheelRecognizer);
  14934. var buildWheelConfig = Object(external_React_["useRef"])();
  14935. if (!buildWheelConfig.current) {
  14936. buildWheelConfig.current = memoizeOne(_buildWheelConfig, isEqual);
  14937. }
  14938. return useRecognizers({
  14939. wheel: handler
  14940. }, buildWheelConfig.current(config));
  14941. }
  14942. var MoveRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
  14943. reactusegesture_esm_inheritsLoose(MoveRecognizer, _CoordinatesRecognize);
  14944. function MoveRecognizer() {
  14945. var _this;
  14946. _this = _CoordinatesRecognize.apply(this, arguments) || this;
  14947. _this.ingKey = 'moving';
  14948. _this.stateKey = 'move';
  14949. _this.debounced = true;
  14950. _this.onMove = function (event) {
  14951. if (!_this.enabled) return;
  14952. _this.setTimeout(_this.onMoveEnd);
  14953. if (!_this.state._active) _this.onMoveStart(event);else _this.onMoveChange(event);
  14954. };
  14955. _this.onMoveStart = function (event) {
  14956. _this.updateSharedState(getGenericEventData(event));
  14957. var values = getPointerEventValues(event, _this.transform);
  14958. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true)));
  14959. _this.updateGestureState(_this.getMovement(values));
  14960. _this.fireGestureHandler();
  14961. };
  14962. _this.onMoveChange = function (event) {
  14963. _this.updateSharedState(getGenericEventData(event));
  14964. var values = getPointerEventValues(event, _this.transform);
  14965. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
  14966. _this.fireGestureHandler();
  14967. };
  14968. _this.onMoveEnd = function () {
  14969. _this.clean();
  14970. if (!_this.state._active) return;
  14971. var values = _this.state.values;
  14972. _this.updateGestureState(_this.getMovement(values));
  14973. _this.updateGestureState({
  14974. velocities: [0, 0],
  14975. velocity: 0,
  14976. _active: false
  14977. });
  14978. _this.fireGestureHandler();
  14979. };
  14980. _this.hoverTransform = function () {
  14981. return _this.controller.config.hover.transform || _this.controller.config.transform;
  14982. };
  14983. _this.onPointerEnter = function (event) {
  14984. _this.controller.state.shared.hovering = true;
  14985. if (!_this.controller.config.enabled) return;
  14986. if (_this.controller.config.hover.enabled) {
  14987. var values = getPointerEventValues(event, _this.hoverTransform());
  14988. var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event, true), {
  14989. args: _this.args,
  14990. values: values,
  14991. active: true,
  14992. hovering: true
  14993. });
  14994. _this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state)));
  14995. }
  14996. if ('move' in _this.controller.handlers) _this.onMoveStart(event);
  14997. };
  14998. _this.onPointerLeave = function (event) {
  14999. _this.controller.state.shared.hovering = false;
  15000. if ('move' in _this.controller.handlers) _this.onMoveEnd();
  15001. if (!_this.controller.config.hover.enabled) return;
  15002. var values = getPointerEventValues(event, _this.hoverTransform());
  15003. var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event), {
  15004. args: _this.args,
  15005. values: values,
  15006. active: false
  15007. });
  15008. _this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state)));
  15009. };
  15010. return _this;
  15011. }
  15012. var _proto = MoveRecognizer.prototype;
  15013. _proto.addBindings = function addBindings$1(bindings) {
  15014. if ('move' in this.controller.handlers) {
  15015. addBindings(bindings, 'onPointerMove', this.onMove);
  15016. }
  15017. if ('hover' in this.controller.handlers) {
  15018. addBindings(bindings, 'onPointerEnter', this.onPointerEnter);
  15019. addBindings(bindings, 'onPointerLeave', this.onPointerLeave);
  15020. }
  15021. };
  15022. return MoveRecognizer;
  15023. }(CoordinatesRecognizer);
  15024. /**
  15025. * Move hook.
  15026. *
  15027. * @param handler - the function fired every time the move gesture updates
  15028. * @param [config={}] - the config object including generic options and move options
  15029. */
  15030. function useMove(handler, config) {
  15031. if (config === void 0) {
  15032. config = {};
  15033. }
  15034. RecognizersMap.set('move', MoveRecognizer);
  15035. var buildMoveConfig = Object(external_React_["useRef"])();
  15036. if (!buildMoveConfig.current) {
  15037. buildMoveConfig.current = memoizeOne(_buildMoveConfig, isEqual);
  15038. }
  15039. return useRecognizers({
  15040. move: handler
  15041. }, buildMoveConfig.current(config));
  15042. }
  15043. /**
  15044. * Hover hook.
  15045. *
  15046. * @param handler - the function fired every time the hover gesture updates
  15047. * @param [config={}] - the config object including generic options and hover options
  15048. */
  15049. function useHover(handler, config) {
  15050. if (config === void 0) {
  15051. config = {};
  15052. }
  15053. RecognizersMap.set('hover', MoveRecognizer);
  15054. var buildHoverConfig = Object(external_React_["useRef"])();
  15055. if (!buildHoverConfig.current) {
  15056. buildHoverConfig.current = memoizeOne(_buildHoverConfig, isEqual);
  15057. }
  15058. return useRecognizers({
  15059. hover: handler
  15060. }, buildHoverConfig.current(config));
  15061. }
  15062. var ScrollRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
  15063. reactusegesture_esm_inheritsLoose(ScrollRecognizer, _CoordinatesRecognize);
  15064. function ScrollRecognizer() {
  15065. var _this;
  15066. _this = _CoordinatesRecognize.apply(this, arguments) || this;
  15067. _this.ingKey = 'scrolling';
  15068. _this.stateKey = 'scroll';
  15069. _this.debounced = true;
  15070. _this.handleEvent = function (event) {
  15071. if (!_this.enabled) return;
  15072. _this.clearTimeout();
  15073. _this.setTimeout(_this.onEnd);
  15074. var values = getScrollEventValues(event, _this.transform);
  15075. _this.updateSharedState(getGenericEventData(event));
  15076. if (!_this.state._active) {
  15077. _this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true)));
  15078. var movementDetection = _this.getMovement(values);
  15079. var geometry = calculateAllGeometry(movementDetection.delta);
  15080. _this.updateGestureState(movementDetection);
  15081. _this.updateGestureState(geometry);
  15082. } else {
  15083. _this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
  15084. }
  15085. _this.fireGestureHandler();
  15086. };
  15087. _this.onEnd = function () {
  15088. _this.clean();
  15089. if (!_this.state._active) return;
  15090. _this.updateGestureState(_extends({}, _this.getMovement(_this.state.values), {
  15091. _active: false,
  15092. velocities: [0, 0],
  15093. velocity: 0
  15094. }));
  15095. _this.fireGestureHandler();
  15096. };
  15097. return _this;
  15098. }
  15099. var _proto = ScrollRecognizer.prototype;
  15100. _proto.addBindings = function addBindings$1(bindings) {
  15101. addBindings(bindings, 'onScroll', this.handleEvent);
  15102. };
  15103. return ScrollRecognizer;
  15104. }(CoordinatesRecognizer);
  15105. /**
  15106. * Scroll hook.
  15107. *
  15108. * @param handler - the function fired every time the scroll gesture updates
  15109. * @param [config={}] - the config object including generic options and scroll options
  15110. */
  15111. function useScroll(handler, config) {
  15112. if (config === void 0) {
  15113. config = {};
  15114. }
  15115. RecognizersMap.set('scroll', ScrollRecognizer);
  15116. var buildScrollConfig = Object(external_React_["useRef"])();
  15117. if (!buildScrollConfig.current) {
  15118. buildScrollConfig.current = memoizeOne(_buildScrollConfig, isEqual);
  15119. }
  15120. return useRecognizers({
  15121. scroll: handler
  15122. }, buildScrollConfig.current(config));
  15123. }
  15124. var RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
  15125. function sortHandlers(handlers) {
  15126. var _native = {};
  15127. var handle = {};
  15128. var actions = new Set();
  15129. for (var key in handlers) {
  15130. if (RE_NOT_NATIVE.test(key)) {
  15131. actions.add(RegExp.lastMatch);
  15132. handle[key] = handlers[key];
  15133. } else {
  15134. _native[key] = handlers[key];
  15135. }
  15136. }
  15137. return [handle, _native, actions];
  15138. }
  15139. /**
  15140. * @public
  15141. *
  15142. * The most complete gesture hook, allowing support for multiple gestures.
  15143. *
  15144. * @param {Handlers} handlers - an object with on[Gesture] keys containg gesture handlers
  15145. * @param {UseGestureConfig} [config={}] - the full config object
  15146. * @returns {(...args: any[]) => HookReturnType<Config>}
  15147. */
  15148. function useGesture(_handlers, config) {
  15149. if (config === void 0) {
  15150. config = {};
  15151. }
  15152. var _sortHandlers = sortHandlers(_handlers),
  15153. handlers = _sortHandlers[0],
  15154. nativeHandlers = _sortHandlers[1],
  15155. actions = _sortHandlers[2];
  15156. RecognizersMap.set('drag', DragRecognizer);
  15157. RecognizersMap.set('hover', MoveRecognizer);
  15158. RecognizersMap.set('move', MoveRecognizer);
  15159. RecognizersMap.set('pinch', PinchRecognizer);
  15160. RecognizersMap.set('scroll', ScrollRecognizer);
  15161. RecognizersMap.set('wheel', WheelRecognizer);
  15162. var mergedConfig = buildComplexConfig(config, actions);
  15163. var internalHandlers = {};
  15164. if (actions.has('onDrag')) internalHandlers.drag = includeStartEndHandlers(handlers, 'onDrag');
  15165. if (actions.has('onWheel')) internalHandlers.wheel = includeStartEndHandlers(handlers, 'onWheel');
  15166. if (actions.has('onScroll')) internalHandlers.scroll = includeStartEndHandlers(handlers, 'onScroll');
  15167. if (actions.has('onMove')) internalHandlers.move = includeStartEndHandlers(handlers, 'onMove');
  15168. if (actions.has('onPinch')) internalHandlers.pinch = includeStartEndHandlers(handlers, 'onPinch');
  15169. if (actions.has('onHover')) internalHandlers.hover = handlers.onHover;
  15170. return useRecognizers(internalHandlers, mergedConfig, nativeHandlers);
  15171. }
  15172. function includeStartEndHandlers(handlers, handlerKey) {
  15173. var startKey = handlerKey + 'Start';
  15174. var endKey = handlerKey + 'End';
  15175. var fn = function fn(state) {
  15176. var memo = undefined;
  15177. if (state.first && startKey in handlers) handlers[startKey](state);
  15178. if (handlerKey in handlers) memo = handlers[handlerKey](state);
  15179. if (state.last && endKey in handlers) handlers[endKey](state);
  15180. return memo;
  15181. };
  15182. return fn;
  15183. }
  15184. // EXTERNAL MODULE: external ["wp","keycodes"]
  15185. var external_wp_keycodes_ = __webpack_require__("RxS6");
  15186. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js
  15187. /**
  15188. * WordPress dependencies
  15189. */
  15190. /**
  15191. * Gets a CSS cursor value based on a drag direction.
  15192. *
  15193. * @param {string} dragDirection The drag direction.
  15194. * @return {string} The CSS cursor value.
  15195. */
  15196. function getDragCursor(dragDirection) {
  15197. let dragCursor = 'ns-resize';
  15198. switch (dragDirection) {
  15199. case 'n':
  15200. case 's':
  15201. dragCursor = 'ns-resize';
  15202. break;
  15203. case 'e':
  15204. case 'w':
  15205. dragCursor = 'ew-resize';
  15206. break;
  15207. }
  15208. return dragCursor;
  15209. }
  15210. /**
  15211. * Custom hook that renders a drag cursor when dragging.
  15212. *
  15213. * @param {boolean} isDragging The dragging state.
  15214. * @param {string} dragDirection The drag direction.
  15215. *
  15216. * @return {string} The CSS cursor value.
  15217. */
  15218. function useDragCursor(isDragging, dragDirection) {
  15219. const dragCursor = getDragCursor(dragDirection);
  15220. Object(external_wp_element_["useEffect"])(() => {
  15221. if (isDragging) {
  15222. document.documentElement.style.cursor = dragCursor;
  15223. } else {
  15224. document.documentElement.style.cursor = null;
  15225. }
  15226. }, [isDragging]);
  15227. return dragCursor;
  15228. }
  15229. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/state.js
  15230. /**
  15231. * External dependencies
  15232. */
  15233. /**
  15234. * WordPress dependencies
  15235. */
  15236. const initialStateReducer = state => state;
  15237. const initialInputControlState = {
  15238. _event: {},
  15239. error: null,
  15240. initialValue: '',
  15241. isDirty: false,
  15242. isDragEnabled: false,
  15243. isDragging: false,
  15244. isPressEnterToChange: false,
  15245. value: ''
  15246. };
  15247. const actionTypes = {
  15248. CHANGE: 'CHANGE',
  15249. COMMIT: 'COMMIT',
  15250. DRAG_END: 'DRAG_END',
  15251. DRAG_START: 'DRAG_START',
  15252. DRAG: 'DRAG',
  15253. INVALIDATE: 'INVALIDATE',
  15254. PRESS_DOWN: 'PRESS_DOWN',
  15255. PRESS_ENTER: 'PRESS_ENTER',
  15256. PRESS_UP: 'PRESS_UP',
  15257. RESET: 'RESET',
  15258. UPDATE: 'UPDATE'
  15259. };
  15260. const inputControlActionTypes = actionTypes;
  15261. /**
  15262. * Prepares initialState for the reducer.
  15263. *
  15264. * @param {Object} initialState The initial state.
  15265. * @return {Object} Prepared initialState for the reducer
  15266. */
  15267. function mergeInitialState(initialState = initialInputControlState) {
  15268. const {
  15269. value
  15270. } = initialState;
  15271. return { ...initialInputControlState,
  15272. ...initialState,
  15273. initialValue: value
  15274. };
  15275. }
  15276. /**
  15277. * Composes multiple stateReducers into a single stateReducer, building
  15278. * the pipeline to control the flow for state and actions.
  15279. *
  15280. * @param {...Function} fns State reducers.
  15281. * @return {Function} The single composed stateReducer.
  15282. */
  15283. const composeStateReducers = (...fns) => {
  15284. return (...args) => {
  15285. return fns.reduceRight((state, fn) => {
  15286. const fnState = fn(...args);
  15287. return Object(external_lodash_["isEmpty"])(fnState) ? state : { ...state,
  15288. ...fnState
  15289. };
  15290. }, {});
  15291. };
  15292. };
  15293. /**
  15294. * Creates a reducer that opens the channel for external state subscription
  15295. * and modification.
  15296. *
  15297. * This technique uses the "stateReducer" design pattern:
  15298. * https://kentcdodds.com/blog/the-state-reducer-pattern/
  15299. *
  15300. * @param {Function} composedStateReducers A custom reducer that can subscribe and modify state.
  15301. * @return {Function} The reducer.
  15302. */
  15303. function inputControlStateReducer(composedStateReducers) {
  15304. return (state, action) => {
  15305. const nextState = { ...state
  15306. };
  15307. const {
  15308. type,
  15309. payload
  15310. } = action;
  15311. switch (type) {
  15312. /**
  15313. * Keyboard events
  15314. */
  15315. case actionTypes.PRESS_UP:
  15316. nextState.isDirty = false;
  15317. break;
  15318. case actionTypes.PRESS_DOWN:
  15319. nextState.isDirty = false;
  15320. break;
  15321. /**
  15322. * Drag events
  15323. */
  15324. case actionTypes.DRAG_START:
  15325. nextState.isDragging = true;
  15326. break;
  15327. case actionTypes.DRAG_END:
  15328. nextState.isDragging = false;
  15329. break;
  15330. /**
  15331. * Input events
  15332. */
  15333. case actionTypes.CHANGE:
  15334. nextState.error = null;
  15335. nextState.value = payload.value;
  15336. if (state.isPressEnterToChange) {
  15337. nextState.isDirty = true;
  15338. }
  15339. break;
  15340. case actionTypes.COMMIT:
  15341. nextState.value = payload.value;
  15342. nextState.isDirty = false;
  15343. break;
  15344. case actionTypes.RESET:
  15345. nextState.error = null;
  15346. nextState.isDirty = false;
  15347. nextState.value = payload.value || state.initialValue;
  15348. break;
  15349. case actionTypes.UPDATE:
  15350. nextState.value = payload.value;
  15351. nextState.isDirty = false;
  15352. break;
  15353. /**
  15354. * Validation
  15355. */
  15356. case actionTypes.INVALIDATE:
  15357. nextState.error = payload.error;
  15358. break;
  15359. }
  15360. if (payload.event) {
  15361. nextState._event = payload.event;
  15362. }
  15363. /**
  15364. * Send the nextState + action to the composedReducers via
  15365. * this "bridge" mechanism. This allows external stateReducers
  15366. * to hook into actions, and modify state if needed.
  15367. */
  15368. return composedStateReducers(nextState, action);
  15369. };
  15370. }
  15371. /**
  15372. * A custom hook that connects and external stateReducer with an internal
  15373. * reducer. This hook manages the internal state of InputControl.
  15374. * However, by connecting an external stateReducer function, other
  15375. * components can react to actions as well as modify state before it is
  15376. * applied.
  15377. *
  15378. * This technique uses the "stateReducer" design pattern:
  15379. * https://kentcdodds.com/blog/the-state-reducer-pattern/
  15380. *
  15381. * @param {Function} stateReducer An external state reducer.
  15382. * @param {Object} initialState The initial state for the reducer.
  15383. * @return {Object} State, dispatch, and a collection of actions.
  15384. */
  15385. function useInputControlStateReducer(stateReducer = initialStateReducer, initialState = initialInputControlState) {
  15386. const [state, dispatch] = Object(external_wp_element_["useReducer"])(inputControlStateReducer(stateReducer), mergeInitialState(initialState));
  15387. const createChangeEvent = type => (nextValue, event) => {
  15388. /**
  15389. * Persist allows for the (Synthetic) event to be used outside of
  15390. * this function call.
  15391. * https://reactjs.org/docs/events.html#event-pooling
  15392. */
  15393. if (event && event.persist) {
  15394. event.persist();
  15395. }
  15396. dispatch({
  15397. type,
  15398. payload: {
  15399. value: nextValue,
  15400. event
  15401. }
  15402. });
  15403. };
  15404. const createKeyEvent = type => event => {
  15405. /**
  15406. * Persist allows for the (Synthetic) event to be used outside of
  15407. * this function call.
  15408. * https://reactjs.org/docs/events.html#event-pooling
  15409. */
  15410. if (event && event.persist) {
  15411. event.persist();
  15412. }
  15413. dispatch({
  15414. type,
  15415. payload: {
  15416. event
  15417. }
  15418. });
  15419. };
  15420. const createDragEvent = type => dragProps => {
  15421. dispatch({
  15422. type,
  15423. payload: dragProps
  15424. });
  15425. };
  15426. /**
  15427. * Actions for the reducer
  15428. */
  15429. const change = createChangeEvent(actionTypes.CHANGE);
  15430. const invalidate = createChangeEvent(actionTypes.INVALIDATE);
  15431. const reset = createChangeEvent(actionTypes.RESET);
  15432. const commit = createChangeEvent(actionTypes.COMMIT);
  15433. const update = createChangeEvent(actionTypes.UPDATE);
  15434. const dragStart = createDragEvent(actionTypes.DRAG_START);
  15435. const drag = createDragEvent(actionTypes.DRAG);
  15436. const dragEnd = createDragEvent(actionTypes.DRAG_END);
  15437. const pressUp = createKeyEvent(actionTypes.PRESS_UP);
  15438. const pressDown = createKeyEvent(actionTypes.PRESS_DOWN);
  15439. const pressEnter = createKeyEvent(actionTypes.PRESS_ENTER);
  15440. return {
  15441. change,
  15442. commit,
  15443. dispatch,
  15444. drag,
  15445. dragEnd,
  15446. dragStart,
  15447. invalidate,
  15448. pressDown,
  15449. pressEnter,
  15450. pressUp,
  15451. reset,
  15452. state,
  15453. update
  15454. };
  15455. }
  15456. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/values.js
  15457. /* eslint-disable jsdoc/valid-types */
  15458. /**
  15459. * Determines if a value is null or undefined.
  15460. *
  15461. * @template T
  15462. *
  15463. * @param {T | null | undefined} value The value to check.
  15464. * @return {value is T} Whether value is not null or undefined.
  15465. */
  15466. function isValueDefined(value) {
  15467. return value !== undefined && value !== null;
  15468. }
  15469. /* eslint-enable jsdoc/valid-types */
  15470. /* eslint-disable jsdoc/valid-types */
  15471. /**
  15472. * Determines if a value is empty, null, or undefined.
  15473. *
  15474. * @template T
  15475. *
  15476. * @param {T | "" | null | undefined} value The value to check.
  15477. * @return {value is T} Whether value is empty.
  15478. */
  15479. function isValueEmpty(value) {
  15480. const isEmptyString = value === '';
  15481. return !isValueDefined(value) || isEmptyString;
  15482. }
  15483. /* eslint-enable jsdoc/valid-types */
  15484. /**
  15485. * Get the first defined/non-null value from an array.
  15486. *
  15487. * @template T
  15488. *
  15489. * @param {Array<T | null | undefined>} values Values to derive from.
  15490. * @param {T} fallbackValue Fallback value if there are no defined values.
  15491. * @return {T} A defined value or the fallback value.
  15492. */
  15493. function getDefinedValue(values = [], fallbackValue) {
  15494. var _values$find;
  15495. return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue;
  15496. }
  15497. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js
  15498. /**
  15499. * WordPress dependencies
  15500. */
  15501. /**
  15502. * A `React.useEffect` that will not run on the first render.
  15503. * Source:
  15504. * https://github.com/reakit/reakit/blob/HEAD/packages/reakit-utils/src/useUpdateEffect.ts
  15505. *
  15506. * @param {import('react').EffectCallback} effect
  15507. * @param {import('react').DependencyList} deps
  15508. */
  15509. function useUpdateEffect(effect, deps) {
  15510. const mounted = Object(external_wp_element_["useRef"])(false);
  15511. Object(external_wp_element_["useEffect"])(() => {
  15512. if (mounted.current) {
  15513. return effect();
  15514. }
  15515. mounted.current = true;
  15516. return undefined;
  15517. }, deps);
  15518. }
  15519. /* harmony default export */ var use_update_effect = (useUpdateEffect);
  15520. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-field.js
  15521. /**
  15522. * External dependencies
  15523. */
  15524. /**
  15525. * WordPress dependencies
  15526. */
  15527. /**
  15528. * Internal dependencies
  15529. */
  15530. function InputField({
  15531. disabled = false,
  15532. dragDirection = 'n',
  15533. dragThreshold = 10,
  15534. id,
  15535. isDragEnabled = false,
  15536. isFocused,
  15537. isPressEnterToChange = false,
  15538. onBlur = external_lodash_["noop"],
  15539. onChange = external_lodash_["noop"],
  15540. onDrag = external_lodash_["noop"],
  15541. onDragEnd = external_lodash_["noop"],
  15542. onDragStart = external_lodash_["noop"],
  15543. onFocus = external_lodash_["noop"],
  15544. onKeyDown = external_lodash_["noop"],
  15545. onValidate = external_lodash_["noop"],
  15546. size = 'default',
  15547. setIsFocused,
  15548. stateReducer = state => state,
  15549. value: valueProp,
  15550. type,
  15551. ...props
  15552. }, ref) {
  15553. const {
  15554. // State
  15555. state,
  15556. // Actions
  15557. change,
  15558. commit,
  15559. drag,
  15560. dragEnd,
  15561. dragStart,
  15562. invalidate,
  15563. pressDown,
  15564. pressEnter,
  15565. pressUp,
  15566. reset,
  15567. update
  15568. } = useInputControlStateReducer(stateReducer, {
  15569. isDragEnabled,
  15570. value: valueProp,
  15571. isPressEnterToChange
  15572. });
  15573. const {
  15574. _event,
  15575. value,
  15576. isDragging,
  15577. isDirty
  15578. } = state;
  15579. const wasDirtyOnBlur = Object(external_wp_element_["useRef"])(false);
  15580. const dragCursor = useDragCursor(isDragging, dragDirection);
  15581. /*
  15582. * Handles synchronization of external and internal value state.
  15583. * If not focused and did not hold a dirty value[1] on blur
  15584. * updates the value from the props. Otherwise if not holding
  15585. * a dirty value[1] propagates the value and event through onChange.
  15586. * [1] value is only made dirty if isPressEnterToChange is true
  15587. */
  15588. use_update_effect(() => {
  15589. if (valueProp === value) {
  15590. return;
  15591. }
  15592. if (!isFocused && !wasDirtyOnBlur.current) {
  15593. update(valueProp);
  15594. } else if (!isDirty) {
  15595. onChange(value, {
  15596. event: _event
  15597. });
  15598. wasDirtyOnBlur.current = false;
  15599. }
  15600. }, [value, isDirty, isFocused, valueProp]);
  15601. const handleOnBlur = event => {
  15602. onBlur(event);
  15603. setIsFocused(false);
  15604. /**
  15605. * If isPressEnterToChange is set, this commits the value to
  15606. * the onChange callback.
  15607. */
  15608. if (isPressEnterToChange && isDirty) {
  15609. wasDirtyOnBlur.current = true;
  15610. if (!isValueEmpty(value)) {
  15611. handleOnCommit(event);
  15612. } else {
  15613. reset(valueProp);
  15614. }
  15615. }
  15616. };
  15617. const handleOnFocus = event => {
  15618. onFocus(event);
  15619. setIsFocused(true);
  15620. };
  15621. const handleOnChange = event => {
  15622. const nextValue = event.target.value;
  15623. change(nextValue, event);
  15624. };
  15625. const handleOnCommit = event => {
  15626. const nextValue = event.target.value;
  15627. try {
  15628. onValidate(nextValue, event);
  15629. commit(nextValue, event);
  15630. } catch (err) {
  15631. invalidate(err, event);
  15632. }
  15633. };
  15634. const handleOnKeyDown = event => {
  15635. const {
  15636. keyCode
  15637. } = event;
  15638. onKeyDown(event);
  15639. switch (keyCode) {
  15640. case external_wp_keycodes_["UP"]:
  15641. pressUp(event);
  15642. break;
  15643. case external_wp_keycodes_["DOWN"]:
  15644. pressDown(event);
  15645. break;
  15646. case external_wp_keycodes_["ENTER"]:
  15647. pressEnter(event);
  15648. if (isPressEnterToChange) {
  15649. event.preventDefault();
  15650. handleOnCommit(event);
  15651. }
  15652. break;
  15653. }
  15654. };
  15655. const dragGestureProps = useDrag(dragProps => {
  15656. const {
  15657. distance,
  15658. dragging,
  15659. event
  15660. } = dragProps; // The event is persisted to prevent errors in components using this
  15661. // to check if a modifier key was held while dragging.
  15662. event.persist();
  15663. if (!distance) return;
  15664. event.stopPropagation();
  15665. /**
  15666. * Quick return if no longer dragging.
  15667. * This prevents unnecessary value calculations.
  15668. */
  15669. if (!dragging) {
  15670. onDragEnd(dragProps);
  15671. dragEnd(dragProps);
  15672. return;
  15673. }
  15674. onDrag(dragProps);
  15675. drag(dragProps);
  15676. if (!isDragging) {
  15677. onDragStart(dragProps);
  15678. dragStart(dragProps);
  15679. }
  15680. }, {
  15681. threshold: dragThreshold,
  15682. enabled: isDragEnabled
  15683. });
  15684. const dragProps = isDragEnabled ? dragGestureProps() : {};
  15685. /*
  15686. * Works around the odd UA (e.g. Firefox) that does not focus inputs of
  15687. * type=number when their spinner arrows are pressed.
  15688. */
  15689. let handleOnMouseDown;
  15690. if (type === 'number') {
  15691. handleOnMouseDown = event => {
  15692. var _props$onMouseDown;
  15693. (_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 ? void 0 : _props$onMouseDown.call(props, event);
  15694. if (event.target !== event.target.ownerDocument.activeElement) {
  15695. event.target.focus();
  15696. }
  15697. };
  15698. }
  15699. return Object(external_wp_element_["createElement"])(input_control_styles_Input, Object(esm_extends["a" /* default */])({}, props, dragProps, {
  15700. className: "components-input-control__input",
  15701. disabled: disabled,
  15702. dragCursor: dragCursor,
  15703. isDragging: isDragging,
  15704. id: id,
  15705. onBlur: handleOnBlur,
  15706. onChange: handleOnChange,
  15707. onFocus: handleOnFocus,
  15708. onKeyDown: handleOnKeyDown,
  15709. onMouseDown: handleOnMouseDown,
  15710. ref: ref,
  15711. size: size,
  15712. value: value,
  15713. type: type
  15714. }));
  15715. }
  15716. const ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputField);
  15717. /* harmony default export */ var input_field = (ForwardedComponent);
  15718. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js
  15719. /**
  15720. * External dependencies
  15721. */
  15722. /**
  15723. * WordPress dependencies
  15724. */
  15725. /**
  15726. * Internal dependencies
  15727. */
  15728. function input_control_useUniqueId(idProp) {
  15729. const instanceId = Object(external_wp_compose_["useInstanceId"])(InputControl);
  15730. const id = `inspector-input-control-${instanceId}`;
  15731. return idProp || id;
  15732. }
  15733. function InputControl({
  15734. __unstableStateReducer: stateReducer = state => state,
  15735. __unstableInputWidth,
  15736. className,
  15737. disabled = false,
  15738. hideLabelFromVision = false,
  15739. id: idProp,
  15740. isPressEnterToChange = false,
  15741. label,
  15742. labelPosition = 'top',
  15743. onChange = external_lodash_["noop"],
  15744. onValidate = external_lodash_["noop"],
  15745. onKeyDown = external_lodash_["noop"],
  15746. prefix,
  15747. size = 'default',
  15748. suffix,
  15749. value,
  15750. ...props
  15751. }, ref) {
  15752. const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false);
  15753. const id = input_control_useUniqueId(idProp);
  15754. const classes = classnames_default()('components-input-control', className);
  15755. return Object(external_wp_element_["createElement"])(input_base, {
  15756. __unstableInputWidth: __unstableInputWidth,
  15757. className: classes,
  15758. disabled: disabled,
  15759. gap: 3,
  15760. hideLabelFromVision: hideLabelFromVision,
  15761. id: id,
  15762. isFocused: isFocused,
  15763. justify: "left",
  15764. label: label,
  15765. labelPosition: labelPosition,
  15766. prefix: prefix,
  15767. size: size,
  15768. suffix: suffix
  15769. }, Object(external_wp_element_["createElement"])(input_field, Object(esm_extends["a" /* default */])({}, props, {
  15770. className: "components-input-control__input",
  15771. disabled: disabled,
  15772. id: id,
  15773. isFocused: isFocused,
  15774. isPressEnterToChange: isPressEnterToChange,
  15775. onChange: onChange,
  15776. onKeyDown: onKeyDown,
  15777. onValidate: onValidate,
  15778. ref: ref,
  15779. setIsFocused: setIsFocused,
  15780. size: size,
  15781. stateReducer: stateReducer,
  15782. value: value
  15783. })));
  15784. }
  15785. const input_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputControl);
  15786. /* harmony default export */ var input_control = (input_control_ForwardedComponent);
  15787. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js
  15788. function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  15789. /**
  15790. * External dependencies
  15791. */
  15792. /**
  15793. * Internal dependencies
  15794. */
  15795. var number_control_styles_ref = true ? {
  15796. name: "1b9wwt5",
  15797. styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}"
  15798. } : undefined;
  15799. const htmlArrowStyles = ({
  15800. hideHTMLArrows
  15801. }) => {
  15802. if (!hideHTMLArrows) return ``;
  15803. return number_control_styles_ref;
  15804. };
  15805. const number_control_styles_Input = /*#__PURE__*/styled_base_browser_esm(input_control, {
  15806. target: "ep48uk90",
  15807. label: "Input"
  15808. })(htmlArrowStyles, ";" + ( true ? "" : undefined));
  15809. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js
  15810. /**
  15811. * External dependencies
  15812. */
  15813. /**
  15814. * Parses and retrieves a number value.
  15815. *
  15816. * @param {unknown} value The incoming value.
  15817. *
  15818. * @return {number} The parsed number value.
  15819. */
  15820. function getNumber(value) {
  15821. const number = Number(value);
  15822. return isNaN(number) ? 0 : number;
  15823. }
  15824. /**
  15825. * Safely adds 2 values.
  15826. *
  15827. * @param {Array<number|string>} args Values to add together.
  15828. *
  15829. * @return {number} The sum of values.
  15830. */
  15831. function add(...args) {
  15832. return args.reduce(
  15833. /** @type {(sum:number, arg: number|string) => number} */
  15834. (sum, arg) => sum + getNumber(arg), 0);
  15835. }
  15836. /**
  15837. * Safely subtracts 2 values.
  15838. *
  15839. * @param {Array<number|string>} args Values to subtract together.
  15840. *
  15841. * @return {number} The difference of the values.
  15842. */
  15843. function subtract(...args) {
  15844. return args.reduce(
  15845. /** @type {(diff:number, arg: number|string, index:number) => number} */
  15846. (diff, arg, index) => {
  15847. const value = getNumber(arg);
  15848. return index === 0 ? value : diff - value;
  15849. }, 0);
  15850. }
  15851. /**
  15852. * Determines the decimal position of a number value.
  15853. *
  15854. * @param {number} value The number to evaluate.
  15855. *
  15856. * @return {number} The number of decimal places.
  15857. */
  15858. function getPrecision(value) {
  15859. const split = (value + '').split('.');
  15860. return split[1] !== undefined ? split[1].length : 0;
  15861. }
  15862. /**
  15863. * Clamps a value based on a min/max range with rounding
  15864. *
  15865. * @param {number} value The value.
  15866. * @param {number} min The minimum range.
  15867. * @param {number} max The maximum range.
  15868. * @param {number} step A multiplier for the value.
  15869. *
  15870. * @return {number} The rounded and clamped value.
  15871. */
  15872. function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1) {
  15873. const baseValue = getNumber(value);
  15874. const stepValue = getNumber(step);
  15875. const precision = getPrecision(step);
  15876. const rounded = Math.round(baseValue / stepValue) * stepValue;
  15877. const clampedValue = Object(external_lodash_["clamp"])(rounded, min, max);
  15878. return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue;
  15879. }
  15880. /**
  15881. * Clamps a value based on a min/max range with rounding.
  15882. * Returns a string.
  15883. *
  15884. * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
  15885. * @return {string} The rounded and clamped value.
  15886. */
  15887. function roundClampString(...args) {
  15888. return roundClamp(...args).toString();
  15889. }
  15890. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-jump-step.js
  15891. /**
  15892. * WordPress dependencies
  15893. */
  15894. /**
  15895. * A custom hook that calculates a step value (used by elements like input
  15896. * [type="number"]). This value can be modified based on whether the Shift
  15897. * key is being held down.
  15898. *
  15899. * For example, a shiftStep of 10, and a step of 1...
  15900. * Starting from 10, the next incremented value will be 11.
  15901. *
  15902. * Holding down shift...
  15903. * Starting from 10, the next incremented value will be 20.
  15904. *
  15905. * @param {Object} props Properties for the hook.
  15906. * @param {boolean} [props.isShiftStepEnabled=true] Determines if jumping values with shift is enabled
  15907. * @param {number} [props.shiftStep=10] Multiplier to jump by, when holding shift key.
  15908. * @param {number} [props.step=1] Multiplier to jump by, when not-holding shift key.
  15909. *
  15910. * @return {number} The jump step value.
  15911. */
  15912. function useJumpStep({
  15913. isShiftStepEnabled = true,
  15914. shiftStep = 10,
  15915. step = 1
  15916. }) {
  15917. const [isShiftKey, setIsShiftKey] = Object(external_wp_element_["useState"])(false);
  15918. Object(external_wp_element_["useEffect"])(() => {
  15919. /** @type {(event: KeyboardEvent)=>void} */
  15920. const handleShiftKeyToggle = event => {
  15921. setIsShiftKey(event.shiftKey);
  15922. };
  15923. window.addEventListener('keydown', handleShiftKeyToggle);
  15924. window.addEventListener('keyup', handleShiftKeyToggle);
  15925. return () => {
  15926. window.removeEventListener('keydown', handleShiftKeyToggle);
  15927. window.removeEventListener('keyup', handleShiftKeyToggle);
  15928. };
  15929. }, []);
  15930. const isEnabled = isShiftStepEnabled && isShiftKey;
  15931. return isEnabled ? shiftStep * step : step;
  15932. }
  15933. /* harmony default export */ var use_jump_step = (useJumpStep);
  15934. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js
  15935. /**
  15936. * External dependencies
  15937. */
  15938. /**
  15939. * WordPress dependencies
  15940. */
  15941. /**
  15942. * Internal dependencies
  15943. */
  15944. function NumberControl({
  15945. __unstableStateReducer: stateReducer = state => state,
  15946. className,
  15947. dragDirection = 'n',
  15948. hideHTMLArrows = false,
  15949. isDragEnabled = true,
  15950. isShiftStepEnabled = true,
  15951. label,
  15952. max = Infinity,
  15953. min = -Infinity,
  15954. shiftStep = 10,
  15955. step = 1,
  15956. type: typeProp = 'number',
  15957. value: valueProp,
  15958. ...props
  15959. }, ref) {
  15960. const baseValue = roundClamp(0, min, max, step);
  15961. const jumpStep = use_jump_step({
  15962. step,
  15963. shiftStep,
  15964. isShiftStepEnabled
  15965. });
  15966. const autoComplete = typeProp === 'number' ? 'off' : null;
  15967. const classes = classnames_default()('components-number-control', className);
  15968. /**
  15969. * "Middleware" function that intercepts updates from InputControl.
  15970. * This allows us to tap into actions to transform the (next) state for
  15971. * InputControl.
  15972. *
  15973. * @param {Object} state State from InputControl
  15974. * @param {Object} action Action triggering state change
  15975. * @return {Object} The updated state to apply to InputControl
  15976. */
  15977. const numberControlStateReducer = (state, action) => {
  15978. const {
  15979. type,
  15980. payload
  15981. } = action;
  15982. const event = payload === null || payload === void 0 ? void 0 : payload.event;
  15983. const currentValue = state.value;
  15984. /**
  15985. * Handles custom UP and DOWN Keyboard events
  15986. */
  15987. if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {
  15988. const enableShift = event.shiftKey && isShiftStepEnabled;
  15989. const incrementalValue = enableShift ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step);
  15990. let nextValue = isValueEmpty(currentValue) ? baseValue : currentValue;
  15991. if (event !== null && event !== void 0 && event.preventDefault) {
  15992. event.preventDefault();
  15993. }
  15994. if (type === inputControlActionTypes.PRESS_UP) {
  15995. nextValue = add(nextValue, incrementalValue);
  15996. }
  15997. if (type === inputControlActionTypes.PRESS_DOWN) {
  15998. nextValue = subtract(nextValue, incrementalValue);
  15999. }
  16000. nextValue = roundClamp(nextValue, min, max, incrementalValue);
  16001. state.value = nextValue;
  16002. }
  16003. /**
  16004. * Handles drag to update events
  16005. */
  16006. if (type === inputControlActionTypes.DRAG && isDragEnabled) {
  16007. const {
  16008. delta,
  16009. shiftKey
  16010. } = payload;
  16011. const [x, y] = delta;
  16012. const modifier = shiftKey ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step);
  16013. let directionModifier;
  16014. let directionBaseValue;
  16015. switch (dragDirection) {
  16016. case 'n':
  16017. directionBaseValue = y;
  16018. directionModifier = -1;
  16019. break;
  16020. case 'e':
  16021. directionBaseValue = x;
  16022. directionModifier = Object(external_wp_i18n_["isRTL"])() ? -1 : 1;
  16023. break;
  16024. case 's':
  16025. directionBaseValue = y;
  16026. directionModifier = 1;
  16027. break;
  16028. case 'w':
  16029. directionBaseValue = x;
  16030. directionModifier = Object(external_wp_i18n_["isRTL"])() ? 1 : -1;
  16031. break;
  16032. }
  16033. const distance = directionBaseValue * modifier * directionModifier;
  16034. let nextValue;
  16035. if (distance !== 0) {
  16036. nextValue = roundClamp(add(currentValue, distance), min, max, modifier);
  16037. state.value = nextValue;
  16038. }
  16039. }
  16040. /**
  16041. * Handles commit (ENTER key press or on blur if isPressEnterToChange)
  16042. */
  16043. if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) {
  16044. state.value = roundClamp(currentValue, min, max);
  16045. }
  16046. return state;
  16047. };
  16048. return Object(external_wp_element_["createElement"])(number_control_styles_Input, Object(esm_extends["a" /* default */])({
  16049. autoComplete: autoComplete,
  16050. inputMode: "numeric"
  16051. }, props, {
  16052. className: classes,
  16053. dragDirection: dragDirection,
  16054. hideHTMLArrows: hideHTMLArrows,
  16055. isDragEnabled: isDragEnabled,
  16056. label: label,
  16057. max: max,
  16058. min: min,
  16059. ref: ref,
  16060. step: jumpStep,
  16061. type: typeProp,
  16062. value: valueProp,
  16063. __unstableStateReducer: composeStateReducers(numberControlStateReducer, stateReducer)
  16064. }));
  16065. }
  16066. /* harmony default export */ var number_control = (Object(external_wp_element_["forwardRef"])(NumberControl));
  16067. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js
  16068. function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  16069. /**
  16070. * Internal dependencies
  16071. */
  16072. const CIRCLE_SIZE = 30;
  16073. const angle_picker_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  16074. target: "e65ony40",
  16075. label: "Root"
  16076. })( true ? {
  16077. name: "tn9ygg",
  16078. styles: "max-width:200px;"
  16079. } : undefined);
  16080. const CircleRoot = styled_base_browser_esm("div", {
  16081. target: "e65ony41",
  16082. label: "CircleRoot"
  16083. })("border-radius:50%;border:1px solid ", COLORS.ui.borderLight, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;" + ( true ? "" : undefined));
  16084. const CircleIndicatorWrapper = styled_base_browser_esm("div", {
  16085. target: "e65ony42",
  16086. label: "CircleIndicatorWrapper"
  16087. })( true ? {
  16088. name: "11t5m37",
  16089. styles: "box-sizing:border-box;position:relative;width:100%;height:100%;"
  16090. } : undefined);
  16091. const CircleIndicator = styled_base_browser_esm("div", {
  16092. target: "e65ony43",
  16093. label: "CircleIndicator"
  16094. })("background:", COLORS.ui.border, ";border-radius:50%;border:3px solid ", COLORS.ui.border, ";bottom:0;box-sizing:border-box;display:block;height:1px;left:0;margin:auto;position:absolute;right:0;top:-", CIRCLE_SIZE / 2, "px;width:1px;" + ( true ? "" : undefined));
  16095. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js
  16096. /**
  16097. * WordPress dependencies
  16098. */
  16099. /**
  16100. * Internal dependencies
  16101. */
  16102. function AngleCircle({
  16103. value,
  16104. onChange,
  16105. ...props
  16106. }) {
  16107. const angleCircleRef = Object(external_wp_element_["useRef"])();
  16108. const angleCircleCenter = Object(external_wp_element_["useRef"])();
  16109. const previousCursorValue = Object(external_wp_element_["useRef"])();
  16110. const setAngleCircleCenter = () => {
  16111. const rect = angleCircleRef.current.getBoundingClientRect();
  16112. angleCircleCenter.current = {
  16113. x: rect.x + rect.width / 2,
  16114. y: rect.y + rect.height / 2
  16115. };
  16116. };
  16117. const changeAngleToPosition = event => {
  16118. const {
  16119. x: centerX,
  16120. y: centerY
  16121. } = angleCircleCenter.current;
  16122. const {
  16123. ownerDocument
  16124. } = angleCircleRef.current; // Prevent (drag) mouse events from selecting and accidentally
  16125. // triggering actions from other elements.
  16126. event.preventDefault(); // Ensure the input isn't focused as preventDefault would leave it
  16127. ownerDocument.activeElement.blur();
  16128. onChange(getAngle(centerX, centerY, event.clientX, event.clientY));
  16129. };
  16130. const {
  16131. startDrag,
  16132. isDragging
  16133. } = Object(external_wp_compose_["__experimentalUseDragging"])({
  16134. onDragStart: event => {
  16135. setAngleCircleCenter();
  16136. changeAngleToPosition(event);
  16137. },
  16138. onDragMove: changeAngleToPosition,
  16139. onDragEnd: changeAngleToPosition
  16140. });
  16141. Object(external_wp_element_["useEffect"])(() => {
  16142. if (isDragging) {
  16143. if (previousCursorValue.current === undefined) {
  16144. previousCursorValue.current = document.body.style.cursor;
  16145. }
  16146. document.body.style.cursor = 'grabbing';
  16147. } else {
  16148. document.body.style.cursor = previousCursorValue.current || null;
  16149. previousCursorValue.current = undefined;
  16150. }
  16151. }, [isDragging]);
  16152. return (
  16153. /* eslint-disable jsx-a11y/no-static-element-interactions */
  16154. Object(external_wp_element_["createElement"])(CircleRoot, Object(esm_extends["a" /* default */])({
  16155. ref: angleCircleRef,
  16156. onMouseDown: startDrag,
  16157. className: "components-angle-picker-control__angle-circle",
  16158. style: isDragging ? {
  16159. cursor: 'grabbing'
  16160. } : undefined
  16161. }, props), Object(external_wp_element_["createElement"])(CircleIndicatorWrapper, {
  16162. style: value ? {
  16163. transform: `rotate(${value}deg)`
  16164. } : undefined,
  16165. className: "components-angle-picker-control__angle-circle-indicator-wrapper"
  16166. }, Object(external_wp_element_["createElement"])(CircleIndicator, {
  16167. className: "components-angle-picker-control__angle-circle-indicator"
  16168. })))
  16169. /* eslint-enable jsx-a11y/no-static-element-interactions */
  16170. );
  16171. }
  16172. function getAngle(centerX, centerY, pointX, pointY) {
  16173. const y = pointY - centerY;
  16174. const x = pointX - centerX;
  16175. const angleInRadians = Math.atan2(y, x);
  16176. const angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90;
  16177. if (angleInDeg < 0) {
  16178. return 360 + angleInDeg;
  16179. }
  16180. return angleInDeg;
  16181. }
  16182. /* harmony default export */ var angle_circle = (AngleCircle);
  16183. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js
  16184. /**
  16185. * External dependencies
  16186. */
  16187. /**
  16188. * WordPress dependencies
  16189. */
  16190. /**
  16191. * Internal dependencies
  16192. */
  16193. function AnglePickerControl({
  16194. className,
  16195. hideLabelFromVision,
  16196. id: idProp,
  16197. label = Object(external_wp_i18n_["__"])('Angle'),
  16198. onChange,
  16199. value,
  16200. ...props
  16201. }) {
  16202. const instanceId = Object(external_wp_compose_["useInstanceId"])(AnglePickerControl, 'components-angle-picker-control__input');
  16203. const id = idProp || instanceId;
  16204. const handleOnNumberChange = unprocessedValue => {
  16205. const inputValue = unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0;
  16206. onChange(inputValue);
  16207. };
  16208. const classes = classnames_default()('components-angle-picker-control', className);
  16209. return Object(external_wp_element_["createElement"])(base_control, Object(esm_extends["a" /* default */])({
  16210. className: classes,
  16211. hideLabelFromVision: hideLabelFromVision,
  16212. id: id,
  16213. label: label
  16214. }, props), Object(external_wp_element_["createElement"])(angle_picker_control_styles_Root, null, Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(number_control, {
  16215. className: "components-angle-picker-control__input-field",
  16216. id: id,
  16217. max: 360,
  16218. min: 0,
  16219. onChange: handleOnNumberChange,
  16220. step: "1",
  16221. value: value
  16222. })), Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(angle_circle, {
  16223. "aria-hidden": "true",
  16224. value: value,
  16225. onChange: onChange
  16226. }))));
  16227. }
  16228. // EXTERNAL MODULE: external ["wp","richText"]
  16229. var external_wp_richText_ = __webpack_require__("qRz9");
  16230. // EXTERNAL MODULE: external ["wp","a11y"]
  16231. var external_wp_a11y_ = __webpack_require__("gdqT");
  16232. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
  16233. var build_module_button = __webpack_require__("kA6J");
  16234. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 1 modules
  16235. var build_module_popover = __webpack_require__("oXO/");
  16236. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/index.js
  16237. /**
  16238. * External dependencies
  16239. */
  16240. /**
  16241. * WordPress dependencies
  16242. */
  16243. /**
  16244. * Internal dependencies
  16245. */
  16246. /**
  16247. * A raw completer option.
  16248. *
  16249. * @typedef {*} CompleterOption
  16250. */
  16251. /**
  16252. * @callback FnGetOptions
  16253. *
  16254. * @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them.
  16255. */
  16256. /**
  16257. * @callback FnGetOptionKeywords
  16258. * @param {CompleterOption} option a completer option.
  16259. *
  16260. * @return {string[]} list of key words to search.
  16261. */
  16262. /**
  16263. * @callback FnIsOptionDisabled
  16264. * @param {CompleterOption} option a completer option.
  16265. *
  16266. * @return {string[]} whether or not the given option is disabled.
  16267. */
  16268. /**
  16269. * @callback FnGetOptionLabel
  16270. * @param {CompleterOption} option a completer option.
  16271. *
  16272. * @return {(string|Array.<(string|WPElement)>)} list of react components to render.
  16273. */
  16274. /**
  16275. * @callback FnAllowContext
  16276. * @param {string} before the string before the auto complete trigger and query.
  16277. * @param {string} after the string after the autocomplete trigger and query.
  16278. *
  16279. * @return {boolean} true if the completer can handle.
  16280. */
  16281. /**
  16282. * @typedef {Object} OptionCompletion
  16283. * @property {'insert-at-caret'|'replace'} action the intended placement of the completion.
  16284. * @property {OptionCompletionValue} value the completion value.
  16285. */
  16286. /**
  16287. * A completion value.
  16288. *
  16289. * @typedef {(string|WPElement|Object)} OptionCompletionValue
  16290. */
  16291. /**
  16292. * @callback FnGetOptionCompletion
  16293. * @param {CompleterOption} value the value of the completer option.
  16294. * @param {string} query the text value of the autocomplete query.
  16295. *
  16296. * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an
  16297. * OptionCompletionValue is returned, the
  16298. * completion action defaults to `insert-at-caret`.
  16299. */
  16300. /**
  16301. * @typedef {Object} WPCompleter
  16302. * @property {string} name a way to identify a completer, useful for selective overriding.
  16303. * @property {?string} className A class to apply to the popup menu.
  16304. * @property {string} triggerPrefix the prefix that will display the menu.
  16305. * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them.
  16306. * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option.
  16307. * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled.
  16308. * @property {FnGetOptionLabel} getOptionLabel get the label for a given option.
  16309. * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates.
  16310. * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option.
  16311. */
  16312. function filterOptions(search, options = [], maxResults = 10) {
  16313. const filtered = [];
  16314. for (let i = 0; i < options.length; i++) {
  16315. const option = options[i]; // Merge label into keywords
  16316. let {
  16317. keywords = []
  16318. } = option;
  16319. if ('string' === typeof option.label) {
  16320. keywords = [...keywords, option.label];
  16321. }
  16322. const isMatch = keywords.some(keyword => search.test(Object(external_lodash_["deburr"])(keyword)));
  16323. if (!isMatch) {
  16324. continue;
  16325. }
  16326. filtered.push(option); // Abort early if max reached
  16327. if (filtered.length === maxResults) {
  16328. break;
  16329. }
  16330. }
  16331. return filtered;
  16332. }
  16333. const getAutoCompleterUI = autocompleter => {
  16334. const useItems = autocompleter.useItems ? autocompleter.useItems : filterValue => {
  16335. const [items, setItems] = Object(external_wp_element_["useState"])([]);
  16336. /*
  16337. * We support both synchronous and asynchronous retrieval of completer options
  16338. * but internally treat all as async so we maintain a single, consistent code path.
  16339. *
  16340. * Because networks can be slow, and the internet is wonderfully unpredictable,
  16341. * we don't want two promises updating the state at once. This ensures that only
  16342. * the most recent promise will act on `optionsData`. This doesn't use the state
  16343. * because `setState` is batched, and so there's no guarantee that setting
  16344. * `activePromise` in the state would result in it actually being in `this.state`
  16345. * before the promise resolves and we check to see if this is the active promise or not.
  16346. */
  16347. Object(external_wp_element_["useLayoutEffect"])(() => {
  16348. const {
  16349. options,
  16350. isDebounced
  16351. } = autocompleter;
  16352. const loadOptions = Object(external_lodash_["debounce"])(() => {
  16353. const promise = Promise.resolve(typeof options === 'function' ? options(filterValue) : options).then(optionsData => {
  16354. if (promise.canceled) {
  16355. return;
  16356. }
  16357. const keyedOptions = optionsData.map((optionData, optionIndex) => ({
  16358. key: `${autocompleter.name}-${optionIndex}`,
  16359. value: optionData,
  16360. label: autocompleter.getOptionLabel(optionData),
  16361. keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [],
  16362. isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false
  16363. })); // create a regular expression to filter the options
  16364. const search = new RegExp('(?:\\b|\\s|^)' + Object(external_lodash_["escapeRegExp"])(filterValue), 'i');
  16365. setItems(filterOptions(search, keyedOptions));
  16366. });
  16367. return promise;
  16368. }, isDebounced ? 250 : 0);
  16369. const promise = loadOptions();
  16370. return () => {
  16371. loadOptions.cancel();
  16372. if (promise) {
  16373. promise.canceled = true;
  16374. }
  16375. };
  16376. }, [filterValue]);
  16377. return [items];
  16378. };
  16379. function AutocompleterUI({
  16380. filterValue,
  16381. instanceId,
  16382. listBoxId,
  16383. className,
  16384. selectedIndex,
  16385. onChangeOptions,
  16386. onSelect,
  16387. onReset,
  16388. value,
  16389. contentRef
  16390. }) {
  16391. const [items] = useItems(filterValue);
  16392. const anchorRef = Object(external_wp_richText_["useAnchorRef"])({
  16393. ref: contentRef,
  16394. value
  16395. });
  16396. Object(external_wp_element_["useLayoutEffect"])(() => {
  16397. onChangeOptions(items);
  16398. }, [items]);
  16399. if (!items.length > 0) {
  16400. return null;
  16401. }
  16402. return Object(external_wp_element_["createElement"])(build_module_popover["a" /* default */], {
  16403. focusOnMount: false,
  16404. onClose: onReset,
  16405. position: "top right",
  16406. className: "components-autocomplete__popover",
  16407. anchorRef: anchorRef
  16408. }, Object(external_wp_element_["createElement"])("div", {
  16409. id: listBoxId,
  16410. role: "listbox",
  16411. className: "components-autocomplete__results"
  16412. }, Object(external_lodash_["map"])(items, (option, index) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  16413. key: option.key,
  16414. id: `components-autocomplete-item-${instanceId}-${option.key}`,
  16415. role: "option",
  16416. "aria-selected": index === selectedIndex,
  16417. disabled: option.isDisabled,
  16418. className: classnames_default()('components-autocomplete__result', className, {
  16419. 'is-selected': index === selectedIndex
  16420. }),
  16421. onClick: () => onSelect(option)
  16422. }, option.label))));
  16423. }
  16424. return AutocompleterUI;
  16425. };
  16426. function useAutocomplete({
  16427. record,
  16428. onChange,
  16429. onReplace,
  16430. completers,
  16431. contentRef
  16432. }) {
  16433. const debouncedSpeak = Object(external_wp_compose_["useDebounce"])(external_wp_a11y_["speak"], 500);
  16434. const instanceId = Object(external_wp_compose_["useInstanceId"])(useAutocomplete);
  16435. const [selectedIndex, setSelectedIndex] = Object(external_wp_element_["useState"])(0);
  16436. const [filteredOptions, setFilteredOptions] = Object(external_wp_element_["useState"])([]);
  16437. const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])('');
  16438. const [autocompleter, setAutocompleter] = Object(external_wp_element_["useState"])(null);
  16439. const [AutocompleterUI, setAutocompleterUI] = Object(external_wp_element_["useState"])(null);
  16440. const [backspacing, setBackspacing] = Object(external_wp_element_["useState"])(false);
  16441. function insertCompletion(replacement) {
  16442. const end = record.start;
  16443. const start = end - autocompleter.triggerPrefix.length - filterValue.length;
  16444. const toInsert = Object(external_wp_richText_["create"])({
  16445. html: Object(external_wp_element_["renderToString"])(replacement)
  16446. });
  16447. onChange(Object(external_wp_richText_["insert"])(record, toInsert, start, end));
  16448. }
  16449. function select(option) {
  16450. const {
  16451. getOptionCompletion
  16452. } = autocompleter || {};
  16453. if (option.isDisabled) {
  16454. return;
  16455. }
  16456. if (getOptionCompletion) {
  16457. const completion = getOptionCompletion(option.value, filterValue);
  16458. const {
  16459. action,
  16460. value
  16461. } = undefined === completion.action || undefined === completion.value ? {
  16462. action: 'insert-at-caret',
  16463. value: completion
  16464. } : completion;
  16465. if ('replace' === action) {
  16466. onReplace([value]);
  16467. } else if ('insert-at-caret' === action) {
  16468. insertCompletion(value);
  16469. }
  16470. } // Reset autocomplete state after insertion rather than before
  16471. // so insertion events don't cause the completion menu to redisplay.
  16472. reset();
  16473. }
  16474. function reset() {
  16475. setSelectedIndex(0);
  16476. setFilteredOptions([]);
  16477. setFilterValue('');
  16478. setAutocompleter(null);
  16479. setAutocompleterUI(null);
  16480. }
  16481. function announce(options) {
  16482. if (!debouncedSpeak) {
  16483. return;
  16484. }
  16485. if (!!options.length) {
  16486. debouncedSpeak(Object(external_wp_i18n_["sprintf"])(
  16487. /* translators: %d: number of results. */
  16488. Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', options.length), options.length), 'assertive');
  16489. } else {
  16490. debouncedSpeak(Object(external_wp_i18n_["__"])('No results.'), 'assertive');
  16491. }
  16492. }
  16493. /**
  16494. * Load options for an autocompleter.
  16495. *
  16496. * @param {Array} options
  16497. */
  16498. function onChangeOptions(options) {
  16499. setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0);
  16500. setFilteredOptions(options);
  16501. announce(options);
  16502. }
  16503. function handleKeyDown(event) {
  16504. setBackspacing(event.keyCode === external_wp_keycodes_["BACKSPACE"]);
  16505. if (!autocompleter) {
  16506. return;
  16507. }
  16508. if (filteredOptions.length === 0) {
  16509. return;
  16510. }
  16511. switch (event.keyCode) {
  16512. case external_wp_keycodes_["UP"]:
  16513. setSelectedIndex((selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1);
  16514. break;
  16515. case external_wp_keycodes_["DOWN"]:
  16516. setSelectedIndex((selectedIndex + 1) % filteredOptions.length);
  16517. break;
  16518. case external_wp_keycodes_["ESCAPE"]:
  16519. setAutocompleter(null);
  16520. setAutocompleterUI(null);
  16521. break;
  16522. case external_wp_keycodes_["ENTER"]:
  16523. select(filteredOptions[selectedIndex]);
  16524. break;
  16525. case external_wp_keycodes_["LEFT"]:
  16526. case external_wp_keycodes_["RIGHT"]:
  16527. reset();
  16528. return;
  16529. default:
  16530. return;
  16531. } // Any handled keycode should prevent original behavior. This relies on
  16532. // the early return in the default case.
  16533. event.preventDefault();
  16534. event.stopPropagation();
  16535. }
  16536. let textContent;
  16537. if (Object(external_wp_richText_["isCollapsed"])(record)) {
  16538. textContent = Object(external_wp_richText_["getTextContent"])(Object(external_wp_richText_["slice"])(record, 0));
  16539. }
  16540. Object(external_wp_element_["useEffect"])(() => {
  16541. if (!textContent) {
  16542. reset();
  16543. return;
  16544. }
  16545. const text = Object(external_lodash_["deburr"])(textContent);
  16546. const textAfterSelection = Object(external_wp_richText_["getTextContent"])(Object(external_wp_richText_["slice"])(record, undefined, Object(external_wp_richText_["getTextContent"])(record).length));
  16547. const completer = Object(external_lodash_["find"])(completers, ({
  16548. triggerPrefix,
  16549. allowContext
  16550. }) => {
  16551. const index = text.lastIndexOf(triggerPrefix);
  16552. if (index === -1) {
  16553. return false;
  16554. }
  16555. const textWithoutTrigger = text.slice(index + triggerPrefix.length);
  16556. const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.
  16557. // This is a final barrier to prevent the effect from completing with
  16558. // an extremely long string, which causes the editor to slow-down
  16559. // significantly. This could happen, for example, if `matchingWhileBackspacing`
  16560. // is true and one of the "words" end up being too long. If that's the case,
  16561. // it will be caught by this guard.
  16562. if (tooDistantFromTrigger) return false;
  16563. const mismatch = filteredOptions.length === 0;
  16564. const wordsFromTrigger = textWithoutTrigger.split(/\s/); // We need to allow the effect to run when not backspacing and if there
  16565. // was a mismatch. i.e when typing a trigger + the match string or when
  16566. // clicking in an existing trigger word on the page. We do that if we
  16567. // detect that we have one word from trigger in the current textual context.
  16568. //
  16569. // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and
  16570. // allow the effect to run. It will run until there's a mismatch.
  16571. const hasOneTriggerWord = wordsFromTrigger.length === 1; // This is used to allow the effect to run when backspacing and if
  16572. // "touching" a word that "belongs" to a trigger. We consider a "trigger
  16573. // word" any word up to the limit of 3 from the trigger character.
  16574. // Anything beyond that is ignored if there's a mismatch. This allows
  16575. // us to "escape" a mismatch when backspacing, but still imposing some
  16576. // sane limits.
  16577. //
  16578. // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but
  16579. // if the user presses backspace here, it will show the completion popup again.
  16580. const matchingWhileBackspacing = backspacing && textWithoutTrigger.split(/\s/).length <= 3;
  16581. if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
  16582. return false;
  16583. }
  16584. if (allowContext && !allowContext(text.slice(0, index), textAfterSelection)) {
  16585. return false;
  16586. }
  16587. if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
  16588. return false;
  16589. }
  16590. return /[\u0000-\uFFFF]*$/.test(textWithoutTrigger);
  16591. });
  16592. if (!completer) {
  16593. reset();
  16594. return;
  16595. }
  16596. const safeTrigger = Object(external_lodash_["escapeRegExp"])(completer.triggerPrefix);
  16597. const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\u0000-\uFFFF]*)$`));
  16598. const query = match && match[1];
  16599. setAutocompleter(completer);
  16600. setAutocompleterUI(() => completer !== autocompleter ? getAutoCompleterUI(completer) : AutocompleterUI);
  16601. setFilterValue(query);
  16602. }, [textContent]);
  16603. const {
  16604. key: selectedKey = ''
  16605. } = filteredOptions[selectedIndex] || {};
  16606. const {
  16607. className
  16608. } = autocompleter || {};
  16609. const isExpanded = !!autocompleter && filteredOptions.length > 0;
  16610. const listBoxId = isExpanded ? `components-autocomplete-listbox-${instanceId}` : null;
  16611. const activeId = isExpanded ? `components-autocomplete-item-${instanceId}-${selectedKey}` : null;
  16612. const hasSelection = record.start !== undefined;
  16613. return {
  16614. listBoxId,
  16615. activeId,
  16616. onKeyDown: handleKeyDown,
  16617. popover: hasSelection && AutocompleterUI && Object(external_wp_element_["createElement"])(AutocompleterUI, {
  16618. className: className,
  16619. filterValue: filterValue,
  16620. instanceId: instanceId,
  16621. listBoxId: listBoxId,
  16622. selectedIndex: selectedIndex,
  16623. onChangeOptions: onChangeOptions,
  16624. onSelect: select,
  16625. value: record,
  16626. contentRef: contentRef
  16627. })
  16628. };
  16629. }
  16630. function useAutocompleteProps(options) {
  16631. const ref = Object(external_wp_element_["useRef"])();
  16632. const onKeyDownRef = Object(external_wp_element_["useRef"])();
  16633. const {
  16634. popover,
  16635. listBoxId,
  16636. activeId,
  16637. onKeyDown
  16638. } = useAutocomplete({ ...options,
  16639. contentRef: ref
  16640. });
  16641. onKeyDownRef.current = onKeyDown;
  16642. return {
  16643. ref: Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_compose_["useRefEffect"])(element => {
  16644. function _onKeyDown(event) {
  16645. onKeyDownRef.current(event);
  16646. }
  16647. element.addEventListener('keydown', _onKeyDown);
  16648. return () => {
  16649. element.removeEventListener('keydown', _onKeyDown);
  16650. };
  16651. }, [])]),
  16652. children: popover,
  16653. 'aria-autocomplete': listBoxId ? 'list' : undefined,
  16654. 'aria-owns': listBoxId,
  16655. 'aria-activedescendant': activeId
  16656. };
  16657. }
  16658. function Autocomplete({
  16659. children,
  16660. isSelected,
  16661. ...options
  16662. }) {
  16663. const {
  16664. popover,
  16665. ...props
  16666. } = useAutocomplete(options);
  16667. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, children(props), isSelected && popover);
  16668. }
  16669. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js
  16670. function unit_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  16671. /**
  16672. * External dependencies
  16673. */
  16674. /**
  16675. * Internal dependencies
  16676. */
  16677. const unit_control_styles_Root = styled_base_browser_esm("div", {
  16678. target: "e1agakv00",
  16679. label: "Root"
  16680. })( true ? {
  16681. name: "1bt0omd",
  16682. styles: "box-sizing:border-box;position:relative;"
  16683. } : undefined);
  16684. const paddingStyles = ({
  16685. disableUnits
  16686. }) => {
  16687. const value = disableUnits ? 3 : 24;
  16688. return /*#__PURE__*/css_browser_esm(rtl_rtl({
  16689. paddingRight: value
  16690. })(), ";" + ( true ? "" : undefined));
  16691. };
  16692. var unit_control_styles_ref = true ? {
  16693. name: "1y65o8",
  16694. styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}"
  16695. } : undefined;
  16696. const arrowStyles = ({
  16697. disableUnits
  16698. }) => {
  16699. if (disableUnits) return '';
  16700. return unit_control_styles_ref;
  16701. }; // TODO: Resolve need to use &&& to increase specificity
  16702. // https://github.com/WordPress/gutenberg/issues/18483
  16703. const ValueInput = /*#__PURE__*/styled_base_browser_esm(number_control, {
  16704. target: "e1agakv01",
  16705. label: "ValueInput"
  16706. })("&&&{input{appearance:none;-moz-appearance:textfield;display:block;width:100%;", arrowStyles, ";", paddingStyles, ";}}" + ( true ? "" : undefined));
  16707. const unitSizeStyles = ({
  16708. size
  16709. }) => {
  16710. const sizes = {
  16711. default: {
  16712. height: 28,
  16713. lineHeight: '24px',
  16714. minHeight: 28,
  16715. top: 1
  16716. },
  16717. small: {
  16718. height: 22,
  16719. lineHeight: '18px',
  16720. minHeight: 22,
  16721. top: 1
  16722. }
  16723. };
  16724. return /*#__PURE__*/css_browser_esm(sizes[size], true ? "" : undefined);
  16725. };
  16726. const baseUnitLabelStyles = props => {
  16727. return /*#__PURE__*/css_browser_esm("appearance:none;background:transparent;border-radius:2px;border:none;box-sizing:border-box;color:", COLORS.darkGray[500], ";display:block;font-size:8px;line-height:1;letter-spacing:-0.5px;outline:none;padding:2px 1px;position:absolute;text-align-last:center;text-transform:uppercase;width:20px;", rtl_rtl({
  16728. borderTopLeftRadius: 0,
  16729. borderBottomLeftRadius: 0
  16730. })(), " ", rtl_rtl({
  16731. right: 0
  16732. })(), " ", unitSizeStyles(props), true ? "" : undefined);
  16733. };
  16734. const UnitLabel = styled_base_browser_esm("div", {
  16735. target: "e1agakv02",
  16736. label: "UnitLabel"
  16737. })("&&&{pointer-events:none;", baseUnitLabelStyles, ";}" + ( true ? "" : undefined));
  16738. const UnitSelect = styled_base_browser_esm("select", {
  16739. target: "e1agakv03",
  16740. label: "UnitSelect"
  16741. })("&&&{", baseUnitLabelStyles, ";cursor:pointer;border:1px solid transparent;&:hover{background-color:", COLORS.lightGray[300], ";}&:focus{border-color:", COLORS.ui.borderFocus, ";outline:2px solid transparent;outline-offset:0;}&:disabled{cursor:initial;&:hover{background-color:transparent;}}}" + ( true ? "" : undefined));
  16742. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/utils.js
  16743. /**
  16744. * External dependencies
  16745. */
  16746. /**
  16747. * WordPress dependencies
  16748. */
  16749. const isWeb = external_wp_element_["Platform"].OS === 'web';
  16750. /**
  16751. * An array of all available CSS length units.
  16752. */
  16753. const ALL_CSS_UNITS = [{
  16754. value: 'px',
  16755. label: isWeb ? 'px' : Object(external_wp_i18n_["__"])('Pixels (px)'),
  16756. default: '',
  16757. a11yLabel: Object(external_wp_i18n_["__"])('Pixels (px)')
  16758. }, {
  16759. value: '%',
  16760. label: isWeb ? '%' : Object(external_wp_i18n_["__"])('Percentage (%)'),
  16761. default: '',
  16762. a11yLabel: Object(external_wp_i18n_["__"])('Percent (%)')
  16763. }, {
  16764. value: 'em',
  16765. label: isWeb ? 'em' : Object(external_wp_i18n_["__"])('Relative to parent font size (em)'),
  16766. default: '',
  16767. a11yLabel: Object(external_wp_i18n_["__"])('Relative to parent font size (em)')
  16768. }, {
  16769. value: 'rem',
  16770. label: isWeb ? 'rem' : Object(external_wp_i18n_["__"])('Relative to root font size (rem)'),
  16771. default: '',
  16772. a11yLabel: Object(external_wp_i18n_["__"])('Relative to root font size (rem)')
  16773. }, {
  16774. value: 'vw',
  16775. label: isWeb ? 'vw' : Object(external_wp_i18n_["__"])('Viewport width (vw)'),
  16776. default: '',
  16777. a11yLabel: Object(external_wp_i18n_["__"])('Viewport width (vw)')
  16778. }, {
  16779. value: 'vh',
  16780. label: isWeb ? 'vh' : Object(external_wp_i18n_["__"])('Viewport height (vh)'),
  16781. default: '',
  16782. a11yLabel: Object(external_wp_i18n_["__"])('Viewport height (vh)')
  16783. }, {
  16784. value: 'vmin',
  16785. label: isWeb ? 'vmin' : Object(external_wp_i18n_["__"])('Viewport smallest dimension (vmin)'),
  16786. default: '',
  16787. a11yLabel: Object(external_wp_i18n_["__"])('Viewport smallest dimension (vmin)')
  16788. }, {
  16789. value: 'vmax',
  16790. label: isWeb ? 'vmax' : Object(external_wp_i18n_["__"])('Viewport largest dimension (vmax)'),
  16791. default: '',
  16792. a11yLabel: Object(external_wp_i18n_["__"])('Viewport largest dimension (vmax)')
  16793. }, {
  16794. value: 'ch',
  16795. label: isWeb ? 'ch' : Object(external_wp_i18n_["__"])('Width of the zero (0) character (ch)'),
  16796. default: '',
  16797. a11yLabel: Object(external_wp_i18n_["__"])('Width of the zero (0) character (ch)')
  16798. }, {
  16799. value: 'ex',
  16800. label: isWeb ? 'ex' : Object(external_wp_i18n_["__"])('x-height of the font (ex)'),
  16801. default: '',
  16802. a11yLabel: Object(external_wp_i18n_["__"])('x-height of the font (ex)')
  16803. }, {
  16804. value: 'cm',
  16805. label: isWeb ? 'cm' : Object(external_wp_i18n_["__"])('Centimeters (cm)'),
  16806. default: '',
  16807. a11yLabel: Object(external_wp_i18n_["__"])('Centimeters (cm)')
  16808. }, {
  16809. value: 'mm',
  16810. label: isWeb ? 'mm' : Object(external_wp_i18n_["__"])('Millimeters (mm)'),
  16811. default: '',
  16812. a11yLabel: Object(external_wp_i18n_["__"])('Millimeters (mm)')
  16813. }, {
  16814. value: 'in',
  16815. label: isWeb ? 'in' : Object(external_wp_i18n_["__"])('Inches (in)'),
  16816. default: '',
  16817. a11yLabel: Object(external_wp_i18n_["__"])('Inches (in)')
  16818. }, {
  16819. value: 'pc',
  16820. label: isWeb ? 'pc' : Object(external_wp_i18n_["__"])('Picas (pc)'),
  16821. default: '',
  16822. a11yLabel: Object(external_wp_i18n_["__"])('Picas (pc)')
  16823. }, {
  16824. value: 'pt',
  16825. label: isWeb ? 'pt' : Object(external_wp_i18n_["__"])('Points (pt)'),
  16826. default: '',
  16827. a11yLabel: Object(external_wp_i18n_["__"])('Points (pt)')
  16828. }];
  16829. /**
  16830. * Units of measurements. `a11yLabel` is used by screenreaders.
  16831. */
  16832. const CSS_UNITS = [{
  16833. value: 'px',
  16834. label: 'px',
  16835. default: 0,
  16836. a11yLabel: Object(external_wp_i18n_["__"])('pixels')
  16837. }, {
  16838. value: '%',
  16839. label: '%',
  16840. default: 10,
  16841. a11yLabel: Object(external_wp_i18n_["__"])('percent')
  16842. }, {
  16843. value: 'em',
  16844. label: 'em',
  16845. default: 0,
  16846. a11yLabel: Object(external_wp_i18n_["_x"])('ems', 'Relative to parent font size (em)')
  16847. }, {
  16848. value: 'rem',
  16849. label: 'rem',
  16850. default: 0,
  16851. a11yLabel: Object(external_wp_i18n_["_x"])('rems', 'Relative to root font size (rem)')
  16852. }, {
  16853. value: 'vw',
  16854. label: 'vw',
  16855. default: 10,
  16856. a11yLabel: Object(external_wp_i18n_["__"])('viewport widths')
  16857. }, {
  16858. value: 'vh',
  16859. label: 'vh',
  16860. default: 10,
  16861. a11yLabel: Object(external_wp_i18n_["__"])('viewport heights')
  16862. }];
  16863. const DEFAULT_UNIT = CSS_UNITS[0];
  16864. /**
  16865. * Handles legacy value + unit handling.
  16866. * This component use to manage both incoming value and units separately.
  16867. *
  16868. * Moving forward, ideally the value should be a string that contains both
  16869. * the value and unit, example: '10px'
  16870. *
  16871. * @param {number|string} value Value
  16872. * @param {string} unit Unit value
  16873. * @param {Array<Object>} units Units to derive from.
  16874. * @return {Array<number, string>} The extracted number and unit.
  16875. */
  16876. function getParsedValue(value, unit, units) {
  16877. const initialValue = unit ? `${value}${unit}` : value;
  16878. return parseUnit(initialValue, units);
  16879. }
  16880. /**
  16881. * Checks if units are defined.
  16882. *
  16883. * @param {any} units Units to check.
  16884. * @return {boolean} Whether units are defined.
  16885. */
  16886. function utils_hasUnits(units) {
  16887. return !Object(external_lodash_["isEmpty"])(units) && units.length > 1 && units !== false;
  16888. }
  16889. /**
  16890. * Parses a number and unit from a value.
  16891. *
  16892. * @param {string} initialValue Value to parse
  16893. * @param {Array<Object>} units Units to derive from.
  16894. * @return {Array<number, string>} The extracted number and unit.
  16895. */
  16896. function parseUnit(initialValue, units = ALL_CSS_UNITS) {
  16897. const value = String(initialValue).trim();
  16898. let num = parseFloat(value, 10);
  16899. num = isNaN(num) ? '' : num;
  16900. const unitMatch = value.match(/[\d.\-\+]*\s*(.*)/)[1];
  16901. let unit = unitMatch !== undefined ? unitMatch : '';
  16902. unit = unit.toLowerCase();
  16903. if (utils_hasUnits(units)) {
  16904. const match = units.find(item => item.value === unit);
  16905. unit = match === null || match === void 0 ? void 0 : match.value;
  16906. } else {
  16907. unit = DEFAULT_UNIT.value;
  16908. }
  16909. return [num, unit];
  16910. }
  16911. /**
  16912. * Parses a number and unit from a value. Validates parsed value, using fallback
  16913. * value if invalid.
  16914. *
  16915. * @param {number|string} next The next value.
  16916. * @param {Array<Object>} units Units to derive from.
  16917. * @param {number|string} fallbackValue The fallback value.
  16918. * @param {string} fallbackUnit The fallback value.
  16919. * @return {Array<number, string>} The extracted number and unit.
  16920. */
  16921. function getValidParsedUnit(next, units, fallbackValue, fallbackUnit) {
  16922. const [parsedValue, parsedUnit] = parseUnit(next, units);
  16923. let baseValue = parsedValue;
  16924. let baseUnit;
  16925. if (isNaN(parsedValue) || parsedValue === '') {
  16926. baseValue = fallbackValue;
  16927. }
  16928. baseUnit = parsedUnit || fallbackUnit;
  16929. /**
  16930. * If no unit is found, attempt to use the first value from the collection
  16931. * of units as a default fallback.
  16932. */
  16933. if (utils_hasUnits(units) && !baseUnit) {
  16934. var _units$;
  16935. baseUnit = (_units$ = units[0]) === null || _units$ === void 0 ? void 0 : _units$.value;
  16936. }
  16937. return [baseValue, baseUnit];
  16938. }
  16939. /**
  16940. * Takes a unit value and finds the matching accessibility label for the
  16941. * unit abbreviation.
  16942. *
  16943. * @param {string} unit Unit value (example: px)
  16944. * @return {string} a11y label for the unit abbreviation
  16945. */
  16946. function parseA11yLabelForUnit(unit) {
  16947. const match = ALL_CSS_UNITS.find(item => item.value === unit);
  16948. return match !== null && match !== void 0 && match.a11yLabel ? match === null || match === void 0 ? void 0 : match.a11yLabel : match === null || match === void 0 ? void 0 : match.value;
  16949. }
  16950. /**
  16951. * Filters available units based on values defined by settings.
  16952. *
  16953. * @param {Array} settings Collection of preferred units.
  16954. * @param {Array} units Collection of available units.
  16955. *
  16956. * @return {Array} Filtered units based on settings.
  16957. */
  16958. function filterUnitsWithSettings(settings = [], units = []) {
  16959. return units.filter(unit => {
  16960. return settings.includes(unit.value);
  16961. });
  16962. }
  16963. /**
  16964. * Custom hook to retrieve and consolidate units setting from add_theme_support().
  16965. * TODO: ideally this hook shouldn't be needed
  16966. * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823
  16967. *
  16968. * @param {Object} args An object containing units, settingPath & defaultUnits.
  16969. * @param {Object} args.units Collection of available units.
  16970. * @param {string} args.availableUnits The setting path. Defaults to 'spacing.units'.
  16971. * @param {Object} args.defaultValues Collection of default values for defined units. Example: { px: '350', em: '15' }.
  16972. *
  16973. * @return {Array} Filtered units based on settings.
  16974. */
  16975. const useCustomUnits = ({
  16976. units,
  16977. availableUnits,
  16978. defaultValues
  16979. }) => {
  16980. units = units || ALL_CSS_UNITS;
  16981. const usedUnits = filterUnitsWithSettings(!availableUnits ? [] : availableUnits, units);
  16982. if (defaultValues) {
  16983. usedUnits.forEach((unit, i) => {
  16984. if (defaultValues[unit.value]) {
  16985. usedUnits[i].default = defaultValues[unit.value];
  16986. }
  16987. });
  16988. }
  16989. return usedUnits.length === 0 ? false : usedUnits;
  16990. };
  16991. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js
  16992. /**
  16993. * External dependencies
  16994. */
  16995. /**
  16996. * Internal dependencies
  16997. */
  16998. /**
  16999. * Renders a `select` if there are multiple units.
  17000. * Otherwise, renders a non-selectable label.
  17001. *
  17002. * @param {Object} props Component props.
  17003. * @param {string} [props.className] Class to set on the `select` element.
  17004. * @param {boolean} [props.isTabbable=true] Whether the control can be focused via keyboard navigation.
  17005. * @param {Array} [props.options=CSS_UNITS] Available units to select from.
  17006. * @param {Function} [props.onChange=noop] A callback function invoked when the value is changed.
  17007. * @param {string} [props.size="default"] Size of the control option. Supports "default" and "small".
  17008. * @param {string} [props.value="px"] Current unit.
  17009. */
  17010. function UnitSelectControl({
  17011. className,
  17012. isTabbable = true,
  17013. options = CSS_UNITS,
  17014. onChange = external_lodash_["noop"],
  17015. size = 'default',
  17016. value = 'px',
  17017. ...props
  17018. }) {
  17019. if (!utils_hasUnits(options)) {
  17020. return Object(external_wp_element_["createElement"])(UnitLabel, {
  17021. className: "components-unit-control__unit-label",
  17022. size: size
  17023. }, value);
  17024. }
  17025. const handleOnChange = event => {
  17026. const {
  17027. value: unitValue
  17028. } = event.target;
  17029. const data = options.find(option => option.value === unitValue);
  17030. onChange(unitValue, {
  17031. event,
  17032. data
  17033. });
  17034. };
  17035. const classes = classnames_default()('components-unit-control__select', className);
  17036. return Object(external_wp_element_["createElement"])(UnitSelect, Object(esm_extends["a" /* default */])({
  17037. className: classes,
  17038. onChange: handleOnChange,
  17039. size: size,
  17040. tabIndex: isTabbable ? null : '-1',
  17041. value: value
  17042. }, props), options.map(option => Object(external_wp_element_["createElement"])("option", {
  17043. value: option.value,
  17044. key: option.value
  17045. }, option.label)));
  17046. }
  17047. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js
  17048. /**
  17049. * WordPress dependencies
  17050. */
  17051. /**
  17052. * Internal dependencies
  17053. */
  17054. /**
  17055. * @template T
  17056. * @typedef Options
  17057. * @property {T | undefined} initial Initial value
  17058. * @property {T | ""} fallback Fallback value
  17059. */
  17060. /** @type {Readonly<{ initial: undefined, fallback: '' }>} */
  17061. const defaultOptions = {
  17062. initial: undefined,
  17063. /**
  17064. * Defaults to empty string, as that is preferred for usage with
  17065. * <input />, <textarea />, and <select /> form elements.
  17066. */
  17067. fallback: ''
  17068. };
  17069. /**
  17070. * Custom hooks for "controlled" components to track and consolidate internal
  17071. * state and incoming values. This is useful for components that render
  17072. * `input`, `textarea`, or `select` HTML elements.
  17073. *
  17074. * https://reactjs.org/docs/forms.html#controlled-components
  17075. *
  17076. * At first, a component using useControlledState receives an initial prop
  17077. * value, which is used as initial internal state.
  17078. *
  17079. * This internal state can be maintained and updated without
  17080. * relying on new incoming prop values.
  17081. *
  17082. * Unlike the basic useState hook, useControlledState's state can
  17083. * be updated if a new incoming prop value is changed.
  17084. *
  17085. * @template T
  17086. *
  17087. * @param {T | undefined} currentState The current value.
  17088. * @param {Options<T>} [options=defaultOptions] Additional options for the hook.
  17089. *
  17090. * @return {[T | "", (nextState: T) => void]} The controlled value and the value setter.
  17091. */
  17092. function useControlledState(currentState, options = defaultOptions) {
  17093. const {
  17094. initial,
  17095. fallback
  17096. } = { ...defaultOptions,
  17097. ...options
  17098. };
  17099. const [internalState, setInternalState] = Object(external_wp_element_["useState"])(currentState);
  17100. const hasCurrentState = isValueDefined(currentState);
  17101. /*
  17102. * Resets internal state if value every changes from uncontrolled <-> controlled.
  17103. */
  17104. Object(external_wp_element_["useEffect"])(() => {
  17105. if (hasCurrentState && internalState) {
  17106. setInternalState(undefined);
  17107. }
  17108. }, [hasCurrentState, internalState]);
  17109. const state = getDefinedValue([currentState, internalState, initial], fallback);
  17110. /* eslint-disable jsdoc/no-undefined-types */
  17111. /** @type {(nextState: T) => void} */
  17112. const setState = nextState => {
  17113. if (!hasCurrentState) {
  17114. setInternalState(nextState);
  17115. }
  17116. };
  17117. /* eslint-enable jsdoc/no-undefined-types */
  17118. return [state, setState];
  17119. }
  17120. /* harmony default export */ var use_controlled_state = (useControlledState);
  17121. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/index.js
  17122. /**
  17123. * External dependencies
  17124. */
  17125. /**
  17126. * WordPress dependencies
  17127. */
  17128. /**
  17129. * Internal dependencies
  17130. */
  17131. function UnitControl({
  17132. __unstableStateReducer: stateReducer = state => state,
  17133. autoComplete = 'off',
  17134. className,
  17135. disabled = false,
  17136. disableUnits = false,
  17137. isPressEnterToChange = false,
  17138. isResetValueOnUnitChange = false,
  17139. isUnitSelectTabbable = true,
  17140. label,
  17141. onChange = external_lodash_["noop"],
  17142. onUnitChange = external_lodash_["noop"],
  17143. size = 'default',
  17144. style,
  17145. unit: unitProp,
  17146. units = CSS_UNITS,
  17147. value: valueProp,
  17148. ...props
  17149. }, ref) {
  17150. const [value, initialUnit] = getParsedValue(valueProp, unitProp, units);
  17151. const [unit, setUnit] = use_controlled_state(unitProp, {
  17152. initial: initialUnit
  17153. }); // Stores parsed value for hand-off in state reducer
  17154. const refParsedValue = Object(external_wp_element_["useRef"])(null);
  17155. const classes = classnames_default()('components-unit-control', className);
  17156. const handleOnChange = (next, changeProps) => {
  17157. if (next === '') {
  17158. onChange('', changeProps);
  17159. return;
  17160. }
  17161. /*
  17162. * Customizing the onChange callback.
  17163. * This allows as to broadcast a combined value+unit to onChange.
  17164. */
  17165. next = getValidParsedUnit(next, units, value, unit).join('');
  17166. onChange(next, changeProps);
  17167. };
  17168. const handleOnUnitChange = (next, changeProps) => {
  17169. const {
  17170. data
  17171. } = changeProps;
  17172. let nextValue = `${value}${next}`;
  17173. if (isResetValueOnUnitChange && (data === null || data === void 0 ? void 0 : data.default) !== undefined) {
  17174. nextValue = `${data.default}${next}`;
  17175. }
  17176. onChange(nextValue, changeProps);
  17177. onUnitChange(next, changeProps);
  17178. setUnit(next);
  17179. };
  17180. const mayUpdateUnit = event => {
  17181. if (!isNaN(event.target.value)) {
  17182. refParsedValue.current = null;
  17183. return;
  17184. }
  17185. const [parsedValue, parsedUnit] = getValidParsedUnit(event.target.value, units, value, unit);
  17186. refParsedValue.current = parsedValue;
  17187. if (isPressEnterToChange && parsedUnit !== unit) {
  17188. const data = units.find(option => option.value === parsedUnit);
  17189. const changeProps = {
  17190. event,
  17191. data
  17192. };
  17193. onChange(`${parsedValue}${parsedUnit}`, changeProps);
  17194. onUnitChange(parsedUnit, changeProps);
  17195. setUnit(parsedUnit);
  17196. }
  17197. };
  17198. const handleOnBlur = mayUpdateUnit;
  17199. const handleOnKeyDown = event => {
  17200. const {
  17201. keyCode
  17202. } = event;
  17203. if (keyCode === external_wp_keycodes_["ENTER"]) {
  17204. mayUpdateUnit(event);
  17205. }
  17206. };
  17207. /**
  17208. * "Middleware" function that intercepts updates from InputControl.
  17209. * This allows us to tap into actions to transform the (next) state for
  17210. * InputControl.
  17211. *
  17212. * @param {Object} state State from InputControl
  17213. * @param {Object} action Action triggering state change
  17214. * @return {Object} The updated state to apply to InputControl
  17215. */
  17216. const unitControlStateReducer = (state, action) => {
  17217. /*
  17218. * On commits (when pressing ENTER and on blur if
  17219. * isPressEnterToChange is true), if a parse has been performed
  17220. * then use that result to update the state.
  17221. */
  17222. if (action.type === inputControlActionTypes.COMMIT) {
  17223. if (refParsedValue.current !== null) {
  17224. state.value = refParsedValue.current;
  17225. refParsedValue.current = null;
  17226. }
  17227. }
  17228. return state;
  17229. };
  17230. const inputSuffix = !disableUnits ? Object(external_wp_element_["createElement"])(UnitSelectControl, {
  17231. "aria-label": Object(external_wp_i18n_["__"])('Select unit'),
  17232. disabled: disabled,
  17233. isTabbable: isUnitSelectTabbable,
  17234. options: units,
  17235. onChange: handleOnUnitChange,
  17236. size: size,
  17237. value: unit
  17238. }) : null;
  17239. let step = props.step;
  17240. /*
  17241. * If no step prop has been passed, lookup the active unit and
  17242. * try to get step from `units`, or default to a value of `1`
  17243. */
  17244. if (!step && units) {
  17245. var _activeUnit$step;
  17246. const activeUnit = units.find(option => option.value === unit);
  17247. step = (_activeUnit$step = activeUnit === null || activeUnit === void 0 ? void 0 : activeUnit.step) !== null && _activeUnit$step !== void 0 ? _activeUnit$step : 1;
  17248. }
  17249. return Object(external_wp_element_["createElement"])(unit_control_styles_Root, {
  17250. className: "components-unit-control-wrapper",
  17251. style: style
  17252. }, Object(external_wp_element_["createElement"])(ValueInput, Object(esm_extends["a" /* default */])({
  17253. "aria-label": label,
  17254. type: isPressEnterToChange ? 'text' : 'number'
  17255. }, Object(external_lodash_["omit"])(props, ['children']), {
  17256. autoComplete: autoComplete,
  17257. className: classes,
  17258. disabled: disabled,
  17259. disableUnits: disableUnits,
  17260. isPressEnterToChange: isPressEnterToChange,
  17261. label: label,
  17262. onBlur: handleOnBlur,
  17263. onKeyDown: handleOnKeyDown,
  17264. onChange: handleOnChange,
  17265. ref: ref,
  17266. size: size,
  17267. suffix: inputSuffix,
  17268. value: value,
  17269. step: step,
  17270. __unstableStateReducer: composeStateReducers(unitControlStateReducer, stateReducer)
  17271. })));
  17272. }
  17273. const ForwardedUnitControl = Object(external_wp_element_["forwardRef"])(UnitControl);
  17274. /* harmony default export */ var unit_control = (ForwardedUnitControl);
  17275. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js
  17276. function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  17277. /**
  17278. * External dependencies
  17279. */
  17280. /**
  17281. * Internal dependencies
  17282. */
  17283. const box_control_styles_Root = styled_base_browser_esm("div", {
  17284. target: "e7pk0lh0",
  17285. label: "Root"
  17286. })( true ? {
  17287. name: "vho1ao",
  17288. styles: "box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%;"
  17289. } : undefined);
  17290. const Header = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  17291. target: "e7pk0lh1",
  17292. label: "Header"
  17293. })("color:", COLORS.ui.label, ";padding-bottom:8px;" + ( true ? "" : undefined));
  17294. const HeaderControlWrapper = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  17295. target: "e7pk0lh2",
  17296. label: "HeaderControlWrapper"
  17297. })( true ? {
  17298. name: "19de7qh",
  17299. styles: "min-height:30px;"
  17300. } : undefined);
  17301. const UnitControlWrapper = styled_base_browser_esm("div", {
  17302. target: "e7pk0lh3",
  17303. label: "UnitControlWrapper"
  17304. })( true ? {
  17305. name: "zypm0w",
  17306. styles: "box-sizing:border-box;max-width:80px;"
  17307. } : undefined);
  17308. const LayoutContainer = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  17309. target: "e7pk0lh4",
  17310. label: "LayoutContainer"
  17311. })( true ? {
  17312. name: "39f89t",
  17313. styles: "justify-content:center;padding-top:8px;"
  17314. } : undefined);
  17315. const Layout = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  17316. target: "e7pk0lh5",
  17317. label: "Layout"
  17318. })( true ? {
  17319. name: "qpveuy",
  17320. styles: "position:relative;height:100%;width:100%;justify-content:flex-start;"
  17321. } : undefined);
  17322. var box_control_styles_ref = true ? {
  17323. name: "icip60",
  17324. styles: "border-radius:2px;"
  17325. } : undefined;
  17326. var box_control_styles_ref2 = true ? {
  17327. name: "1k07npk",
  17328. styles: "border-radius:0;"
  17329. } : undefined;
  17330. const unitControlBorderRadiusStyles = ({
  17331. isFirst,
  17332. isLast,
  17333. isOnly
  17334. }) => {
  17335. if (isFirst) {
  17336. return rtl_rtl({
  17337. borderTopRightRadius: 0,
  17338. borderBottomRightRadius: 0
  17339. })();
  17340. }
  17341. if (isLast) {
  17342. return rtl_rtl({
  17343. borderTopLeftRadius: 0,
  17344. borderBottomLeftRadius: 0
  17345. })();
  17346. }
  17347. if (isOnly) {
  17348. return box_control_styles_ref;
  17349. }
  17350. return box_control_styles_ref2;
  17351. };
  17352. const unitControlMarginStyles = ({
  17353. isFirst
  17354. }) => {
  17355. const marginLeft = isFirst ? 0 : -1;
  17356. return rtl_rtl({
  17357. marginLeft
  17358. })();
  17359. };
  17360. const box_control_styles_UnitControl = /*#__PURE__*/styled_base_browser_esm(unit_control, {
  17361. target: "e7pk0lh6",
  17362. label: "UnitControl"
  17363. })("max-width:60px;", unitControlBorderRadiusStyles, ";", unitControlMarginStyles, ";" + ( true ? "" : undefined));
  17364. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/unit-control.js
  17365. /**
  17366. * External dependencies
  17367. */
  17368. /**
  17369. * Internal dependencies
  17370. */
  17371. function BoxUnitControl({
  17372. isFirst,
  17373. isLast,
  17374. isOnly,
  17375. onHoverOn = external_lodash_["noop"],
  17376. onHoverOff = external_lodash_["noop"],
  17377. label,
  17378. value,
  17379. ...props
  17380. }) {
  17381. const bindHoverGesture = useHover(({
  17382. event,
  17383. ...state
  17384. }) => {
  17385. if (state.hovering) {
  17386. onHoverOn(event, state);
  17387. } else {
  17388. onHoverOff(event, state);
  17389. }
  17390. });
  17391. return Object(external_wp_element_["createElement"])(UnitControlWrapper, bindHoverGesture(), Object(external_wp_element_["createElement"])(Tooltip, {
  17392. text: label
  17393. }, Object(external_wp_element_["createElement"])(box_control_styles_UnitControl, Object(esm_extends["a" /* default */])({
  17394. "aria-label": label,
  17395. className: "component-box-control__unit-control",
  17396. hideHTMLArrows: true,
  17397. isFirst: isFirst,
  17398. isLast: isLast,
  17399. isOnly: isOnly,
  17400. isPressEnterToChange: true,
  17401. isResetValueOnUnitChange: false,
  17402. value: value
  17403. }, props))));
  17404. }
  17405. function Tooltip({
  17406. children,
  17407. text
  17408. }) {
  17409. if (!text) return children;
  17410. /**
  17411. * Wrapping the children in a `<div />` as Tooltip as it attempts
  17412. * to render the <UnitControl />. Using a plain `<div />` appears to
  17413. * resolve this issue.
  17414. *
  17415. * Originally discovered and referenced here:
  17416. * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026
  17417. */
  17418. return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
  17419. text: text,
  17420. position: "top"
  17421. }, Object(external_wp_element_["createElement"])("div", null, children));
  17422. }
  17423. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/utils.js
  17424. /**
  17425. * External dependencies
  17426. */
  17427. /**
  17428. * WordPress dependencies
  17429. */
  17430. /**
  17431. * Internal dependencies
  17432. */
  17433. const LABELS = {
  17434. all: Object(external_wp_i18n_["__"])('All'),
  17435. top: Object(external_wp_i18n_["__"])('Top'),
  17436. bottom: Object(external_wp_i18n_["__"])('Bottom'),
  17437. left: Object(external_wp_i18n_["__"])('Left'),
  17438. right: Object(external_wp_i18n_["__"])('Right'),
  17439. mixed: Object(external_wp_i18n_["__"])('Mixed')
  17440. };
  17441. const DEFAULT_VALUES = {
  17442. top: null,
  17443. right: null,
  17444. bottom: null,
  17445. left: null
  17446. };
  17447. const DEFAULT_VISUALIZER_VALUES = {
  17448. top: false,
  17449. right: false,
  17450. bottom: false,
  17451. left: false
  17452. };
  17453. /**
  17454. * Gets an items with the most occurance within an array
  17455. * https://stackoverflow.com/a/20762713
  17456. *
  17457. * @param {Array<any>} arr Array of items to check.
  17458. * @return {any} The item with the most occurances.
  17459. */
  17460. function mode(arr) {
  17461. return arr.sort((a, b) => arr.filter(v => v === a).length - arr.filter(v => v === b).length).pop();
  17462. }
  17463. /**
  17464. * Gets the 'all' input value and unit from values data.
  17465. *
  17466. * @param {Object} values Box values.
  17467. * @return {string} A value + unit for the 'all' input.
  17468. */
  17469. function getAllValue(values = {}) {
  17470. const parsedValues = Object.values(values).map(value => parseUnit(value));
  17471. const allValues = parsedValues.map(value => value[0]);
  17472. const allUnits = parsedValues.map(value => value[1]);
  17473. const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
  17474. const unit = mode(allUnits);
  17475. /**
  17476. * The isNumber check is important. On reset actions, the incoming value
  17477. * may be null or an empty string.
  17478. *
  17479. * Also, the value may also be zero (0), which is considered a valid unit value.
  17480. *
  17481. * isNumber() is more specific for these cases, rather than relying on a
  17482. * simple truthy check.
  17483. */
  17484. const allValue = Object(external_lodash_["isNumber"])(value) ? `${value}${unit}` : null;
  17485. return allValue;
  17486. }
  17487. /**
  17488. * Checks to determine if values are mixed.
  17489. *
  17490. * @param {Object} values Box values.
  17491. * @return {boolean} Whether values are mixed.
  17492. */
  17493. function isValuesMixed(values = {}) {
  17494. const allValue = getAllValue(values);
  17495. const isMixed = isNaN(parseFloat(allValue));
  17496. return isMixed;
  17497. }
  17498. /**
  17499. * Checks to determine if values are defined.
  17500. *
  17501. * @param {Object} values Box values.
  17502. *
  17503. * @return {boolean} Whether values are mixed.
  17504. */
  17505. function isValuesDefined(values) {
  17506. return values !== undefined && !Object(external_lodash_["isEmpty"])(Object.values(values).filter( // Switching units when input is empty causes values only
  17507. // containing units. This gives false positive on mixed values
  17508. // unless filtered.
  17509. value => !!value && /\d/.test(value)));
  17510. }
  17511. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/all-input-control.js
  17512. /**
  17513. * External dependencies
  17514. */
  17515. /**
  17516. * Internal dependencies
  17517. */
  17518. function AllInputControl({
  17519. onChange = external_lodash_["noop"],
  17520. onFocus = external_lodash_["noop"],
  17521. onHoverOn = external_lodash_["noop"],
  17522. onHoverOff = external_lodash_["noop"],
  17523. values,
  17524. sides,
  17525. ...props
  17526. }) {
  17527. const allValue = getAllValue(values);
  17528. const hasValues = isValuesDefined(values);
  17529. const isMixed = hasValues && isValuesMixed(values);
  17530. const allPlaceholder = isMixed ? LABELS.mixed : null;
  17531. const handleOnFocus = event => {
  17532. onFocus(event, {
  17533. side: 'all'
  17534. });
  17535. };
  17536. const handleOnChange = next => {
  17537. const nextValues = { ...values
  17538. };
  17539. const selectedSides = sides !== null && sides !== void 0 && sides.length ? sides : ['top', 'right', 'bottom', 'left'];
  17540. selectedSides.forEach(side => nextValues[side] = next);
  17541. onChange(nextValues);
  17542. };
  17543. const handleOnHoverOn = () => {
  17544. onHoverOn({
  17545. top: true,
  17546. bottom: true,
  17547. left: true,
  17548. right: true
  17549. });
  17550. };
  17551. const handleOnHoverOff = () => {
  17552. onHoverOff({
  17553. top: false,
  17554. bottom: false,
  17555. left: false,
  17556. right: false
  17557. });
  17558. };
  17559. return Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
  17560. disableUnits: isMixed,
  17561. isOnly: true,
  17562. value: allValue,
  17563. onChange: handleOnChange,
  17564. onFocus: handleOnFocus,
  17565. onHoverOn: handleOnHoverOn,
  17566. onHoverOff: handleOnHoverOff,
  17567. placeholder: allPlaceholder
  17568. }));
  17569. }
  17570. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/input-controls.js
  17571. /**
  17572. * External dependencies
  17573. */
  17574. /**
  17575. * Internal dependencies
  17576. */
  17577. const allSides = ['top', 'right', 'bottom', 'left'];
  17578. function BoxInputControls({
  17579. onChange = external_lodash_["noop"],
  17580. onFocus = external_lodash_["noop"],
  17581. onHoverOn = external_lodash_["noop"],
  17582. onHoverOff = external_lodash_["noop"],
  17583. values,
  17584. sides,
  17585. ...props
  17586. }) {
  17587. const createHandleOnFocus = side => event => {
  17588. onFocus(event, {
  17589. side
  17590. });
  17591. };
  17592. const createHandleOnHoverOn = side => () => {
  17593. onHoverOn({
  17594. [side]: true
  17595. });
  17596. };
  17597. const createHandleOnHoverOff = side => () => {
  17598. onHoverOff({
  17599. [side]: false
  17600. });
  17601. };
  17602. const handleOnChange = nextValues => {
  17603. onChange(nextValues);
  17604. };
  17605. const createHandleOnChange = side => (next, {
  17606. event
  17607. }) => {
  17608. const {
  17609. altKey
  17610. } = event;
  17611. const nextValues = { ...values
  17612. };
  17613. nextValues[side] = next;
  17614. /**
  17615. * Supports changing pair sides. For example, holding the ALT key
  17616. * when changing the TOP will also update BOTTOM.
  17617. */
  17618. if (altKey) {
  17619. switch (side) {
  17620. case 'top':
  17621. nextValues.bottom = next;
  17622. break;
  17623. case 'bottom':
  17624. nextValues.top = next;
  17625. break;
  17626. case 'left':
  17627. nextValues.right = next;
  17628. break;
  17629. case 'right':
  17630. nextValues.left = next;
  17631. break;
  17632. }
  17633. }
  17634. handleOnChange(nextValues);
  17635. }; // Filter sides if custom configuration provided, maintaining default order.
  17636. const filteredSides = sides !== null && sides !== void 0 && sides.length ? allSides.filter(side => sides.includes(side)) : allSides;
  17637. const first = filteredSides[0];
  17638. const last = filteredSides[filteredSides.length - 1];
  17639. const only = first === last && first;
  17640. return Object(external_wp_element_["createElement"])(LayoutContainer, {
  17641. className: "component-box-control__input-controls-wrapper"
  17642. }, Object(external_wp_element_["createElement"])(Layout, {
  17643. gap: 0,
  17644. align: "top",
  17645. className: "component-box-control__input-controls"
  17646. }, filteredSides.map(side => Object(external_wp_element_["createElement"])(BoxUnitControl, Object(esm_extends["a" /* default */])({}, props, {
  17647. isFirst: first === side,
  17648. isLast: last === side,
  17649. isOnly: only === side,
  17650. value: values[side],
  17651. onChange: createHandleOnChange(side),
  17652. onFocus: createHandleOnFocus(side),
  17653. onHoverOn: createHandleOnHoverOn(side),
  17654. onHoverOff: createHandleOnHoverOff(side),
  17655. label: LABELS[side],
  17656. key: `box-control-${side}`
  17657. })))));
  17658. }
  17659. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js
  17660. function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  17661. /**
  17662. * External dependencies
  17663. */
  17664. const box_control_icon_styles_Root = styled_base_browser_esm("span", {
  17665. target: "eaw9yqk0",
  17666. label: "Root"
  17667. })( true ? {
  17668. name: "1qtciqq",
  17669. styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px;"
  17670. } : undefined);
  17671. const Viewbox = styled_base_browser_esm("span", {
  17672. target: "eaw9yqk1",
  17673. label: "Viewbox"
  17674. })( true ? {
  17675. name: "be7uli",
  17676. styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%;"
  17677. } : undefined);
  17678. const strokeFocus = ({
  17679. isFocused
  17680. }) => {
  17681. return /*#__PURE__*/css_browser_esm({
  17682. backgroundColor: 'currentColor',
  17683. opacity: isFocused ? 1 : 0.3
  17684. }, true ? "" : undefined);
  17685. };
  17686. const Stroke = styled_base_browser_esm("span", {
  17687. target: "eaw9yqk2",
  17688. label: "Stroke"
  17689. })("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : undefined));
  17690. const VerticalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, {
  17691. target: "eaw9yqk3",
  17692. label: "VerticalStroke"
  17693. })( true ? {
  17694. name: "r820ty",
  17695. styles: "bottom:3px;top:3px;width:2px;"
  17696. } : undefined);
  17697. const HorizontalStroke = /*#__PURE__*/styled_base_browser_esm(Stroke, {
  17698. target: "eaw9yqk4",
  17699. label: "HorizontalStroke"
  17700. })( true ? {
  17701. name: "1gteeqa",
  17702. styles: "height:2px;left:3px;right:3px;"
  17703. } : undefined);
  17704. const TopStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, {
  17705. target: "eaw9yqk5",
  17706. label: "TopStroke"
  17707. })( true ? {
  17708. name: "1etxbbi",
  17709. styles: "top:0;"
  17710. } : undefined);
  17711. const RightStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, {
  17712. target: "eaw9yqk6",
  17713. label: "RightStroke"
  17714. })( true ? {
  17715. name: "19zs6va",
  17716. styles: "right:0;"
  17717. } : undefined);
  17718. const BottomStroke = /*#__PURE__*/styled_base_browser_esm(HorizontalStroke, {
  17719. target: "eaw9yqk7",
  17720. label: "BottomStroke"
  17721. })( true ? {
  17722. name: "lh0t43",
  17723. styles: "bottom:0;"
  17724. } : undefined);
  17725. const LeftStroke = /*#__PURE__*/styled_base_browser_esm(VerticalStroke, {
  17726. target: "eaw9yqk8",
  17727. label: "LeftStroke"
  17728. })( true ? {
  17729. name: "260zpl",
  17730. styles: "left:0;"
  17731. } : undefined);
  17732. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js
  17733. /**
  17734. * Internal dependencies
  17735. */
  17736. const BASE_ICON_SIZE = 24;
  17737. function BoxControlIcon({
  17738. size = 24,
  17739. side = 'all',
  17740. sides,
  17741. ...props
  17742. }) {
  17743. const isSideDisabled = value => (sides === null || sides === void 0 ? void 0 : sides.length) && !sides.includes(value);
  17744. const getSide = value => {
  17745. if (isSideDisabled(value)) {
  17746. return false;
  17747. }
  17748. return side === 'all' || side === value;
  17749. };
  17750. const top = getSide('top');
  17751. const right = getSide('right');
  17752. const bottom = getSide('bottom');
  17753. const left = getSide('left'); // Simulates SVG Icon scaling
  17754. const scale = size / BASE_ICON_SIZE;
  17755. return Object(external_wp_element_["createElement"])(box_control_icon_styles_Root, Object(esm_extends["a" /* default */])({
  17756. style: {
  17757. transform: `scale(${scale})`
  17758. }
  17759. }, props), Object(external_wp_element_["createElement"])(Viewbox, null, Object(external_wp_element_["createElement"])(TopStroke, {
  17760. isFocused: top
  17761. }), Object(external_wp_element_["createElement"])(RightStroke, {
  17762. isFocused: right
  17763. }), Object(external_wp_element_["createElement"])(BottomStroke, {
  17764. isFocused: bottom
  17765. }), Object(external_wp_element_["createElement"])(LeftStroke, {
  17766. isFocused: left
  17767. })));
  17768. }
  17769. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
  17770. var library_link = __webpack_require__("Bpkj");
  17771. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
  17772. var link_off = __webpack_require__("Mp0b");
  17773. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/linked-button.js
  17774. /**
  17775. * WordPress dependencies
  17776. */
  17777. /**
  17778. * Internal dependencies
  17779. */
  17780. function LinkedButton({
  17781. isLinked,
  17782. ...props
  17783. }) {
  17784. const label = isLinked ? Object(external_wp_i18n_["__"])('Unlink Sides') : Object(external_wp_i18n_["__"])('Link Sides');
  17785. return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
  17786. text: label
  17787. }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, {
  17788. className: "component-box-control__linked-button",
  17789. isPrimary: isLinked,
  17790. isSecondary: !isLinked,
  17791. isSmall: true,
  17792. icon: isLinked ? library_link["a" /* default */] : link_off["a" /* default */],
  17793. iconSize: 16,
  17794. "aria-label": label
  17795. }))));
  17796. }
  17797. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-visualizer-styles.js
  17798. function box_control_visualizer_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  17799. /**
  17800. * External dependencies
  17801. */
  17802. /**
  17803. * Internal dependencies
  17804. */
  17805. var box_control_visualizer_styles_ref = true ? {
  17806. name: "tbck19",
  17807. styles: "bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1;"
  17808. } : undefined;
  17809. const containerPositionStyles = ({
  17810. isPositionAbsolute
  17811. }) => {
  17812. if (!isPositionAbsolute) return '';
  17813. return box_control_visualizer_styles_ref;
  17814. };
  17815. const box_control_visualizer_styles_Container = styled_base_browser_esm("div", {
  17816. target: "e1df9b4q0",
  17817. label: "Container"
  17818. })("box-sizing:border-box;position:relative;", containerPositionStyles, ";" + ( true ? "" : undefined));
  17819. const Side = styled_base_browser_esm("div", {
  17820. target: "e1df9b4q1",
  17821. label: "Side"
  17822. })("box-sizing:border-box;background:", COLORS.blue.wordpress[700], ";background:", COLORS.ui.theme, ";filter:brightness( 1 );opacity:0;position:absolute;pointer-events:none;transition:opacity 120ms linear;z-index:1;", ({
  17823. isActive
  17824. }) => isActive && `
  17825. opacity: 0.3;
  17826. `, true ? "" : undefined);
  17827. const TopView = /*#__PURE__*/styled_base_browser_esm(Side, {
  17828. target: "e1df9b4q2",
  17829. label: "TopView"
  17830. })( true ? {
  17831. name: "1pb21am",
  17832. styles: "top:0;left:0;right:0;"
  17833. } : undefined);
  17834. const RightView = /*#__PURE__*/styled_base_browser_esm(Side, {
  17835. target: "e1df9b4q3",
  17836. label: "RightView"
  17837. })("top:0;bottom:0;", rtl_rtl({
  17838. right: 0
  17839. }), ";" + ( true ? "" : undefined));
  17840. const BottomView = /*#__PURE__*/styled_base_browser_esm(Side, {
  17841. target: "e1df9b4q4",
  17842. label: "BottomView"
  17843. })( true ? {
  17844. name: "w87m56",
  17845. styles: "bottom:0;left:0;right:0;"
  17846. } : undefined);
  17847. const LeftView = /*#__PURE__*/styled_base_browser_esm(Side, {
  17848. target: "e1df9b4q5",
  17849. label: "LeftView"
  17850. })("top:0;bottom:0;", rtl_rtl({
  17851. left: 0
  17852. }), ";" + ( true ? "" : undefined));
  17853. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/visualizer.js
  17854. /**
  17855. * WordPress dependencies
  17856. */
  17857. /**
  17858. * Internal dependencies
  17859. */
  17860. function BoxControlVisualizer({
  17861. children,
  17862. showValues = DEFAULT_VISUALIZER_VALUES,
  17863. values: valuesProp = DEFAULT_VALUES,
  17864. ...props
  17865. }) {
  17866. const isPositionAbsolute = !children;
  17867. return Object(external_wp_element_["createElement"])(box_control_visualizer_styles_Container, Object(esm_extends["a" /* default */])({}, props, {
  17868. isPositionAbsolute: isPositionAbsolute,
  17869. "aria-hidden": "true"
  17870. }), Object(external_wp_element_["createElement"])(Sides, {
  17871. showValues: showValues,
  17872. values: valuesProp
  17873. }), children);
  17874. }
  17875. function Sides({
  17876. showValues = DEFAULT_VISUALIZER_VALUES,
  17877. values
  17878. }) {
  17879. const {
  17880. top,
  17881. right,
  17882. bottom,
  17883. left
  17884. } = values;
  17885. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Top, {
  17886. isVisible: showValues.top,
  17887. value: top
  17888. }), Object(external_wp_element_["createElement"])(Right, {
  17889. isVisible: showValues.right,
  17890. value: right
  17891. }), Object(external_wp_element_["createElement"])(Bottom, {
  17892. isVisible: showValues.bottom,
  17893. value: bottom
  17894. }), Object(external_wp_element_["createElement"])(Left, {
  17895. isVisible: showValues.left,
  17896. value: left
  17897. }));
  17898. }
  17899. function Top({
  17900. isVisible = false,
  17901. value
  17902. }) {
  17903. const height = value;
  17904. const animationProps = useSideAnimation(height);
  17905. const isActive = animationProps.isActive || isVisible;
  17906. return Object(external_wp_element_["createElement"])(TopView, {
  17907. isActive: isActive,
  17908. style: {
  17909. height
  17910. }
  17911. });
  17912. }
  17913. function Right({
  17914. isVisible = false,
  17915. value
  17916. }) {
  17917. const width = value;
  17918. const animationProps = useSideAnimation(width);
  17919. const isActive = animationProps.isActive || isVisible;
  17920. return Object(external_wp_element_["createElement"])(RightView, {
  17921. isActive: isActive,
  17922. style: {
  17923. width
  17924. }
  17925. });
  17926. }
  17927. function Bottom({
  17928. isVisible = false,
  17929. value
  17930. }) {
  17931. const height = value;
  17932. const animationProps = useSideAnimation(height);
  17933. const isActive = animationProps.isActive || isVisible;
  17934. return Object(external_wp_element_["createElement"])(BottomView, {
  17935. isActive: isActive,
  17936. style: {
  17937. height
  17938. }
  17939. });
  17940. }
  17941. function Left({
  17942. isVisible = false,
  17943. value
  17944. }) {
  17945. const width = value;
  17946. const animationProps = useSideAnimation(width);
  17947. const isActive = animationProps.isActive || isVisible;
  17948. return Object(external_wp_element_["createElement"])(LeftView, {
  17949. isActive: isActive,
  17950. style: {
  17951. width
  17952. }
  17953. });
  17954. }
  17955. /**
  17956. * Custom hook that renders the "flash" animation whenever the value changes.
  17957. *
  17958. * @param {string} value Value of (box) side.
  17959. */
  17960. function useSideAnimation(value) {
  17961. const [isActive, setIsActive] = Object(external_wp_element_["useState"])(false);
  17962. const valueRef = Object(external_wp_element_["useRef"])(value);
  17963. const timeoutRef = Object(external_wp_element_["useRef"])();
  17964. const clearTimer = () => {
  17965. if (timeoutRef.current) {
  17966. window.clearTimeout(timeoutRef.current);
  17967. }
  17968. };
  17969. Object(external_wp_element_["useEffect"])(() => {
  17970. if (value !== valueRef.current) {
  17971. setIsActive(true);
  17972. valueRef.current = value;
  17973. clearTimer();
  17974. timeoutRef.current = setTimeout(() => {
  17975. setIsActive(false);
  17976. }, 400);
  17977. }
  17978. return () => clearTimer();
  17979. }, [value]);
  17980. return {
  17981. isActive
  17982. };
  17983. }
  17984. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/index.js
  17985. /**
  17986. * External dependencies
  17987. */
  17988. /**
  17989. * WordPress dependencies
  17990. */
  17991. /**
  17992. * Internal dependencies
  17993. */
  17994. const defaultInputProps = {
  17995. min: 0
  17996. };
  17997. function box_control_useUniqueId(idProp) {
  17998. const instanceId = Object(external_wp_compose_["useInstanceId"])(BoxControl, 'inspector-box-control');
  17999. return idProp || instanceId;
  18000. }
  18001. function BoxControl({
  18002. id: idProp,
  18003. inputProps = defaultInputProps,
  18004. onChange = external_lodash_["noop"],
  18005. onChangeShowVisualizer = external_lodash_["noop"],
  18006. label = Object(external_wp_i18n_["__"])('Box Control'),
  18007. values: valuesProp,
  18008. units,
  18009. sides,
  18010. resetValues = DEFAULT_VALUES
  18011. }) {
  18012. const [values, setValues] = use_controlled_state(valuesProp, {
  18013. fallback: DEFAULT_VALUES
  18014. });
  18015. const inputValues = values || DEFAULT_VALUES;
  18016. const hasInitialValue = isValuesDefined(valuesProp);
  18017. const hasOneSide = (sides === null || sides === void 0 ? void 0 : sides.length) === 1;
  18018. const [isDirty, setIsDirty] = Object(external_wp_element_["useState"])(hasInitialValue);
  18019. const [isLinked, setIsLinked] = Object(external_wp_element_["useState"])(!hasInitialValue || !isValuesMixed(inputValues) || hasOneSide);
  18020. const [side, setSide] = Object(external_wp_element_["useState"])(isLinked ? 'all' : 'top');
  18021. const id = box_control_useUniqueId(idProp);
  18022. const headingId = `${id}-heading`;
  18023. const toggleLinked = () => {
  18024. setIsLinked(!isLinked);
  18025. setSide(!isLinked ? 'all' : 'top');
  18026. };
  18027. const handleOnFocus = (event, {
  18028. side: nextSide
  18029. }) => {
  18030. setSide(nextSide);
  18031. };
  18032. const handleOnChange = nextValues => {
  18033. onChange(nextValues);
  18034. setValues(nextValues);
  18035. setIsDirty(true);
  18036. };
  18037. const handleOnHoverOn = (next = {}) => {
  18038. onChangeShowVisualizer({ ...DEFAULT_VISUALIZER_VALUES,
  18039. ...next
  18040. });
  18041. };
  18042. const handleOnHoverOff = (next = {}) => {
  18043. onChangeShowVisualizer({ ...DEFAULT_VISUALIZER_VALUES,
  18044. ...next
  18045. });
  18046. };
  18047. const handleOnReset = () => {
  18048. onChange(resetValues);
  18049. setValues(resetValues);
  18050. setIsDirty(false);
  18051. };
  18052. const inputControlProps = { ...inputProps,
  18053. onChange: handleOnChange,
  18054. onFocus: handleOnFocus,
  18055. onHoverOn: handleOnHoverOn,
  18056. onHoverOff: handleOnHoverOff,
  18057. isLinked,
  18058. units,
  18059. sides,
  18060. values: inputValues
  18061. };
  18062. return Object(external_wp_element_["createElement"])(box_control_styles_Root, {
  18063. id: id,
  18064. role: "region",
  18065. "aria-labelledby": headingId
  18066. }, Object(external_wp_element_["createElement"])(Header, {
  18067. className: "component-box-control__header"
  18068. }, Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(text_component, {
  18069. id: headingId,
  18070. className: "component-box-control__label"
  18071. }, label)), Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  18072. className: "component-box-control__reset-button",
  18073. isSecondary: true,
  18074. isSmall: true,
  18075. onClick: handleOnReset,
  18076. disabled: !isDirty
  18077. }, Object(external_wp_i18n_["__"])('Reset')))), Object(external_wp_element_["createElement"])(HeaderControlWrapper, {
  18078. className: "component-box-control__header-control-wrapper"
  18079. }, Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(BoxControlIcon, {
  18080. side: side,
  18081. sides: sides
  18082. })), isLinked && Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(AllInputControl, Object(esm_extends["a" /* default */])({
  18083. "aria-label": label
  18084. }, inputControlProps))), !hasOneSide && Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(LinkedButton, {
  18085. onClick: toggleLinked,
  18086. isLinked: isLinked
  18087. }))), !isLinked && Object(external_wp_element_["createElement"])(BoxInputControls, inputControlProps));
  18088. }
  18089. BoxControl.__Visualizer = BoxControlVisualizer;
  18090. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button-group/index.js
  18091. /**
  18092. * External dependencies
  18093. */
  18094. /**
  18095. * WordPress dependencies
  18096. */
  18097. function ButtonGroup({
  18098. className,
  18099. ...props
  18100. }, ref) {
  18101. const classes = classnames_default()('components-button-group', className);
  18102. return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
  18103. ref: ref,
  18104. role: "group",
  18105. className: classes
  18106. }, props));
  18107. }
  18108. /* harmony default export */ var button_group = (Object(external_wp_element_["forwardRef"])(ButtonGroup));
  18109. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/context.js
  18110. /**
  18111. * WordPress dependencies
  18112. */
  18113. const CardContext = Object(external_wp_element_["createContext"])({});
  18114. const useCardContext = () => Object(external_wp_element_["useContext"])(CardContext);
  18115. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/styles/card-styles.js
  18116. /**
  18117. * WordPress dependencies
  18118. */
  18119. /**
  18120. * Internal dependencies
  18121. */
  18122. const styleProps = {
  18123. borderColor: COLORS.lightGray[500],
  18124. borderRadius: '3px',
  18125. backgroundShady: COLORS.lightGray[200]
  18126. };
  18127. const {
  18128. borderColor: card_styles_borderColor,
  18129. borderRadius,
  18130. backgroundShady
  18131. } = styleProps;
  18132. const CardUI = styled_base_browser_esm("div", {
  18133. target: "e1q7k77g0",
  18134. label: "CardUI"
  18135. })("background:", COLORS.white, ";box-sizing:border-box;border-radius:", borderRadius, ";border:1px solid ", card_styles_borderColor, ";", handleBorderless, ";&.is-elevated{box-shadow:0px 1px 3px 0px rgba( 0,0,0,0.2 ),0px 1px 1px 0px rgba( 0,0,0,0.14 ),0px 2px 1px -1px rgba( 0,0,0,0.12 );}" + ( true ? "" : undefined));
  18136. const HeaderUI = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  18137. target: "e1q7k77g1",
  18138. label: "HeaderUI"
  18139. })("border-bottom:1px solid ", card_styles_borderColor, ";border-top-left-radius:", borderRadius, ";border-top-right-radius:", borderRadius, ";box-sizing:border-box;&:last-child{border-bottom:none;}", headerFooterSizes, ";", handleBorderless, ";", handleShady, ";" + ( true ? "" : undefined));
  18140. const MediaUI = styled_base_browser_esm("div", {
  18141. target: "e1q7k77g2",
  18142. label: "MediaUI"
  18143. })("box-sizing:border-box;overflow:hidden;& > img,& > iframe{display:block;height:auto;max-width:100%;width:100%;}&:first-of-type{border-top-left-radius:", borderRadius, ";border-top-right-radius:", borderRadius, ";}&:last-of-type{border-bottom-left-radius:", borderRadius, ";border-bottom-right-radius:", borderRadius, ";}" + ( true ? "" : undefined));
  18144. const BodyUI = styled_base_browser_esm("div", {
  18145. target: "e1q7k77g3",
  18146. label: "BodyUI"
  18147. })("box-sizing:border-box;", bodySize, ";", handleShady, ";" + ( true ? "" : undefined));
  18148. const FooterUI = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  18149. target: "e1q7k77g4",
  18150. label: "FooterUI"
  18151. })("border-top:1px solid ", card_styles_borderColor, ";border-bottom-left-radius:", borderRadius, ";border-bottom-right-radius:", borderRadius, ";box-sizing:border-box;&:first-of-type{border-top:none;}", headerFooterSizes, ";", handleBorderless, ";", handleShady, ";" + ( true ? "" : undefined));
  18152. const DividerUI = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["HorizontalRule"], {
  18153. target: "e1q7k77g5",
  18154. label: "DividerUI"
  18155. })("all:unset;border-top:1px solid ", card_styles_borderColor, ";box-sizing:border-box;display:block;height:0;width:100%;" + ( true ? "" : undefined));
  18156. function bodySize() {
  18157. return `
  18158. &.is-size {
  18159. &-large {
  18160. padding: ${space(3)} ${space(4)};
  18161. }
  18162. &-medium {
  18163. padding: ${space(2)} ${space(3)};
  18164. }
  18165. &-small {
  18166. padding: ${space(2)};
  18167. }
  18168. &-extraSmall {
  18169. padding: ${space(1)};
  18170. }
  18171. }
  18172. `;
  18173. }
  18174. function headerFooterSizes() {
  18175. return `
  18176. &.is-size {
  18177. &-large {
  18178. padding: ${space(3)} ${space(4)};
  18179. }
  18180. &-medium {
  18181. padding: ${space(2)} ${space(3)};
  18182. }
  18183. &-small {
  18184. padding: ${space(2)};
  18185. }
  18186. &-extraSmall {
  18187. padding: ${space(1)};
  18188. }
  18189. }
  18190. `;
  18191. }
  18192. function handleBorderless() {
  18193. return `
  18194. &.is-borderless {
  18195. border: none;
  18196. }
  18197. `;
  18198. }
  18199. function handleShady() {
  18200. return `
  18201. &.is-shady {
  18202. background: ${backgroundShady};
  18203. }
  18204. `;
  18205. }
  18206. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/index.js
  18207. /**
  18208. * External dependencies
  18209. */
  18210. /**
  18211. * Internal dependencies
  18212. */
  18213. const card_defaultProps = {
  18214. isBorderless: false,
  18215. isElevated: false,
  18216. size: 'medium'
  18217. };
  18218. function Card(props) {
  18219. const {
  18220. className,
  18221. isBorderless,
  18222. isElevated,
  18223. size,
  18224. ...additionalProps
  18225. } = props;
  18226. const {
  18227. Provider
  18228. } = CardContext;
  18229. const contextProps = {
  18230. isBorderless,
  18231. isElevated,
  18232. size
  18233. };
  18234. const classes = classnames_default()('components-card', isBorderless && 'is-borderless', isElevated && 'is-elevated', size && `is-size-${size}`, className);
  18235. return Object(external_wp_element_["createElement"])(Provider, {
  18236. value: contextProps
  18237. }, Object(external_wp_element_["createElement"])(CardUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18238. className: classes
  18239. })));
  18240. }
  18241. Card.defaultProps = card_defaultProps;
  18242. /* harmony default export */ var card = (Card);
  18243. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/body.js
  18244. /**
  18245. * External dependencies
  18246. */
  18247. /**
  18248. * Internal dependencies
  18249. */
  18250. const body_defaultProps = {
  18251. isShady: false,
  18252. size: 'medium'
  18253. };
  18254. function CardBody(props) {
  18255. const {
  18256. className,
  18257. isShady,
  18258. ...additionalProps
  18259. } = props;
  18260. const mergedProps = { ...body_defaultProps,
  18261. ...useCardContext(),
  18262. ...props
  18263. };
  18264. const {
  18265. size
  18266. } = mergedProps;
  18267. const classes = classnames_default()('components-card__body', isShady && 'is-shady', size && `is-size-${size}`, className);
  18268. return Object(external_wp_element_["createElement"])(BodyUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18269. className: classes
  18270. }));
  18271. }
  18272. /* harmony default export */ var card_body = (CardBody);
  18273. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/divider.js
  18274. /**
  18275. * External dependencies
  18276. */
  18277. /**
  18278. * Internal dependencies
  18279. */
  18280. function CardDivider(props) {
  18281. const {
  18282. className,
  18283. ...additionalProps
  18284. } = props;
  18285. const classes = classnames_default()('components-card__divider', className);
  18286. return Object(external_wp_element_["createElement"])(DividerUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18287. children: null,
  18288. className: classes,
  18289. role: "separator"
  18290. }));
  18291. }
  18292. /* harmony default export */ var divider = (CardDivider);
  18293. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/footer.js
  18294. /**
  18295. * External dependencies
  18296. */
  18297. /**
  18298. * Internal dependencies
  18299. */
  18300. const footer_defaultProps = {
  18301. isBorderless: false,
  18302. isShady: false,
  18303. size: 'medium'
  18304. };
  18305. function CardFooter(props) {
  18306. const {
  18307. className,
  18308. isShady,
  18309. ...additionalProps
  18310. } = props;
  18311. const mergedProps = { ...footer_defaultProps,
  18312. ...useCardContext(),
  18313. ...props
  18314. };
  18315. const {
  18316. isBorderless,
  18317. size
  18318. } = mergedProps;
  18319. const classes = classnames_default()('components-card__footer', isBorderless && 'is-borderless', isShady && 'is-shady', size && `is-size-${size}`, className);
  18320. return Object(external_wp_element_["createElement"])(FooterUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18321. className: classes
  18322. }));
  18323. }
  18324. /* harmony default export */ var footer = (CardFooter);
  18325. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/header.js
  18326. /**
  18327. * External dependencies
  18328. */
  18329. /**
  18330. * Internal dependencies
  18331. */
  18332. const header_defaultProps = {
  18333. isBorderless: false,
  18334. isShady: false,
  18335. size: 'medium'
  18336. };
  18337. function CardHeader(props) {
  18338. const {
  18339. className,
  18340. isShady,
  18341. ...additionalProps
  18342. } = props;
  18343. const mergedProps = { ...header_defaultProps,
  18344. ...useCardContext(),
  18345. ...props
  18346. };
  18347. const {
  18348. isBorderless,
  18349. size
  18350. } = mergedProps;
  18351. const classes = classnames_default()('components-card__header', isBorderless && 'is-borderless', isShady && 'is-shady', size && `is-size-${size}`, className);
  18352. return Object(external_wp_element_["createElement"])(HeaderUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18353. className: classes
  18354. }));
  18355. }
  18356. /* harmony default export */ var card_header = (CardHeader);
  18357. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/media.js
  18358. /**
  18359. * External dependencies
  18360. */
  18361. /**
  18362. * Internal dependencies
  18363. */
  18364. function CardMedia(props) {
  18365. const {
  18366. className,
  18367. ...additionalProps
  18368. } = props;
  18369. const classes = classnames_default()('components-card__media', className);
  18370. return Object(external_wp_element_["createElement"])(MediaUI, Object(esm_extends["a" /* default */])({}, additionalProps, {
  18371. className: classes
  18372. }));
  18373. }
  18374. /* harmony default export */ var media = (CardMedia);
  18375. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  18376. var build_module_icon = __webpack_require__("iClF");
  18377. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  18378. var check = __webpack_require__("RMJe");
  18379. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/checkbox-control/index.js
  18380. /**
  18381. * External dependencies
  18382. */
  18383. /**
  18384. * WordPress dependencies
  18385. */
  18386. /**
  18387. * Internal dependencies
  18388. */
  18389. function CheckboxControl({
  18390. label,
  18391. className,
  18392. heading,
  18393. checked,
  18394. help,
  18395. onChange,
  18396. ...props
  18397. }) {
  18398. if (heading) {
  18399. external_wp_deprecated_default()('`heading` prop in `CheckboxControl`', {
  18400. alternative: 'a separate element to implement a heading',
  18401. plugin: 'Gutenberg'
  18402. });
  18403. }
  18404. const instanceId = Object(external_wp_compose_["useInstanceId"])(CheckboxControl);
  18405. const id = `inspector-checkbox-control-${instanceId}`;
  18406. const onChangeValue = event => onChange(event.target.checked);
  18407. return Object(external_wp_element_["createElement"])(base_control, {
  18408. label: heading,
  18409. id: id,
  18410. help: help,
  18411. className: classnames_default()('components-checkbox-control', className)
  18412. }, Object(external_wp_element_["createElement"])("span", {
  18413. className: "components-checkbox-control__input-container"
  18414. }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
  18415. id: id,
  18416. className: "components-checkbox-control__input",
  18417. type: "checkbox",
  18418. value: "1",
  18419. onChange: onChangeValue,
  18420. checked: checked,
  18421. "aria-describedby": !!help ? id + '__help' : undefined
  18422. }, props)), checked ? Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  18423. icon: check["a" /* default */],
  18424. className: "components-checkbox-control__checked",
  18425. role: "presentation"
  18426. }) : null), Object(external_wp_element_["createElement"])("label", {
  18427. className: "components-checkbox-control__label",
  18428. htmlFor: id
  18429. }, label));
  18430. }
  18431. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/clipboard-button/index.js
  18432. /**
  18433. * External dependencies
  18434. */
  18435. /**
  18436. * WordPress dependencies
  18437. */
  18438. /**
  18439. * Internal dependencies
  18440. */
  18441. const TIMEOUT = 4000;
  18442. function ClipboardButton({
  18443. className,
  18444. children,
  18445. onCopy,
  18446. onFinishCopy,
  18447. text,
  18448. ...buttonProps
  18449. }) {
  18450. external_wp_deprecated_default()('wp.components.ClipboardButton', {
  18451. since: '10.3',
  18452. plugin: 'Gutenberg',
  18453. alternative: 'wp.compose.useCopyToClipboard'
  18454. });
  18455. const timeoutId = Object(external_wp_element_["useRef"])();
  18456. const ref = Object(external_wp_compose_["useCopyToClipboard"])(text, () => {
  18457. onCopy();
  18458. clearTimeout(timeoutId.current);
  18459. if (onFinishCopy) {
  18460. timeoutId.current = setTimeout(() => onFinishCopy(), TIMEOUT);
  18461. }
  18462. });
  18463. Object(external_wp_element_["useEffect"])(() => {
  18464. clearTimeout(timeoutId.current);
  18465. }, []);
  18466. const classes = classnames_default()('components-clipboard-button', className); // Workaround for inconsistent behavior in Safari, where <textarea> is not
  18467. // the document.activeElement at the moment when the copy event fires.
  18468. // This causes documentHasSelection() in the copy-handler component to
  18469. // mistakenly override the ClipboardButton, and copy a serialized string
  18470. // of the current block instead.
  18471. const focusOnCopyEventTarget = event => {
  18472. event.target.focus();
  18473. };
  18474. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, buttonProps, {
  18475. className: classes,
  18476. ref: ref,
  18477. onCopy: focusOnCopyEventTarget
  18478. }), children);
  18479. }
  18480. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules
  18481. var edit = __webpack_require__("B9Az");
  18482. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  18483. var library_close = __webpack_require__("w95h");
  18484. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
  18485. var chevron_up = __webpack_require__("XgzB");
  18486. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
  18487. var chevron_down = __webpack_require__("NWDH");
  18488. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
  18489. var plus = __webpack_require__("Q4Sy");
  18490. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js
  18491. /**
  18492. * External dependencies
  18493. */
  18494. /**
  18495. * WordPress dependencies
  18496. */
  18497. /**
  18498. * Internal dependencies
  18499. */
  18500. function useObservableState(initialState, onStateChange) {
  18501. const [state, setState] = Object(external_wp_element_["useState"])(initialState);
  18502. return [state, value => {
  18503. setState(value);
  18504. if (onStateChange) {
  18505. onStateChange(value);
  18506. }
  18507. }];
  18508. }
  18509. function Dropdown({
  18510. renderContent,
  18511. renderToggle,
  18512. position = 'bottom right',
  18513. className,
  18514. contentClassName,
  18515. expandOnMobile,
  18516. headerTitle,
  18517. focusOnMount,
  18518. popoverProps,
  18519. onClose,
  18520. onToggle
  18521. }) {
  18522. var _popoverProps$anchorR;
  18523. const containerRef = Object(external_wp_element_["useRef"])();
  18524. const [isOpen, setIsOpen] = useObservableState(false, onToggle);
  18525. Object(external_wp_element_["useEffect"])(() => () => {
  18526. if (onToggle) {
  18527. onToggle(false);
  18528. }
  18529. }, []);
  18530. function toggle() {
  18531. setIsOpen(!isOpen);
  18532. }
  18533. /**
  18534. * Closes the dropdown if a focus leaves the dropdown wrapper. This is
  18535. * intentionally distinct from `onClose` since focus loss from the popover
  18536. * is expected to occur when using the Dropdown's toggle button, in which
  18537. * case the correct behavior is to keep the dropdown closed. The same applies
  18538. * in case when focus is moved to the modal dialog.
  18539. */
  18540. function closeIfFocusOutside() {
  18541. const {
  18542. ownerDocument
  18543. } = containerRef.current;
  18544. if (!containerRef.current.contains(ownerDocument.activeElement) && !ownerDocument.activeElement.closest('[role="dialog"]')) {
  18545. close();
  18546. }
  18547. }
  18548. function close() {
  18549. if (onClose) {
  18550. onClose();
  18551. }
  18552. setIsOpen(false);
  18553. }
  18554. const args = {
  18555. isOpen,
  18556. onToggle: toggle,
  18557. onClose: close
  18558. };
  18559. return Object(external_wp_element_["createElement"])("div", {
  18560. className: classnames_default()('components-dropdown', className),
  18561. ref: containerRef
  18562. }, renderToggle(args), isOpen && Object(external_wp_element_["createElement"])(build_module_popover["a" /* default */], Object(esm_extends["a" /* default */])({
  18563. position: position,
  18564. onClose: close,
  18565. onFocusOutside: closeIfFocusOutside,
  18566. expandOnMobile: expandOnMobile,
  18567. headerTitle: headerTitle,
  18568. focusOnMount: focusOnMount
  18569. }, popoverProps, {
  18570. anchorRef: (_popoverProps$anchorR = popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.anchorRef) !== null && _popoverProps$anchorR !== void 0 ? _popoverProps$anchorR : containerRef.current,
  18571. className: classnames_default()('components-dropdown__content', popoverProps ? popoverProps.className : undefined, contentClassName)
  18572. }), renderContent(args)));
  18573. }
  18574. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/circular-option-picker/index.js
  18575. /**
  18576. * External dependencies
  18577. */
  18578. /**
  18579. * WordPress dependencies
  18580. */
  18581. /**
  18582. * Internal dependencies
  18583. */
  18584. function Option({
  18585. className,
  18586. isSelected,
  18587. selectedIconProps,
  18588. tooltipText,
  18589. ...additionalProps
  18590. }) {
  18591. const optionButton = Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  18592. isPressed: isSelected,
  18593. className: classnames_default()(className, 'components-circular-option-picker__option')
  18594. }, additionalProps));
  18595. return Object(external_wp_element_["createElement"])("div", {
  18596. className: "components-circular-option-picker__option-wrapper"
  18597. }, tooltipText ? Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
  18598. text: tooltipText
  18599. }, optionButton) : optionButton, isSelected && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], Object(esm_extends["a" /* default */])({
  18600. icon: check["a" /* default */]
  18601. }, selectedIconProps ? selectedIconProps : {})));
  18602. }
  18603. function DropdownLinkAction({
  18604. buttonProps,
  18605. className,
  18606. dropdownProps,
  18607. linkText
  18608. }) {
  18609. return Object(external_wp_element_["createElement"])(Dropdown, Object(esm_extends["a" /* default */])({
  18610. className: classnames_default()('components-circular-option-picker__dropdown-link-action', className),
  18611. renderToggle: ({
  18612. isOpen,
  18613. onToggle
  18614. }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  18615. "aria-expanded": isOpen,
  18616. "aria-haspopup": "true",
  18617. onClick: onToggle,
  18618. isLink: true
  18619. }, buttonProps), linkText)
  18620. }, dropdownProps));
  18621. }
  18622. function ButtonAction({
  18623. className,
  18624. children,
  18625. ...additionalProps
  18626. }) {
  18627. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  18628. className: classnames_default()('components-circular-option-picker__clear', className),
  18629. isSmall: true,
  18630. isSecondary: true
  18631. }, additionalProps), children);
  18632. }
  18633. function CircularOptionPicker({
  18634. actions,
  18635. className,
  18636. options,
  18637. children
  18638. }) {
  18639. return Object(external_wp_element_["createElement"])("div", {
  18640. className: classnames_default()('components-circular-option-picker', className)
  18641. }, Object(external_wp_element_["createElement"])("div", {
  18642. className: "components-circular-option-picker__swatches"
  18643. }, options), children, actions && Object(external_wp_element_["createElement"])("div", {
  18644. className: "components-circular-option-picker__custom-clear-wrapper"
  18645. }, actions));
  18646. }
  18647. CircularOptionPicker.Option = Option;
  18648. CircularOptionPicker.ButtonAction = ButtonAction;
  18649. CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
  18650. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/utils.js
  18651. /**
  18652. * Parts of this source were derived and modified from react-color,
  18653. * released under the MIT license.
  18654. *
  18655. * https://github.com/casesandberg/react-color/
  18656. *
  18657. * Copyright (c) 2015 Case Sandberg
  18658. *
  18659. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18660. * of this software and associated documentation files (the "Software"), to deal
  18661. * in the Software without restriction, including without limitation the rights
  18662. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18663. * copies of the Software, and to permit persons to whom the Software is
  18664. * furnished to do so, subject to the following conditions:
  18665. *
  18666. * The above copyright notice and this permission notice shall be included in
  18667. * all copies or substantial portions of the Software.
  18668. *
  18669. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18670. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18671. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18672. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18673. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18674. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18675. * THE SOFTWARE.
  18676. */
  18677. /**
  18678. * External dependencies
  18679. */
  18680. /**
  18681. * Given a hex color, get all other color properties (rgb, alpha, etc).
  18682. *
  18683. * @param {Object|string} data A hex color string or an object with a hex property
  18684. * @param {string} oldHue A reference to the hue of the previous color, otherwise dragging the saturation to zero will reset the current hue to zero as well. See https://github.com/casesandberg/react-color/issues/29#issuecomment-132686909.
  18685. * @return {Object} An object of different color representations.
  18686. */
  18687. function colorToState(data = {}, oldHue = false) {
  18688. const color = data.hex ? tinycolor_default()(data.hex) : tinycolor_default()(data);
  18689. const hsl = color.toHsl();
  18690. hsl.h = Math.round(hsl.h);
  18691. hsl.s = Math.round(hsl.s * 100);
  18692. hsl.l = Math.round(hsl.l * 100);
  18693. const hsv = color.toHsv();
  18694. hsv.h = Math.round(hsv.h);
  18695. hsv.s = Math.round(hsv.s * 100);
  18696. hsv.v = Math.round(hsv.v * 100);
  18697. const rgb = color.toRgb();
  18698. const hex = color.toHex();
  18699. if (hsl.s === 0) {
  18700. hsl.h = oldHue || 0;
  18701. hsv.h = oldHue || 0;
  18702. }
  18703. const transparent = hex === '000000' && rgb.a === 0;
  18704. return {
  18705. color,
  18706. hex: transparent ? 'transparent' : `#${hex}`,
  18707. hsl,
  18708. hsv,
  18709. oldHue: data.h || oldHue || hsl.h,
  18710. rgb,
  18711. source: data.source
  18712. };
  18713. }
  18714. /**
  18715. * Get the top/left offsets of a point in a container, also returns the container width/height.
  18716. *
  18717. * @param {Event} e Mouse or touch event with a location coordinate.
  18718. * @param {HTMLElement} container The container div, returned point is relative to this container.
  18719. * @return {Object} An object of the offset positions & container size.
  18720. */
  18721. function getPointOffset(e, container) {
  18722. e.preventDefault();
  18723. const {
  18724. left: containerLeft,
  18725. top: containerTop,
  18726. width,
  18727. height
  18728. } = container.getBoundingClientRect();
  18729. const x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
  18730. const y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
  18731. let left = x - (containerLeft + window.pageXOffset);
  18732. let top = y - (containerTop + window.pageYOffset);
  18733. if (left < 0) {
  18734. left = 0;
  18735. } else if (left > width) {
  18736. left = width;
  18737. } else if (top < 0) {
  18738. top = 0;
  18739. } else if (top > height) {
  18740. top = height;
  18741. }
  18742. return {
  18743. top,
  18744. left,
  18745. width,
  18746. height
  18747. };
  18748. }
  18749. /**
  18750. * Check if a string is a valid hex color code.
  18751. *
  18752. * @param {string} hex A possible hex color.
  18753. * @return {boolean} True if the color is a valid hex color.
  18754. */
  18755. function isValidHex(hex) {
  18756. // disable hex4 and hex8
  18757. const lh = String(hex).charAt(0) === '#' ? 1 : 0;
  18758. return hex.length !== 4 + lh && hex.length < 7 + lh && tinycolor_default()(hex).isValid();
  18759. }
  18760. /**
  18761. * Check an object for any valid color properties.
  18762. *
  18763. * @param {Object} data A possible object representing a color.
  18764. * @return {Object|boolean} If a valid representation of color, returns the data object. Otherwise returns false.
  18765. */
  18766. function simpleCheckForValidColor(data) {
  18767. const keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
  18768. let checked = 0;
  18769. let passed = 0;
  18770. Object(external_lodash_["each"])(keysToCheck, letter => {
  18771. if (data[letter]) {
  18772. checked += 1;
  18773. if (!isNaN(data[letter])) {
  18774. passed += 1;
  18775. }
  18776. }
  18777. });
  18778. return checked === passed ? data : false;
  18779. }
  18780. /**
  18781. * Calculate the current alpha based on a mouse or touch event
  18782. *
  18783. * @param {Event} e A mouse or touch event on the alpha bar.
  18784. * @param {Object} props The current component props
  18785. * @param {HTMLElement} container The container div for the alpha bar graph.
  18786. * @return {Object|null} If the alpha value has changed, returns a new color object.
  18787. */
  18788. function calculateAlphaChange(e, props, container) {
  18789. const {
  18790. left,
  18791. width
  18792. } = getPointOffset(e, container);
  18793. const a = left < 0 ? 0 : Math.round(left * 100 / width) / 100;
  18794. if (props.hsl.a !== a) {
  18795. return {
  18796. h: props.hsl.h,
  18797. s: props.hsl.s,
  18798. l: props.hsl.l,
  18799. a,
  18800. source: 'rgb'
  18801. };
  18802. }
  18803. return null;
  18804. }
  18805. /**
  18806. * Calculate the current hue based on a mouse or touch event
  18807. *
  18808. * @param {Event} e A mouse or touch event on the hue bar.
  18809. * @param {Object} props The current component props
  18810. * @param {HTMLElement} container The container div for the hue bar graph.
  18811. * @return {Object|null} If the hue value has changed, returns a new color object.
  18812. */
  18813. function calculateHueChange(e, props, container) {
  18814. const {
  18815. left,
  18816. width
  18817. } = getPointOffset(e, container);
  18818. const percent = left * 100 / width;
  18819. const h = left >= width ? 359 : 360 * percent / 100;
  18820. if (props.hsl.h !== h) {
  18821. return {
  18822. h,
  18823. s: props.hsl.s,
  18824. l: props.hsl.l,
  18825. a: props.hsl.a,
  18826. source: 'rgb'
  18827. };
  18828. }
  18829. return null;
  18830. }
  18831. /**
  18832. * Calculate the current saturation & brightness based on a mouse or touch event
  18833. *
  18834. * @param {Event} e A mouse or touch event on the saturation graph.
  18835. * @param {Object} props The current component props
  18836. * @param {HTMLElement} container The container div for the 2D saturation graph.
  18837. * @return {Object} Returns a new color object.
  18838. */
  18839. function calculateSaturationChange(e, props, container) {
  18840. const {
  18841. top,
  18842. left,
  18843. width,
  18844. height
  18845. } = getPointOffset(e, container);
  18846. const saturation = left < 0 ? 0 : left * 100 / width;
  18847. let bright = top >= height ? 0 : -(top * 100 / height) + 100; // `v` values less than 1 are considered in the [0,1] range, causing unexpected behavior at the bottom
  18848. // of the chart. To fix this, we assume any value less than 1 should be 0 brightness.
  18849. if (bright < 1) {
  18850. bright = 0;
  18851. }
  18852. return {
  18853. h: props.hsl.h,
  18854. s: saturation,
  18855. v: bright,
  18856. a: props.hsl.a,
  18857. source: 'rgb'
  18858. };
  18859. }
  18860. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js
  18861. /**
  18862. * External dependencies
  18863. */
  18864. /**
  18865. * WordPress dependencies
  18866. */
  18867. function KeyboardShortcut({
  18868. target,
  18869. callback,
  18870. shortcut,
  18871. bindGlobal,
  18872. eventName
  18873. }) {
  18874. Object(external_wp_compose_["useKeyboardShortcut"])(shortcut, callback, {
  18875. bindGlobal,
  18876. target,
  18877. eventName
  18878. });
  18879. return null;
  18880. }
  18881. function KeyboardShortcuts({
  18882. children,
  18883. shortcuts,
  18884. bindGlobal,
  18885. eventName
  18886. }) {
  18887. const target = Object(external_wp_element_["useRef"])();
  18888. const element = Object(external_lodash_["map"])(shortcuts, (callback, shortcut) => Object(external_wp_element_["createElement"])(KeyboardShortcut, {
  18889. key: shortcut,
  18890. shortcut: shortcut,
  18891. callback: callback,
  18892. bindGlobal: bindGlobal,
  18893. eventName: eventName,
  18894. target: target
  18895. })); // Render as non-visual if there are no children pressed. Keyboard
  18896. // events will be bound to the document instead.
  18897. if (!external_wp_element_["Children"].count(children)) {
  18898. return element;
  18899. }
  18900. return Object(external_wp_element_["createElement"])("div", {
  18901. ref: target
  18902. }, element, children);
  18903. }
  18904. /* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
  18905. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/alpha.js
  18906. /**
  18907. * Parts of this source were derived and modified from react-color,
  18908. * released under the MIT license.
  18909. *
  18910. * https://github.com/casesandberg/react-color/
  18911. *
  18912. * Copyright (c) 2015 Case Sandberg
  18913. *
  18914. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18915. * of this software and associated documentation files (the "Software"), to deal
  18916. * in the Software without restriction, including without limitation the rights
  18917. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18918. * copies of the Software, and to permit persons to whom the Software is
  18919. * furnished to do so, subject to the following conditions:
  18920. *
  18921. * The above copyright notice and this permission notice shall be included in
  18922. * all copies or substantial portions of the Software.
  18923. *
  18924. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18925. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18926. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18927. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18928. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18929. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18930. * THE SOFTWARE.
  18931. */
  18932. /**
  18933. * External dependencies
  18934. */
  18935. /**
  18936. * WordPress dependencies
  18937. */
  18938. /**
  18939. * Internal dependencies
  18940. */
  18941. class alpha_Alpha extends external_wp_element_["Component"] {
  18942. constructor() {
  18943. super(...arguments);
  18944. this.container = Object(external_wp_element_["createRef"])();
  18945. this.increase = this.increase.bind(this);
  18946. this.decrease = this.decrease.bind(this);
  18947. this.handleChange = this.handleChange.bind(this);
  18948. this.handleMouseDown = this.handleMouseDown.bind(this);
  18949. this.handleMouseUp = this.handleMouseUp.bind(this);
  18950. }
  18951. componentWillUnmount() {
  18952. this.unbindEventListeners();
  18953. }
  18954. increase(amount = 0.01) {
  18955. const {
  18956. hsl,
  18957. onChange = external_lodash_["noop"]
  18958. } = this.props;
  18959. amount = parseInt(amount * 100, 10);
  18960. const change = {
  18961. h: hsl.h,
  18962. s: hsl.s,
  18963. l: hsl.l,
  18964. a: (parseInt(hsl.a * 100, 10) + amount) / 100,
  18965. source: 'rgb'
  18966. };
  18967. onChange(change);
  18968. }
  18969. decrease(amount = 0.01) {
  18970. const {
  18971. hsl,
  18972. onChange = external_lodash_["noop"]
  18973. } = this.props;
  18974. const intValue = parseInt(hsl.a * 100, 10) - parseInt(amount * 100, 10);
  18975. const change = {
  18976. h: hsl.h,
  18977. s: hsl.s,
  18978. l: hsl.l,
  18979. a: hsl.a <= amount ? 0 : intValue / 100,
  18980. source: 'rgb'
  18981. };
  18982. onChange(change);
  18983. }
  18984. handleChange(e) {
  18985. const {
  18986. onChange = external_lodash_["noop"]
  18987. } = this.props;
  18988. const change = calculateAlphaChange(e, this.props, this.container.current);
  18989. if (change) {
  18990. onChange(change, e);
  18991. }
  18992. }
  18993. handleMouseDown(e) {
  18994. this.handleChange(e);
  18995. window.addEventListener('mousemove', this.handleChange);
  18996. window.addEventListener('mouseup', this.handleMouseUp);
  18997. }
  18998. handleMouseUp() {
  18999. this.unbindEventListeners();
  19000. }
  19001. preventKeyEvents(event) {
  19002. if (event.keyCode === external_wp_keycodes_["TAB"]) {
  19003. return;
  19004. }
  19005. event.preventDefault();
  19006. }
  19007. unbindEventListeners() {
  19008. window.removeEventListener('mousemove', this.handleChange);
  19009. window.removeEventListener('mouseup', this.handleMouseUp);
  19010. }
  19011. render() {
  19012. const {
  19013. rgb
  19014. } = this.props;
  19015. const rgbString = `${rgb.r},${rgb.g},${rgb.b}`;
  19016. const gradient = {
  19017. background: `linear-gradient(to right, rgba(${rgbString}, 0) 0%, rgba(${rgbString}, 1) 100%)`
  19018. };
  19019. const pointerLocation = {
  19020. left: `${rgb.a * 100}%`
  19021. };
  19022. const shortcuts = {
  19023. up: () => this.increase(),
  19024. right: () => this.increase(),
  19025. 'shift+up': () => this.increase(0.1),
  19026. 'shift+right': () => this.increase(0.1),
  19027. pageup: () => this.increase(0.1),
  19028. end: () => this.increase(1),
  19029. down: () => this.decrease(),
  19030. left: () => this.decrease(),
  19031. 'shift+down': () => this.decrease(0.1),
  19032. 'shift+left': () => this.decrease(0.1),
  19033. pagedown: () => this.decrease(0.1),
  19034. home: () => this.decrease(1)
  19035. };
  19036. return Object(external_wp_element_["createElement"])(keyboard_shortcuts, {
  19037. shortcuts: shortcuts
  19038. }, Object(external_wp_element_["createElement"])("div", {
  19039. className: "components-color-picker__alpha"
  19040. }, Object(external_wp_element_["createElement"])("div", {
  19041. className: "components-color-picker__alpha-gradient",
  19042. style: gradient
  19043. }), Object(external_wp_element_["createElement"])("div", {
  19044. className: "components-color-picker__alpha-bar",
  19045. ref: this.container,
  19046. onMouseDown: this.handleMouseDown,
  19047. onTouchMove: this.handleChange,
  19048. onTouchStart: this.handleChange
  19049. }, Object(external_wp_element_["createElement"])("div", {
  19050. tabIndex: "0",
  19051. role: "slider",
  19052. "aria-valuemax": "1",
  19053. "aria-valuemin": "0",
  19054. "aria-valuenow": rgb.a,
  19055. "aria-orientation": "horizontal",
  19056. "aria-label": Object(external_wp_i18n_["__"])('Alpha value, from 0 (transparent) to 1 (fully opaque).'),
  19057. className: "components-color-picker__alpha-pointer",
  19058. style: pointerLocation,
  19059. onKeyDown: this.preventKeyEvents
  19060. }))));
  19061. }
  19062. }
  19063. /* harmony default export */ var color_picker_alpha = (Object(external_wp_compose_["pure"])(alpha_Alpha));
  19064. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/hue.js
  19065. /**
  19066. * Parts of this source were derived and modified from react-color,
  19067. * released under the MIT license.
  19068. *
  19069. * https://github.com/casesandberg/react-color/
  19070. *
  19071. * Copyright (c) 2015 Case Sandberg
  19072. *
  19073. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19074. * of this software and associated documentation files (the "Software"), to deal
  19075. * in the Software without restriction, including without limitation the rights
  19076. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19077. * copies of the Software, and to permit persons to whom the Software is
  19078. * furnished to do so, subject to the following conditions:
  19079. *
  19080. * The above copyright notice and this permission notice shall be included in
  19081. * all copies or substantial portions of the Software.
  19082. *
  19083. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19084. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19085. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19086. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19087. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19088. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19089. * THE SOFTWARE.
  19090. */
  19091. /**
  19092. * External dependencies
  19093. */
  19094. /**
  19095. * WordPress dependencies
  19096. */
  19097. /**
  19098. * Internal dependencies
  19099. */
  19100. class hue_Hue extends external_wp_element_["Component"] {
  19101. constructor() {
  19102. super(...arguments);
  19103. this.container = Object(external_wp_element_["createRef"])();
  19104. this.increase = this.increase.bind(this);
  19105. this.decrease = this.decrease.bind(this);
  19106. this.handleChange = this.handleChange.bind(this);
  19107. this.handleMouseDown = this.handleMouseDown.bind(this);
  19108. this.handleMouseUp = this.handleMouseUp.bind(this);
  19109. }
  19110. componentWillUnmount() {
  19111. this.unbindEventListeners();
  19112. }
  19113. increase(amount = 1) {
  19114. const {
  19115. hsl,
  19116. onChange = external_lodash_["noop"]
  19117. } = this.props;
  19118. const change = {
  19119. h: hsl.h + amount >= 359 ? 359 : hsl.h + amount,
  19120. s: hsl.s,
  19121. l: hsl.l,
  19122. a: hsl.a,
  19123. source: 'rgb'
  19124. };
  19125. onChange(change);
  19126. }
  19127. decrease(amount = 1) {
  19128. const {
  19129. hsl,
  19130. onChange = external_lodash_["noop"]
  19131. } = this.props;
  19132. const change = {
  19133. h: hsl.h <= amount ? 0 : hsl.h - amount,
  19134. s: hsl.s,
  19135. l: hsl.l,
  19136. a: hsl.a,
  19137. source: 'rgb'
  19138. };
  19139. onChange(change);
  19140. }
  19141. handleChange(e) {
  19142. const {
  19143. onChange = external_lodash_["noop"]
  19144. } = this.props;
  19145. const change = calculateHueChange(e, this.props, this.container.current);
  19146. if (change) {
  19147. onChange(change, e);
  19148. }
  19149. }
  19150. handleMouseDown(e) {
  19151. this.handleChange(e);
  19152. window.addEventListener('mousemove', this.handleChange);
  19153. window.addEventListener('mouseup', this.handleMouseUp);
  19154. }
  19155. handleMouseUp() {
  19156. this.unbindEventListeners();
  19157. }
  19158. preventKeyEvents(event) {
  19159. if (event.keyCode === external_wp_keycodes_["TAB"]) {
  19160. return;
  19161. }
  19162. event.preventDefault();
  19163. }
  19164. unbindEventListeners() {
  19165. window.removeEventListener('mousemove', this.handleChange);
  19166. window.removeEventListener('mouseup', this.handleMouseUp);
  19167. }
  19168. render() {
  19169. const {
  19170. hsl = {},
  19171. instanceId
  19172. } = this.props;
  19173. const pointerLocation = {
  19174. left: `${hsl.h * 100 / 360}%`
  19175. };
  19176. const shortcuts = {
  19177. up: () => this.increase(),
  19178. right: () => this.increase(),
  19179. 'shift+up': () => this.increase(10),
  19180. 'shift+right': () => this.increase(10),
  19181. pageup: () => this.increase(10),
  19182. end: () => this.increase(359),
  19183. down: () => this.decrease(),
  19184. left: () => this.decrease(),
  19185. 'shift+down': () => this.decrease(10),
  19186. 'shift+left': () => this.decrease(10),
  19187. pagedown: () => this.decrease(10),
  19188. home: () => this.decrease(359)
  19189. };
  19190. return Object(external_wp_element_["createElement"])(keyboard_shortcuts, {
  19191. shortcuts: shortcuts
  19192. }, Object(external_wp_element_["createElement"])("div", {
  19193. className: "components-color-picker__hue"
  19194. }, Object(external_wp_element_["createElement"])("div", {
  19195. className: "components-color-picker__hue-gradient"
  19196. }), Object(external_wp_element_["createElement"])("div", {
  19197. className: "components-color-picker__hue-bar",
  19198. ref: this.container,
  19199. onMouseDown: this.handleMouseDown,
  19200. onTouchMove: this.handleChange,
  19201. onTouchStart: this.handleChange
  19202. }, Object(external_wp_element_["createElement"])("div", {
  19203. tabIndex: "0",
  19204. role: "slider",
  19205. "aria-valuemax": "1",
  19206. "aria-valuemin": "359",
  19207. "aria-valuenow": hsl.h,
  19208. "aria-orientation": "horizontal",
  19209. "aria-label": Object(external_wp_i18n_["__"])('Hue value in degrees, from 0 to 359.'),
  19210. "aria-describedby": `components-color-picker__hue-description-${instanceId}`,
  19211. className: "components-color-picker__hue-pointer",
  19212. style: pointerLocation,
  19213. onKeyDown: this.preventKeyEvents
  19214. }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  19215. as: "p",
  19216. id: `components-color-picker__hue-description-${instanceId}`
  19217. }, Object(external_wp_i18n_["__"])('Move the arrow left or right to change hue.')))));
  19218. }
  19219. }
  19220. /* harmony default export */ var hue = (Object(external_wp_compose_["compose"])(external_wp_compose_["pure"], external_wp_compose_["withInstanceId"])(hue_Hue));
  19221. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-control/index.js
  19222. /**
  19223. * WordPress dependencies
  19224. */
  19225. /**
  19226. * Internal dependencies
  19227. */
  19228. /**
  19229. * @typedef OwnProps
  19230. * @property {string} label Label for the control.
  19231. * @property {boolean} [hideLabelFromVision] Whether to accessibly hide the label.
  19232. * @property {string} value Value of the input.
  19233. * @property {string} [help] Optional help text for the control.
  19234. * @property {string} [className] Classname passed to BaseControl wrapper
  19235. * @property {(value: string) => void} onChange Handle changes.
  19236. * @property {string} [type='text'] Type of the input.
  19237. */
  19238. /** @typedef {OwnProps & import('react').ComponentProps<'input'>} Props */
  19239. /**
  19240. *
  19241. * @param {Props} props Props
  19242. * @param {import('react').Ref<HTMLInputElement>} [ref]
  19243. */
  19244. function TextControl({
  19245. label,
  19246. hideLabelFromVision,
  19247. value,
  19248. help,
  19249. className,
  19250. onChange,
  19251. type = 'text',
  19252. ...props
  19253. }, ref) {
  19254. const instanceId = Object(external_wp_compose_["useInstanceId"])(TextControl);
  19255. const id = `inspector-text-control-${instanceId}`;
  19256. const onChangeValue =
  19257. /** @type {import('react').ChangeEvent<HTMLInputElement>} */
  19258. event => onChange(event.target.value);
  19259. return Object(external_wp_element_["createElement"])(base_control, {
  19260. label: label,
  19261. hideLabelFromVision: hideLabelFromVision,
  19262. id: id,
  19263. help: help,
  19264. className: className
  19265. }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
  19266. className: "components-text-control__input",
  19267. type: type,
  19268. id: id,
  19269. value: value,
  19270. onChange: onChangeValue,
  19271. "aria-describedby": !!help ? id + '__help' : undefined,
  19272. ref: ref
  19273. }, props)));
  19274. }
  19275. /* harmony default export */ var text_control = (Object(external_wp_element_["forwardRef"])(TextControl));
  19276. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/inputs.js
  19277. /**
  19278. * External dependencies
  19279. */
  19280. /**
  19281. * WordPress dependencies
  19282. */
  19283. /**
  19284. * Internal dependencies
  19285. */
  19286. /* Wrapper for TextControl, only used to handle intermediate state while typing. */
  19287. class inputs_Input extends external_wp_element_["Component"] {
  19288. constructor() {
  19289. super(...arguments);
  19290. this.handleBlur = this.handleBlur.bind(this);
  19291. this.handleChange = this.handleChange.bind(this);
  19292. this.handleKeyDown = this.handleKeyDown.bind(this);
  19293. }
  19294. handleBlur() {
  19295. const {
  19296. value,
  19297. valueKey,
  19298. onChange,
  19299. source
  19300. } = this.props;
  19301. onChange({
  19302. source,
  19303. state: 'commit',
  19304. value,
  19305. valueKey
  19306. });
  19307. }
  19308. handleChange(value) {
  19309. const {
  19310. valueKey,
  19311. onChange,
  19312. source
  19313. } = this.props;
  19314. if (value.length > 4 && isValidHex(value)) {
  19315. onChange({
  19316. source,
  19317. state: 'commit',
  19318. value,
  19319. valueKey
  19320. });
  19321. } else {
  19322. onChange({
  19323. source,
  19324. state: 'draft',
  19325. value,
  19326. valueKey
  19327. });
  19328. }
  19329. }
  19330. handleKeyDown({
  19331. keyCode
  19332. }) {
  19333. if (keyCode !== external_wp_keycodes_["ENTER"] && keyCode !== external_wp_keycodes_["UP"] && keyCode !== external_wp_keycodes_["DOWN"]) {
  19334. return;
  19335. }
  19336. const {
  19337. value,
  19338. valueKey,
  19339. onChange,
  19340. source
  19341. } = this.props;
  19342. onChange({
  19343. source,
  19344. state: 'commit',
  19345. value,
  19346. valueKey
  19347. });
  19348. }
  19349. render() {
  19350. const {
  19351. label,
  19352. value,
  19353. ...props
  19354. } = this.props;
  19355. return Object(external_wp_element_["createElement"])(text_control, Object(esm_extends["a" /* default */])({
  19356. className: "components-color-picker__inputs-field",
  19357. label: label,
  19358. value: value,
  19359. onChange: newValue => this.handleChange(newValue),
  19360. onBlur: this.handleBlur,
  19361. onKeyDown: this.handleKeyDown
  19362. }, Object(external_lodash_["omit"])(props, ['onChange', 'valueKey', 'source'])));
  19363. }
  19364. }
  19365. const PureButton = Object(external_wp_compose_["pure"])(build_module_button["a" /* default */]);
  19366. class inputs_Inputs extends external_wp_element_["Component"] {
  19367. constructor({
  19368. hsl
  19369. }) {
  19370. super(...arguments);
  19371. const view = hsl.a === 1 ? 'hex' : 'rgb';
  19372. this.state = {
  19373. view
  19374. };
  19375. this.toggleViews = this.toggleViews.bind(this);
  19376. this.resetDraftValues = this.resetDraftValues.bind(this);
  19377. this.handleChange = this.handleChange.bind(this);
  19378. this.normalizeValue = this.normalizeValue.bind(this);
  19379. }
  19380. static getDerivedStateFromProps(props, state) {
  19381. if (props.hsl.a !== 1 && state.view === 'hex') {
  19382. return {
  19383. view: 'rgb'
  19384. };
  19385. }
  19386. return null;
  19387. }
  19388. toggleViews() {
  19389. if (this.state.view === 'hex') {
  19390. this.setState({
  19391. view: 'rgb'
  19392. }, this.resetDraftValues);
  19393. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active'));
  19394. } else if (this.state.view === 'rgb') {
  19395. this.setState({
  19396. view: 'hsl'
  19397. }, this.resetDraftValues);
  19398. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hue/saturation/lightness mode active'));
  19399. } else if (this.state.view === 'hsl') {
  19400. if (this.props.hsl.a === 1) {
  19401. this.setState({
  19402. view: 'hex'
  19403. }, this.resetDraftValues);
  19404. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Hex color mode active'));
  19405. } else {
  19406. this.setState({
  19407. view: 'rgb'
  19408. }, this.resetDraftValues);
  19409. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('RGB mode active'));
  19410. }
  19411. }
  19412. }
  19413. resetDraftValues() {
  19414. return this.props.onChange({
  19415. state: 'reset'
  19416. });
  19417. }
  19418. normalizeValue(valueKey, value) {
  19419. if (valueKey !== 'a') {
  19420. return value;
  19421. }
  19422. if (value < 0) {
  19423. return 0;
  19424. } else if (value > 1) {
  19425. return 1;
  19426. }
  19427. return Math.round(value * 100) / 100;
  19428. }
  19429. handleChange({
  19430. source,
  19431. state,
  19432. value,
  19433. valueKey
  19434. }) {
  19435. this.props.onChange({
  19436. source,
  19437. state,
  19438. valueKey,
  19439. value: this.normalizeValue(valueKey, value)
  19440. });
  19441. }
  19442. renderFields() {
  19443. const {
  19444. disableAlpha = false
  19445. } = this.props;
  19446. if (this.state.view === 'hex') {
  19447. return Object(external_wp_element_["createElement"])("div", {
  19448. className: "components-color-picker__inputs-fields"
  19449. }, Object(external_wp_element_["createElement"])(inputs_Input, {
  19450. source: this.state.view,
  19451. label: Object(external_wp_i18n_["__"])('Color value in hexadecimal'),
  19452. valueKey: "hex",
  19453. value: this.props.hex,
  19454. onChange: this.handleChange
  19455. }));
  19456. } else if (this.state.view === 'rgb') {
  19457. const legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in RGB') : Object(external_wp_i18n_["__"])('Color value in RGBA');
  19458. return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  19459. as: "legend"
  19460. }, legend), Object(external_wp_element_["createElement"])("div", {
  19461. className: "components-color-picker__inputs-fields"
  19462. }, Object(external_wp_element_["createElement"])(inputs_Input, {
  19463. source: this.state.view,
  19464. label: "r",
  19465. valueKey: "r",
  19466. value: this.props.rgb.r,
  19467. onChange: this.handleChange,
  19468. type: "number",
  19469. min: "0",
  19470. max: "255"
  19471. }), Object(external_wp_element_["createElement"])(inputs_Input, {
  19472. source: this.state.view,
  19473. label: "g",
  19474. valueKey: "g",
  19475. value: this.props.rgb.g,
  19476. onChange: this.handleChange,
  19477. type: "number",
  19478. min: "0",
  19479. max: "255"
  19480. }), Object(external_wp_element_["createElement"])(inputs_Input, {
  19481. source: this.state.view,
  19482. label: "b",
  19483. valueKey: "b",
  19484. value: this.props.rgb.b,
  19485. onChange: this.handleChange,
  19486. type: "number",
  19487. min: "0",
  19488. max: "255"
  19489. }), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, {
  19490. source: this.state.view,
  19491. label: "a",
  19492. valueKey: "a",
  19493. value: this.props.rgb.a,
  19494. onChange: this.handleChange,
  19495. type: "number",
  19496. min: "0",
  19497. max: "1",
  19498. step: "0.01"
  19499. })));
  19500. } else if (this.state.view === 'hsl') {
  19501. const legend = disableAlpha ? Object(external_wp_i18n_["__"])('Color value in HSL') : Object(external_wp_i18n_["__"])('Color value in HSLA');
  19502. return Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  19503. as: "legend"
  19504. }, legend), Object(external_wp_element_["createElement"])("div", {
  19505. className: "components-color-picker__inputs-fields"
  19506. }, Object(external_wp_element_["createElement"])(inputs_Input, {
  19507. source: this.state.view,
  19508. label: "h",
  19509. valueKey: "h",
  19510. value: this.props.hsl.h,
  19511. onChange: this.handleChange,
  19512. type: "number",
  19513. min: "0",
  19514. max: "359"
  19515. }), Object(external_wp_element_["createElement"])(inputs_Input, {
  19516. source: this.state.view,
  19517. label: "s",
  19518. valueKey: "s",
  19519. value: this.props.hsl.s,
  19520. onChange: this.handleChange,
  19521. type: "number",
  19522. min: "0",
  19523. max: "100"
  19524. }), Object(external_wp_element_["createElement"])(inputs_Input, {
  19525. source: this.state.view,
  19526. label: "l",
  19527. valueKey: "l",
  19528. value: this.props.hsl.l,
  19529. onChange: this.handleChange,
  19530. type: "number",
  19531. min: "0",
  19532. max: "100"
  19533. }), disableAlpha ? null : Object(external_wp_element_["createElement"])(inputs_Input, {
  19534. source: this.state.view,
  19535. label: "a",
  19536. valueKey: "a",
  19537. value: this.props.hsl.a,
  19538. onChange: this.handleChange,
  19539. type: "number",
  19540. min: "0",
  19541. max: "1",
  19542. step: "0.05"
  19543. })));
  19544. }
  19545. }
  19546. render() {
  19547. return Object(external_wp_element_["createElement"])("div", {
  19548. className: "components-color-picker__inputs-wrapper"
  19549. }, this.renderFields(), Object(external_wp_element_["createElement"])("div", {
  19550. className: "components-color-picker__inputs-toggle-wrapper"
  19551. }, Object(external_wp_element_["createElement"])(PureButton, {
  19552. className: "components-color-picker__inputs-toggle",
  19553. icon: chevron_down["a" /* default */],
  19554. label: Object(external_wp_i18n_["__"])('Change color format'),
  19555. onClick: this.toggleViews
  19556. })));
  19557. }
  19558. }
  19559. /* harmony default export */ var inputs = (inputs_Inputs);
  19560. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/saturation.js
  19561. /**
  19562. * Parts of this source were derived and modified from react-color,
  19563. * released under the MIT license.
  19564. *
  19565. * https://github.com/casesandberg/react-color/
  19566. *
  19567. * Copyright (c) 2015 Case Sandberg
  19568. *
  19569. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19570. * of this software and associated documentation files (the "Software"), to deal
  19571. * in the Software without restriction, including without limitation the rights
  19572. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19573. * copies of the Software, and to permit persons to whom the Software is
  19574. * furnished to do so, subject to the following conditions:
  19575. *
  19576. * The above copyright notice and this permission notice shall be included in
  19577. * all copies or substantial portions of the Software.
  19578. *
  19579. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19580. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19581. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19582. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19583. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19584. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19585. * THE SOFTWARE.
  19586. */
  19587. /**
  19588. * External dependencies
  19589. */
  19590. /**
  19591. * WordPress dependencies
  19592. */
  19593. /**
  19594. * Internal dependencies
  19595. */
  19596. class saturation_Saturation extends external_wp_element_["Component"] {
  19597. constructor(props) {
  19598. super(props);
  19599. this.throttle = Object(external_lodash_["throttle"])((fn, data, e) => {
  19600. fn(data, e);
  19601. }, 50);
  19602. this.container = Object(external_wp_element_["createRef"])();
  19603. this.saturate = this.saturate.bind(this);
  19604. this.brighten = this.brighten.bind(this);
  19605. this.handleChange = this.handleChange.bind(this);
  19606. this.handleMouseDown = this.handleMouseDown.bind(this);
  19607. this.handleMouseUp = this.handleMouseUp.bind(this);
  19608. }
  19609. componentWillUnmount() {
  19610. this.throttle.cancel();
  19611. this.unbindEventListeners();
  19612. }
  19613. saturate(amount = 0.01) {
  19614. const {
  19615. hsv,
  19616. onChange = external_lodash_["noop"]
  19617. } = this.props;
  19618. const intSaturation = Object(external_lodash_["clamp"])(hsv.s + Math.round(amount * 100), 0, 100);
  19619. const change = {
  19620. h: hsv.h,
  19621. s: intSaturation,
  19622. v: hsv.v,
  19623. a: hsv.a,
  19624. source: 'rgb'
  19625. };
  19626. onChange(change);
  19627. }
  19628. brighten(amount = 0.01) {
  19629. const {
  19630. hsv,
  19631. onChange = external_lodash_["noop"]
  19632. } = this.props;
  19633. const intValue = Object(external_lodash_["clamp"])(hsv.v + Math.round(amount * 100), 0, 100);
  19634. const change = {
  19635. h: hsv.h,
  19636. s: hsv.s,
  19637. v: intValue,
  19638. a: hsv.a,
  19639. source: 'rgb'
  19640. };
  19641. onChange(change);
  19642. }
  19643. handleChange(e) {
  19644. const {
  19645. onChange = external_lodash_["noop"]
  19646. } = this.props;
  19647. const change = calculateSaturationChange(e, this.props, this.container.current);
  19648. this.throttle(onChange, change, e);
  19649. }
  19650. handleMouseDown(e) {
  19651. this.handleChange(e);
  19652. window.addEventListener('mousemove', this.handleChange);
  19653. window.addEventListener('mouseup', this.handleMouseUp);
  19654. }
  19655. handleMouseUp() {
  19656. this.unbindEventListeners();
  19657. }
  19658. preventKeyEvents(event) {
  19659. if (event.keyCode === external_wp_keycodes_["TAB"]) {
  19660. return;
  19661. }
  19662. event.preventDefault();
  19663. }
  19664. unbindEventListeners() {
  19665. window.removeEventListener('mousemove', this.handleChange);
  19666. window.removeEventListener('mouseup', this.handleMouseUp);
  19667. }
  19668. render() {
  19669. const {
  19670. hsv,
  19671. hsl,
  19672. instanceId
  19673. } = this.props;
  19674. const pointerLocation = {
  19675. top: `${-hsv.v + 100}%`,
  19676. left: `${hsv.s}%`
  19677. };
  19678. const shortcuts = {
  19679. up: () => this.brighten(),
  19680. 'shift+up': () => this.brighten(0.1),
  19681. pageup: () => this.brighten(1),
  19682. down: () => this.brighten(-0.01),
  19683. 'shift+down': () => this.brighten(-0.1),
  19684. pagedown: () => this.brighten(-1),
  19685. right: () => this.saturate(),
  19686. 'shift+right': () => this.saturate(0.1),
  19687. end: () => this.saturate(1),
  19688. left: () => this.saturate(-0.01),
  19689. 'shift+left': () => this.saturate(-0.1),
  19690. home: () => this.saturate(-1)
  19691. };
  19692. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
  19693. return Object(external_wp_element_["createElement"])(keyboard_shortcuts, {
  19694. shortcuts: shortcuts
  19695. }, Object(external_wp_element_["createElement"])("div", {
  19696. style: {
  19697. background: `hsl(${hsl.h},100%, 50%)`
  19698. },
  19699. className: "components-color-picker__saturation-color",
  19700. ref: this.container,
  19701. onMouseDown: this.handleMouseDown,
  19702. onTouchMove: this.handleChange,
  19703. onTouchStart: this.handleChange,
  19704. role: "application"
  19705. }, Object(external_wp_element_["createElement"])("div", {
  19706. className: "components-color-picker__saturation-white"
  19707. }), Object(external_wp_element_["createElement"])("div", {
  19708. className: "components-color-picker__saturation-black"
  19709. }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  19710. "aria-label": Object(external_wp_i18n_["__"])('Choose a shade'),
  19711. "aria-describedby": `color-picker-saturation-${instanceId}`,
  19712. className: "components-color-picker__saturation-pointer",
  19713. style: pointerLocation,
  19714. onKeyDown: this.preventKeyEvents
  19715. }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  19716. id: `color-picker-saturation-${instanceId}`
  19717. }, Object(external_wp_i18n_["__"])('Use your arrow keys to change the base color. Move up to lighten the color, down to darken, left to decrease saturation, and right to increase saturation.'))));
  19718. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
  19719. }
  19720. }
  19721. /* harmony default export */ var saturation = (Object(external_wp_compose_["compose"])(external_wp_compose_["pure"], external_wp_compose_["withInstanceId"])(saturation_Saturation));
  19722. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/index.js
  19723. /**
  19724. * Parts of this source were derived and modified from react-color,
  19725. * released under the MIT license.
  19726. *
  19727. * https://github.com/casesandberg/react-color/
  19728. *
  19729. * Copyright (c) 2015 Case Sandberg
  19730. *
  19731. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19732. * of this software and associated documentation files (the "Software"), to deal
  19733. * in the Software without restriction, including without limitation the rights
  19734. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19735. * copies of the Software, and to permit persons to whom the Software is
  19736. * furnished to do so, subject to the following conditions:
  19737. *
  19738. * The above copyright notice and this permission notice shall be included in
  19739. * all copies or substantial portions of the Software.
  19740. *
  19741. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19742. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19743. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19744. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19745. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19746. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19747. * THE SOFTWARE.
  19748. */
  19749. /**
  19750. * External dependencies
  19751. */
  19752. /**
  19753. * WordPress dependencies
  19754. */
  19755. /**
  19756. * Internal dependencies
  19757. */
  19758. const toLowerCase = value => String(value).toLowerCase();
  19759. const color_picker_isValueEmpty = data => {
  19760. if (data.source === 'hex' && data.hex === undefined) {
  19761. return true;
  19762. }
  19763. if (data.source === 'hsl' && (data.h === undefined || data.s === undefined || data.l === undefined)) {
  19764. return true;
  19765. }
  19766. /**
  19767. * Check that if source is `rgb`:
  19768. * `r`, `g` or `b` properties are not undefined
  19769. * OR (||) `h`, `s`, `v` or `a` properties are not undefined
  19770. * OR (||) `h`, `s`, `l` or `a` properties are not undefined
  19771. *
  19772. * before it was checking with NOT(!) statement witch for `0` (bool|int) values returns `true`
  19773. * this is a typecasting issue only visible for hex values that derive from #000000
  19774. */
  19775. return data.source === 'rgb' && (data.r === undefined || data.g === undefined || data.b === undefined) && (data.h === undefined || data.s === undefined || data.v === undefined || data.a === undefined) && (data.h === undefined || data.s === undefined || data.l === undefined || data.a === undefined);
  19776. };
  19777. const isValidColor = colors => colors.hex ? isValidHex(colors.hex) : simpleCheckForValidColor(colors);
  19778. /**
  19779. * Function that creates the new color object
  19780. * from old data and the new value.
  19781. *
  19782. * @param {Object} oldColors The old color object.
  19783. * @param {string} oldColors.hex
  19784. * @param {Object} oldColors.rgb
  19785. * @param {number} oldColors.rgb.r
  19786. * @param {number} oldColors.rgb.g
  19787. * @param {number} oldColors.rgb.b
  19788. * @param {number} oldColors.rgb.a
  19789. * @param {Object} oldColors.hsl
  19790. * @param {number} oldColors.hsl.h
  19791. * @param {number} oldColors.hsl.s
  19792. * @param {number} oldColors.hsl.l
  19793. * @param {number} oldColors.hsl.a
  19794. * @param {string} oldColors.draftHex Same format as oldColors.hex
  19795. * @param {Object} oldColors.draftRgb Same format as oldColors.rgb
  19796. * @param {Object} oldColors.draftHsl Same format as oldColors.hsl
  19797. * @param {Object} data Data containing the new value to update.
  19798. * @param {Object} data.source One of `hex`, `rgb`, `hsl`.
  19799. * @param {string|number} data.value Value to update.
  19800. * @param {string} data.valueKey Depends on `data.source` values:
  19801. * - when source = `rgb`, valuKey can be `r`, `g`, `b`, or `a`.
  19802. * - when source = `hsl`, valuKey can be `h`, `s`, `l`, or `a`.
  19803. * @return {Object} A new color object for a specific source. For example:
  19804. * { source: 'rgb', r: 1, g: 2, b:3, a:0 }
  19805. */
  19806. const dataToColors = (oldColors, {
  19807. source,
  19808. valueKey,
  19809. value
  19810. }) => {
  19811. if (source === 'hex') {
  19812. return {
  19813. source,
  19814. [source]: value
  19815. };
  19816. }
  19817. return {
  19818. source,
  19819. ...{ ...oldColors[source],
  19820. ...{
  19821. [valueKey]: value
  19822. }
  19823. }
  19824. };
  19825. };
  19826. class color_picker_ColorPicker extends external_wp_element_["Component"] {
  19827. constructor({
  19828. color = '0071a1'
  19829. }) {
  19830. super(...arguments);
  19831. const colors = colorToState(color);
  19832. this.state = { ...colors,
  19833. draftHex: toLowerCase(colors.hex),
  19834. draftRgb: colors.rgb,
  19835. draftHsl: colors.hsl
  19836. };
  19837. this.commitValues = this.commitValues.bind(this);
  19838. this.setDraftValues = this.setDraftValues.bind(this);
  19839. this.resetDraftValues = this.resetDraftValues.bind(this);
  19840. this.handleInputChange = this.handleInputChange.bind(this);
  19841. }
  19842. commitValues(data) {
  19843. const {
  19844. oldHue,
  19845. onChangeComplete = external_lodash_["noop"]
  19846. } = this.props;
  19847. if (isValidColor(data)) {
  19848. const colors = colorToState(data, data.h || oldHue);
  19849. this.setState({ ...colors,
  19850. draftHex: toLowerCase(colors.hex),
  19851. draftHsl: colors.hsl,
  19852. draftRgb: colors.rgb
  19853. }, Object(external_lodash_["debounce"])(Object(external_lodash_["partial"])(onChangeComplete, colors), 100));
  19854. }
  19855. }
  19856. resetDraftValues() {
  19857. this.setState({
  19858. draftHex: this.state.hex,
  19859. draftHsl: this.state.hsl,
  19860. draftRgb: this.state.rgb
  19861. });
  19862. }
  19863. setDraftValues(data) {
  19864. switch (data.source) {
  19865. case 'hex':
  19866. this.setState({
  19867. draftHex: toLowerCase(data.hex)
  19868. });
  19869. break;
  19870. case 'rgb':
  19871. this.setState({
  19872. draftRgb: data
  19873. });
  19874. break;
  19875. case 'hsl':
  19876. this.setState({
  19877. draftHsl: data
  19878. });
  19879. break;
  19880. }
  19881. }
  19882. handleInputChange(data) {
  19883. switch (data.state) {
  19884. case 'reset':
  19885. this.resetDraftValues();
  19886. break;
  19887. case 'commit':
  19888. const colors = dataToColors(this.state, data);
  19889. if (!color_picker_isValueEmpty(colors)) {
  19890. this.commitValues(colors);
  19891. }
  19892. break;
  19893. case 'draft':
  19894. this.setDraftValues(dataToColors(this.state, data));
  19895. break;
  19896. }
  19897. }
  19898. render() {
  19899. const {
  19900. className,
  19901. disableAlpha
  19902. } = this.props;
  19903. const {
  19904. color,
  19905. hsl,
  19906. hsv,
  19907. rgb,
  19908. draftHex,
  19909. draftHsl,
  19910. draftRgb
  19911. } = this.state;
  19912. const classes = classnames_default()(className, {
  19913. 'components-color-picker': true,
  19914. 'is-alpha-disabled': disableAlpha,
  19915. 'is-alpha-enabled': !disableAlpha
  19916. });
  19917. return Object(external_wp_element_["createElement"])("div", {
  19918. className: classes
  19919. }, Object(external_wp_element_["createElement"])("div", {
  19920. className: "components-color-picker__saturation"
  19921. }, Object(external_wp_element_["createElement"])(saturation, {
  19922. hsl: hsl,
  19923. hsv: hsv,
  19924. onChange: this.commitValues
  19925. })), Object(external_wp_element_["createElement"])("div", {
  19926. className: "components-color-picker__body"
  19927. }, Object(external_wp_element_["createElement"])("div", {
  19928. className: "components-color-picker__controls"
  19929. }, Object(external_wp_element_["createElement"])("div", {
  19930. className: "components-color-picker__swatch"
  19931. }, Object(external_wp_element_["createElement"])("div", {
  19932. className: "components-color-picker__active",
  19933. style: {
  19934. backgroundColor: color && color.toRgbString()
  19935. }
  19936. })), Object(external_wp_element_["createElement"])("div", {
  19937. className: "components-color-picker__toggles"
  19938. }, Object(external_wp_element_["createElement"])(hue, {
  19939. hsl: hsl,
  19940. onChange: this.commitValues
  19941. }), disableAlpha ? null : Object(external_wp_element_["createElement"])(color_picker_alpha, {
  19942. rgb: rgb,
  19943. hsl: hsl,
  19944. onChange: this.commitValues
  19945. }))), Object(external_wp_element_["createElement"])(inputs, {
  19946. rgb: draftRgb,
  19947. hsl: draftHsl,
  19948. hex: draftHex,
  19949. onChange: this.handleInputChange,
  19950. disableAlpha: disableAlpha
  19951. })));
  19952. }
  19953. }
  19954. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-edit/index.js
  19955. /**
  19956. * External dependencies
  19957. */
  19958. /**
  19959. * WordPress dependencies
  19960. */
  19961. /**
  19962. * Internal dependencies
  19963. */
  19964. function DropdownOpenOnMount({
  19965. shouldOpen,
  19966. isOpen,
  19967. onToggle
  19968. }) {
  19969. Object(external_wp_element_["useEffect"])(() => {
  19970. if (shouldOpen && !isOpen) {
  19971. onToggle();
  19972. }
  19973. }, []);
  19974. return null;
  19975. }
  19976. function ColorOption({
  19977. color,
  19978. name,
  19979. slug,
  19980. onChange,
  19981. onRemove,
  19982. onConfirm,
  19983. confirmLabel = Object(external_wp_i18n_["__"])('OK'),
  19984. isEditingNameOnMount = false,
  19985. isEditingColorOnMount = false,
  19986. onCancel,
  19987. immutableColorSlugs = []
  19988. }) {
  19989. const [isHover, setIsHover] = Object(external_wp_element_["useState"])(false);
  19990. const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false);
  19991. const [isEditingName, setIsEditingName] = Object(external_wp_element_["useState"])(isEditingNameOnMount);
  19992. const [isShowingAdvancedPanel, setIsShowingAdvancedPanel] = Object(external_wp_element_["useState"])(false);
  19993. const isShowingControls = (isHover || isFocused || isEditingName || isShowingAdvancedPanel) && !immutableColorSlugs.includes(slug);
  19994. return Object(external_wp_element_["createElement"])("div", {
  19995. tabIndex: 0,
  19996. className: classnames_default()('components-color-edit__color-option', {
  19997. 'is-hover': isHover && !isEditingName && !isShowingAdvancedPanel
  19998. }),
  19999. onMouseEnter: () => setIsHover(true),
  20000. onMouseLeave: () => setIsHover(false),
  20001. onFocus: () => setIsFocused(true),
  20002. onBlur: () => setIsFocused(false),
  20003. "aria-label": name ? // translators: %s: The name of the color e.g: "vivid red".
  20004. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
  20005. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color)
  20006. }, Object(external_wp_element_["createElement"])("div", {
  20007. className: "components-color-edit__color-option-main-area"
  20008. }, Object(external_wp_element_["createElement"])(Dropdown, {
  20009. renderToggle: ({
  20010. isOpen,
  20011. onToggle
  20012. }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(DropdownOpenOnMount, {
  20013. shouldOpen: isEditingColorOnMount,
  20014. isOpen: isOpen,
  20015. onToggle: onToggle
  20016. }), Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
  20017. style: {
  20018. backgroundColor: color,
  20019. color
  20020. },
  20021. "aria-expanded": isOpen,
  20022. "aria-haspopup": "true",
  20023. onClick: onToggle,
  20024. "aria-label": Object(external_wp_i18n_["__"])('Edit color value')
  20025. })),
  20026. renderContent: () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
  20027. color: color,
  20028. onChangeComplete: newColor => onChange({
  20029. color: newColor.hex,
  20030. slug,
  20031. name
  20032. }),
  20033. disableAlpha: true
  20034. })
  20035. }), !isEditingName && Object(external_wp_element_["createElement"])("div", {
  20036. className: "components-color-edit__color-option-color-name"
  20037. }, name), isEditingName && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(text_control, {
  20038. className: "components-color-edit__color-option-color-name-input",
  20039. hideLabelFromVision: true,
  20040. onChange: newColorName => onChange({
  20041. color,
  20042. slug: Object(external_lodash_["kebabCase"])(newColorName),
  20043. name: newColorName
  20044. }),
  20045. label: Object(external_wp_i18n_["__"])('Color name'),
  20046. placeholder: Object(external_wp_i18n_["__"])('Name'),
  20047. value: name
  20048. }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20049. onClick: () => {
  20050. setIsEditingName(false);
  20051. setIsFocused(false);
  20052. if (onConfirm) {
  20053. onConfirm();
  20054. }
  20055. },
  20056. isPrimary: true
  20057. }, confirmLabel)), !isEditingName && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20058. className: classnames_default()({
  20059. 'components-color-edit__hidden-control': !isShowingControls
  20060. }),
  20061. icon: edit["a" /* default */],
  20062. label: Object(external_wp_i18n_["__"])('Edit color name'),
  20063. onClick: () => setIsEditingName(true)
  20064. }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20065. className: classnames_default()({
  20066. 'components-color-edit__hidden-control': !isShowingControls
  20067. }),
  20068. icon: library_close["a" /* default */],
  20069. label: Object(external_wp_i18n_["__"])('Remove color'),
  20070. onClick: onRemove
  20071. })), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20072. className: classnames_default()({
  20073. 'components-color-edit__hidden-control': !isShowingControls
  20074. }),
  20075. icon: isShowingAdvancedPanel ? chevron_up["a" /* default */] : chevron_down["a" /* default */],
  20076. label: Object(external_wp_i18n_["__"])('Additional color settings'),
  20077. onClick: () => {
  20078. if (isShowingAdvancedPanel) {
  20079. setIsFocused(false);
  20080. }
  20081. setIsShowingAdvancedPanel(!isShowingAdvancedPanel);
  20082. },
  20083. "aria-expanded": isShowingAdvancedPanel
  20084. })), onCancel && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20085. className: "components-color-edit__cancel-button",
  20086. onClick: onCancel
  20087. }, Object(external_wp_i18n_["__"])('Cancel')), isShowingAdvancedPanel && Object(external_wp_element_["createElement"])(text_control, {
  20088. className: "components-color-edit__slug-input",
  20089. onChange: newSlug => onChange({
  20090. color,
  20091. slug: newSlug,
  20092. name
  20093. }),
  20094. label: Object(external_wp_i18n_["__"])('Slug'),
  20095. value: slug
  20096. }));
  20097. }
  20098. function ColorInserter({
  20099. onInsert,
  20100. onCancel
  20101. }) {
  20102. const [color, setColor] = Object(external_wp_element_["useState"])({
  20103. color: '#fff',
  20104. name: '',
  20105. slug: ''
  20106. });
  20107. return Object(external_wp_element_["createElement"])(ColorOption, {
  20108. color: color.color,
  20109. name: color.name,
  20110. slug: color.slug,
  20111. onChange: setColor,
  20112. confirmLabel: Object(external_wp_i18n_["__"])('Save'),
  20113. onConfirm: () => onInsert(color),
  20114. isEditingNameOnMount: true,
  20115. isEditingColorOnMount: true,
  20116. onCancel: onCancel
  20117. });
  20118. }
  20119. function ColorEdit({
  20120. colors,
  20121. onChange,
  20122. emptyUI,
  20123. immutableColorSlugs,
  20124. canReset = true
  20125. }) {
  20126. const [isInsertingColor, setIsInsertingColor] = Object(external_wp_element_["useState"])(false);
  20127. return Object(external_wp_element_["createElement"])(base_control, null, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("div", {
  20128. className: "components-color-edit__label-and-insert-container"
  20129. }, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(base_control.VisualLabel, null, Object(external_wp_i18n_["__"])('Color palette')))), !isInsertingColor && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20130. onClick: () => {
  20131. setIsInsertingColor(true);
  20132. },
  20133. className: "components-color-edit__insert-button",
  20134. icon: plus["a" /* default */]
  20135. })), Object(external_wp_element_["createElement"])("div", null, !Object(external_lodash_["isEmpty"])(colors) && colors.map((color, index) => {
  20136. return Object(external_wp_element_["createElement"])(ColorOption, {
  20137. key: index,
  20138. color: color.color,
  20139. name: color.name,
  20140. slug: color.slug,
  20141. immutableColorSlugs: immutableColorSlugs,
  20142. onChange: newColor => {
  20143. onChange(colors.map((currentColor, currentIndex) => {
  20144. if (currentIndex === index) {
  20145. return newColor;
  20146. }
  20147. return currentColor;
  20148. }));
  20149. },
  20150. onRemove: () => {
  20151. onChange(colors.filter((_currentColor, currentIndex) => {
  20152. if (currentIndex === index) {
  20153. return false;
  20154. }
  20155. return true;
  20156. }));
  20157. }
  20158. });
  20159. }), isInsertingColor && Object(external_wp_element_["createElement"])(ColorInserter, {
  20160. onInsert: newColor => {
  20161. setIsInsertingColor(false);
  20162. onChange([...(colors || []), newColor]);
  20163. },
  20164. onCancel: () => setIsInsertingColor(false)
  20165. }), !isInsertingColor && Object(external_lodash_["isEmpty"])(colors) && emptyUI), !!canReset && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20166. isSmall: true,
  20167. isSecondary: true,
  20168. className: "components-color-edit__reset-button",
  20169. onClick: () => onChange()
  20170. }, Object(external_wp_i18n_["__"])('Reset'))));
  20171. }
  20172. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js
  20173. /**
  20174. * External dependencies
  20175. */
  20176. const ColorIndicator = ({
  20177. className,
  20178. colorValue,
  20179. ...props
  20180. }) => Object(external_wp_element_["createElement"])("span", Object(esm_extends["a" /* default */])({
  20181. className: classnames_default()('component-color-indicator', className),
  20182. style: {
  20183. background: colorValue
  20184. }
  20185. }, props));
  20186. /* harmony default export */ var color_indicator = (ColorIndicator);
  20187. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/index.js
  20188. /**
  20189. * External dependencies
  20190. */
  20191. /**
  20192. * WordPress dependencies
  20193. */
  20194. /**
  20195. * Internal dependencies
  20196. */
  20197. function ColorPalette({
  20198. clearable = true,
  20199. className,
  20200. colors,
  20201. disableCustomColors = false,
  20202. onChange,
  20203. value
  20204. }) {
  20205. const clearColor = Object(external_wp_element_["useCallback"])(() => onChange(undefined), [onChange]);
  20206. const colorOptions = Object(external_wp_element_["useMemo"])(() => {
  20207. return Object(external_lodash_["map"])(colors, ({
  20208. color,
  20209. name
  20210. }) => Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
  20211. key: color,
  20212. isSelected: value === color,
  20213. selectedIconProps: value === color ? {
  20214. fill: tinycolor_default.a.mostReadable(color, ['#000', '#fff']).toHexString()
  20215. } : {},
  20216. tooltipText: name || // translators: %s: color hex code e.g: "#f00".
  20217. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color),
  20218. style: {
  20219. backgroundColor: color,
  20220. color
  20221. },
  20222. onClick: value === color ? clearColor : () => onChange(color),
  20223. "aria-label": name ? // translators: %s: The name of the color e.g: "vivid red".
  20224. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
  20225. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color)
  20226. }));
  20227. }, [colors, value, onChange, clearColor]);
  20228. const renderCustomColorPicker = () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
  20229. color: value,
  20230. onChangeComplete: color => onChange(color.hex),
  20231. disableAlpha: true
  20232. });
  20233. return Object(external_wp_element_["createElement"])(CircularOptionPicker, {
  20234. className: className,
  20235. options: colorOptions,
  20236. actions: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !disableCustomColors && Object(external_wp_element_["createElement"])(CircularOptionPicker.DropdownLinkAction, {
  20237. dropdownProps: {
  20238. renderContent: renderCustomColorPicker,
  20239. contentClassName: 'components-color-palette__picker'
  20240. },
  20241. buttonProps: {
  20242. 'aria-label': Object(external_wp_i18n_["__"])('Custom color picker')
  20243. },
  20244. linkText: Object(external_wp_i18n_["__"])('Custom color')
  20245. }), !!clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
  20246. onClick: clearColor
  20247. }, Object(external_wp_i18n_["__"])('Clear')))
  20248. });
  20249. }
  20250. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  20251. var close_small = __webpack_require__("bWcr");
  20252. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js
  20253. /**
  20254. * External dependencies
  20255. */
  20256. /**
  20257. * WordPress dependencies
  20258. */
  20259. class token_input_TokenInput extends external_wp_element_["Component"] {
  20260. constructor() {
  20261. super(...arguments);
  20262. this.onChange = this.onChange.bind(this);
  20263. this.bindInput = this.bindInput.bind(this);
  20264. }
  20265. focus() {
  20266. this.input.focus();
  20267. }
  20268. hasFocus() {
  20269. return this.input === this.input.ownerDocument.activeElement;
  20270. }
  20271. bindInput(ref) {
  20272. this.input = ref;
  20273. }
  20274. onChange(event) {
  20275. this.props.onChange({
  20276. value: event.target.value
  20277. });
  20278. }
  20279. render() {
  20280. const {
  20281. value,
  20282. isExpanded,
  20283. instanceId,
  20284. selectedSuggestionIndex,
  20285. className,
  20286. ...props
  20287. } = this.props;
  20288. const size = value ? value.length + 1 : 0;
  20289. return Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
  20290. ref: this.bindInput,
  20291. id: `components-form-token-input-${instanceId}`,
  20292. type: "text"
  20293. }, props, {
  20294. value: value || '',
  20295. onChange: this.onChange,
  20296. size: size,
  20297. className: classnames_default()(className, 'components-form-token-field__input'),
  20298. autoComplete: "off",
  20299. role: "combobox",
  20300. "aria-expanded": isExpanded,
  20301. "aria-autocomplete": "list",
  20302. "aria-owns": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined,
  20303. "aria-activedescendant": selectedSuggestionIndex !== -1 ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined,
  20304. "aria-describedby": `components-form-token-suggestions-howto-${instanceId}`
  20305. }));
  20306. }
  20307. }
  20308. /* harmony default export */ var token_input = (token_input_TokenInput);
  20309. // EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js
  20310. var lib = __webpack_require__("9Do8");
  20311. var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
  20312. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js
  20313. /**
  20314. * External dependencies
  20315. */
  20316. /**
  20317. * WordPress dependencies
  20318. */
  20319. class suggestions_list_SuggestionsList extends external_wp_element_["Component"] {
  20320. constructor() {
  20321. super(...arguments);
  20322. this.handleMouseDown = this.handleMouseDown.bind(this);
  20323. this.bindList = this.bindList.bind(this);
  20324. }
  20325. componentDidUpdate() {
  20326. // only have to worry about scrolling selected suggestion into view
  20327. // when already expanded
  20328. if (this.props.selectedIndex > -1 && this.props.scrollIntoView && this.list.children[this.props.selectedIndex]) {
  20329. this.scrollingIntoView = true;
  20330. lib_default()(this.list.children[this.props.selectedIndex], this.list, {
  20331. onlyScrollIfNeeded: true
  20332. });
  20333. this.props.setTimeout(() => {
  20334. this.scrollingIntoView = false;
  20335. }, 100);
  20336. }
  20337. }
  20338. bindList(ref) {
  20339. this.list = ref;
  20340. }
  20341. handleHover(suggestion) {
  20342. return () => {
  20343. if (!this.scrollingIntoView) {
  20344. this.props.onHover(suggestion);
  20345. }
  20346. };
  20347. }
  20348. handleClick(suggestion) {
  20349. return () => {
  20350. this.props.onSelect(suggestion);
  20351. };
  20352. }
  20353. handleMouseDown(e) {
  20354. // By preventing default here, we will not lose focus of <input> when clicking a suggestion
  20355. e.preventDefault();
  20356. }
  20357. computeSuggestionMatch(suggestion) {
  20358. const match = this.props.displayTransform(this.props.match || '').toLocaleLowerCase();
  20359. if (match.length === 0) {
  20360. return null;
  20361. }
  20362. suggestion = this.props.displayTransform(suggestion);
  20363. const indexOfMatch = suggestion.toLocaleLowerCase().indexOf(match);
  20364. return {
  20365. suggestionBeforeMatch: suggestion.substring(0, indexOfMatch),
  20366. suggestionMatch: suggestion.substring(indexOfMatch, indexOfMatch + match.length),
  20367. suggestionAfterMatch: suggestion.substring(indexOfMatch + match.length)
  20368. };
  20369. }
  20370. render() {
  20371. // We set `tabIndex` here because otherwise Firefox sets focus on this
  20372. // div when tabbing off of the input in `TokenField` -- not really sure
  20373. // why, since usually a div isn't focusable by default
  20374. // TODO does this still apply now that it's a <ul> and not a <div>?
  20375. return Object(external_wp_element_["createElement"])("ul", {
  20376. ref: this.bindList,
  20377. className: "components-form-token-field__suggestions-list",
  20378. id: `components-form-token-suggestions-${this.props.instanceId}`,
  20379. role: "listbox"
  20380. }, Object(external_lodash_["map"])(this.props.suggestions, (suggestion, index) => {
  20381. const match = this.computeSuggestionMatch(suggestion);
  20382. const classeName = classnames_default()('components-form-token-field__suggestion', {
  20383. 'is-selected': index === this.props.selectedIndex
  20384. });
  20385. /* eslint-disable jsx-a11y/click-events-have-key-events */
  20386. return Object(external_wp_element_["createElement"])("li", {
  20387. id: `components-form-token-suggestions-${this.props.instanceId}-${index}`,
  20388. role: "option",
  20389. className: classeName,
  20390. key: suggestion !== null && suggestion !== void 0 && suggestion.value ? suggestion.value : this.props.displayTransform(suggestion),
  20391. onMouseDown: this.handleMouseDown,
  20392. onClick: this.handleClick(suggestion),
  20393. onMouseEnter: this.handleHover(suggestion),
  20394. "aria-selected": index === this.props.selectedIndex
  20395. }, match ? Object(external_wp_element_["createElement"])("span", {
  20396. "aria-label": this.props.displayTransform(suggestion)
  20397. }, match.suggestionBeforeMatch, Object(external_wp_element_["createElement"])("strong", {
  20398. className: "components-form-token-field__suggestion-match"
  20399. }, match.suggestionMatch), match.suggestionAfterMatch) : this.props.displayTransform(suggestion));
  20400. /* eslint-enable jsx-a11y/click-events-have-key-events */
  20401. }));
  20402. }
  20403. }
  20404. suggestions_list_SuggestionsList.defaultProps = {
  20405. match: '',
  20406. onHover: () => {},
  20407. onSelect: () => {},
  20408. suggestions: Object.freeze([])
  20409. };
  20410. /* harmony default export */ var suggestions_list = (Object(external_wp_compose_["withSafeTimeout"])(suggestions_list_SuggestionsList));
  20411. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
  20412. /**
  20413. * WordPress dependencies
  20414. */
  20415. /* harmony default export */ var with_focus_outside = (Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => props => {
  20416. const [handleFocusOutside, setHandleFocusOutside] = Object(external_wp_element_["useState"])();
  20417. const bindFocusOutsideHandler = Object(external_wp_element_["useCallback"])(node => setHandleFocusOutside(() => node !== null && node !== void 0 && node.handleFocusOutside ? node.handleFocusOutside.bind(node) : undefined), []);
  20418. return Object(external_wp_element_["createElement"])("div", Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleFocusOutside), Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({
  20419. ref: bindFocusOutsideHandler
  20420. }, props)));
  20421. }, 'withFocusOutside'));
  20422. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/combobox-control/index.js
  20423. /**
  20424. * External dependencies
  20425. */
  20426. /**
  20427. * WordPress dependencies
  20428. */
  20429. /**
  20430. * Internal dependencies
  20431. */
  20432. const DetectOutside = with_focus_outside(class extends external_wp_element_["Component"] {
  20433. handleFocusOutside(event) {
  20434. this.props.onFocusOutside(event);
  20435. }
  20436. render() {
  20437. return this.props.children;
  20438. }
  20439. });
  20440. function ComboboxControl({
  20441. value,
  20442. label,
  20443. options,
  20444. onChange,
  20445. onFilterValueChange = external_lodash_["noop"],
  20446. hideLabelFromVision,
  20447. help,
  20448. allowReset = true,
  20449. className,
  20450. messages = {
  20451. selected: Object(external_wp_i18n_["__"])('Item selected.')
  20452. }
  20453. }) {
  20454. var _currentOption$label;
  20455. const instanceId = Object(external_wp_compose_["useInstanceId"])(ComboboxControl);
  20456. const [selectedSuggestion, setSelectedSuggestion] = Object(external_wp_element_["useState"])(null);
  20457. const [isExpanded, setIsExpanded] = Object(external_wp_element_["useState"])(false);
  20458. const [inputValue, setInputValue] = Object(external_wp_element_["useState"])('');
  20459. const inputContainer = Object(external_wp_element_["useRef"])();
  20460. const currentOption = options.find(option => option.value === value);
  20461. const currentLabel = (_currentOption$label = currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : '';
  20462. const matchingSuggestions = Object(external_wp_element_["useMemo"])(() => {
  20463. const startsWithMatch = [];
  20464. const containsMatch = [];
  20465. const match = Object(external_lodash_["deburr"])(inputValue.toLocaleLowerCase());
  20466. options.forEach(option => {
  20467. const index = Object(external_lodash_["deburr"])(option.label).toLocaleLowerCase().indexOf(match);
  20468. if (index === 0) {
  20469. startsWithMatch.push(option);
  20470. } else if (index > 0) {
  20471. containsMatch.push(option);
  20472. }
  20473. });
  20474. return startsWithMatch.concat(containsMatch);
  20475. }, [inputValue, options, value]);
  20476. const onSuggestionSelected = newSelectedSuggestion => {
  20477. onChange(newSelectedSuggestion.value);
  20478. Object(external_wp_a11y_["speak"])(messages.selected, 'assertive');
  20479. setSelectedSuggestion(newSelectedSuggestion);
  20480. setInputValue('');
  20481. setIsExpanded(false);
  20482. };
  20483. const handleArrowNavigation = (offset = 1) => {
  20484. const index = matchingSuggestions.indexOf(selectedSuggestion);
  20485. let nextIndex = index + offset;
  20486. if (nextIndex < 0) {
  20487. nextIndex = matchingSuggestions.length - 1;
  20488. } else if (nextIndex >= matchingSuggestions.length) {
  20489. nextIndex = 0;
  20490. }
  20491. setSelectedSuggestion(matchingSuggestions[nextIndex]);
  20492. setIsExpanded(true);
  20493. };
  20494. const onKeyDown = event => {
  20495. let preventDefault = false;
  20496. switch (event.keyCode) {
  20497. case external_wp_keycodes_["ENTER"]:
  20498. if (selectedSuggestion) {
  20499. onSuggestionSelected(selectedSuggestion);
  20500. preventDefault = true;
  20501. }
  20502. break;
  20503. case external_wp_keycodes_["UP"]:
  20504. handleArrowNavigation(-1);
  20505. preventDefault = true;
  20506. break;
  20507. case external_wp_keycodes_["DOWN"]:
  20508. handleArrowNavigation(1);
  20509. preventDefault = true;
  20510. break;
  20511. case external_wp_keycodes_["ESCAPE"]:
  20512. setIsExpanded(false);
  20513. setSelectedSuggestion(null);
  20514. preventDefault = true;
  20515. event.stopPropagation();
  20516. break;
  20517. default:
  20518. break;
  20519. }
  20520. if (preventDefault) {
  20521. event.preventDefault();
  20522. }
  20523. };
  20524. const onFocus = () => {
  20525. setIsExpanded(true);
  20526. onFilterValueChange('');
  20527. setInputValue('');
  20528. };
  20529. const onFocusOutside = () => {
  20530. setIsExpanded(false);
  20531. };
  20532. const onInputChange = event => {
  20533. const text = event.value;
  20534. setInputValue(text);
  20535. onFilterValueChange(text);
  20536. setIsExpanded(true);
  20537. };
  20538. const handleOnReset = () => {
  20539. onChange(null);
  20540. inputContainer.current.input.focus();
  20541. }; // Announcements
  20542. Object(external_wp_element_["useEffect"])(() => {
  20543. const hasMatchingSuggestions = matchingSuggestions.length > 0;
  20544. if (isExpanded) {
  20545. const message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])(
  20546. /* translators: %d: number of results. */
  20547. Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.');
  20548. Object(external_wp_a11y_["speak"])(message, 'polite');
  20549. }
  20550. }, [matchingSuggestions, isExpanded]); // Disable reason: There is no appropriate role which describes the
  20551. // input container intended accessible usability.
  20552. // TODO: Refactor click detection to use blur to stop propagation.
  20553. /* eslint-disable jsx-a11y/no-static-element-interactions */
  20554. return Object(external_wp_element_["createElement"])(DetectOutside, {
  20555. onFocusOutside: onFocusOutside
  20556. }, Object(external_wp_element_["createElement"])(base_control, {
  20557. className: classnames_default()(className, 'components-combobox-control'),
  20558. tabIndex: "-1",
  20559. label: label,
  20560. id: `components-form-token-input-${instanceId}`,
  20561. hideLabelFromVision: hideLabelFromVision,
  20562. help: help
  20563. }, Object(external_wp_element_["createElement"])("div", {
  20564. className: "components-combobox-control__suggestions-container",
  20565. tabIndex: "-1",
  20566. onKeyDown: onKeyDown
  20567. }, Object(external_wp_element_["createElement"])(flex_component, null, Object(external_wp_element_["createElement"])(flex_block_component, null, Object(external_wp_element_["createElement"])(token_input, {
  20568. className: "components-combobox-control__input",
  20569. instanceId: instanceId,
  20570. ref: inputContainer,
  20571. value: isExpanded ? inputValue : currentLabel,
  20572. "aria-label": currentLabel ? `${currentLabel}, ${label}` : null,
  20573. onFocus: onFocus,
  20574. isExpanded: isExpanded,
  20575. selectedSuggestionIndex: matchingSuggestions.indexOf(selectedSuggestion),
  20576. onChange: onInputChange
  20577. })), allowReset && Object(external_wp_element_["createElement"])(flex_item_component, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  20578. className: "components-combobox-control__reset",
  20579. icon: close_small["a" /* default */],
  20580. disabled: !value,
  20581. onClick: handleOnReset,
  20582. label: Object(external_wp_i18n_["__"])('Reset')
  20583. }))), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, {
  20584. instanceId: instanceId,
  20585. match: {
  20586. label: inputValue
  20587. },
  20588. displayTransform: suggestion => suggestion.label,
  20589. suggestions: matchingSuggestions,
  20590. selectedIndex: matchingSuggestions.indexOf(selectedSuggestion),
  20591. onHover: setSelectedSuggestion,
  20592. onSelect: onSuggestionSelected,
  20593. scrollIntoView: true
  20594. }))));
  20595. /* eslint-enable jsx-a11y/no-static-element-interactions */
  20596. }
  20597. /* harmony default export */ var combobox_control = (ComboboxControl);
  20598. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
  20599. function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
  20600. if (source == null) return {};
  20601. var target = {};
  20602. var sourceKeys = Object.keys(source);
  20603. var key, i;
  20604. for (i = 0; i < sourceKeys.length; i++) {
  20605. key = sourceKeys[i];
  20606. if (excluded.indexOf(key) >= 0) continue;
  20607. target[key] = source[key];
  20608. }
  20609. return target;
  20610. }
  20611. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/extends.js
  20612. function extends_extends() {
  20613. extends_extends = Object.assign || function (target) {
  20614. for (var i = 1; i < arguments.length; i++) {
  20615. var source = arguments[i];
  20616. for (var key in source) {
  20617. if (Object.prototype.hasOwnProperty.call(source, key)) {
  20618. target[key] = source[key];
  20619. }
  20620. }
  20621. }
  20622. return target;
  20623. };
  20624. return extends_extends.apply(this, arguments);
  20625. }
  20626. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
  20627. function assertThisInitialized_assertThisInitialized(self) {
  20628. if (self === void 0) {
  20629. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  20630. }
  20631. return self;
  20632. }
  20633. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
  20634. function setPrototypeOf_setPrototypeOf(o, p) {
  20635. setPrototypeOf_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  20636. o.__proto__ = p;
  20637. return o;
  20638. };
  20639. return setPrototypeOf_setPrototypeOf(o, p);
  20640. }
  20641. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
  20642. function inheritsLoose_inheritsLoose(subClass, superClass) {
  20643. subClass.prototype = Object.create(superClass.prototype);
  20644. subClass.prototype.constructor = subClass;
  20645. setPrototypeOf_setPrototypeOf(subClass, superClass);
  20646. }
  20647. // EXTERNAL MODULE: ./node_modules/prop-types/index.js
  20648. var prop_types = __webpack_require__("17x9");
  20649. var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
  20650. // EXTERNAL MODULE: ./node_modules/downshift/node_modules/react-is/index.js
  20651. var react_is = __webpack_require__("cD2C");
  20652. // CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.module.js
  20653. function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function index_module_e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return index_module_e(r.overflowY,n)||index_module_e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function index_module_r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}/* harmony default export */ var index_module = (function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?index_module_r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:index_module_r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?index_module_r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:index_module_r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C});
  20654. // CONCATENATED MODULE: ./node_modules/downshift/node_modules/tslib/tslib.es6.js
  20655. /*! *****************************************************************************
  20656. Copyright (c) Microsoft Corporation.
  20657. Permission to use, copy, modify, and/or distribute this software for any
  20658. purpose with or without fee is hereby granted.
  20659. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  20660. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  20661. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  20662. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  20663. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  20664. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20665. PERFORMANCE OF THIS SOFTWARE.
  20666. ***************************************************************************** */
  20667. /* global Reflect, Promise */
  20668. var extendStatics = function(d, b) {
  20669. extendStatics = Object.setPrototypeOf ||
  20670. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  20671. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  20672. return extendStatics(d, b);
  20673. };
  20674. function __extends(d, b) {
  20675. if (typeof b !== "function" && b !== null)
  20676. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  20677. extendStatics(d, b);
  20678. function __() { this.constructor = d; }
  20679. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  20680. }
  20681. var __assign = function() {
  20682. __assign = Object.assign || function __assign(t) {
  20683. for (var s, i = 1, n = arguments.length; i < n; i++) {
  20684. s = arguments[i];
  20685. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  20686. }
  20687. return t;
  20688. }
  20689. return __assign.apply(this, arguments);
  20690. }
  20691. function __rest(s, e) {
  20692. var t = {};
  20693. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  20694. t[p] = s[p];
  20695. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  20696. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  20697. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  20698. t[p[i]] = s[p[i]];
  20699. }
  20700. return t;
  20701. }
  20702. function __decorate(decorators, target, key, desc) {
  20703. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20704. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  20705. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  20706. return c > 3 && r && Object.defineProperty(target, key, r), r;
  20707. }
  20708. function __param(paramIndex, decorator) {
  20709. return function (target, key) { decorator(target, key, paramIndex); }
  20710. }
  20711. function __metadata(metadataKey, metadataValue) {
  20712. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  20713. }
  20714. function __awaiter(thisArg, _arguments, P, generator) {
  20715. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  20716. return new (P || (P = Promise))(function (resolve, reject) {
  20717. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  20718. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  20719. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  20720. step((generator = generator.apply(thisArg, _arguments || [])).next());
  20721. });
  20722. }
  20723. function __generator(thisArg, body) {
  20724. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  20725. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  20726. function verb(n) { return function (v) { return step([n, v]); }; }
  20727. function step(op) {
  20728. if (f) throw new TypeError("Generator is already executing.");
  20729. while (_) try {
  20730. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  20731. if (y = 0, t) op = [op[0] & 2, t.value];
  20732. switch (op[0]) {
  20733. case 0: case 1: t = op; break;
  20734. case 4: _.label++; return { value: op[1], done: false };
  20735. case 5: _.label++; y = op[1]; op = [0]; continue;
  20736. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  20737. default:
  20738. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  20739. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  20740. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  20741. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  20742. if (t[2]) _.ops.pop();
  20743. _.trys.pop(); continue;
  20744. }
  20745. op = body.call(thisArg, _);
  20746. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  20747. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  20748. }
  20749. }
  20750. var __createBinding = Object.create ? (function(o, m, k, k2) {
  20751. if (k2 === undefined) k2 = k;
  20752. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  20753. }) : (function(o, m, k, k2) {
  20754. if (k2 === undefined) k2 = k;
  20755. o[k2] = m[k];
  20756. });
  20757. function __exportStar(m, o) {
  20758. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  20759. }
  20760. function __values(o) {
  20761. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  20762. if (m) return m.call(o);
  20763. if (o && typeof o.length === "number") return {
  20764. next: function () {
  20765. if (o && i >= o.length) o = void 0;
  20766. return { value: o && o[i++], done: !o };
  20767. }
  20768. };
  20769. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  20770. }
  20771. function __read(o, n) {
  20772. var m = typeof Symbol === "function" && o[Symbol.iterator];
  20773. if (!m) return o;
  20774. var i = m.call(o), r, ar = [], e;
  20775. try {
  20776. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  20777. }
  20778. catch (error) { e = { error: error }; }
  20779. finally {
  20780. try {
  20781. if (r && !r.done && (m = i["return"])) m.call(i);
  20782. }
  20783. finally { if (e) throw e.error; }
  20784. }
  20785. return ar;
  20786. }
  20787. /** @deprecated */
  20788. function __spread() {
  20789. for (var ar = [], i = 0; i < arguments.length; i++)
  20790. ar = ar.concat(__read(arguments[i]));
  20791. return ar;
  20792. }
  20793. /** @deprecated */
  20794. function __spreadArrays() {
  20795. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  20796. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  20797. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  20798. r[k] = a[j];
  20799. return r;
  20800. }
  20801. function __spreadArray(to, from, pack) {
  20802. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  20803. if (ar || !(i in from)) {
  20804. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  20805. ar[i] = from[i];
  20806. }
  20807. }
  20808. return to.concat(ar || Array.prototype.slice.call(from));
  20809. }
  20810. function __await(v) {
  20811. return this instanceof __await ? (this.v = v, this) : new __await(v);
  20812. }
  20813. function __asyncGenerator(thisArg, _arguments, generator) {
  20814. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  20815. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  20816. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  20817. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  20818. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  20819. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  20820. function fulfill(value) { resume("next", value); }
  20821. function reject(value) { resume("throw", value); }
  20822. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  20823. }
  20824. function __asyncDelegator(o) {
  20825. var i, p;
  20826. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  20827. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  20828. }
  20829. function __asyncValues(o) {
  20830. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  20831. var m = o[Symbol.asyncIterator], i;
  20832. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  20833. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  20834. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  20835. }
  20836. function __makeTemplateObject(cooked, raw) {
  20837. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  20838. return cooked;
  20839. };
  20840. var __setModuleDefault = Object.create ? (function(o, v) {
  20841. Object.defineProperty(o, "default", { enumerable: true, value: v });
  20842. }) : function(o, v) {
  20843. o["default"] = v;
  20844. };
  20845. function __importStar(mod) {
  20846. if (mod && mod.__esModule) return mod;
  20847. var result = {};
  20848. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  20849. __setModuleDefault(result, mod);
  20850. return result;
  20851. }
  20852. function __importDefault(mod) {
  20853. return (mod && mod.__esModule) ? mod : { default: mod };
  20854. }
  20855. function __classPrivateFieldGet(receiver, state, kind, f) {
  20856. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  20857. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  20858. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  20859. }
  20860. function __classPrivateFieldSet(receiver, state, value, kind, f) {
  20861. if (kind === "m") throw new TypeError("Private method is not writable");
  20862. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  20863. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  20864. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  20865. }
  20866. // CONCATENATED MODULE: ./node_modules/downshift/dist/downshift.esm.js
  20867. var idCounter = 0;
  20868. /**
  20869. * Accepts a parameter and returns it if it's a function
  20870. * or a noop function if it's not. This allows us to
  20871. * accept a callback, but not worry about it if it's not
  20872. * passed.
  20873. * @param {Function} cb the callback
  20874. * @return {Function} a function
  20875. */
  20876. function cbToCb(cb) {
  20877. return typeof cb === 'function' ? cb : downshift_esm_noop;
  20878. }
  20879. function downshift_esm_noop() {}
  20880. /**
  20881. * Scroll node into view if necessary
  20882. * @param {HTMLElement} node the element that should scroll into view
  20883. * @param {HTMLElement} menuNode the menu element of the component
  20884. */
  20885. function downshift_esm_scrollIntoView(node, menuNode) {
  20886. if (!node) {
  20887. return;
  20888. }
  20889. var actions = index_module(node, {
  20890. boundary: menuNode,
  20891. block: 'nearest',
  20892. scrollMode: 'if-needed'
  20893. });
  20894. actions.forEach(function (_ref) {
  20895. var el = _ref.el,
  20896. top = _ref.top,
  20897. left = _ref.left;
  20898. el.scrollTop = top;
  20899. el.scrollLeft = left;
  20900. });
  20901. }
  20902. /**
  20903. * @param {HTMLElement} parent the parent node
  20904. * @param {HTMLElement} child the child node
  20905. * @param {Window} environment The window context where downshift renders.
  20906. * @return {Boolean} whether the parent is the child or the child is in the parent
  20907. */
  20908. function isOrContainsNode(parent, child, environment) {
  20909. var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);
  20910. return result;
  20911. }
  20912. /**
  20913. * Simple debounce implementation. Will call the given
  20914. * function once after the time given has passed since
  20915. * it was last called.
  20916. * @param {Function} fn the function to call after the time
  20917. * @param {Number} time the time to wait
  20918. * @return {Function} the debounced function
  20919. */
  20920. function debounce(fn, time) {
  20921. var timeoutId;
  20922. function cancel() {
  20923. if (timeoutId) {
  20924. clearTimeout(timeoutId);
  20925. }
  20926. }
  20927. function wrapper() {
  20928. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  20929. args[_key] = arguments[_key];
  20930. }
  20931. cancel();
  20932. timeoutId = setTimeout(function () {
  20933. timeoutId = null;
  20934. fn.apply(void 0, args);
  20935. }, time);
  20936. }
  20937. wrapper.cancel = cancel;
  20938. return wrapper;
  20939. }
  20940. /**
  20941. * This is intended to be used to compose event handlers.
  20942. * They are executed in order until one of them sets
  20943. * `event.preventDownshiftDefault = true`.
  20944. * @param {...Function} fns the event handler functions
  20945. * @return {Function} the event handler to add to an element
  20946. */
  20947. function callAllEventHandlers() {
  20948. for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  20949. fns[_key2] = arguments[_key2];
  20950. }
  20951. return function (event) {
  20952. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  20953. args[_key3 - 1] = arguments[_key3];
  20954. }
  20955. return fns.some(function (fn) {
  20956. if (fn) {
  20957. fn.apply(void 0, [event].concat(args));
  20958. }
  20959. return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault;
  20960. });
  20961. };
  20962. }
  20963. function handleRefs() {
  20964. for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  20965. refs[_key4] = arguments[_key4];
  20966. }
  20967. return function (node) {
  20968. refs.forEach(function (ref) {
  20969. if (typeof ref === 'function') {
  20970. ref(node);
  20971. } else if (ref) {
  20972. ref.current = node;
  20973. }
  20974. });
  20975. };
  20976. }
  20977. /**
  20978. * This generates a unique ID for an instance of Downshift
  20979. * @return {String} the unique ID
  20980. */
  20981. function downshift_esm_generateId() {
  20982. return String(idCounter++);
  20983. }
  20984. /**
  20985. * Resets idCounter to 0. Used for SSR.
  20986. */
  20987. function resetIdCounter() {
  20988. idCounter = 0;
  20989. }
  20990. /**
  20991. * Default implementation for status message. Only added when menu is open.
  20992. * Will specify if there are results in the list, and if so, how many,
  20993. * and what keys are relevant.
  20994. *
  20995. * @param {Object} param the downshift state and other relevant properties
  20996. * @return {String} the a11y status message
  20997. */
  20998. function getA11yStatusMessage$1(_ref2) {
  20999. var isOpen = _ref2.isOpen,
  21000. resultCount = _ref2.resultCount,
  21001. previousResultCount = _ref2.previousResultCount;
  21002. if (!isOpen) {
  21003. return '';
  21004. }
  21005. if (!resultCount) {
  21006. return 'No results are available.';
  21007. }
  21008. if (resultCount !== previousResultCount) {
  21009. return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter key to select.";
  21010. }
  21011. return '';
  21012. }
  21013. /**
  21014. * Takes an argument and if it's an array, returns the first item in the array
  21015. * otherwise returns the argument
  21016. * @param {*} arg the maybe-array
  21017. * @param {*} defaultValue the value if arg is falsey not defined
  21018. * @return {*} the arg or it's first item
  21019. */
  21020. function unwrapArray(arg, defaultValue) {
  21021. arg = Array.isArray(arg) ?
  21022. /* istanbul ignore next (preact) */
  21023. arg[0] : arg;
  21024. if (!arg && defaultValue) {
  21025. return defaultValue;
  21026. } else {
  21027. return arg;
  21028. }
  21029. }
  21030. /**
  21031. * @param {Object} element (P)react element
  21032. * @return {Boolean} whether it's a DOM element
  21033. */
  21034. function isDOMElement(element) {
  21035. return typeof element.type === 'string';
  21036. }
  21037. /**
  21038. * @param {Object} element (P)react element
  21039. * @return {Object} the props
  21040. */
  21041. function getElementProps(element) {
  21042. return element.props;
  21043. }
  21044. /**
  21045. * Throws a helpful error message for required properties. Useful
  21046. * to be used as a default in destructuring or object params.
  21047. * @param {String} fnName the function name
  21048. * @param {String} propName the prop name
  21049. */
  21050. function requiredProp(fnName, propName) {
  21051. // eslint-disable-next-line no-console
  21052. console.error("The property \"" + propName + "\" is required in \"" + fnName + "\"");
  21053. }
  21054. var stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];
  21055. /**
  21056. * @param {Object} state the state object
  21057. * @return {Object} state that is relevant to downshift
  21058. */
  21059. function pickState(state) {
  21060. if (state === void 0) {
  21061. state = {};
  21062. }
  21063. var result = {};
  21064. stateKeys.forEach(function (k) {
  21065. if (state.hasOwnProperty(k)) {
  21066. result[k] = state[k];
  21067. }
  21068. });
  21069. return result;
  21070. }
  21071. /**
  21072. * This will perform a shallow merge of the given state object
  21073. * with the state coming from props
  21074. * (for the controlled component scenario)
  21075. * This is used in state updater functions so they're referencing
  21076. * the right state regardless of where it comes from.
  21077. *
  21078. * @param {Object} state The state of the component/hook.
  21079. * @param {Object} props The props that may contain controlled values.
  21080. * @returns {Object} The merged controlled state.
  21081. */
  21082. function getState(state, props) {
  21083. return Object.keys(state).reduce(function (prevState, key) {
  21084. prevState[key] = isControlledProp(props, key) ? props[key] : state[key];
  21085. return prevState;
  21086. }, {});
  21087. }
  21088. /**
  21089. * This determines whether a prop is a "controlled prop" meaning it is
  21090. * state which is controlled by the outside of this component rather
  21091. * than within this component.
  21092. *
  21093. * @param {Object} props The props that may contain controlled values.
  21094. * @param {String} key the key to check
  21095. * @return {Boolean} whether it is a controlled controlled prop
  21096. */
  21097. function isControlledProp(props, key) {
  21098. return props[key] !== undefined;
  21099. }
  21100. /**
  21101. * Normalizes the 'key' property of a KeyboardEvent in IE/Edge
  21102. * @param {Object} event a keyboardEvent object
  21103. * @return {String} keyboard key
  21104. */
  21105. function normalizeArrowKey(event) {
  21106. var key = event.key,
  21107. keyCode = event.keyCode;
  21108. /* istanbul ignore next (ie) */
  21109. if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {
  21110. return "Arrow" + key;
  21111. }
  21112. return key;
  21113. }
  21114. /**
  21115. * Simple check if the value passed is object literal
  21116. * @param {*} obj any things
  21117. * @return {Boolean} whether it's object literal
  21118. */
  21119. function isPlainObject(obj) {
  21120. return Object.prototype.toString.call(obj) === '[object Object]';
  21121. }
  21122. /**
  21123. * Returns the new index in the list, in a circular way. If next value is out of bonds from the total,
  21124. * it will wrap to either 0 or itemCount - 1.
  21125. *
  21126. * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
  21127. * @param {number} baseIndex The initial position to move from.
  21128. * @param {number} itemCount The total number of items.
  21129. * @param {Function} getItemNodeFromIndex Used to check if item is disabled.
  21130. * @param {boolean} circular Specify if navigation is circular. Default is true.
  21131. * @returns {number} The new index after the move.
  21132. */
  21133. function getNextWrappingIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {
  21134. if (circular === void 0) {
  21135. circular = true;
  21136. }
  21137. if (itemCount === 0) {
  21138. return -1;
  21139. }
  21140. var itemsLastIndex = itemCount - 1;
  21141. if (typeof baseIndex !== 'number' || baseIndex < 0 || baseIndex >= itemCount) {
  21142. baseIndex = moveAmount > 0 ? -1 : itemsLastIndex + 1;
  21143. }
  21144. var newIndex = baseIndex + moveAmount;
  21145. if (newIndex < 0) {
  21146. newIndex = circular ? itemsLastIndex : 0;
  21147. } else if (newIndex > itemsLastIndex) {
  21148. newIndex = circular ? 0 : itemsLastIndex;
  21149. }
  21150. var nonDisabledNewIndex = getNextNonDisabledIndex(moveAmount, newIndex, itemCount, getItemNodeFromIndex, circular);
  21151. if (nonDisabledNewIndex === -1) {
  21152. return baseIndex >= itemCount ? -1 : baseIndex;
  21153. }
  21154. return nonDisabledNewIndex;
  21155. }
  21156. /**
  21157. * Returns the next index in the list of an item that is not disabled.
  21158. *
  21159. * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.
  21160. * @param {number} baseIndex The initial position to move from.
  21161. * @param {number} itemCount The total number of items.
  21162. * @param {Function} getItemNodeFromIndex Used to check if item is disabled.
  21163. * @param {boolean} circular Specify if navigation is circular. Default is true.
  21164. * @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.
  21165. */
  21166. function getNextNonDisabledIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {
  21167. var currentElementNode = getItemNodeFromIndex(baseIndex);
  21168. if (!currentElementNode || !currentElementNode.hasAttribute('disabled')) {
  21169. return baseIndex;
  21170. }
  21171. if (moveAmount > 0) {
  21172. for (var index = baseIndex + 1; index < itemCount; index++) {
  21173. if (!getItemNodeFromIndex(index).hasAttribute('disabled')) {
  21174. return index;
  21175. }
  21176. }
  21177. } else {
  21178. for (var _index = baseIndex - 1; _index >= 0; _index--) {
  21179. if (!getItemNodeFromIndex(_index).hasAttribute('disabled')) {
  21180. return _index;
  21181. }
  21182. }
  21183. }
  21184. if (circular) {
  21185. return moveAmount > 0 ? getNextNonDisabledIndex(1, 0, itemCount, getItemNodeFromIndex, false) : getNextNonDisabledIndex(-1, itemCount - 1, itemCount, getItemNodeFromIndex, false);
  21186. }
  21187. return -1;
  21188. }
  21189. /**
  21190. * Checks if event target is within the downshift elements.
  21191. *
  21192. * @param {EventTarget} target Target to check.
  21193. * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).
  21194. * @param {Window} environment The window context where downshift renders.
  21195. * @param {boolean} checkActiveElement Whether to also check activeElement.
  21196. *
  21197. * @returns {boolean} Whether or not the target is within downshift elements.
  21198. */
  21199. function targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {
  21200. if (checkActiveElement === void 0) {
  21201. checkActiveElement = true;
  21202. }
  21203. return downshiftElements.some(function (contextNode) {
  21204. return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));
  21205. });
  21206. } // eslint-disable-next-line import/no-mutable-exports
  21207. var validateControlledUnchanged = downshift_esm_noop;
  21208. /* istanbul ignore next */
  21209. if (false) {}
  21210. var cleanupStatus = debounce(function (documentProp) {
  21211. getStatusDiv(documentProp).textContent = '';
  21212. }, 500);
  21213. /**
  21214. * @param {String} status the status message
  21215. * @param {Object} documentProp document passed by the user.
  21216. */
  21217. function setStatus(status, documentProp) {
  21218. var div = getStatusDiv(documentProp);
  21219. if (!status) {
  21220. return;
  21221. }
  21222. div.textContent = status;
  21223. cleanupStatus(documentProp);
  21224. }
  21225. /**
  21226. * Get the status node or create it if it does not already exist.
  21227. * @param {Object} documentProp document passed by the user.
  21228. * @return {HTMLElement} the status node.
  21229. */
  21230. function getStatusDiv(documentProp) {
  21231. if (documentProp === void 0) {
  21232. documentProp = document;
  21233. }
  21234. var statusDiv = documentProp.getElementById('a11y-status-message');
  21235. if (statusDiv) {
  21236. return statusDiv;
  21237. }
  21238. statusDiv = documentProp.createElement('div');
  21239. statusDiv.setAttribute('id', 'a11y-status-message');
  21240. statusDiv.setAttribute('role', 'status');
  21241. statusDiv.setAttribute('aria-live', 'polite');
  21242. statusDiv.setAttribute('aria-relevant', 'additions text');
  21243. Object.assign(statusDiv.style, {
  21244. border: '0',
  21245. clip: 'rect(0 0 0 0)',
  21246. height: '1px',
  21247. margin: '-1px',
  21248. overflow: 'hidden',
  21249. padding: '0',
  21250. position: 'absolute',
  21251. width: '1px'
  21252. });
  21253. documentProp.body.appendChild(statusDiv);
  21254. return statusDiv;
  21255. }
  21256. var unknown = false ? undefined : 0;
  21257. var mouseUp = false ? undefined : 1;
  21258. var itemMouseEnter = false ? undefined : 2;
  21259. var keyDownArrowUp = false ? undefined : 3;
  21260. var keyDownArrowDown = false ? undefined : 4;
  21261. var keyDownEscape = false ? undefined : 5;
  21262. var keyDownEnter = false ? undefined : 6;
  21263. var keyDownHome = false ? undefined : 7;
  21264. var keyDownEnd = false ? undefined : 8;
  21265. var clickItem = false ? undefined : 9;
  21266. var blurInput = false ? undefined : 10;
  21267. var changeInput = false ? undefined : 11;
  21268. var keyDownSpaceButton = false ? undefined : 12;
  21269. var clickButton = false ? undefined : 13;
  21270. var blurButton = false ? undefined : 14;
  21271. var controlledPropUpdatedSelectedItem = false ? undefined : 15;
  21272. var touchEnd = false ? undefined : 16;
  21273. var stateChangeTypes$3 = /*#__PURE__*/Object.freeze({
  21274. __proto__: null,
  21275. unknown: unknown,
  21276. mouseUp: mouseUp,
  21277. itemMouseEnter: itemMouseEnter,
  21278. keyDownArrowUp: keyDownArrowUp,
  21279. keyDownArrowDown: keyDownArrowDown,
  21280. keyDownEscape: keyDownEscape,
  21281. keyDownEnter: keyDownEnter,
  21282. keyDownHome: keyDownHome,
  21283. keyDownEnd: keyDownEnd,
  21284. clickItem: clickItem,
  21285. blurInput: blurInput,
  21286. changeInput: changeInput,
  21287. keyDownSpaceButton: keyDownSpaceButton,
  21288. clickButton: clickButton,
  21289. blurButton: blurButton,
  21290. controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
  21291. touchEnd: touchEnd
  21292. });
  21293. var _excluded$4 = ["refKey", "ref"],
  21294. _excluded2$3 = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"],
  21295. _excluded3$2 = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"],
  21296. _excluded4$1 = ["refKey", "ref"],
  21297. _excluded5$1 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"];
  21298. var downshift_esm_Downshift = /*#__PURE__*/function () {
  21299. var Downshift = /*#__PURE__*/function (_Component) {
  21300. inheritsLoose_inheritsLoose(Downshift, _Component);
  21301. function Downshift(_props) {
  21302. var _this;
  21303. _this = _Component.call(this, _props) || this; // fancy destructuring + defaults + aliases
  21304. // this basically says each value of state should either be set to
  21305. // the initial value or the default value if the initial value is not provided
  21306. _this.id = _this.props.id || "downshift-" + downshift_esm_generateId();
  21307. _this.menuId = _this.props.menuId || _this.id + "-menu";
  21308. _this.labelId = _this.props.labelId || _this.id + "-label";
  21309. _this.inputId = _this.props.inputId || _this.id + "-input";
  21310. _this.getItemId = _this.props.getItemId || function (index) {
  21311. return _this.id + "-item-" + index;
  21312. };
  21313. _this.input = null;
  21314. _this.items = [];
  21315. _this.itemCount = null;
  21316. _this.previousResultCount = 0;
  21317. _this.timeoutIds = [];
  21318. _this.internalSetTimeout = function (fn, time) {
  21319. var id = setTimeout(function () {
  21320. _this.timeoutIds = _this.timeoutIds.filter(function (i) {
  21321. return i !== id;
  21322. });
  21323. fn();
  21324. }, time);
  21325. _this.timeoutIds.push(id);
  21326. };
  21327. _this.setItemCount = function (count) {
  21328. _this.itemCount = count;
  21329. };
  21330. _this.unsetItemCount = function () {
  21331. _this.itemCount = null;
  21332. };
  21333. _this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {
  21334. if (highlightedIndex === void 0) {
  21335. highlightedIndex = _this.props.defaultHighlightedIndex;
  21336. }
  21337. if (otherStateToSet === void 0) {
  21338. otherStateToSet = {};
  21339. }
  21340. otherStateToSet = pickState(otherStateToSet);
  21341. _this.internalSetState(extends_extends({
  21342. highlightedIndex: highlightedIndex
  21343. }, otherStateToSet));
  21344. };
  21345. _this.clearSelection = function (cb) {
  21346. _this.internalSetState({
  21347. selectedItem: null,
  21348. inputValue: '',
  21349. highlightedIndex: _this.props.defaultHighlightedIndex,
  21350. isOpen: _this.props.defaultIsOpen
  21351. }, cb);
  21352. };
  21353. _this.selectItem = function (item, otherStateToSet, cb) {
  21354. otherStateToSet = pickState(otherStateToSet);
  21355. _this.internalSetState(extends_extends({
  21356. isOpen: _this.props.defaultIsOpen,
  21357. highlightedIndex: _this.props.defaultHighlightedIndex,
  21358. selectedItem: item,
  21359. inputValue: _this.props.itemToString(item)
  21360. }, otherStateToSet), cb);
  21361. };
  21362. _this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) {
  21363. var item = _this.items[itemIndex];
  21364. if (item == null) {
  21365. return;
  21366. }
  21367. _this.selectItem(item, otherStateToSet, cb);
  21368. };
  21369. _this.selectHighlightedItem = function (otherStateToSet, cb) {
  21370. return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);
  21371. };
  21372. _this.internalSetState = function (stateToSet, cb) {
  21373. var isItemSelected, onChangeArg;
  21374. var onStateChangeArg = {};
  21375. var isStateToSetFunction = typeof stateToSet === 'function'; // we want to call `onInputValueChange` before the `setState` call
  21376. // so someone controlling the `inputValue` state gets notified of
  21377. // the input change as soon as possible. This avoids issues with
  21378. // preserving the cursor position.
  21379. // See https://github.com/downshift-js/downshift/issues/217 for more info.
  21380. if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {
  21381. _this.props.onInputValueChange(stateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), stateToSet));
  21382. }
  21383. return _this.setState(function (state) {
  21384. state = _this.getState(state);
  21385. var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; // Your own function that could modify the state that will be set.
  21386. newStateToSet = _this.props.stateReducer(state, newStateToSet); // checks if an item is selected, regardless of if it's different from
  21387. // what was selected before
  21388. // used to determine if onSelect and onChange callbacks should be called
  21389. isItemSelected = newStateToSet.hasOwnProperty('selectedItem'); // this keeps track of the object we want to call with setState
  21390. var nextState = {}; // this is just used to tell whether the state changed
  21391. var nextFullState = {}; // we need to call on change if the outside world is controlling any of our state
  21392. // and we're trying to update that state. OR if the selection has changed and we're
  21393. // trying to update the selection
  21394. if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {
  21395. onChangeArg = newStateToSet.selectedItem;
  21396. }
  21397. newStateToSet.type = newStateToSet.type || unknown;
  21398. Object.keys(newStateToSet).forEach(function (key) {
  21399. // onStateChangeArg should only have the state that is
  21400. // actually changing
  21401. if (state[key] !== newStateToSet[key]) {
  21402. onStateChangeArg[key] = newStateToSet[key];
  21403. } // the type is useful for the onStateChangeArg
  21404. // but we don't actually want to set it in internal state.
  21405. // this is an undocumented feature for now... Not all internalSetState
  21406. // calls support it and I'm not certain we want them to yet.
  21407. // But it enables users controlling the isOpen state to know when
  21408. // the isOpen state changes due to mouseup events which is quite handy.
  21409. if (key === 'type') {
  21410. return;
  21411. }
  21412. nextFullState[key] = newStateToSet[key]; // if it's coming from props, then we don't care to set it internally
  21413. if (!isControlledProp(_this.props, key)) {
  21414. nextState[key] = newStateToSet[key];
  21415. }
  21416. }); // if stateToSet is a function, then we weren't able to call onInputValueChange
  21417. // earlier, so we'll call it now that we know what the inputValue state will be.
  21418. if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {
  21419. _this.props.onInputValueChange(newStateToSet.inputValue, extends_extends({}, _this.getStateAndHelpers(), newStateToSet));
  21420. }
  21421. return nextState;
  21422. }, function () {
  21423. // call the provided callback if it's a function
  21424. cbToCb(cb)(); // only call the onStateChange and onChange callbacks if
  21425. // we have relevant information to pass them.
  21426. var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;
  21427. if (hasMoreStateThanType) {
  21428. _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers());
  21429. }
  21430. if (isItemSelected) {
  21431. _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers());
  21432. }
  21433. if (onChangeArg !== undefined) {
  21434. _this.props.onChange(onChangeArg, _this.getStateAndHelpers());
  21435. } // this is currently undocumented and therefore subject to change
  21436. // We'll try to not break it, but just be warned.
  21437. _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());
  21438. });
  21439. };
  21440. _this.rootRef = function (node) {
  21441. return _this._rootNode = node;
  21442. };
  21443. _this.getRootProps = function (_temp, _temp2) {
  21444. var _extends2;
  21445. var _ref = _temp === void 0 ? {} : _temp,
  21446. _ref$refKey = _ref.refKey,
  21447. refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
  21448. ref = _ref.ref,
  21449. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$4);
  21450. var _ref2 = _temp2 === void 0 ? {} : _temp2,
  21451. _ref2$suppressRefErro = _ref2.suppressRefError,
  21452. suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
  21453. // this is used in the render to know whether the user has called getRootProps.
  21454. // It uses that to know whether to apply the props automatically
  21455. _this.getRootProps.called = true;
  21456. _this.getRootProps.refKey = refKey;
  21457. _this.getRootProps.suppressRefError = suppressRefError;
  21458. var _this$getState = _this.getState(),
  21459. isOpen = _this$getState.isOpen;
  21460. return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : null, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);
  21461. };
  21462. _this.keyDownHandlers = {
  21463. ArrowDown: function ArrowDown(event) {
  21464. var _this2 = this;
  21465. event.preventDefault();
  21466. if (this.getState().isOpen) {
  21467. var amount = event.shiftKey ? 5 : 1;
  21468. this.moveHighlightedIndex(amount, {
  21469. type: keyDownArrowDown
  21470. });
  21471. } else {
  21472. this.internalSetState({
  21473. isOpen: true,
  21474. type: keyDownArrowDown
  21475. }, function () {
  21476. var itemCount = _this2.getItemCount();
  21477. if (itemCount > 0) {
  21478. var _this2$getState = _this2.getState(),
  21479. highlightedIndex = _this2$getState.highlightedIndex;
  21480. var nextHighlightedIndex = getNextWrappingIndex(1, highlightedIndex, itemCount, function (index) {
  21481. return _this2.getItemNodeFromIndex(index);
  21482. });
  21483. _this2.setHighlightedIndex(nextHighlightedIndex, {
  21484. type: keyDownArrowDown
  21485. });
  21486. }
  21487. });
  21488. }
  21489. },
  21490. ArrowUp: function ArrowUp(event) {
  21491. var _this3 = this;
  21492. event.preventDefault();
  21493. if (this.getState().isOpen) {
  21494. var amount = event.shiftKey ? -5 : -1;
  21495. this.moveHighlightedIndex(amount, {
  21496. type: keyDownArrowUp
  21497. });
  21498. } else {
  21499. this.internalSetState({
  21500. isOpen: true,
  21501. type: keyDownArrowUp
  21502. }, function () {
  21503. var itemCount = _this3.getItemCount();
  21504. if (itemCount > 0) {
  21505. var _this3$getState = _this3.getState(),
  21506. highlightedIndex = _this3$getState.highlightedIndex;
  21507. var nextHighlightedIndex = getNextWrappingIndex(-1, highlightedIndex, itemCount, function (index) {
  21508. return _this3.getItemNodeFromIndex(index);
  21509. });
  21510. _this3.setHighlightedIndex(nextHighlightedIndex, {
  21511. type: keyDownArrowUp
  21512. });
  21513. }
  21514. });
  21515. }
  21516. },
  21517. Enter: function Enter(event) {
  21518. if (event.which === 229) {
  21519. return;
  21520. }
  21521. var _this$getState2 = this.getState(),
  21522. isOpen = _this$getState2.isOpen,
  21523. highlightedIndex = _this$getState2.highlightedIndex;
  21524. if (isOpen && highlightedIndex != null) {
  21525. event.preventDefault();
  21526. var item = this.items[highlightedIndex];
  21527. var itemNode = this.getItemNodeFromIndex(highlightedIndex);
  21528. if (item == null || itemNode && itemNode.hasAttribute('disabled')) {
  21529. return;
  21530. }
  21531. this.selectHighlightedItem({
  21532. type: keyDownEnter
  21533. });
  21534. }
  21535. },
  21536. Escape: function Escape(event) {
  21537. event.preventDefault();
  21538. this.reset(extends_extends({
  21539. type: keyDownEscape
  21540. }, !this.state.isOpen && {
  21541. selectedItem: null,
  21542. inputValue: ''
  21543. }));
  21544. }
  21545. };
  21546. _this.buttonKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, {
  21547. ' ': function _(event) {
  21548. event.preventDefault();
  21549. this.toggleMenu({
  21550. type: keyDownSpaceButton
  21551. });
  21552. }
  21553. });
  21554. _this.inputKeyDownHandlers = extends_extends({}, _this.keyDownHandlers, {
  21555. Home: function Home(event) {
  21556. var _this4 = this;
  21557. var _this$getState3 = this.getState(),
  21558. isOpen = _this$getState3.isOpen;
  21559. if (!isOpen) {
  21560. return;
  21561. }
  21562. event.preventDefault();
  21563. var itemCount = this.getItemCount();
  21564. if (itemCount <= 0 || !isOpen) {
  21565. return;
  21566. } // get next non-disabled starting downwards from 0 if that's disabled.
  21567. var newHighlightedIndex = getNextNonDisabledIndex(1, 0, itemCount, function (index) {
  21568. return _this4.getItemNodeFromIndex(index);
  21569. }, false);
  21570. this.setHighlightedIndex(newHighlightedIndex, {
  21571. type: keyDownHome
  21572. });
  21573. },
  21574. End: function End(event) {
  21575. var _this5 = this;
  21576. var _this$getState4 = this.getState(),
  21577. isOpen = _this$getState4.isOpen;
  21578. if (!isOpen) {
  21579. return;
  21580. }
  21581. event.preventDefault();
  21582. var itemCount = this.getItemCount();
  21583. if (itemCount <= 0 || !isOpen) {
  21584. return;
  21585. } // get next non-disabled starting upwards from last index if that's disabled.
  21586. var newHighlightedIndex = getNextNonDisabledIndex(-1, itemCount - 1, itemCount, function (index) {
  21587. return _this5.getItemNodeFromIndex(index);
  21588. }, false);
  21589. this.setHighlightedIndex(newHighlightedIndex, {
  21590. type: keyDownEnd
  21591. });
  21592. }
  21593. });
  21594. _this.getToggleButtonProps = function (_temp3) {
  21595. var _ref3 = _temp3 === void 0 ? {} : _temp3,
  21596. onClick = _ref3.onClick;
  21597. _ref3.onPress;
  21598. var onKeyDown = _ref3.onKeyDown,
  21599. onKeyUp = _ref3.onKeyUp,
  21600. onBlur = _ref3.onBlur,
  21601. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$3);
  21602. var _this$getState5 = _this.getState(),
  21603. isOpen = _this$getState5.isOpen;
  21604. var enabledEventHandlers = {
  21605. onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),
  21606. onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),
  21607. onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),
  21608. onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)
  21609. };
  21610. var eventHandlers = rest.disabled ? {} : enabledEventHandlers;
  21611. return extends_extends({
  21612. type: 'button',
  21613. role: 'button',
  21614. 'aria-label': isOpen ? 'close menu' : 'open menu',
  21615. 'aria-haspopup': true,
  21616. 'data-toggle': true
  21617. }, eventHandlers, rest);
  21618. };
  21619. _this.buttonHandleKeyUp = function (event) {
  21620. // Prevent click event from emitting in Firefox
  21621. event.preventDefault();
  21622. };
  21623. _this.buttonHandleKeyDown = function (event) {
  21624. var key = normalizeArrowKey(event);
  21625. if (_this.buttonKeyDownHandlers[key]) {
  21626. _this.buttonKeyDownHandlers[key].call(assertThisInitialized_assertThisInitialized(_this), event);
  21627. }
  21628. };
  21629. _this.buttonHandleClick = function (event) {
  21630. event.preventDefault(); // handle odd case for Safari and Firefox which
  21631. // don't give the button the focus properly.
  21632. /* istanbul ignore if (can't reasonably test this) */
  21633. if (_this.props.environment.document.activeElement === _this.props.environment.document.body) {
  21634. event.target.focus();
  21635. } // to simplify testing components that use downshift, we'll not wrap this in a setTimeout
  21636. // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated
  21637. // when building for production and should therefore have no impact on production code.
  21638. if (false) {} else {
  21639. // Ensure that toggle of menu occurs after the potential blur event in iOS
  21640. _this.internalSetTimeout(function () {
  21641. return _this.toggleMenu({
  21642. type: clickButton
  21643. });
  21644. });
  21645. }
  21646. };
  21647. _this.buttonHandleBlur = function (event) {
  21648. var blurTarget = event.target; // Save blur target for comparison with activeElement later
  21649. // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element
  21650. _this.internalSetTimeout(function () {
  21651. if (!_this.isMouseDown && (_this.props.environment.document.activeElement == null || _this.props.environment.document.activeElement.id !== _this.inputId) && _this.props.environment.document.activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)
  21652. ) {
  21653. _this.reset({
  21654. type: blurButton
  21655. });
  21656. }
  21657. });
  21658. };
  21659. _this.getLabelProps = function (props) {
  21660. return extends_extends({
  21661. htmlFor: _this.inputId,
  21662. id: _this.labelId
  21663. }, props);
  21664. };
  21665. _this.getInputProps = function (_temp4) {
  21666. var _ref4 = _temp4 === void 0 ? {} : _temp4,
  21667. onKeyDown = _ref4.onKeyDown,
  21668. onBlur = _ref4.onBlur,
  21669. onChange = _ref4.onChange,
  21670. onInput = _ref4.onInput;
  21671. _ref4.onChangeText;
  21672. var rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref4, _excluded3$2);
  21673. var onChangeKey;
  21674. var eventHandlers = {};
  21675. /* istanbul ignore next (preact) */
  21676. {
  21677. onChangeKey = 'onChange';
  21678. }
  21679. var _this$getState6 = _this.getState(),
  21680. inputValue = _this$getState6.inputValue,
  21681. isOpen = _this$getState6.isOpen,
  21682. highlightedIndex = _this$getState6.highlightedIndex;
  21683. if (!rest.disabled) {
  21684. var _eventHandlers;
  21685. eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);
  21686. }
  21687. return extends_extends({
  21688. 'aria-autocomplete': 'list',
  21689. 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : null,
  21690. 'aria-controls': isOpen ? _this.menuId : null,
  21691. 'aria-labelledby': _this.labelId,
  21692. // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
  21693. // revert back since autocomplete="nope" is ignored on latest Chrome and Opera
  21694. autoComplete: 'off',
  21695. value: inputValue,
  21696. id: _this.inputId
  21697. }, eventHandlers, rest);
  21698. };
  21699. _this.inputHandleKeyDown = function (event) {
  21700. var key = normalizeArrowKey(event);
  21701. if (key && _this.inputKeyDownHandlers[key]) {
  21702. _this.inputKeyDownHandlers[key].call(assertThisInitialized_assertThisInitialized(_this), event);
  21703. }
  21704. };
  21705. _this.inputHandleChange = function (event) {
  21706. _this.internalSetState({
  21707. type: changeInput,
  21708. isOpen: true,
  21709. inputValue: event.target.value,
  21710. highlightedIndex: _this.props.defaultHighlightedIndex
  21711. });
  21712. };
  21713. _this.inputHandleBlur = function () {
  21714. // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element
  21715. _this.internalSetTimeout(function () {
  21716. var downshiftButtonIsActive = _this.props.environment.document && !!_this.props.environment.document.activeElement && !!_this.props.environment.document.activeElement.dataset && _this.props.environment.document.activeElement.dataset.toggle && _this._rootNode && _this._rootNode.contains(_this.props.environment.document.activeElement);
  21717. if (!_this.isMouseDown && !downshiftButtonIsActive) {
  21718. _this.reset({
  21719. type: blurInput
  21720. });
  21721. }
  21722. });
  21723. };
  21724. _this.menuRef = function (node) {
  21725. _this._menuNode = node;
  21726. };
  21727. _this.getMenuProps = function (_temp5, _temp6) {
  21728. var _extends3;
  21729. var _ref5 = _temp5 === void 0 ? {} : _temp5,
  21730. _ref5$refKey = _ref5.refKey,
  21731. refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
  21732. ref = _ref5.ref,
  21733. props = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded4$1);
  21734. var _ref6 = _temp6 === void 0 ? {} : _temp6,
  21735. _ref6$suppressRefErro = _ref6.suppressRefError,
  21736. suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;
  21737. _this.getMenuProps.called = true;
  21738. _this.getMenuProps.refKey = refKey;
  21739. _this.getMenuProps.suppressRefError = suppressRefError;
  21740. return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? null : _this.labelId, _extends3.id = _this.menuId, _extends3), props);
  21741. };
  21742. _this.getItemProps = function (_temp7) {
  21743. var _enabledEventHandlers;
  21744. var _ref7 = _temp7 === void 0 ? {} : _temp7,
  21745. onMouseMove = _ref7.onMouseMove,
  21746. onMouseDown = _ref7.onMouseDown,
  21747. onClick = _ref7.onClick;
  21748. _ref7.onPress;
  21749. var index = _ref7.index,
  21750. _ref7$item = _ref7.item,
  21751. item = _ref7$item === void 0 ? true ?
  21752. /* istanbul ignore next */
  21753. undefined : undefined : _ref7$item,
  21754. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref7, _excluded5$1);
  21755. if (index === undefined) {
  21756. _this.items.push(item);
  21757. index = _this.items.indexOf(item);
  21758. } else {
  21759. _this.items[index] = item;
  21760. }
  21761. var onSelectKey = 'onClick';
  21762. var customClickHandler = onClick;
  21763. var enabledEventHandlers = (_enabledEventHandlers = {
  21764. // onMouseMove is used over onMouseEnter here. onMouseMove
  21765. // is only triggered on actual mouse movement while onMouseEnter
  21766. // can fire on DOM changes, interrupting keyboard navigation
  21767. onMouseMove: callAllEventHandlers(onMouseMove, function () {
  21768. if (index === _this.getState().highlightedIndex) {
  21769. return;
  21770. }
  21771. _this.setHighlightedIndex(index, {
  21772. type: itemMouseEnter
  21773. }); // We never want to manually scroll when changing state based
  21774. // on `onMouseMove` because we will be moving the element out
  21775. // from under the user which is currently scrolling/moving the
  21776. // cursor
  21777. _this.avoidScrolling = true;
  21778. _this.internalSetTimeout(function () {
  21779. return _this.avoidScrolling = false;
  21780. }, 250);
  21781. }),
  21782. onMouseDown: callAllEventHandlers(onMouseDown, function (event) {
  21783. // This prevents the activeElement from being changed
  21784. // to the item so it can remain with the current activeElement
  21785. // which is a more common use case.
  21786. event.preventDefault();
  21787. })
  21788. }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function () {
  21789. _this.selectItemAtIndex(index, {
  21790. type: clickItem
  21791. });
  21792. }), _enabledEventHandlers); // Passing down the onMouseDown handler to prevent redirect
  21793. // of the activeElement if clicking on disabled items
  21794. var eventHandlers = rest.disabled ? {
  21795. onMouseDown: enabledEventHandlers.onMouseDown
  21796. } : enabledEventHandlers;
  21797. return extends_extends({
  21798. id: _this.getItemId(index),
  21799. role: 'option',
  21800. 'aria-selected': _this.getState().highlightedIndex === index
  21801. }, eventHandlers, rest);
  21802. };
  21803. _this.clearItems = function () {
  21804. _this.items = [];
  21805. };
  21806. _this.reset = function (otherStateToSet, cb) {
  21807. if (otherStateToSet === void 0) {
  21808. otherStateToSet = {};
  21809. }
  21810. otherStateToSet = pickState(otherStateToSet);
  21811. _this.internalSetState(function (_ref8) {
  21812. var selectedItem = _ref8.selectedItem;
  21813. return extends_extends({
  21814. isOpen: _this.props.defaultIsOpen,
  21815. highlightedIndex: _this.props.defaultHighlightedIndex,
  21816. inputValue: _this.props.itemToString(selectedItem)
  21817. }, otherStateToSet);
  21818. }, cb);
  21819. };
  21820. _this.toggleMenu = function (otherStateToSet, cb) {
  21821. if (otherStateToSet === void 0) {
  21822. otherStateToSet = {};
  21823. }
  21824. otherStateToSet = pickState(otherStateToSet);
  21825. _this.internalSetState(function (_ref9) {
  21826. var isOpen = _ref9.isOpen;
  21827. return extends_extends({
  21828. isOpen: !isOpen
  21829. }, isOpen && {
  21830. highlightedIndex: _this.props.defaultHighlightedIndex
  21831. }, otherStateToSet);
  21832. }, function () {
  21833. var _this$getState7 = _this.getState(),
  21834. isOpen = _this$getState7.isOpen,
  21835. highlightedIndex = _this$getState7.highlightedIndex;
  21836. if (isOpen) {
  21837. if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {
  21838. _this.setHighlightedIndex(highlightedIndex, otherStateToSet);
  21839. }
  21840. }
  21841. cbToCb(cb)();
  21842. });
  21843. };
  21844. _this.openMenu = function (cb) {
  21845. _this.internalSetState({
  21846. isOpen: true
  21847. }, cb);
  21848. };
  21849. _this.closeMenu = function (cb) {
  21850. _this.internalSetState({
  21851. isOpen: false
  21852. }, cb);
  21853. };
  21854. _this.updateStatus = debounce(function () {
  21855. var state = _this.getState();
  21856. var item = _this.items[state.highlightedIndex];
  21857. var resultCount = _this.getItemCount();
  21858. var status = _this.props.getA11yStatusMessage(extends_extends({
  21859. itemToString: _this.props.itemToString,
  21860. previousResultCount: _this.previousResultCount,
  21861. resultCount: resultCount,
  21862. highlightedItem: item
  21863. }, state));
  21864. _this.previousResultCount = resultCount;
  21865. setStatus(status, _this.props.environment.document);
  21866. }, 200);
  21867. var _this$props = _this.props,
  21868. defaultHighlightedIndex = _this$props.defaultHighlightedIndex,
  21869. _this$props$initialHi = _this$props.initialHighlightedIndex,
  21870. _highlightedIndex = _this$props$initialHi === void 0 ? defaultHighlightedIndex : _this$props$initialHi,
  21871. defaultIsOpen = _this$props.defaultIsOpen,
  21872. _this$props$initialIs = _this$props.initialIsOpen,
  21873. _isOpen = _this$props$initialIs === void 0 ? defaultIsOpen : _this$props$initialIs,
  21874. _this$props$initialIn = _this$props.initialInputValue,
  21875. _inputValue = _this$props$initialIn === void 0 ? '' : _this$props$initialIn,
  21876. _this$props$initialSe = _this$props.initialSelectedItem,
  21877. _selectedItem = _this$props$initialSe === void 0 ? null : _this$props$initialSe;
  21878. var _state = _this.getState({
  21879. highlightedIndex: _highlightedIndex,
  21880. isOpen: _isOpen,
  21881. inputValue: _inputValue,
  21882. selectedItem: _selectedItem
  21883. });
  21884. if (_state.selectedItem != null && _this.props.initialInputValue === undefined) {
  21885. _state.inputValue = _this.props.itemToString(_state.selectedItem);
  21886. }
  21887. _this.state = _state;
  21888. return _this;
  21889. }
  21890. var _proto = Downshift.prototype;
  21891. /**
  21892. * Clear all running timeouts
  21893. */
  21894. _proto.internalClearTimeouts = function internalClearTimeouts() {
  21895. this.timeoutIds.forEach(function (id) {
  21896. clearTimeout(id);
  21897. });
  21898. this.timeoutIds = [];
  21899. }
  21900. /**
  21901. * Gets the state based on internal state or props
  21902. * If a state value is passed via props, then that
  21903. * is the value given, otherwise it's retrieved from
  21904. * stateToMerge
  21905. *
  21906. * @param {Object} stateToMerge defaults to this.state
  21907. * @return {Object} the state
  21908. */
  21909. ;
  21910. _proto.getState = function getState$1(stateToMerge) {
  21911. if (stateToMerge === void 0) {
  21912. stateToMerge = this.state;
  21913. }
  21914. return getState(stateToMerge, this.props);
  21915. };
  21916. _proto.getItemCount = function getItemCount() {
  21917. // things read better this way. They're in priority order:
  21918. // 1. `this.itemCount`
  21919. // 2. `this.props.itemCount`
  21920. // 3. `this.items.length`
  21921. var itemCount = this.items.length;
  21922. if (this.itemCount != null) {
  21923. itemCount = this.itemCount;
  21924. } else if (this.props.itemCount !== undefined) {
  21925. itemCount = this.props.itemCount;
  21926. }
  21927. return itemCount;
  21928. };
  21929. _proto.getItemNodeFromIndex = function getItemNodeFromIndex(index) {
  21930. return this.props.environment.document.getElementById(this.getItemId(index));
  21931. };
  21932. _proto.scrollHighlightedItemIntoView = function scrollHighlightedItemIntoView() {
  21933. /* istanbul ignore else (react-native) */
  21934. {
  21935. var node = this.getItemNodeFromIndex(this.getState().highlightedIndex);
  21936. this.props.scrollIntoView(node, this._menuNode);
  21937. }
  21938. };
  21939. _proto.moveHighlightedIndex = function moveHighlightedIndex(amount, otherStateToSet) {
  21940. var _this6 = this;
  21941. var itemCount = this.getItemCount();
  21942. var _this$getState8 = this.getState(),
  21943. highlightedIndex = _this$getState8.highlightedIndex;
  21944. if (itemCount > 0) {
  21945. var nextHighlightedIndex = getNextWrappingIndex(amount, highlightedIndex, itemCount, function (index) {
  21946. return _this6.getItemNodeFromIndex(index);
  21947. });
  21948. this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);
  21949. }
  21950. };
  21951. _proto.getStateAndHelpers = function getStateAndHelpers() {
  21952. var _this$getState9 = this.getState(),
  21953. highlightedIndex = _this$getState9.highlightedIndex,
  21954. inputValue = _this$getState9.inputValue,
  21955. selectedItem = _this$getState9.selectedItem,
  21956. isOpen = _this$getState9.isOpen;
  21957. var itemToString = this.props.itemToString;
  21958. var id = this.id;
  21959. var getRootProps = this.getRootProps,
  21960. getToggleButtonProps = this.getToggleButtonProps,
  21961. getLabelProps = this.getLabelProps,
  21962. getMenuProps = this.getMenuProps,
  21963. getInputProps = this.getInputProps,
  21964. getItemProps = this.getItemProps,
  21965. openMenu = this.openMenu,
  21966. closeMenu = this.closeMenu,
  21967. toggleMenu = this.toggleMenu,
  21968. selectItem = this.selectItem,
  21969. selectItemAtIndex = this.selectItemAtIndex,
  21970. selectHighlightedItem = this.selectHighlightedItem,
  21971. setHighlightedIndex = this.setHighlightedIndex,
  21972. clearSelection = this.clearSelection,
  21973. clearItems = this.clearItems,
  21974. reset = this.reset,
  21975. setItemCount = this.setItemCount,
  21976. unsetItemCount = this.unsetItemCount,
  21977. setState = this.internalSetState;
  21978. return {
  21979. // prop getters
  21980. getRootProps: getRootProps,
  21981. getToggleButtonProps: getToggleButtonProps,
  21982. getLabelProps: getLabelProps,
  21983. getMenuProps: getMenuProps,
  21984. getInputProps: getInputProps,
  21985. getItemProps: getItemProps,
  21986. // actions
  21987. reset: reset,
  21988. openMenu: openMenu,
  21989. closeMenu: closeMenu,
  21990. toggleMenu: toggleMenu,
  21991. selectItem: selectItem,
  21992. selectItemAtIndex: selectItemAtIndex,
  21993. selectHighlightedItem: selectHighlightedItem,
  21994. setHighlightedIndex: setHighlightedIndex,
  21995. clearSelection: clearSelection,
  21996. clearItems: clearItems,
  21997. setItemCount: setItemCount,
  21998. unsetItemCount: unsetItemCount,
  21999. setState: setState,
  22000. // props
  22001. itemToString: itemToString,
  22002. // derived
  22003. id: id,
  22004. // state
  22005. highlightedIndex: highlightedIndex,
  22006. inputValue: inputValue,
  22007. isOpen: isOpen,
  22008. selectedItem: selectedItem
  22009. };
  22010. } //////////////////////////// ROOT
  22011. ;
  22012. _proto.componentDidMount = function componentDidMount() {
  22013. var _this7 = this;
  22014. /* istanbul ignore if (react-native) */
  22015. if (false) {}
  22016. /* istanbul ignore if (react-native) */
  22017. {
  22018. // this.isMouseDown helps us track whether the mouse is currently held down.
  22019. // This is useful when the user clicks on an item in the list, but holds the mouse
  22020. // down long enough for the list to disappear (because the blur event fires on the input)
  22021. // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should
  22022. // trigger hiding the menu.
  22023. var onMouseDown = function onMouseDown() {
  22024. _this7.isMouseDown = true;
  22025. };
  22026. var onMouseUp = function onMouseUp(event) {
  22027. _this7.isMouseDown = false; // if the target element or the activeElement is within a downshift node
  22028. // then we don't want to reset downshift
  22029. var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment);
  22030. if (!contextWithinDownshift && _this7.getState().isOpen) {
  22031. _this7.reset({
  22032. type: mouseUp
  22033. }, function () {
  22034. return _this7.props.onOuterClick(_this7.getStateAndHelpers());
  22035. });
  22036. }
  22037. }; // Touching an element in iOS gives focus and hover states, but touching out of
  22038. // the element will remove hover, and persist the focus state, resulting in the
  22039. // blur event not being triggered.
  22040. // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
  22041. // If the user taps outside of Downshift, the component should be reset,
  22042. // but not if the user is swiping
  22043. var onTouchStart = function onTouchStart() {
  22044. _this7.isTouchMove = false;
  22045. };
  22046. var onTouchMove = function onTouchMove() {
  22047. _this7.isTouchMove = true;
  22048. };
  22049. var onTouchEnd = function onTouchEnd(event) {
  22050. var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment, false);
  22051. if (!_this7.isTouchMove && !contextWithinDownshift && _this7.getState().isOpen) {
  22052. _this7.reset({
  22053. type: touchEnd
  22054. }, function () {
  22055. return _this7.props.onOuterClick(_this7.getStateAndHelpers());
  22056. });
  22057. }
  22058. };
  22059. var environment = this.props.environment;
  22060. environment.addEventListener('mousedown', onMouseDown);
  22061. environment.addEventListener('mouseup', onMouseUp);
  22062. environment.addEventListener('touchstart', onTouchStart);
  22063. environment.addEventListener('touchmove', onTouchMove);
  22064. environment.addEventListener('touchend', onTouchEnd);
  22065. this.cleanup = function () {
  22066. _this7.internalClearTimeouts();
  22067. _this7.updateStatus.cancel();
  22068. environment.removeEventListener('mousedown', onMouseDown);
  22069. environment.removeEventListener('mouseup', onMouseUp);
  22070. environment.removeEventListener('touchstart', onTouchStart);
  22071. environment.removeEventListener('touchmove', onTouchMove);
  22072. environment.removeEventListener('touchend', onTouchEnd);
  22073. };
  22074. }
  22075. };
  22076. _proto.shouldScroll = function shouldScroll(prevState, prevProps) {
  22077. var _ref10 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
  22078. currentHighlightedIndex = _ref10.highlightedIndex;
  22079. var _ref11 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
  22080. prevHighlightedIndex = _ref11.highlightedIndex;
  22081. var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
  22082. var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
  22083. return scrollWhenOpen || scrollWhenNavigating;
  22084. };
  22085. _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
  22086. if (false) {}
  22087. if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {
  22088. this.internalSetState({
  22089. type: controlledPropUpdatedSelectedItem,
  22090. inputValue: this.props.itemToString(this.props.selectedItem)
  22091. });
  22092. }
  22093. if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {
  22094. this.scrollHighlightedItemIntoView();
  22095. }
  22096. /* istanbul ignore else (react-native) */
  22097. {
  22098. this.updateStatus();
  22099. }
  22100. };
  22101. _proto.componentWillUnmount = function componentWillUnmount() {
  22102. this.cleanup(); // avoids memory leak
  22103. };
  22104. _proto.render = function render() {
  22105. var children = unwrapArray(this.props.children, downshift_esm_noop); // because the items are rerendered every time we call the children
  22106. // we clear this out each render and it will be populated again as
  22107. // getItemProps is called.
  22108. this.clearItems(); // we reset this so we know whether the user calls getRootProps during
  22109. // this render. If they do then we don't need to do anything,
  22110. // if they don't then we need to clone the element they return and
  22111. // apply the props for them.
  22112. this.getRootProps.called = false;
  22113. this.getRootProps.refKey = undefined;
  22114. this.getRootProps.suppressRefError = undefined; // we do something similar for getMenuProps
  22115. this.getMenuProps.called = false;
  22116. this.getMenuProps.refKey = undefined;
  22117. this.getMenuProps.suppressRefError = undefined; // we do something similar for getLabelProps
  22118. this.getLabelProps.called = false; // and something similar for getInputProps
  22119. this.getInputProps.called = false;
  22120. var element = unwrapArray(children(this.getStateAndHelpers()));
  22121. if (!element) {
  22122. return null;
  22123. }
  22124. if (this.getRootProps.called || this.props.suppressRefError) {
  22125. if (false) {}
  22126. return element;
  22127. } else if (isDOMElement(element)) {
  22128. // they didn't apply the root props, but we can clone
  22129. // this and apply the props ourselves
  22130. return /*#__PURE__*/Object(external_React_["cloneElement"])(element, this.getRootProps(getElementProps(element)));
  22131. }
  22132. /* istanbul ignore else */
  22133. if (false) {}
  22134. /* istanbul ignore next */
  22135. return undefined;
  22136. };
  22137. return Downshift;
  22138. }(external_React_["Component"]);
  22139. Downshift.defaultProps = {
  22140. defaultHighlightedIndex: null,
  22141. defaultIsOpen: false,
  22142. getA11yStatusMessage: getA11yStatusMessage$1,
  22143. itemToString: function itemToString(i) {
  22144. if (i == null) {
  22145. return '';
  22146. }
  22147. if (false) {}
  22148. return String(i);
  22149. },
  22150. onStateChange: downshift_esm_noop,
  22151. onInputValueChange: downshift_esm_noop,
  22152. onUserAction: downshift_esm_noop,
  22153. onChange: downshift_esm_noop,
  22154. onSelect: downshift_esm_noop,
  22155. onOuterClick: downshift_esm_noop,
  22156. selectedItemChanged: function selectedItemChanged(prevItem, item) {
  22157. return prevItem !== item;
  22158. },
  22159. environment:
  22160. /* istanbul ignore next (ssr) */
  22161. typeof window === 'undefined' ? {} : window,
  22162. stateReducer: function stateReducer(state, stateToSet) {
  22163. return stateToSet;
  22164. },
  22165. suppressRefError: false,
  22166. scrollIntoView: downshift_esm_scrollIntoView
  22167. };
  22168. Downshift.stateChangeTypes = stateChangeTypes$3;
  22169. return Downshift;
  22170. }();
  22171. false ? undefined : void 0;
  22172. var Downshift$1 = downshift_esm_Downshift;
  22173. function validateGetMenuPropsCalledCorrectly(node, _ref12) {
  22174. var refKey = _ref12.refKey;
  22175. if (!node) {
  22176. // eslint-disable-next-line no-console
  22177. console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
  22178. }
  22179. }
  22180. function validateGetRootPropsCalledCorrectly(element, _ref13) {
  22181. var refKey = _ref13.refKey;
  22182. var refKeySpecified = refKey !== 'ref';
  22183. var isComposite = !isDOMElement(element);
  22184. if (isComposite && !refKeySpecified && !Object(react_is["isForwardRef"])(element)) {
  22185. // eslint-disable-next-line no-console
  22186. console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');
  22187. } else if (!isComposite && refKeySpecified) {
  22188. // eslint-disable-next-line no-console
  22189. console.error("downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"" + refKey + "\"");
  22190. }
  22191. if (!Object(react_is["isForwardRef"])(element) && !getElementProps(element)[refKey]) {
  22192. // eslint-disable-next-line no-console
  22193. console.error("downshift: You must apply the ref prop \"" + refKey + "\" from getRootProps onto your root element.");
  22194. }
  22195. }
  22196. var _excluded$3 = ["isInitialMount", "highlightedIndex", "items", "environment"];
  22197. var dropdownDefaultStateValues = {
  22198. highlightedIndex: -1,
  22199. isOpen: false,
  22200. selectedItem: null,
  22201. inputValue: ''
  22202. };
  22203. function callOnChangeProps(action, state, newState) {
  22204. var props = action.props,
  22205. type = action.type;
  22206. var changes = {};
  22207. Object.keys(state).forEach(function (key) {
  22208. invokeOnChangeHandler(key, action, state, newState);
  22209. if (newState[key] !== state[key]) {
  22210. changes[key] = newState[key];
  22211. }
  22212. });
  22213. if (props.onStateChange && Object.keys(changes).length) {
  22214. props.onStateChange(extends_extends({
  22215. type: type
  22216. }, changes));
  22217. }
  22218. }
  22219. function invokeOnChangeHandler(key, action, state, newState) {
  22220. var props = action.props,
  22221. type = action.type;
  22222. var handler = "on" + capitalizeString(key) + "Change";
  22223. if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {
  22224. props[handler](extends_extends({
  22225. type: type
  22226. }, newState));
  22227. }
  22228. }
  22229. /**
  22230. * Default state reducer that returns the changes.
  22231. *
  22232. * @param {Object} s state.
  22233. * @param {Object} a action with changes.
  22234. * @returns {Object} changes.
  22235. */
  22236. function downshift_esm_stateReducer(s, a) {
  22237. return a.changes;
  22238. }
  22239. /**
  22240. * Returns a message to be added to aria-live region when item is selected.
  22241. *
  22242. * @param {Object} selectionParameters Parameters required to build the message.
  22243. * @returns {string} The a11y message.
  22244. */
  22245. function downshift_esm_getA11ySelectionMessage(selectionParameters) {
  22246. var selectedItem = selectionParameters.selectedItem,
  22247. itemToStringLocal = selectionParameters.itemToString;
  22248. return selectedItem ? itemToStringLocal(selectedItem) + " has been selected." : '';
  22249. }
  22250. /**
  22251. * Debounced call for updating the a11y message.
  22252. */
  22253. var updateA11yStatus = debounce(function (getA11yMessage, document) {
  22254. setStatus(getA11yMessage(), document);
  22255. }, 200); // istanbul ignore next
  22256. var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? external_React_["useLayoutEffect"] : external_React_["useEffect"];
  22257. function useElementIds(_ref) {
  22258. var _ref$id = _ref.id,
  22259. id = _ref$id === void 0 ? "downshift-" + downshift_esm_generateId() : _ref$id,
  22260. labelId = _ref.labelId,
  22261. menuId = _ref.menuId,
  22262. getItemId = _ref.getItemId,
  22263. toggleButtonId = _ref.toggleButtonId,
  22264. inputId = _ref.inputId;
  22265. var elementIdsRef = Object(external_React_["useRef"])({
  22266. labelId: labelId || id + "-label",
  22267. menuId: menuId || id + "-menu",
  22268. getItemId: getItemId || function (index) {
  22269. return id + "-item-" + index;
  22270. },
  22271. toggleButtonId: toggleButtonId || id + "-toggle-button",
  22272. inputId: inputId || id + "-input"
  22273. });
  22274. return elementIdsRef.current;
  22275. }
  22276. function getItemIndex(index, item, items) {
  22277. if (index !== undefined) {
  22278. return index;
  22279. }
  22280. if (items.length === 0) {
  22281. return -1;
  22282. }
  22283. return items.indexOf(item);
  22284. }
  22285. function downshift_esm_itemToString(item) {
  22286. return item ? String(item) : '';
  22287. }
  22288. function isAcceptedCharacterKey(key) {
  22289. return /^\S{1}$/.test(key);
  22290. }
  22291. function capitalizeString(string) {
  22292. return "" + string.slice(0, 1).toUpperCase() + string.slice(1);
  22293. }
  22294. function useLatestRef(val) {
  22295. var ref = Object(external_React_["useRef"])(val); // technically this is not "concurrent mode safe" because we're manipulating
  22296. // the value during render (so it's not idempotent). However, the places this
  22297. // hook is used is to support memoizing callbacks which will be called
  22298. // *during* render, so we need the latest values *during* render.
  22299. // If not for this, then we'd probably want to use useLayoutEffect instead.
  22300. ref.current = val;
  22301. return ref;
  22302. }
  22303. /**
  22304. * Computes the controlled state using a the previous state, props,
  22305. * two reducers, one from downshift and an optional one from the user.
  22306. * Also calls the onChange handlers for state values that have changed.
  22307. *
  22308. * @param {Function} reducer Reducer function from downshift.
  22309. * @param {Object} initialState Initial state of the hook.
  22310. * @param {Object} props The hook props.
  22311. * @returns {Array} An array with the state and an action dispatcher.
  22312. */
  22313. function useEnhancedReducer(reducer, initialState, props) {
  22314. var prevStateRef = Object(external_React_["useRef"])();
  22315. var actionRef = Object(external_React_["useRef"])();
  22316. var enhancedReducer = Object(external_React_["useCallback"])(function (state, action) {
  22317. actionRef.current = action;
  22318. state = getState(state, action.props);
  22319. var changes = reducer(state, action);
  22320. var newState = action.props.stateReducer(state, extends_extends({}, action, {
  22321. changes: changes
  22322. }));
  22323. return newState;
  22324. }, [reducer]);
  22325. var _useReducer = Object(external_React_["useReducer"])(enhancedReducer, initialState),
  22326. state = _useReducer[0],
  22327. dispatch = _useReducer[1];
  22328. var propsRef = useLatestRef(props);
  22329. var dispatchWithProps = Object(external_React_["useCallback"])(function (action) {
  22330. return dispatch(extends_extends({
  22331. props: propsRef.current
  22332. }, action));
  22333. }, [propsRef]);
  22334. var action = actionRef.current;
  22335. Object(external_React_["useEffect"])(function () {
  22336. if (action && prevStateRef.current && prevStateRef.current !== state) {
  22337. callOnChangeProps(action, getState(prevStateRef.current, action.props), state);
  22338. }
  22339. prevStateRef.current = state;
  22340. }, [state, props, action]);
  22341. return [state, dispatchWithProps];
  22342. }
  22343. /**
  22344. * Wraps the useEnhancedReducer and applies the controlled prop values before
  22345. * returning the new state.
  22346. *
  22347. * @param {Function} reducer Reducer function from downshift.
  22348. * @param {Object} initialState Initial state of the hook.
  22349. * @param {Object} props The hook props.
  22350. * @returns {Array} An array with the state and an action dispatcher.
  22351. */
  22352. function useControlledReducer$1(reducer, initialState, props) {
  22353. var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props),
  22354. state = _useEnhancedReducer[0],
  22355. dispatch = _useEnhancedReducer[1];
  22356. return [getState(state, props), dispatch];
  22357. }
  22358. var defaultProps$3 = {
  22359. itemToString: downshift_esm_itemToString,
  22360. stateReducer: downshift_esm_stateReducer,
  22361. getA11ySelectionMessage: downshift_esm_getA11ySelectionMessage,
  22362. scrollIntoView: downshift_esm_scrollIntoView,
  22363. circularNavigation: false,
  22364. environment:
  22365. /* istanbul ignore next (ssr) */
  22366. typeof window === 'undefined' ? {} : window
  22367. };
  22368. function getDefaultValue$1(props, propKey, defaultStateValues) {
  22369. if (defaultStateValues === void 0) {
  22370. defaultStateValues = dropdownDefaultStateValues;
  22371. }
  22372. var defaultPropKey = "default" + capitalizeString(propKey);
  22373. if (defaultPropKey in props) {
  22374. return props[defaultPropKey];
  22375. }
  22376. return defaultStateValues[propKey];
  22377. }
  22378. function getInitialValue$1(props, propKey, defaultStateValues) {
  22379. if (defaultStateValues === void 0) {
  22380. defaultStateValues = dropdownDefaultStateValues;
  22381. }
  22382. if (propKey in props) {
  22383. return props[propKey];
  22384. }
  22385. var initialPropKey = "initial" + capitalizeString(propKey);
  22386. if (initialPropKey in props) {
  22387. return props[initialPropKey];
  22388. }
  22389. return getDefaultValue$1(props, propKey, defaultStateValues);
  22390. }
  22391. function getInitialState$2(props) {
  22392. var selectedItem = getInitialValue$1(props, 'selectedItem');
  22393. var isOpen = getInitialValue$1(props, 'isOpen');
  22394. var highlightedIndex = getInitialValue$1(props, 'highlightedIndex');
  22395. var inputValue = getInitialValue$1(props, 'inputValue');
  22396. return {
  22397. highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,
  22398. isOpen: isOpen,
  22399. selectedItem: selectedItem,
  22400. inputValue: inputValue
  22401. };
  22402. }
  22403. function getHighlightedIndexOnOpen(props, state, offset, getItemNodeFromIndex) {
  22404. var items = props.items,
  22405. initialHighlightedIndex = props.initialHighlightedIndex,
  22406. defaultHighlightedIndex = props.defaultHighlightedIndex;
  22407. var selectedItem = state.selectedItem,
  22408. highlightedIndex = state.highlightedIndex;
  22409. if (items.length === 0) {
  22410. return -1;
  22411. } // initialHighlightedIndex will give value to highlightedIndex on initial state only.
  22412. if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex) {
  22413. return initialHighlightedIndex;
  22414. }
  22415. if (defaultHighlightedIndex !== undefined) {
  22416. return defaultHighlightedIndex;
  22417. }
  22418. if (selectedItem) {
  22419. if (offset === 0) {
  22420. return items.indexOf(selectedItem);
  22421. }
  22422. return getNextWrappingIndex(offset, items.indexOf(selectedItem), items.length, getItemNodeFromIndex, false);
  22423. }
  22424. if (offset === 0) {
  22425. return -1;
  22426. }
  22427. return offset < 0 ? items.length - 1 : 0;
  22428. }
  22429. /**
  22430. * Reuse the movement tracking of mouse and touch events.
  22431. *
  22432. * @param {boolean} isOpen Whether the dropdown is open or not.
  22433. * @param {Array<Object>} downshiftElementRefs Downshift element refs to track movement (toggleButton, menu etc.)
  22434. * @param {Object} environment Environment where component/hook exists.
  22435. * @param {Function} handleBlur Handler on blur from mouse or touch.
  22436. * @returns {Object} Ref containing whether mouseDown or touchMove event is happening
  22437. */
  22438. function useMouseAndTouchTracker(isOpen, downshiftElementRefs, environment, handleBlur) {
  22439. var mouseAndTouchTrackersRef = Object(external_React_["useRef"])({
  22440. isMouseDown: false,
  22441. isTouchMove: false
  22442. });
  22443. Object(external_React_["useEffect"])(function () {
  22444. // The same strategy for checking if a click occurred inside or outside downsift
  22445. // as in downshift.js.
  22446. var onMouseDown = function onMouseDown() {
  22447. mouseAndTouchTrackersRef.current.isMouseDown = true;
  22448. };
  22449. var onMouseUp = function onMouseUp(event) {
  22450. mouseAndTouchTrackersRef.current.isMouseDown = false;
  22451. if (isOpen && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) {
  22452. return ref.current;
  22453. }), environment)) {
  22454. handleBlur();
  22455. }
  22456. };
  22457. var onTouchStart = function onTouchStart() {
  22458. mouseAndTouchTrackersRef.current.isTouchMove = false;
  22459. };
  22460. var onTouchMove = function onTouchMove() {
  22461. mouseAndTouchTrackersRef.current.isTouchMove = true;
  22462. };
  22463. var onTouchEnd = function onTouchEnd(event) {
  22464. if (isOpen && !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) {
  22465. return ref.current;
  22466. }), environment, false)) {
  22467. handleBlur();
  22468. }
  22469. };
  22470. environment.addEventListener('mousedown', onMouseDown);
  22471. environment.addEventListener('mouseup', onMouseUp);
  22472. environment.addEventListener('touchstart', onTouchStart);
  22473. environment.addEventListener('touchmove', onTouchMove);
  22474. environment.addEventListener('touchend', onTouchEnd);
  22475. return function cleanup() {
  22476. environment.removeEventListener('mousedown', onMouseDown);
  22477. environment.removeEventListener('mouseup', onMouseUp);
  22478. environment.removeEventListener('touchstart', onTouchStart);
  22479. environment.removeEventListener('touchmove', onTouchMove);
  22480. environment.removeEventListener('touchend', onTouchEnd);
  22481. }; // eslint-disable-next-line react-hooks/exhaustive-deps
  22482. }, [isOpen, environment]);
  22483. return mouseAndTouchTrackersRef;
  22484. }
  22485. /* istanbul ignore next */
  22486. // eslint-disable-next-line import/no-mutable-exports
  22487. var useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {
  22488. return downshift_esm_noop;
  22489. };
  22490. /**
  22491. * Custom hook that checks if getter props are called correctly.
  22492. *
  22493. * @param {...any} propKeys Getter prop names to be handled.
  22494. * @returns {Function} Setter function called inside getter props to set call information.
  22495. */
  22496. /* istanbul ignore next */
  22497. if (false) {}
  22498. function useA11yMessageSetter(getA11yMessage, dependencyArray, _ref2) {
  22499. var isInitialMount = _ref2.isInitialMount,
  22500. highlightedIndex = _ref2.highlightedIndex,
  22501. items = _ref2.items,
  22502. environment = _ref2.environment,
  22503. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref2, _excluded$3);
  22504. // Sets a11y status message on changes in state.
  22505. Object(external_React_["useEffect"])(function () {
  22506. if (isInitialMount || false) {
  22507. return;
  22508. }
  22509. updateA11yStatus(function () {
  22510. return getA11yMessage(extends_extends({
  22511. highlightedIndex: highlightedIndex,
  22512. highlightedItem: items[highlightedIndex],
  22513. resultCount: items.length
  22514. }, rest));
  22515. }, environment.document); // eslint-disable-next-line react-hooks/exhaustive-deps
  22516. }, dependencyArray);
  22517. }
  22518. function useScrollIntoView(_ref3) {
  22519. var highlightedIndex = _ref3.highlightedIndex,
  22520. isOpen = _ref3.isOpen,
  22521. itemRefs = _ref3.itemRefs,
  22522. getItemNodeFromIndex = _ref3.getItemNodeFromIndex,
  22523. menuElement = _ref3.menuElement,
  22524. scrollIntoViewProp = _ref3.scrollIntoView;
  22525. // used not to scroll on highlight by mouse.
  22526. var shouldScrollRef = Object(external_React_["useRef"])(true); // Scroll on highlighted item if change comes from keyboard.
  22527. useIsomorphicLayoutEffect(function () {
  22528. if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) {
  22529. return;
  22530. }
  22531. if (shouldScrollRef.current === false) {
  22532. shouldScrollRef.current = true;
  22533. } else {
  22534. scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement);
  22535. } // eslint-disable-next-line react-hooks/exhaustive-deps
  22536. }, [highlightedIndex]);
  22537. return shouldScrollRef;
  22538. } // eslint-disable-next-line import/no-mutable-exports
  22539. var useControlPropsValidator = downshift_esm_noop;
  22540. /* istanbul ignore next */
  22541. if (false) {}
  22542. /* eslint-disable complexity */
  22543. function downshiftCommonReducer(state, action, stateChangeTypes) {
  22544. var type = action.type,
  22545. props = action.props;
  22546. var changes;
  22547. switch (type) {
  22548. case stateChangeTypes.ItemMouseMove:
  22549. changes = {
  22550. highlightedIndex: action.index
  22551. };
  22552. break;
  22553. case stateChangeTypes.MenuMouseLeave:
  22554. changes = {
  22555. highlightedIndex: -1
  22556. };
  22557. break;
  22558. case stateChangeTypes.ToggleButtonClick:
  22559. case stateChangeTypes.FunctionToggleMenu:
  22560. changes = {
  22561. isOpen: !state.isOpen,
  22562. highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)
  22563. };
  22564. break;
  22565. case stateChangeTypes.FunctionOpenMenu:
  22566. changes = {
  22567. isOpen: true,
  22568. highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)
  22569. };
  22570. break;
  22571. case stateChangeTypes.FunctionCloseMenu:
  22572. changes = {
  22573. isOpen: false
  22574. };
  22575. break;
  22576. case stateChangeTypes.FunctionSetHighlightedIndex:
  22577. changes = {
  22578. highlightedIndex: action.highlightedIndex
  22579. };
  22580. break;
  22581. case stateChangeTypes.FunctionSetInputValue:
  22582. changes = {
  22583. inputValue: action.inputValue
  22584. };
  22585. break;
  22586. case stateChangeTypes.FunctionReset:
  22587. changes = {
  22588. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),
  22589. isOpen: getDefaultValue$1(props, 'isOpen'),
  22590. selectedItem: getDefaultValue$1(props, 'selectedItem'),
  22591. inputValue: getDefaultValue$1(props, 'inputValue')
  22592. };
  22593. break;
  22594. default:
  22595. throw new Error('Reducer called without proper action type.');
  22596. }
  22597. return extends_extends({}, state, changes);
  22598. }
  22599. /* eslint-enable complexity */
  22600. function getItemIndexByCharacterKey(_a) {
  22601. var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, getItemNodeFromIndex = _a.getItemNodeFromIndex;
  22602. var lowerCasedKeysSoFar = keysSoFar.toLowerCase();
  22603. for (var index = 0; index < items.length; index++) {
  22604. var offsetIndex = (index + highlightedIndex + 1) % items.length;
  22605. var item = items[offsetIndex];
  22606. if (item !== undefined &&
  22607. itemToString(item)
  22608. .toLowerCase()
  22609. .startsWith(lowerCasedKeysSoFar)) {
  22610. var element = getItemNodeFromIndex(offsetIndex);
  22611. if (!(element === null || element === void 0 ? void 0 : element.hasAttribute('disabled'))) {
  22612. return offsetIndex;
  22613. }
  22614. }
  22615. }
  22616. return highlightedIndex;
  22617. }
  22618. var propTypes$2 = {
  22619. items: prop_types_default.a.array.isRequired,
  22620. itemToString: prop_types_default.a.func,
  22621. getA11yStatusMessage: prop_types_default.a.func,
  22622. getA11ySelectionMessage: prop_types_default.a.func,
  22623. circularNavigation: prop_types_default.a.bool,
  22624. highlightedIndex: prop_types_default.a.number,
  22625. defaultHighlightedIndex: prop_types_default.a.number,
  22626. initialHighlightedIndex: prop_types_default.a.number,
  22627. isOpen: prop_types_default.a.bool,
  22628. defaultIsOpen: prop_types_default.a.bool,
  22629. initialIsOpen: prop_types_default.a.bool,
  22630. selectedItem: prop_types_default.a.any,
  22631. initialSelectedItem: prop_types_default.a.any,
  22632. defaultSelectedItem: prop_types_default.a.any,
  22633. id: prop_types_default.a.string,
  22634. labelId: prop_types_default.a.string,
  22635. menuId: prop_types_default.a.string,
  22636. getItemId: prop_types_default.a.func,
  22637. toggleButtonId: prop_types_default.a.string,
  22638. stateReducer: prop_types_default.a.func,
  22639. onSelectedItemChange: prop_types_default.a.func,
  22640. onHighlightedIndexChange: prop_types_default.a.func,
  22641. onStateChange: prop_types_default.a.func,
  22642. onIsOpenChange: prop_types_default.a.func,
  22643. environment: prop_types_default.a.shape({
  22644. addEventListener: prop_types_default.a.func,
  22645. removeEventListener: prop_types_default.a.func,
  22646. document: prop_types_default.a.shape({
  22647. getElementById: prop_types_default.a.func,
  22648. activeElement: prop_types_default.a.any,
  22649. body: prop_types_default.a.any
  22650. })
  22651. })
  22652. };
  22653. /**
  22654. * Default implementation for status message. Only added when menu is open.
  22655. * Will specift if there are results in the list, and if so, how many,
  22656. * and what keys are relevant.
  22657. *
  22658. * @param {Object} param the downshift state and other relevant properties
  22659. * @return {String} the a11y status message
  22660. */
  22661. function downshift_esm_getA11yStatusMessage(_a) {
  22662. var isOpen = _a.isOpen, resultCount = _a.resultCount, previousResultCount = _a.previousResultCount;
  22663. if (!isOpen) {
  22664. return '';
  22665. }
  22666. if (!resultCount) {
  22667. return 'No results are available.';
  22668. }
  22669. if (resultCount !== previousResultCount) {
  22670. return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.";
  22671. }
  22672. return '';
  22673. }
  22674. var defaultProps$2 = __assign(__assign({}, defaultProps$3), { getA11yStatusMessage: downshift_esm_getA11yStatusMessage });
  22675. // eslint-disable-next-line import/no-mutable-exports
  22676. var validatePropTypes$2 = downshift_esm_noop;
  22677. /* istanbul ignore next */
  22678. if (false) {}
  22679. var MenuKeyDownArrowDown = false ? undefined : 0;
  22680. var MenuKeyDownArrowUp = false ? undefined : 1;
  22681. var MenuKeyDownEscape = false ? undefined : 2;
  22682. var MenuKeyDownHome = false ? undefined : 3;
  22683. var MenuKeyDownEnd = false ? undefined : 4;
  22684. var MenuKeyDownEnter = false ? undefined : 5;
  22685. var MenuKeyDownSpaceButton = false ? undefined : 6;
  22686. var MenuKeyDownCharacter = false ? undefined : 7;
  22687. var MenuBlur = false ? undefined : 8;
  22688. var MenuMouseLeave$1 = false ? undefined : 9;
  22689. var ItemMouseMove$1 = false ? undefined : 10;
  22690. var ItemClick$1 = false ? undefined : 11;
  22691. var ToggleButtonClick$1 = false ? undefined : 12;
  22692. var ToggleButtonKeyDownArrowDown = false ? undefined : 13;
  22693. var ToggleButtonKeyDownArrowUp = false ? undefined : 14;
  22694. var ToggleButtonKeyDownCharacter = false ? undefined : 15;
  22695. var FunctionToggleMenu$1 = false ? undefined : 16;
  22696. var FunctionOpenMenu$1 = false ? undefined : 17;
  22697. var FunctionCloseMenu$1 = false ? undefined : 18;
  22698. var FunctionSetHighlightedIndex$1 = false ? undefined : 19;
  22699. var FunctionSelectItem$1 = false ? undefined : 20;
  22700. var FunctionSetInputValue$1 = false ? undefined : 21;
  22701. var FunctionReset$2 = false ? undefined : 22;
  22702. var stateChangeTypes$2 = /*#__PURE__*/Object.freeze({
  22703. __proto__: null,
  22704. MenuKeyDownArrowDown: MenuKeyDownArrowDown,
  22705. MenuKeyDownArrowUp: MenuKeyDownArrowUp,
  22706. MenuKeyDownEscape: MenuKeyDownEscape,
  22707. MenuKeyDownHome: MenuKeyDownHome,
  22708. MenuKeyDownEnd: MenuKeyDownEnd,
  22709. MenuKeyDownEnter: MenuKeyDownEnter,
  22710. MenuKeyDownSpaceButton: MenuKeyDownSpaceButton,
  22711. MenuKeyDownCharacter: MenuKeyDownCharacter,
  22712. MenuBlur: MenuBlur,
  22713. MenuMouseLeave: MenuMouseLeave$1,
  22714. ItemMouseMove: ItemMouseMove$1,
  22715. ItemClick: ItemClick$1,
  22716. ToggleButtonClick: ToggleButtonClick$1,
  22717. ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,
  22718. ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,
  22719. ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,
  22720. FunctionToggleMenu: FunctionToggleMenu$1,
  22721. FunctionOpenMenu: FunctionOpenMenu$1,
  22722. FunctionCloseMenu: FunctionCloseMenu$1,
  22723. FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
  22724. FunctionSelectItem: FunctionSelectItem$1,
  22725. FunctionSetInputValue: FunctionSetInputValue$1,
  22726. FunctionReset: FunctionReset$2
  22727. });
  22728. /* eslint-disable complexity */
  22729. function downshiftSelectReducer(state, action) {
  22730. var type = action.type,
  22731. props = action.props,
  22732. shiftKey = action.shiftKey;
  22733. var changes;
  22734. switch (type) {
  22735. case ItemClick$1:
  22736. changes = {
  22737. isOpen: getDefaultValue$1(props, 'isOpen'),
  22738. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),
  22739. selectedItem: props.items[action.index]
  22740. };
  22741. break;
  22742. case ToggleButtonKeyDownCharacter:
  22743. {
  22744. var lowercasedKey = action.key;
  22745. var inputValue = "" + state.inputValue + lowercasedKey;
  22746. var itemIndex = getItemIndexByCharacterKey({
  22747. keysSoFar: inputValue,
  22748. highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,
  22749. items: props.items,
  22750. itemToString: props.itemToString,
  22751. getItemNodeFromIndex: action.getItemNodeFromIndex
  22752. });
  22753. changes = extends_extends({
  22754. inputValue: inputValue
  22755. }, itemIndex >= 0 && {
  22756. selectedItem: props.items[itemIndex]
  22757. });
  22758. }
  22759. break;
  22760. case ToggleButtonKeyDownArrowDown:
  22761. changes = {
  22762. highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),
  22763. isOpen: true
  22764. };
  22765. break;
  22766. case ToggleButtonKeyDownArrowUp:
  22767. changes = {
  22768. highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),
  22769. isOpen: true
  22770. };
  22771. break;
  22772. case MenuKeyDownEnter:
  22773. case MenuKeyDownSpaceButton:
  22774. changes = extends_extends({
  22775. isOpen: getDefaultValue$1(props, 'isOpen'),
  22776. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')
  22777. }, state.highlightedIndex >= 0 && {
  22778. selectedItem: props.items[state.highlightedIndex]
  22779. });
  22780. break;
  22781. case MenuKeyDownHome:
  22782. changes = {
  22783. highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)
  22784. };
  22785. break;
  22786. case MenuKeyDownEnd:
  22787. changes = {
  22788. highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)
  22789. };
  22790. break;
  22791. case MenuKeyDownEscape:
  22792. changes = {
  22793. isOpen: false,
  22794. highlightedIndex: -1
  22795. };
  22796. break;
  22797. case MenuBlur:
  22798. changes = {
  22799. isOpen: false,
  22800. highlightedIndex: -1
  22801. };
  22802. break;
  22803. case MenuKeyDownCharacter:
  22804. {
  22805. var _lowercasedKey = action.key;
  22806. var _inputValue = "" + state.inputValue + _lowercasedKey;
  22807. var highlightedIndex = getItemIndexByCharacterKey({
  22808. keysSoFar: _inputValue,
  22809. highlightedIndex: state.highlightedIndex,
  22810. items: props.items,
  22811. itemToString: props.itemToString,
  22812. getItemNodeFromIndex: action.getItemNodeFromIndex
  22813. });
  22814. changes = extends_extends({
  22815. inputValue: _inputValue
  22816. }, highlightedIndex >= 0 && {
  22817. highlightedIndex: highlightedIndex
  22818. });
  22819. }
  22820. break;
  22821. case MenuKeyDownArrowDown:
  22822. changes = {
  22823. highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)
  22824. };
  22825. break;
  22826. case MenuKeyDownArrowUp:
  22827. changes = {
  22828. highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)
  22829. };
  22830. break;
  22831. case FunctionSelectItem$1:
  22832. changes = {
  22833. selectedItem: action.selectedItem
  22834. };
  22835. break;
  22836. default:
  22837. return downshiftCommonReducer(state, action, stateChangeTypes$2);
  22838. }
  22839. return extends_extends({}, state, changes);
  22840. }
  22841. /* eslint-enable complexity */
  22842. var _excluded$2 = ["onMouseLeave", "refKey", "onKeyDown", "onBlur", "ref"],
  22843. _excluded2$2 = ["onClick", "onKeyDown", "refKey", "ref"],
  22844. _excluded3$1 = ["item", "index", "onMouseMove", "onClick", "refKey", "ref"];
  22845. useSelect.stateChangeTypes = stateChangeTypes$2;
  22846. function useSelect(userProps) {
  22847. if (userProps === void 0) {
  22848. userProps = {};
  22849. }
  22850. validatePropTypes$2(userProps, useSelect); // Props defaults and destructuring.
  22851. var props = extends_extends({}, defaultProps$2, userProps);
  22852. var items = props.items,
  22853. scrollIntoView = props.scrollIntoView,
  22854. environment = props.environment,
  22855. initialIsOpen = props.initialIsOpen,
  22856. defaultIsOpen = props.defaultIsOpen,
  22857. itemToString = props.itemToString,
  22858. getA11ySelectionMessage = props.getA11ySelectionMessage,
  22859. getA11yStatusMessage = props.getA11yStatusMessage; // Initial state depending on controlled props.
  22860. var initialState = getInitialState$2(props);
  22861. var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, initialState, props),
  22862. state = _useControlledReducer[0],
  22863. dispatch = _useControlledReducer[1];
  22864. var isOpen = state.isOpen,
  22865. highlightedIndex = state.highlightedIndex,
  22866. selectedItem = state.selectedItem,
  22867. inputValue = state.inputValue; // Element efs.
  22868. var toggleButtonRef = Object(external_React_["useRef"])(null);
  22869. var menuRef = Object(external_React_["useRef"])(null);
  22870. var itemRefs = Object(external_React_["useRef"])({}); // used not to trigger menu blur action in some scenarios.
  22871. var shouldBlurRef = Object(external_React_["useRef"])(true); // used to keep the inputValue clearTimeout object between renders.
  22872. var clearTimeoutRef = Object(external_React_["useRef"])(null); // prevent id re-generation between renders.
  22873. var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.
  22874. var previousResultCountRef = Object(external_React_["useRef"])();
  22875. var isInitialMountRef = Object(external_React_["useRef"])(true); // utility callback to get item element.
  22876. var latest = useLatestRef({
  22877. state: state,
  22878. props: props
  22879. }); // Some utils.
  22880. var getItemNodeFromIndex = Object(external_React_["useCallback"])(function (index) {
  22881. return itemRefs.current[elementIds.getItemId(index)];
  22882. }, [elementIds]); // Effects.
  22883. // Sets a11y status message on changes in state.
  22884. useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], extends_extends({
  22885. isInitialMount: isInitialMountRef.current,
  22886. previousResultCount: previousResultCountRef.current,
  22887. items: items,
  22888. environment: environment,
  22889. itemToString: itemToString
  22890. }, state)); // Sets a11y status message on changes in selectedItem.
  22891. useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], extends_extends({
  22892. isInitialMount: isInitialMountRef.current,
  22893. previousResultCount: previousResultCountRef.current,
  22894. items: items,
  22895. environment: environment,
  22896. itemToString: itemToString
  22897. }, state)); // Scroll on highlighted item if change comes from keyboard.
  22898. var shouldScrollRef = useScrollIntoView({
  22899. menuElement: menuRef.current,
  22900. highlightedIndex: highlightedIndex,
  22901. isOpen: isOpen,
  22902. itemRefs: itemRefs,
  22903. scrollIntoView: scrollIntoView,
  22904. getItemNodeFromIndex: getItemNodeFromIndex
  22905. }); // Sets cleanup for the keysSoFar callback, debounded after 500ms.
  22906. Object(external_React_["useEffect"])(function () {
  22907. // init the clean function here as we need access to dispatch.
  22908. clearTimeoutRef.current = debounce(function (outerDispatch) {
  22909. outerDispatch({
  22910. type: FunctionSetInputValue$1,
  22911. inputValue: ''
  22912. });
  22913. }, 500); // Cancel any pending debounced calls on mount
  22914. return function () {
  22915. clearTimeoutRef.current.cancel();
  22916. };
  22917. }, []); // Invokes the keysSoFar callback set up above.
  22918. Object(external_React_["useEffect"])(function () {
  22919. if (!inputValue) {
  22920. return;
  22921. }
  22922. clearTimeoutRef.current(dispatch);
  22923. }, [dispatch, inputValue]);
  22924. useControlPropsValidator({
  22925. isInitialMount: isInitialMountRef.current,
  22926. props: props,
  22927. state: state
  22928. });
  22929. /* Controls the focus on the menu or the toggle button. */
  22930. Object(external_React_["useEffect"])(function () {
  22931. // Don't focus menu on first render.
  22932. if (isInitialMountRef.current) {
  22933. // Unless it was initialised as open.
  22934. if ((initialIsOpen || defaultIsOpen || isOpen) && menuRef.current) {
  22935. menuRef.current.focus();
  22936. }
  22937. return;
  22938. } // Focus menu on open.
  22939. if (isOpen) {
  22940. // istanbul ignore else
  22941. if (menuRef.current) {
  22942. menuRef.current.focus();
  22943. }
  22944. return;
  22945. } // Focus toggleButton on close, but not if it was closed with (Shift+)Tab.
  22946. if (environment.document.activeElement === menuRef.current) {
  22947. // istanbul ignore else
  22948. if (toggleButtonRef.current) {
  22949. shouldBlurRef.current = false;
  22950. toggleButtonRef.current.focus();
  22951. }
  22952. } // eslint-disable-next-line react-hooks/exhaustive-deps
  22953. }, [isOpen]);
  22954. Object(external_React_["useEffect"])(function () {
  22955. if (isInitialMountRef.current) {
  22956. return;
  22957. }
  22958. previousResultCountRef.current = items.length;
  22959. }); // Add mouse/touch events to document.
  22960. var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [menuRef, toggleButtonRef], environment, function () {
  22961. dispatch({
  22962. type: MenuBlur
  22963. });
  22964. });
  22965. var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps'); // Make initial ref false.
  22966. Object(external_React_["useEffect"])(function () {
  22967. isInitialMountRef.current = false;
  22968. }, []); // Reset itemRefs on close.
  22969. Object(external_React_["useEffect"])(function () {
  22970. if (!isOpen) {
  22971. itemRefs.current = {};
  22972. }
  22973. }, [isOpen]); // Event handler functions.
  22974. var toggleButtonKeyDownHandlers = Object(external_React_["useMemo"])(function () {
  22975. return {
  22976. ArrowDown: function ArrowDown(event) {
  22977. event.preventDefault();
  22978. dispatch({
  22979. type: ToggleButtonKeyDownArrowDown,
  22980. getItemNodeFromIndex: getItemNodeFromIndex,
  22981. shiftKey: event.shiftKey
  22982. });
  22983. },
  22984. ArrowUp: function ArrowUp(event) {
  22985. event.preventDefault();
  22986. dispatch({
  22987. type: ToggleButtonKeyDownArrowUp,
  22988. getItemNodeFromIndex: getItemNodeFromIndex,
  22989. shiftKey: event.shiftKey
  22990. });
  22991. }
  22992. };
  22993. }, [dispatch, getItemNodeFromIndex]);
  22994. var menuKeyDownHandlers = Object(external_React_["useMemo"])(function () {
  22995. return {
  22996. ArrowDown: function ArrowDown(event) {
  22997. event.preventDefault();
  22998. dispatch({
  22999. type: MenuKeyDownArrowDown,
  23000. getItemNodeFromIndex: getItemNodeFromIndex,
  23001. shiftKey: event.shiftKey
  23002. });
  23003. },
  23004. ArrowUp: function ArrowUp(event) {
  23005. event.preventDefault();
  23006. dispatch({
  23007. type: MenuKeyDownArrowUp,
  23008. getItemNodeFromIndex: getItemNodeFromIndex,
  23009. shiftKey: event.shiftKey
  23010. });
  23011. },
  23012. Home: function Home(event) {
  23013. event.preventDefault();
  23014. dispatch({
  23015. type: MenuKeyDownHome,
  23016. getItemNodeFromIndex: getItemNodeFromIndex
  23017. });
  23018. },
  23019. End: function End(event) {
  23020. event.preventDefault();
  23021. dispatch({
  23022. type: MenuKeyDownEnd,
  23023. getItemNodeFromIndex: getItemNodeFromIndex
  23024. });
  23025. },
  23026. Escape: function Escape() {
  23027. dispatch({
  23028. type: MenuKeyDownEscape
  23029. });
  23030. },
  23031. Enter: function Enter(event) {
  23032. event.preventDefault();
  23033. dispatch({
  23034. type: MenuKeyDownEnter
  23035. });
  23036. },
  23037. ' ': function _(event) {
  23038. event.preventDefault();
  23039. dispatch({
  23040. type: MenuKeyDownSpaceButton
  23041. });
  23042. }
  23043. };
  23044. }, [dispatch, getItemNodeFromIndex]); // Action functions.
  23045. var toggleMenu = Object(external_React_["useCallback"])(function () {
  23046. dispatch({
  23047. type: FunctionToggleMenu$1
  23048. });
  23049. }, [dispatch]);
  23050. var closeMenu = Object(external_React_["useCallback"])(function () {
  23051. dispatch({
  23052. type: FunctionCloseMenu$1
  23053. });
  23054. }, [dispatch]);
  23055. var openMenu = Object(external_React_["useCallback"])(function () {
  23056. dispatch({
  23057. type: FunctionOpenMenu$1
  23058. });
  23059. }, [dispatch]);
  23060. var setHighlightedIndex = Object(external_React_["useCallback"])(function (newHighlightedIndex) {
  23061. dispatch({
  23062. type: FunctionSetHighlightedIndex$1,
  23063. highlightedIndex: newHighlightedIndex
  23064. });
  23065. }, [dispatch]);
  23066. var selectItem = Object(external_React_["useCallback"])(function (newSelectedItem) {
  23067. dispatch({
  23068. type: FunctionSelectItem$1,
  23069. selectedItem: newSelectedItem
  23070. });
  23071. }, [dispatch]);
  23072. var reset = Object(external_React_["useCallback"])(function () {
  23073. dispatch({
  23074. type: FunctionReset$2
  23075. });
  23076. }, [dispatch]);
  23077. var setInputValue = Object(external_React_["useCallback"])(function (newInputValue) {
  23078. dispatch({
  23079. type: FunctionSetInputValue$1,
  23080. inputValue: newInputValue
  23081. });
  23082. }, [dispatch]); // Getter functions.
  23083. var getLabelProps = Object(external_React_["useCallback"])(function (labelProps) {
  23084. return extends_extends({
  23085. id: elementIds.labelId,
  23086. htmlFor: elementIds.toggleButtonId
  23087. }, labelProps);
  23088. }, [elementIds]);
  23089. var getMenuProps = Object(external_React_["useCallback"])(function (_temp, _temp2) {
  23090. var _extends2;
  23091. var _ref = _temp === void 0 ? {} : _temp,
  23092. onMouseLeave = _ref.onMouseLeave,
  23093. _ref$refKey = _ref.refKey,
  23094. refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
  23095. onKeyDown = _ref.onKeyDown,
  23096. onBlur = _ref.onBlur,
  23097. ref = _ref.ref,
  23098. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$2);
  23099. var _ref2 = _temp2 === void 0 ? {} : _temp2,
  23100. _ref2$suppressRefErro = _ref2.suppressRefError,
  23101. suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
  23102. var latestState = latest.current.state;
  23103. var menuHandleKeyDown = function menuHandleKeyDown(event) {
  23104. var key = normalizeArrowKey(event);
  23105. if (key && menuKeyDownHandlers[key]) {
  23106. menuKeyDownHandlers[key](event);
  23107. } else if (isAcceptedCharacterKey(key)) {
  23108. dispatch({
  23109. type: MenuKeyDownCharacter,
  23110. key: key,
  23111. getItemNodeFromIndex: getItemNodeFromIndex
  23112. });
  23113. }
  23114. };
  23115. var menuHandleBlur = function menuHandleBlur() {
  23116. // if the blur was a result of selection, we don't trigger this action.
  23117. if (shouldBlurRef.current === false) {
  23118. shouldBlurRef.current = true;
  23119. return;
  23120. }
  23121. var shouldBlur = !mouseAndTouchTrackersRef.current.isMouseDown;
  23122. /* istanbul ignore else */
  23123. if (shouldBlur) {
  23124. dispatch({
  23125. type: MenuBlur
  23126. });
  23127. }
  23128. };
  23129. var menuHandleMouseLeave = function menuHandleMouseLeave() {
  23130. dispatch({
  23131. type: MenuMouseLeave$1
  23132. });
  23133. };
  23134. setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
  23135. return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
  23136. menuRef.current = menuNode;
  23137. }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.tabIndex = -1, _extends2), latestState.isOpen && latestState.highlightedIndex > -1 && {
  23138. 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)
  23139. }, {
  23140. onMouseLeave: callAllEventHandlers(onMouseLeave, menuHandleMouseLeave),
  23141. onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown),
  23142. onBlur: callAllEventHandlers(onBlur, menuHandleBlur)
  23143. }, rest);
  23144. }, [dispatch, latest, menuKeyDownHandlers, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);
  23145. var getToggleButtonProps = Object(external_React_["useCallback"])(function (_temp3, _temp4) {
  23146. var _extends3;
  23147. var _ref3 = _temp3 === void 0 ? {} : _temp3,
  23148. onClick = _ref3.onClick,
  23149. onKeyDown = _ref3.onKeyDown,
  23150. _ref3$refKey = _ref3.refKey,
  23151. refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,
  23152. ref = _ref3.ref,
  23153. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$2);
  23154. var _ref4 = _temp4 === void 0 ? {} : _temp4,
  23155. _ref4$suppressRefErro = _ref4.suppressRefError,
  23156. suppressRefError = _ref4$suppressRefErro === void 0 ? false : _ref4$suppressRefErro;
  23157. var toggleButtonHandleClick = function toggleButtonHandleClick() {
  23158. dispatch({
  23159. type: ToggleButtonClick$1
  23160. });
  23161. };
  23162. var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) {
  23163. var key = normalizeArrowKey(event);
  23164. if (key && toggleButtonKeyDownHandlers[key]) {
  23165. toggleButtonKeyDownHandlers[key](event);
  23166. } else if (isAcceptedCharacterKey(key)) {
  23167. dispatch({
  23168. type: ToggleButtonKeyDownCharacter,
  23169. key: key,
  23170. getItemNodeFromIndex: getItemNodeFromIndex
  23171. });
  23172. }
  23173. };
  23174. var toggleProps = extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {
  23175. toggleButtonRef.current = toggleButtonNode;
  23176. }), _extends3.id = elementIds.toggleButtonId, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-labelledby'] = elementIds.labelId + " " + elementIds.toggleButtonId, _extends3), rest);
  23177. if (!rest.disabled) {
  23178. toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);
  23179. toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);
  23180. }
  23181. setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);
  23182. return toggleProps;
  23183. }, [dispatch, latest, toggleButtonKeyDownHandlers, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);
  23184. var getItemProps = Object(external_React_["useCallback"])(function (_temp5) {
  23185. var _extends4;
  23186. var _ref5 = _temp5 === void 0 ? {} : _temp5,
  23187. item = _ref5.item,
  23188. index = _ref5.index,
  23189. onMouseMove = _ref5.onMouseMove,
  23190. onClick = _ref5.onClick,
  23191. _ref5$refKey = _ref5.refKey,
  23192. refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
  23193. ref = _ref5.ref,
  23194. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded3$1);
  23195. var _latest$current = latest.current,
  23196. latestState = _latest$current.state,
  23197. latestProps = _latest$current.props;
  23198. var itemHandleMouseMove = function itemHandleMouseMove() {
  23199. if (index === latestState.highlightedIndex) {
  23200. return;
  23201. }
  23202. shouldScrollRef.current = false;
  23203. dispatch({
  23204. type: ItemMouseMove$1,
  23205. index: index
  23206. });
  23207. };
  23208. var itemHandleClick = function itemHandleClick() {
  23209. dispatch({
  23210. type: ItemClick$1,
  23211. index: index
  23212. });
  23213. };
  23214. var itemIndex = getItemIndex(index, item, latestProps.items);
  23215. if (itemIndex < 0) {
  23216. throw new Error('Pass either item or item index in getItemProps!');
  23217. }
  23218. var itemProps = extends_extends((_extends4 = {
  23219. role: 'option',
  23220. 'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
  23221. id: elementIds.getItemId(itemIndex)
  23222. }, _extends4[refKey] = handleRefs(ref, function (itemNode) {
  23223. if (itemNode) {
  23224. itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
  23225. }
  23226. }), _extends4), rest);
  23227. if (!rest.disabled) {
  23228. itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
  23229. itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
  23230. }
  23231. return itemProps;
  23232. }, [dispatch, latest, shouldScrollRef, elementIds]);
  23233. return {
  23234. // prop getters.
  23235. getToggleButtonProps: getToggleButtonProps,
  23236. getLabelProps: getLabelProps,
  23237. getMenuProps: getMenuProps,
  23238. getItemProps: getItemProps,
  23239. // actions.
  23240. toggleMenu: toggleMenu,
  23241. openMenu: openMenu,
  23242. closeMenu: closeMenu,
  23243. setHighlightedIndex: setHighlightedIndex,
  23244. selectItem: selectItem,
  23245. reset: reset,
  23246. setInputValue: setInputValue,
  23247. // state.
  23248. highlightedIndex: highlightedIndex,
  23249. isOpen: isOpen,
  23250. selectedItem: selectedItem,
  23251. inputValue: inputValue
  23252. };
  23253. }
  23254. var InputKeyDownArrowDown = false ? undefined : 0;
  23255. var InputKeyDownArrowUp = false ? undefined : 1;
  23256. var InputKeyDownEscape = false ? undefined : 2;
  23257. var InputKeyDownHome = false ? undefined : 3;
  23258. var InputKeyDownEnd = false ? undefined : 4;
  23259. var InputKeyDownEnter = false ? undefined : 5;
  23260. var InputChange = false ? undefined : 6;
  23261. var InputBlur = false ? undefined : 7;
  23262. var MenuMouseLeave = false ? undefined : 8;
  23263. var ItemMouseMove = false ? undefined : 9;
  23264. var ItemClick = false ? undefined : 10;
  23265. var ToggleButtonClick = false ? undefined : 11;
  23266. var FunctionToggleMenu = false ? undefined : 12;
  23267. var FunctionOpenMenu = false ? undefined : 13;
  23268. var FunctionCloseMenu = false ? undefined : 14;
  23269. var FunctionSetHighlightedIndex = false ? undefined : 15;
  23270. var FunctionSelectItem = false ? undefined : 16;
  23271. var FunctionSetInputValue = false ? undefined : 17;
  23272. var FunctionReset$1 = false ? undefined : 18;
  23273. var ControlledPropUpdatedSelectedItem = false ? undefined : 19;
  23274. var stateChangeTypes$1 = /*#__PURE__*/Object.freeze({
  23275. __proto__: null,
  23276. InputKeyDownArrowDown: InputKeyDownArrowDown,
  23277. InputKeyDownArrowUp: InputKeyDownArrowUp,
  23278. InputKeyDownEscape: InputKeyDownEscape,
  23279. InputKeyDownHome: InputKeyDownHome,
  23280. InputKeyDownEnd: InputKeyDownEnd,
  23281. InputKeyDownEnter: InputKeyDownEnter,
  23282. InputChange: InputChange,
  23283. InputBlur: InputBlur,
  23284. MenuMouseLeave: MenuMouseLeave,
  23285. ItemMouseMove: ItemMouseMove,
  23286. ItemClick: ItemClick,
  23287. ToggleButtonClick: ToggleButtonClick,
  23288. FunctionToggleMenu: FunctionToggleMenu,
  23289. FunctionOpenMenu: FunctionOpenMenu,
  23290. FunctionCloseMenu: FunctionCloseMenu,
  23291. FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,
  23292. FunctionSelectItem: FunctionSelectItem,
  23293. FunctionSetInputValue: FunctionSetInputValue,
  23294. FunctionReset: FunctionReset$1,
  23295. ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem
  23296. });
  23297. function getInitialState$1(props) {
  23298. var initialState = getInitialState$2(props);
  23299. var selectedItem = initialState.selectedItem;
  23300. var inputValue = initialState.inputValue;
  23301. if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {
  23302. inputValue = props.itemToString(selectedItem);
  23303. }
  23304. return extends_extends({}, initialState, {
  23305. inputValue: inputValue
  23306. });
  23307. }
  23308. var propTypes$1 = {
  23309. items: prop_types_default.a.array.isRequired,
  23310. itemToString: prop_types_default.a.func,
  23311. getA11yStatusMessage: prop_types_default.a.func,
  23312. getA11ySelectionMessage: prop_types_default.a.func,
  23313. circularNavigation: prop_types_default.a.bool,
  23314. highlightedIndex: prop_types_default.a.number,
  23315. defaultHighlightedIndex: prop_types_default.a.number,
  23316. initialHighlightedIndex: prop_types_default.a.number,
  23317. isOpen: prop_types_default.a.bool,
  23318. defaultIsOpen: prop_types_default.a.bool,
  23319. initialIsOpen: prop_types_default.a.bool,
  23320. selectedItem: prop_types_default.a.any,
  23321. initialSelectedItem: prop_types_default.a.any,
  23322. defaultSelectedItem: prop_types_default.a.any,
  23323. inputValue: prop_types_default.a.string,
  23324. defaultInputValue: prop_types_default.a.string,
  23325. initialInputValue: prop_types_default.a.string,
  23326. id: prop_types_default.a.string,
  23327. labelId: prop_types_default.a.string,
  23328. menuId: prop_types_default.a.string,
  23329. getItemId: prop_types_default.a.func,
  23330. inputId: prop_types_default.a.string,
  23331. toggleButtonId: prop_types_default.a.string,
  23332. stateReducer: prop_types_default.a.func,
  23333. onSelectedItemChange: prop_types_default.a.func,
  23334. onHighlightedIndexChange: prop_types_default.a.func,
  23335. onStateChange: prop_types_default.a.func,
  23336. onIsOpenChange: prop_types_default.a.func,
  23337. onInputValueChange: prop_types_default.a.func,
  23338. environment: prop_types_default.a.shape({
  23339. addEventListener: prop_types_default.a.func,
  23340. removeEventListener: prop_types_default.a.func,
  23341. document: prop_types_default.a.shape({
  23342. getElementById: prop_types_default.a.func,
  23343. activeElement: prop_types_default.a.any,
  23344. body: prop_types_default.a.any
  23345. })
  23346. })
  23347. };
  23348. /**
  23349. * The useCombobox version of useControlledReducer, which also
  23350. * checks if the controlled prop selectedItem changed between
  23351. * renders. If so, it will also update inputValue with its
  23352. * string equivalent. It uses the common useEnhancedReducer to
  23353. * compute the rest of the state.
  23354. *
  23355. * @param {Function} reducer Reducer function from downshift.
  23356. * @param {Object} initialState Initial state of the hook.
  23357. * @param {Object} props The hook props.
  23358. * @returns {Array} An array with the state and an action dispatcher.
  23359. */
  23360. function useControlledReducer(reducer, initialState, props) {
  23361. var previousSelectedItemRef = Object(external_React_["useRef"])();
  23362. var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props),
  23363. state = _useEnhancedReducer[0],
  23364. dispatch = _useEnhancedReducer[1]; // ToDo: if needed, make same approach as selectedItemChanged from Downshift.
  23365. Object(external_React_["useEffect"])(function () {
  23366. if (isControlledProp(props, 'selectedItem')) {
  23367. if (previousSelectedItemRef.current !== props.selectedItem) {
  23368. dispatch({
  23369. type: ControlledPropUpdatedSelectedItem,
  23370. inputValue: props.itemToString(props.selectedItem)
  23371. });
  23372. }
  23373. previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;
  23374. }
  23375. });
  23376. return [getState(state, props), dispatch];
  23377. } // eslint-disable-next-line import/no-mutable-exports
  23378. var validatePropTypes$1 = downshift_esm_noop;
  23379. /* istanbul ignore next */
  23380. if (false) {}
  23381. var defaultProps$1 = extends_extends({}, defaultProps$3, {
  23382. getA11yStatusMessage: getA11yStatusMessage$1,
  23383. circularNavigation: true
  23384. });
  23385. /* eslint-disable complexity */
  23386. function downshiftUseComboboxReducer(state, action) {
  23387. var type = action.type,
  23388. props = action.props,
  23389. shiftKey = action.shiftKey;
  23390. var changes;
  23391. switch (type) {
  23392. case ItemClick:
  23393. changes = {
  23394. isOpen: getDefaultValue$1(props, 'isOpen'),
  23395. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),
  23396. selectedItem: props.items[action.index],
  23397. inputValue: props.itemToString(props.items[action.index])
  23398. };
  23399. break;
  23400. case InputKeyDownArrowDown:
  23401. if (state.isOpen) {
  23402. changes = {
  23403. highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)
  23404. };
  23405. } else {
  23406. changes = {
  23407. highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),
  23408. isOpen: props.items.length >= 0
  23409. };
  23410. }
  23411. break;
  23412. case InputKeyDownArrowUp:
  23413. if (state.isOpen) {
  23414. changes = {
  23415. highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)
  23416. };
  23417. } else {
  23418. changes = {
  23419. highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),
  23420. isOpen: props.items.length >= 0
  23421. };
  23422. }
  23423. break;
  23424. case InputKeyDownEnter:
  23425. changes = extends_extends({}, state.isOpen && state.highlightedIndex >= 0 && {
  23426. selectedItem: props.items[state.highlightedIndex],
  23427. isOpen: getDefaultValue$1(props, 'isOpen'),
  23428. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),
  23429. inputValue: props.itemToString(props.items[state.highlightedIndex])
  23430. });
  23431. break;
  23432. case InputKeyDownEscape:
  23433. changes = extends_extends({
  23434. isOpen: false,
  23435. highlightedIndex: -1
  23436. }, !state.isOpen && {
  23437. selectedItem: null,
  23438. inputValue: ''
  23439. });
  23440. break;
  23441. case InputKeyDownHome:
  23442. changes = {
  23443. highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)
  23444. };
  23445. break;
  23446. case InputKeyDownEnd:
  23447. changes = {
  23448. highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)
  23449. };
  23450. break;
  23451. case InputBlur:
  23452. changes = extends_extends({
  23453. isOpen: false,
  23454. highlightedIndex: -1
  23455. }, state.highlightedIndex >= 0 && action.selectItem && {
  23456. selectedItem: props.items[state.highlightedIndex],
  23457. inputValue: props.itemToString(props.items[state.highlightedIndex])
  23458. });
  23459. break;
  23460. case InputChange:
  23461. changes = {
  23462. isOpen: true,
  23463. highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),
  23464. inputValue: action.inputValue
  23465. };
  23466. break;
  23467. case FunctionSelectItem:
  23468. changes = {
  23469. selectedItem: action.selectedItem,
  23470. inputValue: props.itemToString(action.selectedItem)
  23471. };
  23472. break;
  23473. case ControlledPropUpdatedSelectedItem:
  23474. changes = {
  23475. inputValue: action.inputValue
  23476. };
  23477. break;
  23478. default:
  23479. return downshiftCommonReducer(state, action, stateChangeTypes$1);
  23480. }
  23481. return extends_extends({}, state, changes);
  23482. }
  23483. /* eslint-enable complexity */
  23484. var _excluded$1 = ["onMouseLeave", "refKey", "ref"],
  23485. _excluded2$1 = ["item", "index", "refKey", "ref", "onMouseMove", "onClick", "onPress"],
  23486. _excluded3 = ["onClick", "onPress", "refKey", "ref"],
  23487. _excluded4 = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "refKey", "ref"],
  23488. _excluded5 = ["refKey", "ref"];
  23489. useCombobox.stateChangeTypes = stateChangeTypes$1;
  23490. function useCombobox(userProps) {
  23491. if (userProps === void 0) {
  23492. userProps = {};
  23493. }
  23494. validatePropTypes$1(userProps, useCombobox); // Props defaults and destructuring.
  23495. var props = extends_extends({}, defaultProps$1, userProps);
  23496. var initialIsOpen = props.initialIsOpen,
  23497. defaultIsOpen = props.defaultIsOpen,
  23498. items = props.items,
  23499. scrollIntoView = props.scrollIntoView,
  23500. environment = props.environment,
  23501. getA11yStatusMessage = props.getA11yStatusMessage,
  23502. getA11ySelectionMessage = props.getA11ySelectionMessage,
  23503. itemToString = props.itemToString; // Initial state depending on controlled props.
  23504. var initialState = getInitialState$1(props);
  23505. var _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, initialState, props),
  23506. state = _useControlledReducer[0],
  23507. dispatch = _useControlledReducer[1];
  23508. var isOpen = state.isOpen,
  23509. highlightedIndex = state.highlightedIndex,
  23510. selectedItem = state.selectedItem,
  23511. inputValue = state.inputValue; // Element refs.
  23512. var menuRef = Object(external_React_["useRef"])(null);
  23513. var itemRefs = Object(external_React_["useRef"])({});
  23514. var inputRef = Object(external_React_["useRef"])(null);
  23515. var toggleButtonRef = Object(external_React_["useRef"])(null);
  23516. var comboboxRef = Object(external_React_["useRef"])(null);
  23517. var isInitialMountRef = Object(external_React_["useRef"])(true); // prevent id re-generation between renders.
  23518. var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.
  23519. var previousResultCountRef = Object(external_React_["useRef"])(); // utility callback to get item element.
  23520. var latest = useLatestRef({
  23521. state: state,
  23522. props: props
  23523. });
  23524. var getItemNodeFromIndex = Object(external_React_["useCallback"])(function (index) {
  23525. return itemRefs.current[elementIds.getItemId(index)];
  23526. }, [elementIds]); // Effects.
  23527. // Sets a11y status message on changes in state.
  23528. useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], extends_extends({
  23529. isInitialMount: isInitialMountRef.current,
  23530. previousResultCount: previousResultCountRef.current,
  23531. items: items,
  23532. environment: environment,
  23533. itemToString: itemToString
  23534. }, state)); // Sets a11y status message on changes in selectedItem.
  23535. useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], extends_extends({
  23536. isInitialMount: isInitialMountRef.current,
  23537. previousResultCount: previousResultCountRef.current,
  23538. items: items,
  23539. environment: environment,
  23540. itemToString: itemToString
  23541. }, state)); // Scroll on highlighted item if change comes from keyboard.
  23542. var shouldScrollRef = useScrollIntoView({
  23543. menuElement: menuRef.current,
  23544. highlightedIndex: highlightedIndex,
  23545. isOpen: isOpen,
  23546. itemRefs: itemRefs,
  23547. scrollIntoView: scrollIntoView,
  23548. getItemNodeFromIndex: getItemNodeFromIndex
  23549. });
  23550. useControlPropsValidator({
  23551. isInitialMount: isInitialMountRef.current,
  23552. props: props,
  23553. state: state
  23554. }); // Focus the input on first render if required.
  23555. Object(external_React_["useEffect"])(function () {
  23556. var focusOnOpen = initialIsOpen || defaultIsOpen || isOpen;
  23557. if (focusOnOpen && inputRef.current) {
  23558. inputRef.current.focus();
  23559. } // eslint-disable-next-line react-hooks/exhaustive-deps
  23560. }, []);
  23561. Object(external_React_["useEffect"])(function () {
  23562. if (isInitialMountRef.current) {
  23563. return;
  23564. }
  23565. previousResultCountRef.current = items.length;
  23566. }); // Add mouse/touch events to document.
  23567. var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [comboboxRef, menuRef, toggleButtonRef], environment, function () {
  23568. dispatch({
  23569. type: InputBlur,
  23570. selectItem: false
  23571. });
  23572. });
  23573. var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getComboboxProps', 'getMenuProps'); // Make initial ref false.
  23574. Object(external_React_["useEffect"])(function () {
  23575. isInitialMountRef.current = false;
  23576. }, []); // Reset itemRefs on close.
  23577. Object(external_React_["useEffect"])(function () {
  23578. if (!isOpen) {
  23579. itemRefs.current = {};
  23580. }
  23581. }, [isOpen]);
  23582. /* Event handler functions */
  23583. var inputKeyDownHandlers = Object(external_React_["useMemo"])(function () {
  23584. return {
  23585. ArrowDown: function ArrowDown(event) {
  23586. event.preventDefault();
  23587. dispatch({
  23588. type: InputKeyDownArrowDown,
  23589. shiftKey: event.shiftKey,
  23590. getItemNodeFromIndex: getItemNodeFromIndex
  23591. });
  23592. },
  23593. ArrowUp: function ArrowUp(event) {
  23594. event.preventDefault();
  23595. dispatch({
  23596. type: InputKeyDownArrowUp,
  23597. shiftKey: event.shiftKey,
  23598. getItemNodeFromIndex: getItemNodeFromIndex
  23599. });
  23600. },
  23601. Home: function Home(event) {
  23602. if (!latest.current.state.isOpen) {
  23603. return;
  23604. }
  23605. event.preventDefault();
  23606. dispatch({
  23607. type: InputKeyDownHome,
  23608. getItemNodeFromIndex: getItemNodeFromIndex
  23609. });
  23610. },
  23611. End: function End(event) {
  23612. if (!latest.current.state.isOpen) {
  23613. return;
  23614. }
  23615. event.preventDefault();
  23616. dispatch({
  23617. type: InputKeyDownEnd,
  23618. getItemNodeFromIndex: getItemNodeFromIndex
  23619. });
  23620. },
  23621. Escape: function Escape() {
  23622. var latestState = latest.current.state;
  23623. if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {
  23624. dispatch({
  23625. type: InputKeyDownEscape
  23626. });
  23627. }
  23628. },
  23629. Enter: function Enter(event) {
  23630. var latestState = latest.current.state; // if closed or no highlighted index, do nothing.
  23631. if (!latestState.isOpen || latestState.highlightedIndex < 0 || event.which === 229 // if IME composing, wait for next Enter keydown event.
  23632. ) {
  23633. return;
  23634. }
  23635. event.preventDefault();
  23636. dispatch({
  23637. type: InputKeyDownEnter,
  23638. getItemNodeFromIndex: getItemNodeFromIndex
  23639. });
  23640. }
  23641. };
  23642. }, [dispatch, latest, getItemNodeFromIndex]); // Getter props.
  23643. var getLabelProps = Object(external_React_["useCallback"])(function (labelProps) {
  23644. return extends_extends({
  23645. id: elementIds.labelId,
  23646. htmlFor: elementIds.inputId
  23647. }, labelProps);
  23648. }, [elementIds]);
  23649. var getMenuProps = Object(external_React_["useCallback"])(function (_temp, _temp2) {
  23650. var _extends2;
  23651. var _ref = _temp === void 0 ? {} : _temp,
  23652. onMouseLeave = _ref.onMouseLeave,
  23653. _ref$refKey = _ref.refKey,
  23654. refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
  23655. ref = _ref.ref,
  23656. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$1);
  23657. var _ref2 = _temp2 === void 0 ? {} : _temp2,
  23658. _ref2$suppressRefErro = _ref2.suppressRefError,
  23659. suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
  23660. setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
  23661. return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
  23662. menuRef.current = menuNode;
  23663. }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {
  23664. dispatch({
  23665. type: MenuMouseLeave
  23666. });
  23667. }), _extends2), rest);
  23668. }, [dispatch, setGetterPropCallInfo, elementIds]);
  23669. var getItemProps = Object(external_React_["useCallback"])(function (_temp3) {
  23670. var _extends3, _ref4;
  23671. var _ref3 = _temp3 === void 0 ? {} : _temp3,
  23672. item = _ref3.item,
  23673. index = _ref3.index,
  23674. _ref3$refKey = _ref3.refKey,
  23675. refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,
  23676. ref = _ref3.ref,
  23677. onMouseMove = _ref3.onMouseMove,
  23678. onClick = _ref3.onClick;
  23679. _ref3.onPress;
  23680. var rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$1);
  23681. var _latest$current = latest.current,
  23682. latestProps = _latest$current.props,
  23683. latestState = _latest$current.state;
  23684. var itemIndex = getItemIndex(index, item, latestProps.items);
  23685. if (itemIndex < 0) {
  23686. throw new Error('Pass either item or item index in getItemProps!');
  23687. }
  23688. var onSelectKey = 'onClick';
  23689. var customClickHandler = onClick;
  23690. var itemHandleMouseMove = function itemHandleMouseMove() {
  23691. if (index === latestState.highlightedIndex) {
  23692. return;
  23693. }
  23694. shouldScrollRef.current = false;
  23695. dispatch({
  23696. type: ItemMouseMove,
  23697. index: index
  23698. });
  23699. };
  23700. var itemHandleClick = function itemHandleClick() {
  23701. dispatch({
  23702. type: ItemClick,
  23703. index: index
  23704. });
  23705. if (inputRef.current) {
  23706. inputRef.current.focus();
  23707. }
  23708. };
  23709. return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {
  23710. if (itemNode) {
  23711. itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
  23712. }
  23713. }), _extends3.role = 'option', _extends3['aria-selected'] = "" + (itemIndex === latestState.highlightedIndex), _extends3.id = elementIds.getItemId(itemIndex), _extends3), !rest.disabled && (_ref4 = {
  23714. onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove)
  23715. }, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), rest);
  23716. }, [dispatch, latest, shouldScrollRef, elementIds]);
  23717. var getToggleButtonProps = Object(external_React_["useCallback"])(function (_temp4) {
  23718. var _extends4;
  23719. var _ref5 = _temp4 === void 0 ? {} : _temp4,
  23720. onClick = _ref5.onClick;
  23721. _ref5.onPress;
  23722. var _ref5$refKey = _ref5.refKey,
  23723. refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
  23724. ref = _ref5.ref,
  23725. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded3);
  23726. var toggleButtonHandleClick = function toggleButtonHandleClick() {
  23727. dispatch({
  23728. type: ToggleButtonClick
  23729. });
  23730. if (!latest.current.state.isOpen && inputRef.current) {
  23731. inputRef.current.focus();
  23732. }
  23733. };
  23734. return extends_extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {
  23735. toggleButtonRef.current = toggleButtonNode;
  23736. }), _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && extends_extends({}, {
  23737. onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)
  23738. }), rest);
  23739. }, [dispatch, latest, elementIds]);
  23740. var getInputProps = Object(external_React_["useCallback"])(function (_temp5, _temp6) {
  23741. var _extends5;
  23742. var _ref6 = _temp5 === void 0 ? {} : _temp5,
  23743. onKeyDown = _ref6.onKeyDown,
  23744. onChange = _ref6.onChange,
  23745. onInput = _ref6.onInput,
  23746. onBlur = _ref6.onBlur;
  23747. _ref6.onChangeText;
  23748. var _ref6$refKey = _ref6.refKey,
  23749. refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,
  23750. ref = _ref6.ref,
  23751. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref6, _excluded4);
  23752. var _ref7 = _temp6 === void 0 ? {} : _temp6,
  23753. _ref7$suppressRefErro = _ref7.suppressRefError,
  23754. suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;
  23755. setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef);
  23756. var latestState = latest.current.state;
  23757. var inputHandleKeyDown = function inputHandleKeyDown(event) {
  23758. var key = normalizeArrowKey(event);
  23759. if (key && inputKeyDownHandlers[key]) {
  23760. inputKeyDownHandlers[key](event);
  23761. }
  23762. };
  23763. var inputHandleChange = function inputHandleChange(event) {
  23764. dispatch({
  23765. type: InputChange,
  23766. inputValue: event.target.value
  23767. });
  23768. };
  23769. var inputHandleBlur = function inputHandleBlur() {
  23770. /* istanbul ignore else */
  23771. if (latestState.isOpen && !mouseAndTouchTrackersRef.current.isMouseDown) {
  23772. dispatch({
  23773. type: InputBlur,
  23774. selectItem: true
  23775. });
  23776. }
  23777. };
  23778. /* istanbul ignore next (preact) */
  23779. var onChangeKey = 'onChange';
  23780. var eventHandlers = {};
  23781. if (!rest.disabled) {
  23782. var _eventHandlers;
  23783. eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers);
  23784. }
  23785. return extends_extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {
  23786. inputRef.current = inputNode;
  23787. }), _extends5.id = elementIds.inputId, _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5), latestState.isOpen && latestState.highlightedIndex > -1 && {
  23788. 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)
  23789. }, {
  23790. 'aria-labelledby': elementIds.labelId,
  23791. // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
  23792. // revert back since autocomplete="nope" is ignored on latest Chrome and Opera
  23793. autoComplete: 'off',
  23794. value: latestState.inputValue
  23795. }, eventHandlers, rest);
  23796. }, [dispatch, inputKeyDownHandlers, latest, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds]);
  23797. var getComboboxProps = Object(external_React_["useCallback"])(function (_temp7, _temp8) {
  23798. var _extends6;
  23799. var _ref8 = _temp7 === void 0 ? {} : _temp7,
  23800. _ref8$refKey = _ref8.refKey,
  23801. refKey = _ref8$refKey === void 0 ? 'ref' : _ref8$refKey,
  23802. ref = _ref8.ref,
  23803. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref8, _excluded5);
  23804. var _ref9 = _temp8 === void 0 ? {} : _temp8,
  23805. _ref9$suppressRefErro = _ref9.suppressRefError,
  23806. suppressRefError = _ref9$suppressRefErro === void 0 ? false : _ref9$suppressRefErro;
  23807. setGetterPropCallInfo('getComboboxProps', suppressRefError, refKey, comboboxRef);
  23808. return extends_extends((_extends6 = {}, _extends6[refKey] = handleRefs(ref, function (comboboxNode) {
  23809. comboboxRef.current = comboboxNode;
  23810. }), _extends6.role = 'combobox', _extends6['aria-haspopup'] = 'listbox', _extends6['aria-owns'] = elementIds.menuId, _extends6['aria-expanded'] = latest.current.state.isOpen, _extends6), rest);
  23811. }, [latest, setGetterPropCallInfo, elementIds]); // returns
  23812. var toggleMenu = Object(external_React_["useCallback"])(function () {
  23813. dispatch({
  23814. type: FunctionToggleMenu
  23815. });
  23816. }, [dispatch]);
  23817. var closeMenu = Object(external_React_["useCallback"])(function () {
  23818. dispatch({
  23819. type: FunctionCloseMenu
  23820. });
  23821. }, [dispatch]);
  23822. var openMenu = Object(external_React_["useCallback"])(function () {
  23823. dispatch({
  23824. type: FunctionOpenMenu
  23825. });
  23826. }, [dispatch]);
  23827. var setHighlightedIndex = Object(external_React_["useCallback"])(function (newHighlightedIndex) {
  23828. dispatch({
  23829. type: FunctionSetHighlightedIndex,
  23830. highlightedIndex: newHighlightedIndex
  23831. });
  23832. }, [dispatch]);
  23833. var selectItem = Object(external_React_["useCallback"])(function (newSelectedItem) {
  23834. dispatch({
  23835. type: FunctionSelectItem,
  23836. selectedItem: newSelectedItem
  23837. });
  23838. }, [dispatch]);
  23839. var setInputValue = Object(external_React_["useCallback"])(function (newInputValue) {
  23840. dispatch({
  23841. type: FunctionSetInputValue,
  23842. inputValue: newInputValue
  23843. });
  23844. }, [dispatch]);
  23845. var reset = Object(external_React_["useCallback"])(function () {
  23846. dispatch({
  23847. type: FunctionReset$1
  23848. });
  23849. }, [dispatch]);
  23850. return {
  23851. // prop getters.
  23852. getItemProps: getItemProps,
  23853. getLabelProps: getLabelProps,
  23854. getMenuProps: getMenuProps,
  23855. getInputProps: getInputProps,
  23856. getComboboxProps: getComboboxProps,
  23857. getToggleButtonProps: getToggleButtonProps,
  23858. // actions.
  23859. toggleMenu: toggleMenu,
  23860. openMenu: openMenu,
  23861. closeMenu: closeMenu,
  23862. setHighlightedIndex: setHighlightedIndex,
  23863. setInputValue: setInputValue,
  23864. selectItem: selectItem,
  23865. reset: reset,
  23866. // state.
  23867. highlightedIndex: highlightedIndex,
  23868. isOpen: isOpen,
  23869. selectedItem: selectedItem,
  23870. inputValue: inputValue
  23871. };
  23872. }
  23873. var defaultStateValues = {
  23874. activeIndex: -1,
  23875. selectedItems: []
  23876. };
  23877. /**
  23878. * Returns the initial value for a state key in the following order:
  23879. * 1. controlled prop, 2. initial prop, 3. default prop, 4. default
  23880. * value from Downshift.
  23881. *
  23882. * @param {Object} props Props passed to the hook.
  23883. * @param {string} propKey Props key to generate the value for.
  23884. * @returns {any} The initial value for that prop.
  23885. */
  23886. function getInitialValue(props, propKey) {
  23887. return getInitialValue$1(props, propKey, defaultStateValues);
  23888. }
  23889. /**
  23890. * Returns the default value for a state key in the following order:
  23891. * 1. controlled prop, 2. default prop, 3. default value from Downshift.
  23892. *
  23893. * @param {Object} props Props passed to the hook.
  23894. * @param {string} propKey Props key to generate the value for.
  23895. * @returns {any} The initial value for that prop.
  23896. */
  23897. function getDefaultValue(props, propKey) {
  23898. return getDefaultValue$1(props, propKey, defaultStateValues);
  23899. }
  23900. /**
  23901. * Gets the initial state based on the provided props. It uses initial, default
  23902. * and controlled props related to state in order to compute the initial value.
  23903. *
  23904. * @param {Object} props Props passed to the hook.
  23905. * @returns {Object} The initial state.
  23906. */
  23907. function downshift_esm_getInitialState(props) {
  23908. var activeIndex = getInitialValue(props, 'activeIndex');
  23909. var selectedItems = getInitialValue(props, 'selectedItems');
  23910. return {
  23911. activeIndex: activeIndex,
  23912. selectedItems: selectedItems
  23913. };
  23914. }
  23915. /**
  23916. * Returns true if dropdown keydown operation is permitted. Should not be
  23917. * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on
  23918. * input element with text content that is either highlighted or selection
  23919. * cursor is not at the starting position.
  23920. *
  23921. * @param {KeyboardEvent} event The event from keydown.
  23922. * @returns {boolean} Whether the operation is allowed.
  23923. */
  23924. function isKeyDownOperationPermitted(event) {
  23925. if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
  23926. return false;
  23927. }
  23928. var element = event.target;
  23929. if (element instanceof HTMLInputElement && // if element is a text input
  23930. element.value !== '' && (element.selectionStart !== 0 || element.selectionEnd !== 0)) {
  23931. return false;
  23932. }
  23933. return true;
  23934. }
  23935. /**
  23936. * Returns a message to be added to aria-live region when item is removed.
  23937. *
  23938. * @param {Object} selectionParameters Parameters required to build the message.
  23939. * @returns {string} The a11y message.
  23940. */
  23941. function downshift_esm_getA11yRemovalMessage(selectionParameters) {
  23942. var removedSelectedItem = selectionParameters.removedSelectedItem,
  23943. itemToStringLocal = selectionParameters.itemToString;
  23944. return itemToStringLocal(removedSelectedItem) + " has been removed.";
  23945. }
  23946. var propTypes = {
  23947. selectedItems: prop_types_default.a.array,
  23948. initialSelectedItems: prop_types_default.a.array,
  23949. defaultSelectedItems: prop_types_default.a.array,
  23950. itemToString: prop_types_default.a.func,
  23951. getA11yRemovalMessage: prop_types_default.a.func,
  23952. stateReducer: prop_types_default.a.func,
  23953. activeIndex: prop_types_default.a.number,
  23954. initialActiveIndex: prop_types_default.a.number,
  23955. defaultActiveIndex: prop_types_default.a.number,
  23956. onActiveIndexChange: prop_types_default.a.func,
  23957. onSelectedItemsChange: prop_types_default.a.func,
  23958. keyNavigationNext: prop_types_default.a.string,
  23959. keyNavigationPrevious: prop_types_default.a.string,
  23960. environment: prop_types_default.a.shape({
  23961. addEventListener: prop_types_default.a.func,
  23962. removeEventListener: prop_types_default.a.func,
  23963. document: prop_types_default.a.shape({
  23964. getElementById: prop_types_default.a.func,
  23965. activeElement: prop_types_default.a.any,
  23966. body: prop_types_default.a.any
  23967. })
  23968. })
  23969. };
  23970. var downshift_esm_defaultProps = {
  23971. itemToString: defaultProps$3.itemToString,
  23972. stateReducer: defaultProps$3.stateReducer,
  23973. environment: defaultProps$3.environment,
  23974. getA11yRemovalMessage: downshift_esm_getA11yRemovalMessage,
  23975. keyNavigationNext: 'ArrowRight',
  23976. keyNavigationPrevious: 'ArrowLeft'
  23977. }; // eslint-disable-next-line import/no-mutable-exports
  23978. var validatePropTypes = downshift_esm_noop;
  23979. /* istanbul ignore next */
  23980. if (false) {}
  23981. var SelectedItemClick = false ? undefined : 0;
  23982. var SelectedItemKeyDownDelete = false ? undefined : 1;
  23983. var SelectedItemKeyDownBackspace = false ? undefined : 2;
  23984. var SelectedItemKeyDownNavigationNext = false ? undefined : 3;
  23985. var SelectedItemKeyDownNavigationPrevious = false ? undefined : 4;
  23986. var DropdownKeyDownNavigationPrevious = false ? undefined : 5;
  23987. var DropdownKeyDownBackspace = false ? undefined : 6;
  23988. var DropdownClick = false ? undefined : 7;
  23989. var FunctionAddSelectedItem = false ? undefined : 8;
  23990. var FunctionRemoveSelectedItem = false ? undefined : 9;
  23991. var FunctionSetSelectedItems = false ? undefined : 10;
  23992. var FunctionSetActiveIndex = false ? undefined : 11;
  23993. var FunctionReset = false ? undefined : 12;
  23994. var downshift_esm_stateChangeTypes = /*#__PURE__*/Object.freeze({
  23995. __proto__: null,
  23996. SelectedItemClick: SelectedItemClick,
  23997. SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,
  23998. SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,
  23999. SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,
  24000. SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious,
  24001. DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,
  24002. DropdownKeyDownBackspace: DropdownKeyDownBackspace,
  24003. DropdownClick: DropdownClick,
  24004. FunctionAddSelectedItem: FunctionAddSelectedItem,
  24005. FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,
  24006. FunctionSetSelectedItems: FunctionSetSelectedItems,
  24007. FunctionSetActiveIndex: FunctionSetActiveIndex,
  24008. FunctionReset: FunctionReset
  24009. });
  24010. /* eslint-disable complexity */
  24011. function downshiftMultipleSelectionReducer(state, action) {
  24012. var type = action.type,
  24013. index = action.index,
  24014. props = action.props,
  24015. selectedItem = action.selectedItem;
  24016. var activeIndex = state.activeIndex,
  24017. selectedItems = state.selectedItems;
  24018. var changes;
  24019. switch (type) {
  24020. case SelectedItemClick:
  24021. changes = {
  24022. activeIndex: index
  24023. };
  24024. break;
  24025. case SelectedItemKeyDownNavigationPrevious:
  24026. changes = {
  24027. activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1
  24028. };
  24029. break;
  24030. case SelectedItemKeyDownNavigationNext:
  24031. changes = {
  24032. activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1
  24033. };
  24034. break;
  24035. case SelectedItemKeyDownBackspace:
  24036. case SelectedItemKeyDownDelete:
  24037. {
  24038. var newActiveIndex = activeIndex;
  24039. if (selectedItems.length === 1) {
  24040. newActiveIndex = -1;
  24041. } else if (activeIndex === selectedItems.length - 1) {
  24042. newActiveIndex = selectedItems.length - 2;
  24043. }
  24044. changes = extends_extends({
  24045. selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))
  24046. }, {
  24047. activeIndex: newActiveIndex
  24048. });
  24049. break;
  24050. }
  24051. case DropdownKeyDownNavigationPrevious:
  24052. changes = {
  24053. activeIndex: selectedItems.length - 1
  24054. };
  24055. break;
  24056. case DropdownKeyDownBackspace:
  24057. changes = {
  24058. selectedItems: selectedItems.slice(0, selectedItems.length - 1)
  24059. };
  24060. break;
  24061. case FunctionAddSelectedItem:
  24062. changes = {
  24063. selectedItems: [].concat(selectedItems, [selectedItem])
  24064. };
  24065. break;
  24066. case DropdownClick:
  24067. changes = {
  24068. activeIndex: -1
  24069. };
  24070. break;
  24071. case FunctionRemoveSelectedItem:
  24072. {
  24073. var _newActiveIndex = activeIndex;
  24074. var selectedItemIndex = selectedItems.indexOf(selectedItem);
  24075. if (selectedItems.length === 1) {
  24076. _newActiveIndex = -1;
  24077. } else if (selectedItemIndex === selectedItems.length - 1) {
  24078. _newActiveIndex = selectedItems.length - 2;
  24079. }
  24080. changes = extends_extends({
  24081. selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1))
  24082. }, {
  24083. activeIndex: _newActiveIndex
  24084. });
  24085. break;
  24086. }
  24087. case FunctionSetSelectedItems:
  24088. {
  24089. var newSelectedItems = action.selectedItems;
  24090. changes = {
  24091. selectedItems: newSelectedItems
  24092. };
  24093. break;
  24094. }
  24095. case FunctionSetActiveIndex:
  24096. {
  24097. var _newActiveIndex2 = action.activeIndex;
  24098. changes = {
  24099. activeIndex: _newActiveIndex2
  24100. };
  24101. break;
  24102. }
  24103. case FunctionReset:
  24104. changes = {
  24105. activeIndex: getDefaultValue(props, 'activeIndex'),
  24106. selectedItems: getDefaultValue(props, 'selectedItems')
  24107. };
  24108. break;
  24109. default:
  24110. throw new Error('Reducer called without proper action type.');
  24111. }
  24112. return extends_extends({}, state, changes);
  24113. }
  24114. var _excluded = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"],
  24115. _excluded2 = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"];
  24116. useMultipleSelection.stateChangeTypes = downshift_esm_stateChangeTypes;
  24117. function useMultipleSelection(userProps) {
  24118. if (userProps === void 0) {
  24119. userProps = {};
  24120. }
  24121. validatePropTypes(userProps, useMultipleSelection); // Props defaults and destructuring.
  24122. var props = extends_extends({}, downshift_esm_defaultProps, userProps);
  24123. var getA11yRemovalMessage = props.getA11yRemovalMessage,
  24124. itemToString = props.itemToString,
  24125. environment = props.environment,
  24126. keyNavigationNext = props.keyNavigationNext,
  24127. keyNavigationPrevious = props.keyNavigationPrevious; // Reducer init.
  24128. var _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, downshift_esm_getInitialState(props), props),
  24129. state = _useControlledReducer[0],
  24130. dispatch = _useControlledReducer[1];
  24131. var activeIndex = state.activeIndex,
  24132. selectedItems = state.selectedItems; // Refs.
  24133. var isInitialMountRef = Object(external_React_["useRef"])(true);
  24134. var dropdownRef = Object(external_React_["useRef"])(null);
  24135. var previousSelectedItemsRef = Object(external_React_["useRef"])(selectedItems);
  24136. var selectedItemRefs = Object(external_React_["useRef"])();
  24137. selectedItemRefs.current = [];
  24138. var latest = useLatestRef({
  24139. state: state,
  24140. props: props
  24141. }); // Effects.
  24142. /* Sets a11y status message on changes in selectedItem. */
  24143. Object(external_React_["useEffect"])(function () {
  24144. if (isInitialMountRef.current) {
  24145. return;
  24146. }
  24147. if (selectedItems.length < previousSelectedItemsRef.current.length) {
  24148. var removedSelectedItem = previousSelectedItemsRef.current.find(function (item) {
  24149. return selectedItems.indexOf(item) < 0;
  24150. });
  24151. setStatus(getA11yRemovalMessage({
  24152. itemToString: itemToString,
  24153. resultCount: selectedItems.length,
  24154. removedSelectedItem: removedSelectedItem,
  24155. activeIndex: activeIndex,
  24156. activeSelectedItem: selectedItems[activeIndex]
  24157. }), environment.document);
  24158. }
  24159. previousSelectedItemsRef.current = selectedItems; // eslint-disable-next-line react-hooks/exhaustive-deps
  24160. }, [selectedItems.length]); // Sets focus on active item.
  24161. Object(external_React_["useEffect"])(function () {
  24162. if (isInitialMountRef.current) {
  24163. return;
  24164. }
  24165. if (activeIndex === -1 && dropdownRef.current) {
  24166. dropdownRef.current.focus();
  24167. } else if (selectedItemRefs.current[activeIndex]) {
  24168. selectedItemRefs.current[activeIndex].focus();
  24169. }
  24170. }, [activeIndex]);
  24171. useControlPropsValidator({
  24172. isInitialMount: isInitialMountRef.current,
  24173. props: props,
  24174. state: state
  24175. });
  24176. var setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps'); // Make initial ref false.
  24177. Object(external_React_["useEffect"])(function () {
  24178. isInitialMountRef.current = false;
  24179. }, []); // Event handler functions.
  24180. var selectedItemKeyDownHandlers = Object(external_React_["useMemo"])(function () {
  24181. var _ref;
  24182. return _ref = {}, _ref[keyNavigationPrevious] = function () {
  24183. dispatch({
  24184. type: SelectedItemKeyDownNavigationPrevious
  24185. });
  24186. }, _ref[keyNavigationNext] = function () {
  24187. dispatch({
  24188. type: SelectedItemKeyDownNavigationNext
  24189. });
  24190. }, _ref.Delete = function Delete() {
  24191. dispatch({
  24192. type: SelectedItemKeyDownDelete
  24193. });
  24194. }, _ref.Backspace = function Backspace() {
  24195. dispatch({
  24196. type: SelectedItemKeyDownBackspace
  24197. });
  24198. }, _ref;
  24199. }, [dispatch, keyNavigationNext, keyNavigationPrevious]);
  24200. var dropdownKeyDownHandlers = Object(external_React_["useMemo"])(function () {
  24201. var _ref2;
  24202. return _ref2 = {}, _ref2[keyNavigationPrevious] = function (event) {
  24203. if (isKeyDownOperationPermitted(event)) {
  24204. dispatch({
  24205. type: DropdownKeyDownNavigationPrevious
  24206. });
  24207. }
  24208. }, _ref2.Backspace = function Backspace(event) {
  24209. if (isKeyDownOperationPermitted(event)) {
  24210. dispatch({
  24211. type: DropdownKeyDownBackspace
  24212. });
  24213. }
  24214. }, _ref2;
  24215. }, [dispatch, keyNavigationPrevious]); // Getter props.
  24216. var getSelectedItemProps = Object(external_React_["useCallback"])(function (_temp) {
  24217. var _extends2;
  24218. var _ref3 = _temp === void 0 ? {} : _temp,
  24219. _ref3$refKey = _ref3.refKey,
  24220. refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,
  24221. ref = _ref3.ref,
  24222. onClick = _ref3.onClick,
  24223. onKeyDown = _ref3.onKeyDown,
  24224. selectedItem = _ref3.selectedItem,
  24225. index = _ref3.index,
  24226. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded);
  24227. var latestState = latest.current.state;
  24228. var itemIndex = getItemIndex(index, selectedItem, latestState.selectedItems);
  24229. if (itemIndex < 0) {
  24230. throw new Error('Pass either selectedItem or index in getSelectedItemProps!');
  24231. }
  24232. var selectedItemHandleClick = function selectedItemHandleClick() {
  24233. dispatch({
  24234. type: SelectedItemClick,
  24235. index: index
  24236. });
  24237. };
  24238. var selectedItemHandleKeyDown = function selectedItemHandleKeyDown(event) {
  24239. var key = normalizeArrowKey(event);
  24240. if (key && selectedItemKeyDownHandlers[key]) {
  24241. selectedItemKeyDownHandlers[key](event);
  24242. }
  24243. };
  24244. return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {
  24245. if (selectedItemNode) {
  24246. selectedItemRefs.current.push(selectedItemNode);
  24247. }
  24248. }), _extends2.tabIndex = index === latestState.activeIndex ? 0 : -1, _extends2.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends2.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends2), rest);
  24249. }, [dispatch, latest, selectedItemKeyDownHandlers]);
  24250. var getDropdownProps = Object(external_React_["useCallback"])(function (_temp2, _temp3) {
  24251. var _extends3;
  24252. var _ref4 = _temp2 === void 0 ? {} : _temp2,
  24253. _ref4$refKey = _ref4.refKey,
  24254. refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,
  24255. ref = _ref4.ref,
  24256. onKeyDown = _ref4.onKeyDown,
  24257. onClick = _ref4.onClick,
  24258. _ref4$preventKeyActio = _ref4.preventKeyAction,
  24259. preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,
  24260. rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref4, _excluded2);
  24261. var _ref5 = _temp3 === void 0 ? {} : _temp3,
  24262. _ref5$suppressRefErro = _ref5.suppressRefError,
  24263. suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;
  24264. setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef);
  24265. var dropdownHandleKeyDown = function dropdownHandleKeyDown(event) {
  24266. var key = normalizeArrowKey(event);
  24267. if (key && dropdownKeyDownHandlers[key]) {
  24268. dropdownKeyDownHandlers[key](event);
  24269. }
  24270. };
  24271. var dropdownHandleClick = function dropdownHandleClick() {
  24272. dispatch({
  24273. type: DropdownClick
  24274. });
  24275. };
  24276. return extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {
  24277. if (dropdownNode) {
  24278. dropdownRef.current = dropdownNode;
  24279. }
  24280. }), _extends3), !preventKeyAction && {
  24281. onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),
  24282. onClick: callAllEventHandlers(onClick, dropdownHandleClick)
  24283. }, rest);
  24284. }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]); // returns
  24285. var addSelectedItem = Object(external_React_["useCallback"])(function (selectedItem) {
  24286. dispatch({
  24287. type: FunctionAddSelectedItem,
  24288. selectedItem: selectedItem
  24289. });
  24290. }, [dispatch]);
  24291. var removeSelectedItem = Object(external_React_["useCallback"])(function (selectedItem) {
  24292. dispatch({
  24293. type: FunctionRemoveSelectedItem,
  24294. selectedItem: selectedItem
  24295. });
  24296. }, [dispatch]);
  24297. var setSelectedItems = Object(external_React_["useCallback"])(function (newSelectedItems) {
  24298. dispatch({
  24299. type: FunctionSetSelectedItems,
  24300. selectedItems: newSelectedItems
  24301. });
  24302. }, [dispatch]);
  24303. var setActiveIndex = Object(external_React_["useCallback"])(function (newActiveIndex) {
  24304. dispatch({
  24305. type: FunctionSetActiveIndex,
  24306. activeIndex: newActiveIndex
  24307. });
  24308. }, [dispatch]);
  24309. var reset = Object(external_React_["useCallback"])(function () {
  24310. dispatch({
  24311. type: FunctionReset
  24312. });
  24313. }, [dispatch]);
  24314. return {
  24315. getSelectedItemProps: getSelectedItemProps,
  24316. getDropdownProps: getDropdownProps,
  24317. addSelectedItem: addSelectedItem,
  24318. removeSelectedItem: removeSelectedItem,
  24319. setSelectedItems: setSelectedItems,
  24320. setActiveIndex: setActiveIndex,
  24321. reset: reset,
  24322. selectedItems: selectedItems,
  24323. activeIndex: activeIndex
  24324. };
  24325. }
  24326. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-select-control/index.js
  24327. /**
  24328. * External dependencies
  24329. */
  24330. /**
  24331. * WordPress dependencies
  24332. */
  24333. /**
  24334. * Internal dependencies
  24335. */
  24336. const custom_select_control_itemToString = item => item && item.name; // This is needed so that in Windows, where
  24337. // the menu does not necessarily open on
  24338. // key up/down, you can still switch between
  24339. // options with the menu closed.
  24340. const custom_select_control_stateReducer = ({
  24341. selectedItem
  24342. }, {
  24343. type,
  24344. changes,
  24345. props: {
  24346. items
  24347. }
  24348. }) => {
  24349. switch (type) {
  24350. case useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:
  24351. // If we already have a selected item, try to select the next one,
  24352. // without circular navigation. Otherwise, select the first item.
  24353. return {
  24354. selectedItem: items[selectedItem ? Math.min(items.indexOf(selectedItem) + 1, items.length - 1) : 0]
  24355. };
  24356. case useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:
  24357. // If we already have a selected item, try to select the previous one,
  24358. // without circular navigation. Otherwise, select the last item.
  24359. return {
  24360. selectedItem: items[selectedItem ? Math.max(items.indexOf(selectedItem) - 1, 0) : items.length - 1]
  24361. };
  24362. default:
  24363. return changes;
  24364. }
  24365. };
  24366. function CustomSelectControl({
  24367. className,
  24368. hideLabelFromVision,
  24369. label,
  24370. options: items,
  24371. onChange: onSelectedItemChange,
  24372. value: _selectedItem
  24373. }) {
  24374. const {
  24375. getLabelProps,
  24376. getToggleButtonProps,
  24377. getMenuProps,
  24378. getItemProps,
  24379. isOpen,
  24380. highlightedIndex,
  24381. selectedItem
  24382. } = useSelect({
  24383. initialSelectedItem: items[0],
  24384. items,
  24385. itemToString: custom_select_control_itemToString,
  24386. onSelectedItemChange,
  24387. selectedItem: _selectedItem,
  24388. stateReducer: custom_select_control_stateReducer
  24389. });
  24390. const menuProps = getMenuProps({
  24391. className: 'components-custom-select-control__menu',
  24392. 'aria-hidden': !isOpen
  24393. }); // We need this here, because the null active descendant is not
  24394. // fully ARIA compliant.
  24395. if (menuProps['aria-activedescendant'] && menuProps['aria-activedescendant'].slice(0, 'downshift-null'.length) === 'downshift-null') {
  24396. delete menuProps['aria-activedescendant'];
  24397. }
  24398. return Object(external_wp_element_["createElement"])("div", {
  24399. className: classnames_default()('components-custom-select-control', className)
  24400. }, hideLabelFromVision ? Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], Object(esm_extends["a" /* default */])({
  24401. as: "label"
  24402. }, getLabelProps()), label) :
  24403. /* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */
  24404. Object(external_wp_element_["createElement"])("label", getLabelProps({
  24405. className: 'components-custom-select-control__label'
  24406. }), label), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], getToggleButtonProps({
  24407. // This is needed because some speech recognition software don't support `aria-labelledby`.
  24408. 'aria-label': label,
  24409. 'aria-labelledby': undefined,
  24410. className: 'components-custom-select-control__button',
  24411. isSmall: true
  24412. }), custom_select_control_itemToString(selectedItem), Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  24413. icon: chevron_down["a" /* default */],
  24414. className: "components-custom-select-control__button-icon"
  24415. })), Object(external_wp_element_["createElement"])("ul", menuProps, isOpen && items.map((item, index) => // eslint-disable-next-line react/jsx-key
  24416. Object(external_wp_element_["createElement"])("li", getItemProps({
  24417. item,
  24418. index,
  24419. key: item.key,
  24420. className: classnames_default()(item.className, 'components-custom-select-control__item', {
  24421. 'is-highlighted': index === highlightedIndex
  24422. }),
  24423. style: item.style
  24424. }), item.name, item === selectedItem && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  24425. icon: check["a" /* default */],
  24426. className: "components-custom-select-control__item-icon"
  24427. })))));
  24428. }
  24429. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/dashicon/index.js
  24430. var dashicon = __webpack_require__("vUUf");
  24431. // EXTERNAL MODULE: ./node_modules/react-dates/initialize.js
  24432. var initialize = __webpack_require__("GG7f");
  24433. // EXTERNAL MODULE: external "moment"
  24434. var external_moment_ = __webpack_require__("wy2R");
  24435. var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_);
  24436. // EXTERNAL MODULE: ./node_modules/react-dates/lib/components/DayPickerSingleDateController.js
  24437. var DayPickerSingleDateController = __webpack_require__("Xtko");
  24438. var DayPickerSingleDateController_default = /*#__PURE__*/__webpack_require__.n(DayPickerSingleDateController);
  24439. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/date.js
  24440. /**
  24441. * External dependencies
  24442. */
  24443. // react-dates doesn't tree-shake correctly, so we import from the individual
  24444. // component here, to avoid including too much of the library
  24445. /**
  24446. * WordPress dependencies
  24447. */
  24448. /**
  24449. * Module Constants
  24450. */
  24451. const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
  24452. const ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';
  24453. function DatePickerDay({
  24454. day,
  24455. events = []
  24456. }) {
  24457. const ref = Object(external_wp_element_["useRef"])();
  24458. /*
  24459. * a11y hack to make the `There is/are n events` string
  24460. * available speaking for readers,
  24461. * re-defining the aria-label attribute.
  24462. * This attribute is handled by the react-dates component.
  24463. */
  24464. Object(external_wp_element_["useEffect"])(() => {
  24465. var _ref$current;
  24466. // Bail when no parent node.
  24467. if (!(ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.parentNode)) {
  24468. return;
  24469. }
  24470. const {
  24471. parentNode
  24472. } = ref.current;
  24473. const dayAriaLabel = external_moment_default()(day).format(ARIAL_LABEL_TIME_FORMAT);
  24474. if (!events.length) {
  24475. // Set aria-label without event description.
  24476. parentNode.setAttribute('aria-label', dayAriaLabel);
  24477. return;
  24478. }
  24479. const dayWithEventsDescription = Object(external_wp_i18n_["sprintf"])( // translators: 1: Calendar day format, 2: Calendar event number.
  24480. Object(external_wp_i18n_["_n"])('%1$s. There is %2$d event.', '%1$s. There are %2$d events.', events.length), dayAriaLabel, events.length);
  24481. parentNode.setAttribute('aria-label', dayWithEventsDescription);
  24482. }, [events.length]);
  24483. return Object(external_wp_element_["createElement"])("div", {
  24484. ref: ref,
  24485. className: classnames_default()('components-datetime__date__day', {
  24486. 'has-events': events === null || events === void 0 ? void 0 : events.length
  24487. })
  24488. }, day.format('D'));
  24489. }
  24490. class date_DatePicker extends external_wp_element_["Component"] {
  24491. constructor() {
  24492. super(...arguments);
  24493. this.onChangeMoment = this.onChangeMoment.bind(this);
  24494. this.nodeRef = Object(external_wp_element_["createRef"])();
  24495. this.onMonthPreviewedHandler = this.onMonthPreviewedHandler.bind(this);
  24496. }
  24497. onMonthPreviewedHandler(newMonthDate) {
  24498. var _this$props;
  24499. (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.onMonthPreviewed(newMonthDate.toISOString());
  24500. this.keepFocusInside();
  24501. }
  24502. /*
  24503. * Todo: We should remove this function ASAP.
  24504. * It is kept because focus is lost when we click on the previous and next month buttons.
  24505. * This focus loss closes the date picker popover.
  24506. * Ideally we should add an upstream commit on react-dates to fix this issue.
  24507. */
  24508. keepFocusInside() {
  24509. if (!this.nodeRef.current) {
  24510. return;
  24511. }
  24512. const {
  24513. ownerDocument
  24514. } = this.nodeRef.current;
  24515. const {
  24516. activeElement
  24517. } = ownerDocument; // If focus was lost.
  24518. if (!activeElement || !this.nodeRef.current.contains(ownerDocument.activeElement)) {
  24519. // Retrieve the focus region div.
  24520. const focusRegion = this.nodeRef.current.querySelector('.DayPicker_focusRegion');
  24521. if (!focusRegion) {
  24522. return;
  24523. } // Keep the focus on focus region.
  24524. focusRegion.focus();
  24525. }
  24526. }
  24527. onChangeMoment(newDate) {
  24528. const {
  24529. currentDate,
  24530. onChange
  24531. } = this.props; // If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
  24532. const momentDate = currentDate ? external_moment_default()(currentDate) : external_moment_default()();
  24533. const momentTime = {
  24534. hours: momentDate.hours(),
  24535. minutes: momentDate.minutes(),
  24536. seconds: 0
  24537. };
  24538. onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT)); // Keep focus on the date picker.
  24539. this.keepFocusInside();
  24540. }
  24541. /**
  24542. * Create a Moment object from a date string. With no currentDate supplied, default to a Moment
  24543. * object representing now. If a null value is passed, return a null value.
  24544. *
  24545. * @param {?string} currentDate Date representing the currently selected date or null to signify no selection.
  24546. * @return {?moment.Moment} Moment object for selected date or null.
  24547. */
  24548. getMomentDate(currentDate) {
  24549. if (null === currentDate) {
  24550. return null;
  24551. }
  24552. return currentDate ? external_moment_default()(currentDate) : external_moment_default()();
  24553. }
  24554. getEventsPerDay(day) {
  24555. var _this$props$events;
  24556. if (!((_this$props$events = this.props.events) !== null && _this$props$events !== void 0 && _this$props$events.length)) {
  24557. return [];
  24558. }
  24559. return this.props.events.filter(eventDay => day.isSame(eventDay.date, 'day'));
  24560. }
  24561. render() {
  24562. const {
  24563. currentDate,
  24564. isInvalidDate
  24565. } = this.props;
  24566. const momentDate = this.getMomentDate(currentDate);
  24567. return Object(external_wp_element_["createElement"])("div", {
  24568. className: "components-datetime__date",
  24569. ref: this.nodeRef
  24570. }, Object(external_wp_element_["createElement"])(DayPickerSingleDateController_default.a, {
  24571. date: momentDate,
  24572. daySize: 30,
  24573. focused: true,
  24574. hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
  24575. // https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
  24576. ,
  24577. key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
  24578. noBorder: true,
  24579. numberOfMonths: 1,
  24580. onDateChange: this.onChangeMoment,
  24581. transitionDuration: 0,
  24582. weekDayFormat: "ddd",
  24583. dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
  24584. isRTL: Object(external_wp_i18n_["isRTL"])(),
  24585. isOutsideRange: date => {
  24586. return isInvalidDate && isInvalidDate(date.toDate());
  24587. },
  24588. onPrevMonthClick: this.onMonthPreviewedHandler,
  24589. onNextMonthClick: this.onMonthPreviewedHandler,
  24590. renderDayContents: day => Object(external_wp_element_["createElement"])(DatePickerDay, {
  24591. day: day,
  24592. events: this.getEventsPerDay(day)
  24593. })
  24594. }));
  24595. }
  24596. }
  24597. /* harmony default export */ var date_time_date = (date_DatePicker);
  24598. // EXTERNAL MODULE: external ["wp","date"]
  24599. var external_wp_date_ = __webpack_require__("FqII");
  24600. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/timezone.js
  24601. /**
  24602. * WordPress dependencies
  24603. */
  24604. /**
  24605. * Internal dependencies
  24606. */
  24607. /**
  24608. * Displays timezone information when user timezone is different from site timezone.
  24609. */
  24610. const TimeZone = () => {
  24611. const {
  24612. timezone
  24613. } = Object(external_wp_date_["__experimentalGetSettings"])(); // Convert timezone offset to hours.
  24614. const userTimezoneOffset = -1 * (new Date().getTimezoneOffset() / 60); // System timezone and user timezone match, nothing needed.
  24615. // Compare as numbers because it comes over as string.
  24616. if (Number(timezone.offset) === userTimezoneOffset) {
  24617. return null;
  24618. }
  24619. const offsetSymbol = timezone.offset >= 0 ? '+' : '';
  24620. const zoneAbbr = '' !== timezone.abbr && isNaN(timezone.abbr) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offset}`;
  24621. const timezoneDetail = 'UTC' === timezone.string ? Object(external_wp_i18n_["__"])('Coordinated Universal Time') : `(${zoneAbbr}) ${timezone.string.replace('_', ' ')}`;
  24622. return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
  24623. position: "top center",
  24624. text: timezoneDetail
  24625. }, Object(external_wp_element_["createElement"])("div", {
  24626. className: "components-datetime__timezone"
  24627. }, zoneAbbr));
  24628. };
  24629. /* harmony default export */ var date_time_timezone = (TimeZone);
  24630. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/time.js
  24631. /**
  24632. * External dependencies
  24633. */
  24634. /**
  24635. * WordPress dependencies
  24636. */
  24637. /**
  24638. * Internal dependencies
  24639. */
  24640. /**
  24641. * Module Constants
  24642. */
  24643. const time_TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
  24644. /**
  24645. * <UpdateOnBlurAsIntegerField>
  24646. * A shared component to parse, validate, and handle remounting of the underlying form field element like <input> and <select>.
  24647. *
  24648. * @param {Object} props Component props.
  24649. * @param {string} props.as Render the component as specific element tag, defaults to "input".
  24650. * @param {number|string} props.value The default value of the component which will be parsed to integer.
  24651. * @param {Function} props.onUpdate Call back when blurred and validated.
  24652. */
  24653. function UpdateOnBlurAsIntegerField({
  24654. as,
  24655. value,
  24656. onUpdate,
  24657. ...props
  24658. }) {
  24659. function handleBlur(event) {
  24660. const {
  24661. target
  24662. } = event;
  24663. if (value === target.value) {
  24664. return;
  24665. }
  24666. const parsedValue = parseInt(target.value, 10); // Run basic number validation on the input.
  24667. if (!Object(external_lodash_["isInteger"])(parsedValue) || typeof props.max !== 'undefined' && parsedValue > props.max || typeof props.min !== 'undefined' && parsedValue < props.min) {
  24668. // If validation failed, reset the value to the previous valid value.
  24669. target.value = value;
  24670. } else {
  24671. // Otherwise, it's valid, call onUpdate.
  24672. onUpdate(target.name, parsedValue);
  24673. }
  24674. }
  24675. return Object(external_wp_element_["createElement"])(as || 'input', {
  24676. // Re-mount the input value to accept the latest value as the defaultValue.
  24677. key: value,
  24678. defaultValue: value,
  24679. onBlur: handleBlur,
  24680. ...props
  24681. });
  24682. }
  24683. /**
  24684. * <TimePicker>
  24685. *
  24686. * @typedef {Date|string|number} WPValidDateTimeFormat
  24687. *
  24688. * @param {Object} props Component props.
  24689. * @param {boolean} props.is12Hour Should the time picker showed in 12 hour format or 24 hour format.
  24690. * @param {WPValidDateTimeFormat} props.currentTime The initial current time the time picker should render.
  24691. * @param {Function} props.onChange Callback function when the date changed.
  24692. */
  24693. function TimePicker({
  24694. is12Hour,
  24695. currentTime,
  24696. onChange
  24697. }) {
  24698. const [date, setDate] = Object(external_wp_element_["useState"])(() => // Truncate the date at the minutes, see: #15495.
  24699. external_moment_default()(currentTime).startOf('minutes')); // Reset the state when currentTime changed.
  24700. Object(external_wp_element_["useEffect"])(() => {
  24701. setDate(currentTime ? external_moment_default()(currentTime).startOf('minutes') : external_moment_default()());
  24702. }, [currentTime]);
  24703. const {
  24704. day,
  24705. month,
  24706. year,
  24707. minutes,
  24708. hours,
  24709. am
  24710. } = Object(external_wp_element_["useMemo"])(() => ({
  24711. day: date.format('DD'),
  24712. month: date.format('MM'),
  24713. year: date.format('YYYY'),
  24714. minutes: date.format('mm'),
  24715. hours: date.format(is12Hour ? 'hh' : 'HH'),
  24716. am: date.format('H') <= 11 ? 'AM' : 'PM'
  24717. }), [date, is12Hour]);
  24718. /**
  24719. * Function that sets the date state and calls the onChange with a new date.
  24720. * The date is truncated at the minutes.
  24721. *
  24722. * @param {Object} newDate The date object.
  24723. */
  24724. function changeDate(newDate) {
  24725. setDate(newDate);
  24726. onChange(newDate.format(time_TIMEZONELESS_FORMAT));
  24727. }
  24728. function update(name, value) {
  24729. // Clone the date and call the specific setter function according to `name`.
  24730. const newDate = date.clone()[name](value);
  24731. changeDate(newDate);
  24732. }
  24733. function updateAmPm(value) {
  24734. return () => {
  24735. if (am === value) {
  24736. return;
  24737. }
  24738. const parsedHours = parseInt(hours, 10);
  24739. const newDate = date.clone().hours(value === 'PM' ? (parsedHours % 12 + 12) % 24 : parsedHours % 12);
  24740. changeDate(newDate);
  24741. };
  24742. }
  24743. const dayFormat = Object(external_wp_element_["createElement"])("div", {
  24744. className: "components-datetime__time-field components-datetime__time-field-day"
  24745. }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, {
  24746. "aria-label": Object(external_wp_i18n_["__"])('Day'),
  24747. className: "components-datetime__time-field-day-input",
  24748. type: "number" // The correct function to call in moment.js is "date" not "day".
  24749. ,
  24750. name: "date",
  24751. value: day,
  24752. step: 1,
  24753. min: 1,
  24754. max: 31,
  24755. onUpdate: update
  24756. }));
  24757. const monthFormat = Object(external_wp_element_["createElement"])("div", {
  24758. className: "components-datetime__time-field components-datetime__time-field-month"
  24759. }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, {
  24760. as: "select",
  24761. "aria-label": Object(external_wp_i18n_["__"])('Month'),
  24762. className: "components-datetime__time-field-month-select",
  24763. name: "month",
  24764. value: month // The value starts from 0, so we have to -1 when setting month.
  24765. ,
  24766. onUpdate: (key, value) => update(key, value - 1)
  24767. }, Object(external_wp_element_["createElement"])("option", {
  24768. value: "01"
  24769. }, Object(external_wp_i18n_["__"])('January')), Object(external_wp_element_["createElement"])("option", {
  24770. value: "02"
  24771. }, Object(external_wp_i18n_["__"])('February')), Object(external_wp_element_["createElement"])("option", {
  24772. value: "03"
  24773. }, Object(external_wp_i18n_["__"])('March')), Object(external_wp_element_["createElement"])("option", {
  24774. value: "04"
  24775. }, Object(external_wp_i18n_["__"])('April')), Object(external_wp_element_["createElement"])("option", {
  24776. value: "05"
  24777. }, Object(external_wp_i18n_["__"])('May')), Object(external_wp_element_["createElement"])("option", {
  24778. value: "06"
  24779. }, Object(external_wp_i18n_["__"])('June')), Object(external_wp_element_["createElement"])("option", {
  24780. value: "07"
  24781. }, Object(external_wp_i18n_["__"])('July')), Object(external_wp_element_["createElement"])("option", {
  24782. value: "08"
  24783. }, Object(external_wp_i18n_["__"])('August')), Object(external_wp_element_["createElement"])("option", {
  24784. value: "09"
  24785. }, Object(external_wp_i18n_["__"])('September')), Object(external_wp_element_["createElement"])("option", {
  24786. value: "10"
  24787. }, Object(external_wp_i18n_["__"])('October')), Object(external_wp_element_["createElement"])("option", {
  24788. value: "11"
  24789. }, Object(external_wp_i18n_["__"])('November')), Object(external_wp_element_["createElement"])("option", {
  24790. value: "12"
  24791. }, Object(external_wp_i18n_["__"])('December'))));
  24792. const dayMonthFormat = is12Hour ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, dayFormat, monthFormat) : Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, monthFormat, dayFormat);
  24793. return Object(external_wp_element_["createElement"])("div", {
  24794. className: classnames_default()('components-datetime__time')
  24795. }, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("legend", {
  24796. className: "components-datetime__time-legend invisible"
  24797. }, Object(external_wp_i18n_["__"])('Date')), Object(external_wp_element_["createElement"])("div", {
  24798. className: "components-datetime__time-wrapper"
  24799. }, dayMonthFormat, Object(external_wp_element_["createElement"])("div", {
  24800. className: "components-datetime__time-field components-datetime__time-field-year"
  24801. }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, {
  24802. "aria-label": Object(external_wp_i18n_["__"])('Year'),
  24803. className: "components-datetime__time-field-year-input",
  24804. type: "number",
  24805. name: "year",
  24806. step: 1,
  24807. min: 0,
  24808. max: 9999,
  24809. value: year,
  24810. onUpdate: update
  24811. })))), Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("legend", {
  24812. className: "components-datetime__time-legend invisible"
  24813. }, Object(external_wp_i18n_["__"])('Time')), Object(external_wp_element_["createElement"])("div", {
  24814. className: "components-datetime__time-wrapper"
  24815. }, Object(external_wp_element_["createElement"])("div", {
  24816. className: "components-datetime__time-field components-datetime__time-field-time"
  24817. }, Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, {
  24818. "aria-label": Object(external_wp_i18n_["__"])('Hours'),
  24819. className: "components-datetime__time-field-hours-input",
  24820. type: "number",
  24821. name: "hours",
  24822. step: 1,
  24823. min: is12Hour ? 1 : 0,
  24824. max: is12Hour ? 12 : 23,
  24825. value: hours,
  24826. onUpdate: update
  24827. }), Object(external_wp_element_["createElement"])("span", {
  24828. className: "components-datetime__time-separator",
  24829. "aria-hidden": "true"
  24830. }, ":"), Object(external_wp_element_["createElement"])(UpdateOnBlurAsIntegerField, {
  24831. "aria-label": Object(external_wp_i18n_["__"])('Minutes'),
  24832. className: "components-datetime__time-field-minutes-input",
  24833. type: "number",
  24834. name: "minutes",
  24835. step: 1,
  24836. min: 0,
  24837. max: 59,
  24838. value: minutes,
  24839. onUpdate: update
  24840. })), is12Hour && Object(external_wp_element_["createElement"])(button_group, {
  24841. className: "components-datetime__time-field components-datetime__time-field-am-pm"
  24842. }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  24843. isPrimary: am === 'AM',
  24844. isSecondary: am !== 'AM',
  24845. onClick: updateAmPm('AM'),
  24846. className: "components-datetime__time-am-button"
  24847. }, Object(external_wp_i18n_["__"])('AM')), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  24848. isPrimary: am === 'PM',
  24849. isSecondary: am !== 'PM',
  24850. onClick: updateAmPm('PM'),
  24851. className: "components-datetime__time-pm-button"
  24852. }, Object(external_wp_i18n_["__"])('PM'))), Object(external_wp_element_["createElement"])(date_time_timezone, null))));
  24853. }
  24854. /* harmony default export */ var time = (TimePicker);
  24855. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/index.js
  24856. /**
  24857. * External dependencies
  24858. */
  24859. // Needed to initialise the default datepicker styles.
  24860. // See: https://github.com/airbnb/react-dates#initialize
  24861. /**
  24862. * WordPress dependencies
  24863. */
  24864. /**
  24865. * Internal dependencies
  24866. */
  24867. function DateTimePicker({
  24868. currentDate,
  24869. is12Hour,
  24870. isInvalidDate,
  24871. onMonthPreviewed = external_lodash_["noop"],
  24872. onChange,
  24873. events
  24874. }, ref) {
  24875. const [calendarHelpIsVisible, setCalendarHelpIsVisible] = Object(external_wp_element_["useState"])(false);
  24876. function onClickDescriptionToggle() {
  24877. setCalendarHelpIsVisible(!calendarHelpIsVisible);
  24878. }
  24879. return Object(external_wp_element_["createElement"])("div", {
  24880. ref: ref,
  24881. className: "components-datetime"
  24882. }, !calendarHelpIsVisible && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(time, {
  24883. currentTime: currentDate,
  24884. onChange: onChange,
  24885. is12Hour: is12Hour
  24886. }), Object(external_wp_element_["createElement"])(date_time_date, {
  24887. currentDate: currentDate,
  24888. onChange: onChange,
  24889. isInvalidDate: isInvalidDate,
  24890. events: events,
  24891. onMonthPreviewed: onMonthPreviewed
  24892. })), calendarHelpIsVisible && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
  24893. className: "components-datetime__calendar-help"
  24894. }, Object(external_wp_element_["createElement"])("h4", null, Object(external_wp_i18n_["__"])('Click to Select')), Object(external_wp_element_["createElement"])("ul", null, Object(external_wp_element_["createElement"])("li", null, Object(external_wp_i18n_["__"])('Click the right or left arrows to select other months in the past or the future.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_i18n_["__"])('Click the desired day to select it.'))), Object(external_wp_element_["createElement"])("h4", null, Object(external_wp_i18n_["__"])('Navigating with a keyboard')), Object(external_wp_element_["createElement"])("ul", null, Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", {
  24895. "aria-label": Object(external_wp_i18n_["_x"])('Enter', 'keyboard button')
  24896. }, "\u21B5"), ' '
  24897. /* JSX removes whitespace, but a space is required for screen readers. */
  24898. , Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Select the date in focus.'))), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", {
  24899. "aria-label": Object(external_wp_i18n_["__"])('Left and Right Arrows')
  24900. }, "\u2190/\u2192"), ' '
  24901. /* JSX removes whitespace, but a space is required for screen readers. */
  24902. , Object(external_wp_i18n_["__"])('Move backward (left) or forward (right) by one day.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", {
  24903. "aria-label": Object(external_wp_i18n_["__"])('Up and Down Arrows')
  24904. }, "\u2191/\u2193"), ' '
  24905. /* JSX removes whitespace, but a space is required for screen readers. */
  24906. , Object(external_wp_i18n_["__"])('Move backward (up) or forward (down) by one week.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", {
  24907. "aria-label": Object(external_wp_i18n_["__"])('Page Up and Page Down')
  24908. }, Object(external_wp_i18n_["__"])('PgUp/PgDn')), ' '
  24909. /* JSX removes whitespace, but a space is required for screen readers. */
  24910. , Object(external_wp_i18n_["__"])('Move backward (PgUp) or forward (PgDn) by one month.')), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])("abbr", {
  24911. "aria-label": Object(external_wp_i18n_["__"])('Home and End')
  24912. }, Object(external_wp_i18n_["__"])('Home/End')), ' '
  24913. /* JSX removes whitespace, but a space is required for screen readers. */
  24914. , Object(external_wp_i18n_["__"])('Go to the first (home) or last (end) day of a week.'))))), Object(external_wp_element_["createElement"])("div", {
  24915. className: "components-datetime__buttons"
  24916. }, !calendarHelpIsVisible && currentDate && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  24917. className: "components-datetime__date-reset-button",
  24918. isLink: true,
  24919. onClick: () => onChange(null)
  24920. }, Object(external_wp_i18n_["__"])('Reset')), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  24921. className: "components-datetime__date-help-toggle",
  24922. isLink: true,
  24923. onClick: onClickDescriptionToggle
  24924. }, calendarHelpIsVisible ? Object(external_wp_i18n_["__"])('Close') : Object(external_wp_i18n_["__"])('Calendar Help'))));
  24925. }
  24926. /* harmony default export */ var date_time = (Object(external_wp_element_["forwardRef"])(DateTimePicker));
  24927. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js
  24928. var components_build_module_icon = __webpack_require__("9VDH");
  24929. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js
  24930. /**
  24931. * External dependencies
  24932. */
  24933. /**
  24934. * Internal dependencies
  24935. */
  24936. const select_control_styles_disabledStyles = ({
  24937. disabled
  24938. }) => {
  24939. if (!disabled) return '';
  24940. return /*#__PURE__*/css_browser_esm({
  24941. color: COLORS.ui.textDisabled
  24942. }, true ? "" : undefined);
  24943. };
  24944. const select_control_styles_fontSizeStyles = ({
  24945. size
  24946. }) => {
  24947. const sizes = {
  24948. default: '13px',
  24949. small: '11px'
  24950. };
  24951. const fontSize = sizes[size];
  24952. const fontSizeMobile = '16px';
  24953. if (!fontSize) return '';
  24954. return /*#__PURE__*/css_browser_esm("font-size:", fontSizeMobile, ";@media ( min-width:600px ){font-size:", fontSize, ";}" + ( true ? "" : undefined));
  24955. };
  24956. const select_control_styles_sizeStyles = ({
  24957. size
  24958. }) => {
  24959. const sizes = {
  24960. default: {
  24961. height: 30,
  24962. lineHeight: 1,
  24963. minHeight: 30
  24964. },
  24965. small: {
  24966. height: 24,
  24967. lineHeight: 1,
  24968. minHeight: 24
  24969. }
  24970. };
  24971. const style = sizes[size] || sizes.default;
  24972. return /*#__PURE__*/css_browser_esm(style, true ? "" : undefined);
  24973. }; // TODO: Resolve need to use &&& to increase specificity
  24974. // https://github.com/WordPress/gutenberg/issues/18483
  24975. const Select = styled_base_browser_esm("select", {
  24976. target: "e12x0a390",
  24977. label: "Select"
  24978. })("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:", COLORS.black, ";display:block;margin:0;width:100%;", select_control_styles_disabledStyles, ";", select_control_styles_fontSizeStyles, ";", select_control_styles_sizeStyles, ";", rtl_rtl({
  24979. paddingLeft: 8,
  24980. paddingRight: 24
  24981. })(), "}" + ( true ? "" : undefined));
  24982. const DownArrowWrapper = styled_base_browser_esm("div", {
  24983. target: "e12x0a391",
  24984. label: "DownArrowWrapper"
  24985. })("align-items:center;bottom:0;box-sizing:border-box;display:flex;padding:0 4px;pointer-events:none;position:absolute;top:0;", rtl_rtl({
  24986. right: 0
  24987. })(), " svg{display:block;}" + ( true ? "" : undefined));
  24988. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/index.js
  24989. /**
  24990. * External dependencies
  24991. */
  24992. /**
  24993. * WordPress dependencies
  24994. */
  24995. /**
  24996. * Internal dependencies
  24997. */
  24998. function select_control_useUniqueId(idProp) {
  24999. const instanceId = Object(external_wp_compose_["useInstanceId"])(SelectControl);
  25000. const id = `inspector-select-control-${instanceId}`;
  25001. return idProp || id;
  25002. }
  25003. function SelectControl({
  25004. className,
  25005. disabled = false,
  25006. help,
  25007. hideLabelFromVision,
  25008. id: idProp,
  25009. label,
  25010. multiple = false,
  25011. onBlur = external_lodash_["noop"],
  25012. onChange = external_lodash_["noop"],
  25013. onFocus = external_lodash_["noop"],
  25014. options = [],
  25015. size = 'default',
  25016. value: valueProp,
  25017. labelPosition = 'top',
  25018. ...props
  25019. }, ref) {
  25020. const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false);
  25021. const id = select_control_useUniqueId(idProp);
  25022. const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning
  25023. if (Object(external_lodash_["isEmpty"])(options)) return null;
  25024. const handleOnBlur = event => {
  25025. onBlur(event);
  25026. setIsFocused(false);
  25027. };
  25028. const handleOnFocus = event => {
  25029. onFocus(event);
  25030. setIsFocused(true);
  25031. };
  25032. const handleOnChange = event => {
  25033. if (multiple) {
  25034. const selectedOptions = [...event.target.options].filter(({
  25035. selected
  25036. }) => selected);
  25037. const newValues = selectedOptions.map(({
  25038. value
  25039. }) => value);
  25040. onChange(newValues);
  25041. return;
  25042. }
  25043. onChange(event.target.value, {
  25044. event
  25045. });
  25046. };
  25047. const classes = classnames_default()('components-select-control', className);
  25048. /* eslint-disable jsx-a11y/no-onchange */
  25049. return Object(external_wp_element_["createElement"])(base_control, {
  25050. help: help
  25051. }, Object(external_wp_element_["createElement"])(input_base, Object(esm_extends["a" /* default */])({
  25052. className: classes,
  25053. disabled: disabled,
  25054. hideLabelFromVision: hideLabelFromVision,
  25055. id: id,
  25056. isFocused: isFocused,
  25057. label: label,
  25058. size: size,
  25059. suffix: Object(external_wp_element_["createElement"])(DownArrowWrapper, null, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  25060. icon: chevron_down["a" /* default */],
  25061. size: 18
  25062. })),
  25063. labelPosition: labelPosition
  25064. }, props), Object(external_wp_element_["createElement"])(Select, Object(esm_extends["a" /* default */])({}, props, {
  25065. "aria-describedby": helpId,
  25066. className: "components-select-control__input",
  25067. disabled: disabled,
  25068. id: id,
  25069. multiple: multiple,
  25070. onBlur: handleOnBlur,
  25071. onChange: handleOnChange,
  25072. onFocus: handleOnFocus,
  25073. ref: ref,
  25074. size: size,
  25075. value: valueProp
  25076. }), options.map((option, index) => {
  25077. const key = option.id || `${option.label}-${option.value}-${index}`;
  25078. return Object(external_wp_element_["createElement"])("option", {
  25079. key: key,
  25080. value: option.value,
  25081. disabled: option.disabled
  25082. }, option.label);
  25083. }))));
  25084. /* eslint-enable jsx-a11y/no-onchange */
  25085. }
  25086. const select_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(SelectControl);
  25087. /* harmony default export */ var select_control = (select_control_ForwardedComponent);
  25088. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dimension-control/sizes.js
  25089. /**
  25090. * Sizes
  25091. *
  25092. * defines the sizes used in dimension controls
  25093. * all hardcoded `size` values are based on the value of
  25094. * the Sass variable `$block-padding` from
  25095. * `packages/block-editor/src/components/dimension-control/sizes.js`.
  25096. */
  25097. /**
  25098. * WordPress dependencies
  25099. */
  25100. /**
  25101. * Finds the correct size object from the provided sizes
  25102. * table by size slug (eg: `medium`)
  25103. *
  25104. * @param {Array} sizes containing objects for each size definition
  25105. * @param {string} slug a string representation of the size (eg: `medium`)
  25106. * @return {Object} the matching size definition
  25107. */
  25108. const findSizeBySlug = (sizes, slug) => sizes.find(size => slug === size.slug);
  25109. /* harmony default export */ var dimension_control_sizes = ([{
  25110. name: Object(external_wp_i18n_["__"])('None'),
  25111. slug: 'none'
  25112. }, {
  25113. name: Object(external_wp_i18n_["__"])('Small'),
  25114. slug: 'small'
  25115. }, {
  25116. name: Object(external_wp_i18n_["__"])('Medium'),
  25117. slug: 'medium'
  25118. }, {
  25119. name: Object(external_wp_i18n_["__"])('Large'),
  25120. slug: 'large'
  25121. }, {
  25122. name: Object(external_wp_i18n_["__"])('Extra Large'),
  25123. slug: 'xlarge'
  25124. }]);
  25125. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dimension-control/index.js
  25126. /**
  25127. * External dependencies
  25128. */
  25129. /**
  25130. * WordPress dependencies
  25131. */
  25132. /**
  25133. * Internal dependencies
  25134. */
  25135. /**
  25136. * Internal dependencies
  25137. */
  25138. function DimensionControl(props) {
  25139. const {
  25140. label,
  25141. value,
  25142. sizes = dimension_control_sizes,
  25143. icon,
  25144. onChange,
  25145. className = ''
  25146. } = props;
  25147. const onChangeSpacingSize = val => {
  25148. const theSize = findSizeBySlug(sizes, val);
  25149. if (!theSize || value === theSize.slug) {
  25150. onChange(undefined);
  25151. } else if (Object(external_lodash_["isFunction"])(onChange)) {
  25152. onChange(theSize.slug);
  25153. }
  25154. };
  25155. const formatSizesAsOptions = theSizes => {
  25156. const options = theSizes.map(({
  25157. name,
  25158. slug
  25159. }) => ({
  25160. label: name,
  25161. value: slug
  25162. }));
  25163. return [{
  25164. label: Object(external_wp_i18n_["__"])('Default'),
  25165. value: ''
  25166. }].concat(options);
  25167. };
  25168. const selectLabel = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  25169. icon: icon
  25170. }), label);
  25171. return Object(external_wp_element_["createElement"])(select_control, {
  25172. className: classnames_default()(className, 'block-editor-dimension-control'),
  25173. label: selectLabel,
  25174. hideLabelFromVision: false,
  25175. value: value,
  25176. onChange: onChangeSpacingSize,
  25177. options: formatSizesAsOptions(sizes)
  25178. });
  25179. }
  25180. /* harmony default export */ var dimension_control = (DimensionControl);
  25181. // EXTERNAL MODULE: external ["wp","dom"]
  25182. var external_wp_dom_ = __webpack_require__("1CF3");
  25183. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disabled/styles/disabled-styles.js
  25184. function disabled_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  25185. const StyledWrapper = styled_base_browser_esm("div", {
  25186. target: "e1ac3xxk0",
  25187. label: "StyledWrapper"
  25188. })( true ? {
  25189. name: "u2jump",
  25190. styles: "position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"
  25191. } : undefined);
  25192. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disabled/index.js
  25193. /**
  25194. * External dependencies
  25195. */
  25196. /**
  25197. * WordPress dependencies
  25198. */
  25199. /**
  25200. * Internal dependencies
  25201. */
  25202. const Context = Object(external_wp_element_["createContext"])(false);
  25203. const {
  25204. Consumer,
  25205. Provider: disabled_Provider
  25206. } = Context;
  25207. /**
  25208. * Names of control nodes which qualify for disabled behavior.
  25209. *
  25210. * See WHATWG HTML Standard: 4.10.18.5: "Enabling and disabling form controls: the disabled attribute".
  25211. *
  25212. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute
  25213. *
  25214. * @type {string[]}
  25215. */
  25216. const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP', 'OPTION', 'SELECT', 'TEXTAREA'];
  25217. function Disabled({
  25218. className,
  25219. children,
  25220. isDisabled = true,
  25221. ...props
  25222. }) {
  25223. const node = Object(external_wp_element_["useRef"])();
  25224. const disable = () => {
  25225. external_wp_dom_["focus"].focusable.find(node.current).forEach(focusable => {
  25226. if (Object(external_lodash_["includes"])(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
  25227. focusable.setAttribute('disabled', '');
  25228. }
  25229. if (focusable.nodeName === 'A') {
  25230. focusable.setAttribute('tabindex', -1);
  25231. }
  25232. const tabIndex = focusable.getAttribute('tabindex');
  25233. if (tabIndex !== null && tabIndex !== '-1') {
  25234. focusable.removeAttribute('tabindex');
  25235. }
  25236. if (focusable.hasAttribute('contenteditable')) {
  25237. focusable.setAttribute('contenteditable', 'false');
  25238. }
  25239. });
  25240. }; // Debounce re-disable since disabling process itself will incur
  25241. // additional mutations which should be ignored.
  25242. const debouncedDisable = Object(external_wp_element_["useCallback"])(Object(external_lodash_["debounce"])(disable, {
  25243. leading: true
  25244. }), []);
  25245. Object(external_wp_element_["useLayoutEffect"])(() => {
  25246. if (!isDisabled) {
  25247. return;
  25248. }
  25249. disable();
  25250. const observer = new window.MutationObserver(debouncedDisable);
  25251. observer.observe(node.current, {
  25252. childList: true,
  25253. attributes: true,
  25254. subtree: true
  25255. });
  25256. return () => {
  25257. observer.disconnect();
  25258. debouncedDisable.cancel();
  25259. };
  25260. }, []);
  25261. if (!isDisabled) {
  25262. return Object(external_wp_element_["createElement"])(disabled_Provider, {
  25263. value: false
  25264. }, children);
  25265. }
  25266. return Object(external_wp_element_["createElement"])(disabled_Provider, {
  25267. value: true
  25268. }, Object(external_wp_element_["createElement"])(StyledWrapper, Object(esm_extends["a" /* default */])({
  25269. ref: node,
  25270. className: classnames_default()(className, 'components-disabled')
  25271. }, props), children));
  25272. }
  25273. Disabled.Context = Context;
  25274. Disabled.Consumer = Consumer;
  25275. /* harmony default export */ var build_module_disabled = (Disabled);
  25276. // CONCATENATED MODULE: ./node_modules/reakit/es/__keys-e6a5cfbe.js
  25277. // Automatically generated
  25278. var DISCLOSURE_STATE_KEYS = ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation"];
  25279. var DISCLOSURE_KEYS = DISCLOSURE_STATE_KEYS;
  25280. var DISCLOSURE_CONTENT_KEYS = DISCLOSURE_KEYS;
  25281. // CONCATENATED MODULE: ./node_modules/reakit/es/Disclosure/DisclosureContent.js
  25282. var useDisclosureContent = Object(createHook["a" /* createHook */])({
  25283. name: "DisclosureContent",
  25284. compose: Role["a" /* useRole */],
  25285. keys: DISCLOSURE_CONTENT_KEYS,
  25286. useProps: function useProps(options, _ref) {
  25287. var htmlOnTransitionEnd = _ref.onTransitionEnd,
  25288. htmlOnAnimationEnd = _ref.onAnimationEnd,
  25289. htmlStyle = _ref.style,
  25290. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["onTransitionEnd", "onAnimationEnd", "style"]);
  25291. var animating = options.animated && options.animating;
  25292. var _React$useState = Object(external_React_["useState"])(null),
  25293. transition = _React$useState[0],
  25294. setTransition = _React$useState[1];
  25295. var hidden = !options.visible && !animating;
  25296. var style = hidden ? Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  25297. display: "none"
  25298. }, htmlStyle) : htmlStyle;
  25299. var onTransitionEndRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnTransitionEnd);
  25300. var onAnimationEndRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnAnimationEnd);
  25301. var raf = Object(external_React_["useRef"])(0);
  25302. Object(external_React_["useEffect"])(function () {
  25303. if (!options.animated) return undefined; // Double RAF is needed so the browser has enough time to paint the
  25304. // default styles before processing the `data-enter` attribute. Otherwise
  25305. // it wouldn't be considered a transition.
  25306. // See https://github.com/reakit/reakit/issues/643
  25307. raf.current = window.requestAnimationFrame(function () {
  25308. raf.current = window.requestAnimationFrame(function () {
  25309. if (options.visible) {
  25310. setTransition("enter");
  25311. } else if (animating) {
  25312. setTransition("leave");
  25313. } else {
  25314. setTransition(null);
  25315. }
  25316. });
  25317. });
  25318. return function () {
  25319. return window.cancelAnimationFrame(raf.current);
  25320. };
  25321. }, [options.animated, options.visible, animating]);
  25322. var onEnd = Object(external_React_["useCallback"])(function (event) {
  25323. if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return;
  25324. if (!animating) return; // Ignores number animated
  25325. if (options.animated === true) {
  25326. var _options$stopAnimatio;
  25327. (_options$stopAnimatio = options.stopAnimation) === null || _options$stopAnimatio === void 0 ? void 0 : _options$stopAnimatio.call(options);
  25328. }
  25329. }, [options.animated, animating, options.stopAnimation]);
  25330. var onTransitionEnd = Object(external_React_["useCallback"])(function (event) {
  25331. var _onTransitionEndRef$c;
  25332. (_onTransitionEndRef$c = onTransitionEndRef.current) === null || _onTransitionEndRef$c === void 0 ? void 0 : _onTransitionEndRef$c.call(onTransitionEndRef, event);
  25333. onEnd(event);
  25334. }, [onEnd]);
  25335. var onAnimationEnd = Object(external_React_["useCallback"])(function (event) {
  25336. var _onAnimationEndRef$cu;
  25337. (_onAnimationEndRef$cu = onAnimationEndRef.current) === null || _onAnimationEndRef$cu === void 0 ? void 0 : _onAnimationEndRef$cu.call(onAnimationEndRef, event);
  25338. onEnd(event);
  25339. }, [onEnd]);
  25340. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  25341. id: options.baseId,
  25342. "data-enter": transition === "enter" ? "" : undefined,
  25343. "data-leave": transition === "leave" ? "" : undefined,
  25344. onTransitionEnd: onTransitionEnd,
  25345. onAnimationEnd: onAnimationEnd,
  25346. hidden: hidden,
  25347. style: style
  25348. }, htmlProps);
  25349. }
  25350. });
  25351. var DisclosureContent = Object(createComponent["a" /* createComponent */])({
  25352. as: "div",
  25353. useHook: useDisclosureContent
  25354. });
  25355. // CONCATENATED MODULE: ./node_modules/reakit/es/Separator/Separator.js
  25356. // Automatically generated
  25357. var SEPARATOR_KEYS = ["orientation"];
  25358. var useSeparator = Object(createHook["a" /* createHook */])({
  25359. name: "Separator",
  25360. compose: Role["a" /* useRole */],
  25361. keys: SEPARATOR_KEYS,
  25362. useOptions: function useOptions(_ref) {
  25363. var _ref$orientation = _ref.orientation,
  25364. orientation = _ref$orientation === void 0 ? "horizontal" : _ref$orientation,
  25365. options = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["orientation"]);
  25366. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  25367. orientation: orientation
  25368. }, options);
  25369. },
  25370. useProps: function useProps(options, htmlProps) {
  25371. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  25372. role: "separator",
  25373. "aria-orientation": options.orientation
  25374. }, htmlProps);
  25375. }
  25376. });
  25377. var Separator = Object(createComponent["a" /* createComponent */])({
  25378. as: "hr",
  25379. memo: true,
  25380. useHook: useSeparator
  25381. });
  25382. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/divider/styles.js
  25383. /**
  25384. * Internal dependencies
  25385. */
  25386. const Divider = /*#__PURE__*/Object(emotion_esm["a" /* css */])("border-color:", config_values.colorDivider, ";border-width:0 0 1px 0;height:0;margin:0;width:auto;;label:Divider;" + ( true ? "" : undefined));
  25387. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/divider/component.js
  25388. // eslint-disable-next-line no-restricted-imports
  25389. // eslint-disable-next-line no-restricted-imports, no-duplicate-imports
  25390. /**
  25391. * WordPress dependencies
  25392. */
  25393. /**
  25394. * Internal dependencies
  25395. */
  25396. // eslint-disable-next-line no-duplicate-imports
  25397. function component_Divider(props, forwardedRef) {
  25398. const {
  25399. className,
  25400. margin,
  25401. marginBottom,
  25402. marginTop,
  25403. ...otherProps
  25404. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Divider');
  25405. const classes = Object(external_wp_element_["useMemo"])(() => {
  25406. const sx = {};
  25407. if (typeof margin !== 'undefined') {
  25408. sx.margin = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(margin), ";margin-top:", space_space(margin), ";" + ( true ? "" : undefined));
  25409. } else {
  25410. if (typeof marginTop !== 'undefined') {
  25411. sx.marginTop = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-top:", space_space(marginTop), ";" + ( true ? "" : undefined));
  25412. }
  25413. if (typeof marginBottom !== 'undefined') {
  25414. sx.marginBottom = /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginBottom), ";" + ( true ? "" : undefined));
  25415. }
  25416. }
  25417. return Object(emotion_esm["b" /* cx */])(Divider, sx.marginBottom, sx.marginTop, sx.margin, className);
  25418. }, [className, margin, marginBottom, marginTop]);
  25419. return Object(external_wp_element_["createElement"])(Separator, Object(esm_extends["a" /* default */])({
  25420. as: "hr"
  25421. }, otherProps, {
  25422. className: classes,
  25423. ref: forwardedRef
  25424. }));
  25425. }
  25426. /**
  25427. * `Divider` is a layout component that separates groups of related content.
  25428. *
  25429. * @example
  25430. * ```js
  25431. * import {
  25432. * __experimentalDivider as Divider,
  25433. * __experimentalText as Text }
  25434. * from `@wordpress/components`;
  25435. *
  25436. * function Example() {
  25437. * return (
  25438. * <ListGroup>
  25439. * <FormGroup>...</FormGroup>
  25440. * <Divider />
  25441. * <FormGroup>...</FormGroup>
  25442. * </ListGroup>
  25443. * );
  25444. * }
  25445. * ```
  25446. */
  25447. const ConnectedDivider = Object(context_connect["a" /* contextConnect */])(component_Divider, 'Divider');
  25448. /* harmony default export */ var divider_component = (ConnectedDivider);
  25449. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/draggable/index.js
  25450. /**
  25451. * WordPress dependencies
  25452. */
  25453. const dragImageClass = 'components-draggable__invisible-drag-image';
  25454. const cloneWrapperClass = 'components-draggable__clone';
  25455. const cloneHeightTransformationBreakpoint = 700;
  25456. const clonePadding = 0;
  25457. const bodyClass = 'is-dragging-components-draggable';
  25458. /**
  25459. * @typedef RenderProp
  25460. * @property {(event: import('react').DragEvent) => void} onDraggableStart `onDragStart` handler.
  25461. * @property {(event: import('react').DragEvent) => void} onDraggableEnd `onDragEnd` handler.
  25462. */
  25463. /**
  25464. * @typedef Props
  25465. * @property {(props: RenderProp) => JSX.Element | null} children Children.
  25466. * @property {(event: import('react').DragEvent) => void} [onDragStart] Callback when dragging starts.
  25467. * @property {(event: import('react').DragEvent) => void} [onDragOver] Callback when dragging happens over the document.
  25468. * @property {(event: import('react').DragEvent) => void} [onDragEnd] Callback when dragging ends.
  25469. * @property {string} [cloneClassname] Classname for the cloned element.
  25470. * @property {string} [elementId] ID for the element.
  25471. * @property {any} [transferData] Transfer data for the drag event.
  25472. * @property {string} [__experimentalTransferDataType] The transfer data type to set.
  25473. * @property {import('react').ReactNode} __experimentalDragComponent Component to show when dragging.
  25474. */
  25475. /**
  25476. * @param {Props} props
  25477. * @return {JSX.Element} A draggable component.
  25478. */
  25479. function Draggable({
  25480. children,
  25481. onDragStart,
  25482. onDragOver,
  25483. onDragEnd,
  25484. cloneClassname,
  25485. elementId,
  25486. transferData,
  25487. __experimentalTransferDataType: transferDataType = 'text',
  25488. __experimentalDragComponent: dragComponent
  25489. }) {
  25490. /** @type {import('react').MutableRefObject<HTMLDivElement | null>} */
  25491. const dragComponentRef = Object(external_wp_element_["useRef"])(null);
  25492. const cleanup = Object(external_wp_element_["useRef"])(() => {});
  25493. /**
  25494. * Removes the element clone, resets cursor, and removes drag listener.
  25495. *
  25496. * @param {import('react').DragEvent} event The non-custom DragEvent.
  25497. */
  25498. function end(event) {
  25499. event.preventDefault();
  25500. cleanup.current();
  25501. if (onDragEnd) {
  25502. onDragEnd(event);
  25503. }
  25504. }
  25505. /**
  25506. * This method does a couple of things:
  25507. *
  25508. * - Clones the current element and spawns clone over original element.
  25509. * - Adds a fake temporary drag image to avoid browser defaults.
  25510. * - Sets transfer data.
  25511. * - Adds dragover listener.
  25512. *
  25513. * @param {import('react').DragEvent} event The non-custom DragEvent.
  25514. */
  25515. function start(event) {
  25516. // @ts-ignore We know that ownerDocument does exist on an Element
  25517. const {
  25518. ownerDocument
  25519. } = event.target;
  25520. event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));
  25521. const cloneWrapper = ownerDocument.createElement('div');
  25522. const dragImage = ownerDocument.createElement('div'); // Set a fake drag image to avoid browser defaults. Remove from DOM
  25523. // right after. event.dataTransfer.setDragImage is not supported yet in
  25524. // IE, we need to check for its existence first.
  25525. if ('function' === typeof event.dataTransfer.setDragImage) {
  25526. dragImage.classList.add(dragImageClass);
  25527. ownerDocument.body.appendChild(dragImage);
  25528. event.dataTransfer.setDragImage(dragImage, 0, 0);
  25529. }
  25530. cloneWrapper.classList.add(cloneWrapperClass);
  25531. if (cloneClassname) {
  25532. cloneWrapper.classList.add(cloneClassname);
  25533. } // If a dragComponent is defined, the following logic will clone the
  25534. // HTML node and inject it into the cloneWrapper.
  25535. if (dragComponentRef.current) {
  25536. // Position dragComponent at the same position as the cursor.
  25537. cloneWrapper.style.top = `${event.clientY}px`;
  25538. cloneWrapper.style.left = `${event.clientX}px`;
  25539. const clonedDragComponent = ownerDocument.createElement('div');
  25540. clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;
  25541. cloneWrapper.appendChild(clonedDragComponent); // Inject the cloneWrapper into the DOM.
  25542. ownerDocument.body.appendChild(cloneWrapper);
  25543. } else {
  25544. const element = ownerDocument.getElementById(elementId); // Prepare element clone and append to element wrapper.
  25545. const elementRect = element.getBoundingClientRect();
  25546. const elementWrapper = element.parentNode;
  25547. const elementTopOffset = parseInt(elementRect.top, 10);
  25548. const elementLeftOffset = parseInt(elementRect.left, 10);
  25549. cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;
  25550. const clone = element.cloneNode(true);
  25551. clone.id = `clone-${elementId}`;
  25552. if (elementRect.height > cloneHeightTransformationBreakpoint) {
  25553. // Scale down clone if original element is larger than 700px.
  25554. cloneWrapper.style.transform = 'scale(0.5)';
  25555. cloneWrapper.style.transformOrigin = 'top left'; // Position clone near the cursor.
  25556. cloneWrapper.style.top = `${event.clientY - 100}px`;
  25557. cloneWrapper.style.left = `${event.clientX}px`;
  25558. } else {
  25559. // Position clone right over the original element (20px padding).
  25560. cloneWrapper.style.top = `${elementTopOffset - clonePadding}px`;
  25561. cloneWrapper.style.left = `${elementLeftOffset - clonePadding}px`;
  25562. } // Hack: Remove iFrames as it's causing the embeds drag clone to freeze
  25563. Array.from(clone.querySelectorAll('iframe')).forEach(child => child.parentNode.removeChild(child));
  25564. cloneWrapper.appendChild(clone); // Inject the cloneWrapper into the DOM.
  25565. elementWrapper.appendChild(cloneWrapper);
  25566. } // Mark the current cursor coordinates.
  25567. let cursorLeft = event.clientX;
  25568. let cursorTop = event.clientY;
  25569. /**
  25570. * @param {import('react').DragEvent} e
  25571. */
  25572. function over(e) {
  25573. cloneWrapper.style.top = `${parseInt(cloneWrapper.style.top, 10) + e.clientY - cursorTop}px`;
  25574. cloneWrapper.style.left = `${parseInt(cloneWrapper.style.left, 10) + e.clientX - cursorLeft}px`; // Update cursor coordinates.
  25575. cursorLeft = e.clientX;
  25576. cursorTop = e.clientY;
  25577. if (onDragOver) {
  25578. onDragOver(e);
  25579. }
  25580. }
  25581. ownerDocument.addEventListener('dragover', over); // Update cursor to 'grabbing', document wide.
  25582. ownerDocument.body.classList.add(bodyClass); // Allow the Synthetic Event to be accessed from asynchronous code.
  25583. // https://reactjs.org/docs/events.html#event-pooling
  25584. event.persist();
  25585. /** @type {number | undefined} */
  25586. let timerId;
  25587. if (onDragStart) {
  25588. timerId = setTimeout(() => onDragStart(event));
  25589. }
  25590. cleanup.current = () => {
  25591. // Remove drag clone
  25592. if (cloneWrapper && cloneWrapper.parentNode) {
  25593. cloneWrapper.parentNode.removeChild(cloneWrapper);
  25594. }
  25595. if (dragImage && dragImage.parentNode) {
  25596. dragImage.parentNode.removeChild(dragImage);
  25597. } // Reset cursor.
  25598. ownerDocument.body.classList.remove(bodyClass);
  25599. ownerDocument.removeEventListener('dragover', over);
  25600. clearTimeout(timerId);
  25601. };
  25602. }
  25603. Object(external_wp_element_["useEffect"])(() => () => {
  25604. cleanup.current();
  25605. }, []);
  25606. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, children({
  25607. onDraggableStart: start,
  25608. onDraggableEnd: end
  25609. }), dragComponent && Object(external_wp_element_["createElement"])("div", {
  25610. className: "components-draggable-drag-component-root",
  25611. style: {
  25612. display: 'none'
  25613. },
  25614. ref: dragComponentRef
  25615. }, dragComponent));
  25616. }
  25617. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
  25618. var upload = __webpack_require__("NTP4");
  25619. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/index.js
  25620. /**
  25621. * External dependencies
  25622. */
  25623. /**
  25624. * WordPress dependencies
  25625. */
  25626. function DropZoneComponent({
  25627. className,
  25628. label,
  25629. onFilesDrop,
  25630. onHTMLDrop,
  25631. onDrop
  25632. }) {
  25633. const [isDraggingOverDocument, setIsDraggingOverDocument] = Object(external_wp_element_["useState"])();
  25634. const [isDraggingOverElement, setIsDraggingOverElement] = Object(external_wp_element_["useState"])();
  25635. const [type, setType] = Object(external_wp_element_["useState"])();
  25636. const ref = Object(external_wp_compose_["__experimentalUseDropZone"])({
  25637. onDrop(event) {
  25638. const files = Object(external_wp_dom_["getFilesFromDataTransfer"])(event.dataTransfer);
  25639. const html = event.dataTransfer.getData('text/html');
  25640. if (files.length && onFilesDrop) {
  25641. onFilesDrop(files);
  25642. } else if (html && onHTMLDrop) {
  25643. onHTMLDrop(html);
  25644. } else if (onDrop) {
  25645. onDrop(event);
  25646. }
  25647. },
  25648. onDragStart(event) {
  25649. setIsDraggingOverDocument(true);
  25650. let _type = 'default';
  25651. if ( // Check for the types because sometimes the files themselves
  25652. // are only available on drop.
  25653. Object(external_lodash_["includes"])(event.dataTransfer.types, 'Files') || Object(external_wp_dom_["getFilesFromDataTransfer"])(event.dataTransfer).length > 0) {
  25654. _type = 'file';
  25655. } else if (Object(external_lodash_["includes"])(event.dataTransfer.types, 'text/html')) {
  25656. _type = 'html';
  25657. }
  25658. setType(_type);
  25659. },
  25660. onDragEnd() {
  25661. setIsDraggingOverDocument(false);
  25662. setType();
  25663. },
  25664. onDragEnter() {
  25665. setIsDraggingOverElement(true);
  25666. },
  25667. onDragLeave() {
  25668. setIsDraggingOverElement(false);
  25669. }
  25670. });
  25671. let children;
  25672. if (isDraggingOverElement) {
  25673. children = Object(external_wp_element_["createElement"])("div", {
  25674. className: "components-drop-zone__content"
  25675. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  25676. icon: upload["a" /* default */],
  25677. className: "components-drop-zone__content-icon"
  25678. }), Object(external_wp_element_["createElement"])("span", {
  25679. className: "components-drop-zone__content-text"
  25680. }, label ? label : Object(external_wp_i18n_["__"])('Drop files to upload')));
  25681. }
  25682. const classes = classnames_default()('components-drop-zone', className, {
  25683. 'is-active': (isDraggingOverDocument || isDraggingOverElement) && (type === 'file' && onFilesDrop || type === 'html' && onHTMLDrop || type === 'default' && onDrop),
  25684. 'is-dragging-over-document': isDraggingOverDocument,
  25685. 'is-dragging-over-element': isDraggingOverElement,
  25686. [`is-dragging-${type}`]: !!type
  25687. });
  25688. return Object(external_wp_element_["createElement"])("div", {
  25689. ref: ref,
  25690. className: classes
  25691. }, children);
  25692. }
  25693. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/provider.js
  25694. /**
  25695. * WordPress dependencies
  25696. */
  25697. function DropZoneProvider({
  25698. children
  25699. }) {
  25700. external_wp_deprecated_default()('wp.components.DropZoneProvider', {
  25701. hint: 'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.'
  25702. });
  25703. return children;
  25704. }
  25705. // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/menu.js
  25706. /**
  25707. * WordPress dependencies
  25708. */
  25709. const menu_menu = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  25710. xmlns: "http://www.w3.org/2000/svg",
  25711. viewBox: "0 0 24 24"
  25712. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
  25713. d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"
  25714. }));
  25715. /* harmony default export */ var library_menu = (menu_menu);
  25716. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/container.js
  25717. /**
  25718. * External dependencies
  25719. */
  25720. /**
  25721. * WordPress dependencies
  25722. */
  25723. const MENU_ITEM_ROLES = ['menuitem', 'menuitemradio', 'menuitemcheckbox'];
  25724. function cycleValue(value, total, offset) {
  25725. const nextValue = value + offset;
  25726. if (nextValue < 0) {
  25727. return total + nextValue;
  25728. } else if (nextValue >= total) {
  25729. return nextValue - total;
  25730. }
  25731. return nextValue;
  25732. }
  25733. class container_NavigableContainer extends external_wp_element_["Component"] {
  25734. constructor() {
  25735. super(...arguments);
  25736. this.onKeyDown = this.onKeyDown.bind(this);
  25737. this.bindContainer = this.bindContainer.bind(this);
  25738. this.getFocusableContext = this.getFocusableContext.bind(this);
  25739. this.getFocusableIndex = this.getFocusableIndex.bind(this);
  25740. }
  25741. componentDidMount() {
  25742. // We use DOM event listeners instead of React event listeners
  25743. // because we want to catch events from the underlying DOM tree
  25744. // The React Tree can be different from the DOM tree when using
  25745. // portals. Block Toolbars for instance are rendered in a separate
  25746. // React Trees.
  25747. this.container.addEventListener('keydown', this.onKeyDown);
  25748. this.container.addEventListener('focus', this.onFocus);
  25749. }
  25750. componentWillUnmount() {
  25751. this.container.removeEventListener('keydown', this.onKeyDown);
  25752. this.container.removeEventListener('focus', this.onFocus);
  25753. }
  25754. bindContainer(ref) {
  25755. const {
  25756. forwardedRef
  25757. } = this.props;
  25758. this.container = ref;
  25759. if (Object(external_lodash_["isFunction"])(forwardedRef)) {
  25760. forwardedRef(ref);
  25761. } else if (forwardedRef && 'current' in forwardedRef) {
  25762. forwardedRef.current = ref;
  25763. }
  25764. }
  25765. getFocusableContext(target) {
  25766. const {
  25767. onlyBrowserTabstops
  25768. } = this.props;
  25769. const finder = onlyBrowserTabstops ? external_wp_dom_["focus"].tabbable : external_wp_dom_["focus"].focusable;
  25770. const focusables = finder.find(this.container);
  25771. const index = this.getFocusableIndex(focusables, target);
  25772. if (index > -1 && target) {
  25773. return {
  25774. index,
  25775. target,
  25776. focusables
  25777. };
  25778. }
  25779. return null;
  25780. }
  25781. getFocusableIndex(focusables, target) {
  25782. const directIndex = focusables.indexOf(target);
  25783. if (directIndex !== -1) {
  25784. return directIndex;
  25785. }
  25786. }
  25787. onKeyDown(event) {
  25788. if (this.props.onKeyDown) {
  25789. this.props.onKeyDown(event);
  25790. }
  25791. const {
  25792. getFocusableContext
  25793. } = this;
  25794. const {
  25795. cycle = true,
  25796. eventToOffset,
  25797. onNavigate = external_lodash_["noop"],
  25798. stopNavigationEvents
  25799. } = this.props;
  25800. const offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component
  25801. if (offset !== undefined && stopNavigationEvents) {
  25802. // Prevents arrow key handlers bound to the document directly interfering
  25803. event.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers
  25804. // from scrolling. The preventDefault also prevents Voiceover from
  25805. // 'handling' the event, as voiceover will try to use arrow keys
  25806. // for highlighting text.
  25807. const targetRole = event.target.getAttribute('role');
  25808. if (MENU_ITEM_ROLES.includes(targetRole)) {
  25809. event.preventDefault();
  25810. }
  25811. }
  25812. if (!offset) {
  25813. return;
  25814. }
  25815. const context = getFocusableContext(event.target.ownerDocument.activeElement);
  25816. if (!context) {
  25817. return;
  25818. }
  25819. const {
  25820. index,
  25821. focusables
  25822. } = context;
  25823. const nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
  25824. if (nextIndex >= 0 && nextIndex < focusables.length) {
  25825. focusables[nextIndex].focus();
  25826. onNavigate(nextIndex, focusables[nextIndex]);
  25827. }
  25828. }
  25829. render() {
  25830. const {
  25831. children,
  25832. ...props
  25833. } = this.props;
  25834. return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
  25835. ref: this.bindContainer
  25836. }, Object(external_lodash_["omit"])(props, ['stopNavigationEvents', 'eventToOffset', 'onNavigate', 'onKeyDown', 'cycle', 'onlyBrowserTabstops', 'forwardedRef'])), children);
  25837. }
  25838. }
  25839. const forwardedNavigableContainer = (props, ref) => {
  25840. return Object(external_wp_element_["createElement"])(container_NavigableContainer, Object(esm_extends["a" /* default */])({}, props, {
  25841. forwardedRef: ref
  25842. }));
  25843. };
  25844. forwardedNavigableContainer.displayName = 'NavigableContainer';
  25845. /* harmony default export */ var navigable_container_container = (Object(external_wp_element_["forwardRef"])(forwardedNavigableContainer));
  25846. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js
  25847. /**
  25848. * External dependencies
  25849. */
  25850. /**
  25851. * WordPress dependencies
  25852. */
  25853. /**
  25854. * Internal dependencies
  25855. */
  25856. function NavigableMenu({
  25857. role = 'menu',
  25858. orientation = 'vertical',
  25859. ...rest
  25860. }, ref) {
  25861. const eventToOffset = evt => {
  25862. const {
  25863. keyCode
  25864. } = evt;
  25865. let next = [external_wp_keycodes_["DOWN"]];
  25866. let previous = [external_wp_keycodes_["UP"]];
  25867. if (orientation === 'horizontal') {
  25868. next = [external_wp_keycodes_["RIGHT"]];
  25869. previous = [external_wp_keycodes_["LEFT"]];
  25870. }
  25871. if (orientation === 'both') {
  25872. next = [external_wp_keycodes_["RIGHT"], external_wp_keycodes_["DOWN"]];
  25873. previous = [external_wp_keycodes_["LEFT"], external_wp_keycodes_["UP"]];
  25874. }
  25875. if (Object(external_lodash_["includes"])(next, keyCode)) {
  25876. return 1;
  25877. } else if (Object(external_lodash_["includes"])(previous, keyCode)) {
  25878. return -1;
  25879. } else if (Object(external_lodash_["includes"])([external_wp_keycodes_["DOWN"], external_wp_keycodes_["UP"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) {
  25880. // Key press should be handled, e.g. have event propagation and
  25881. // default behavior handled by NavigableContainer but not result
  25882. // in an offset.
  25883. return 0;
  25884. }
  25885. };
  25886. return Object(external_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({
  25887. ref: ref,
  25888. stopNavigationEvents: true,
  25889. onlyBrowserTabstops: false,
  25890. role: role,
  25891. "aria-orientation": role === 'presentation' ? null : orientation,
  25892. eventToOffset: eventToOffset
  25893. }, rest));
  25894. }
  25895. /* harmony default export */ var navigable_container_menu = (Object(external_wp_element_["forwardRef"])(NavigableMenu));
  25896. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js
  25897. /**
  25898. * External dependencies
  25899. */
  25900. /**
  25901. * WordPress dependencies
  25902. */
  25903. /**
  25904. * Internal dependencies
  25905. */
  25906. function mergeProps(defaultProps = {}, props = {}) {
  25907. const mergedProps = { ...defaultProps,
  25908. ...props
  25909. };
  25910. if (props.className && defaultProps.className) {
  25911. mergedProps.className = classnames_default()(props.className, defaultProps.className);
  25912. }
  25913. return mergedProps;
  25914. }
  25915. function DropdownMenu({
  25916. children,
  25917. className,
  25918. controls,
  25919. icon = library_menu,
  25920. label,
  25921. popoverProps,
  25922. toggleProps,
  25923. menuProps,
  25924. disableOpenOnArrowDown = false,
  25925. text,
  25926. // The following props exist for backward compatibility.
  25927. menuLabel,
  25928. position,
  25929. noIcons
  25930. }) {
  25931. if (menuLabel) {
  25932. external_wp_deprecated_default()('`menuLabel` prop in `DropdownComponent`', {
  25933. since: '5.3',
  25934. alternative: '`menuProps` object and its `aria-label` property'
  25935. });
  25936. }
  25937. if (position) {
  25938. external_wp_deprecated_default()('`position` prop in `DropdownComponent`', {
  25939. since: '5.3',
  25940. alternative: '`popoverProps` object and its `position` property'
  25941. });
  25942. }
  25943. if (Object(external_lodash_["isEmpty"])(controls) && !Object(external_lodash_["isFunction"])(children)) {
  25944. return null;
  25945. } // Normalize controls to nested array of objects (sets of controls)
  25946. let controlSets;
  25947. if (!Object(external_lodash_["isEmpty"])(controls)) {
  25948. controlSets = controls;
  25949. if (!Array.isArray(controlSets[0])) {
  25950. controlSets = [controlSets];
  25951. }
  25952. }
  25953. const mergedPopoverProps = mergeProps({
  25954. className: 'components-dropdown-menu__popover',
  25955. position
  25956. }, popoverProps);
  25957. return Object(external_wp_element_["createElement"])(Dropdown, {
  25958. className: classnames_default()('components-dropdown-menu', className),
  25959. popoverProps: mergedPopoverProps,
  25960. renderToggle: ({
  25961. isOpen,
  25962. onToggle
  25963. }) => {
  25964. var _toggleProps$showTool;
  25965. const openOnArrowDown = event => {
  25966. if (disableOpenOnArrowDown) {
  25967. return;
  25968. }
  25969. if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) {
  25970. event.preventDefault();
  25971. event.stopPropagation();
  25972. onToggle();
  25973. }
  25974. };
  25975. const mergedToggleProps = mergeProps({
  25976. className: classnames_default()('components-dropdown-menu__toggle', {
  25977. 'is-opened': isOpen
  25978. })
  25979. }, toggleProps);
  25980. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedToggleProps, {
  25981. icon: icon,
  25982. onClick: event => {
  25983. onToggle(event);
  25984. if (mergedToggleProps.onClick) {
  25985. mergedToggleProps.onClick(event);
  25986. }
  25987. },
  25988. onKeyDown: event => {
  25989. openOnArrowDown(event);
  25990. if (mergedToggleProps.onKeyDown) {
  25991. mergedToggleProps.onKeyDown(event);
  25992. }
  25993. },
  25994. "aria-haspopup": "true",
  25995. "aria-expanded": isOpen,
  25996. label: label,
  25997. text: text,
  25998. showTooltip: (_toggleProps$showTool = toggleProps === null || toggleProps === void 0 ? void 0 : toggleProps.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true
  25999. }), mergedToggleProps.children);
  26000. },
  26001. renderContent: props => {
  26002. const mergedMenuProps = mergeProps({
  26003. 'aria-label': menuLabel || label,
  26004. className: classnames_default()('components-dropdown-menu__menu', {
  26005. 'no-icons': noIcons
  26006. })
  26007. }, menuProps);
  26008. return Object(external_wp_element_["createElement"])(navigable_container_menu, Object(esm_extends["a" /* default */])({}, mergedMenuProps, {
  26009. role: "menu"
  26010. }), Object(external_lodash_["isFunction"])(children) ? children(props) : null, Object(external_lodash_["flatMap"])(controlSets, (controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  26011. key: [indexOfSet, indexOfControl].join(),
  26012. onClick: event => {
  26013. event.stopPropagation();
  26014. props.onClose();
  26015. if (control.onClick) {
  26016. control.onClick();
  26017. }
  26018. },
  26019. className: classnames_default()('components-dropdown-menu__menu-item', {
  26020. 'has-separator': indexOfSet > 0 && indexOfControl === 0,
  26021. 'is-active': control.isActive
  26022. }),
  26023. icon: control.icon,
  26024. "aria-checked": control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.isActive : undefined,
  26025. role: control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.role : 'menuitem',
  26026. disabled: control.isDisabled
  26027. }, control.title))));
  26028. }
  26029. });
  26030. }
  26031. /* harmony default export */ var dropdown_menu = (DropdownMenu);
  26032. // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/swatch.js
  26033. /**
  26034. * WordPress dependencies
  26035. */
  26036. const swatch = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  26037. xmlns: "http://www.w3.org/2000/svg",
  26038. viewBox: "0 0 24 24"
  26039. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
  26040. d: "M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"
  26041. }));
  26042. /* harmony default export */ var library_swatch = (swatch);
  26043. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/swatch/index.js
  26044. /**
  26045. * WordPress dependencies
  26046. */
  26047. /**
  26048. * Internal dependencies
  26049. */
  26050. function Swatch({
  26051. fill
  26052. }) {
  26053. return fill ? Object(external_wp_element_["createElement"])("span", {
  26054. className: "components-swatch",
  26055. style: {
  26056. background: fill
  26057. }
  26058. }) : Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  26059. icon: library_swatch
  26060. });
  26061. }
  26062. /* harmony default export */ var build_module_swatch = (Swatch);
  26063. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/utils.js
  26064. /**
  26065. * External dependencies
  26066. */
  26067. /**
  26068. * Object representation for a color.
  26069. *
  26070. * @typedef {Object} RGBColor
  26071. * @property {number} r Red component of the color in the range [0,1].
  26072. * @property {number} g Green component of the color in the range [0,1].
  26073. * @property {number} b Blue component of the color in the range [0,1].
  26074. */
  26075. /**
  26076. * Calculate the brightest and darkest values from a color palette.
  26077. *
  26078. * @param {Object[]} palette Color palette for the theme.
  26079. *
  26080. * @return {string[]} Tuple of the darkest color and brightest color.
  26081. */
  26082. function getDefaultColors(palette) {
  26083. // A default dark and light color are required.
  26084. if (!palette || palette.length < 2) return ['#000', '#fff'];
  26085. return palette.map(({
  26086. color
  26087. }) => ({
  26088. color,
  26089. brightness: tinycolor_default()(color).getBrightness() / 255
  26090. })).reduce(([min, max], current) => {
  26091. return [current.brightness <= min.brightness ? current : min, current.brightness >= max.brightness ? current : max];
  26092. }, [{
  26093. brightness: 1
  26094. }, {
  26095. brightness: 0
  26096. }]).map(({
  26097. color
  26098. }) => color);
  26099. }
  26100. /**
  26101. * Generate a duotone gradient from a list of colors.
  26102. *
  26103. * @param {string[]} colors CSS color strings.
  26104. * @param {string} angle CSS gradient angle.
  26105. *
  26106. * @return {string} CSS gradient string for the duotone swatch.
  26107. */
  26108. function getGradientFromCSSColors(colors = [], angle = '90deg') {
  26109. const l = 100 / colors.length;
  26110. const stops = colors.map((c, i) => `${c} ${i * l}%, ${c} ${(i + 1) * l}%`).join(', ');
  26111. return `linear-gradient( ${angle}, ${stops} )`;
  26112. }
  26113. /**
  26114. * Convert a color array to an array of color stops.
  26115. *
  26116. * @param {string[]} colors CSS colors array
  26117. *
  26118. * @return {Object[]} Color stop information.
  26119. */
  26120. function getColorStopsFromColors(colors) {
  26121. return colors.map((color, i) => ({
  26122. position: i * 100 / (colors.length - 1),
  26123. color
  26124. }));
  26125. }
  26126. /**
  26127. * Convert a color stop array to an array colors.
  26128. *
  26129. * @param {Object[]} colorStops Color stop information.
  26130. *
  26131. * @return {string[]} CSS colors array.
  26132. */
  26133. function getColorsFromColorStops(colorStops = []) {
  26134. return colorStops.map(({
  26135. color
  26136. }) => color);
  26137. }
  26138. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-swatch.js
  26139. /**
  26140. * Internal dependencies
  26141. */
  26142. function DuotoneSwatch({
  26143. values
  26144. }) {
  26145. return Object(external_wp_element_["createElement"])(build_module_swatch, {
  26146. fill: values && getGradientFromCSSColors(values, '135deg')
  26147. });
  26148. }
  26149. /* harmony default export */ var duotone_swatch = (DuotoneSwatch);
  26150. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-list-picker/index.js
  26151. /**
  26152. * WordPress dependencies
  26153. */
  26154. /**
  26155. * Internal dependencies
  26156. */
  26157. function color_list_picker_ColorOption({
  26158. label,
  26159. value,
  26160. colors,
  26161. disableCustomColors,
  26162. onChange
  26163. }) {
  26164. const [isOpen, setIsOpen] = Object(external_wp_element_["useState"])(false);
  26165. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  26166. className: "components-color-list-picker__swatch-button",
  26167. icon: Object(external_wp_element_["createElement"])(build_module_swatch, {
  26168. fill: value
  26169. }),
  26170. onClick: () => setIsOpen(prev => !prev)
  26171. }, label), isOpen && Object(external_wp_element_["createElement"])(ColorPalette, {
  26172. colors: colors,
  26173. value: value,
  26174. clearable: false,
  26175. onChange: onChange,
  26176. disableCustomColors: disableCustomColors
  26177. }));
  26178. }
  26179. function ColorListPicker({
  26180. colors,
  26181. labels,
  26182. value = [],
  26183. disableCustomColors,
  26184. onChange
  26185. }) {
  26186. return Object(external_wp_element_["createElement"])("div", {
  26187. className: "components-color-list-picker"
  26188. }, labels.map((label, index) => Object(external_wp_element_["createElement"])(color_list_picker_ColorOption, {
  26189. key: index,
  26190. label: label,
  26191. value: value[index],
  26192. colors: colors,
  26193. disableCustomColors: disableCustomColors,
  26194. onChange: newColor => {
  26195. const newColors = value.slice();
  26196. newColors[index] = newColor;
  26197. onChange(newColors);
  26198. }
  26199. })));
  26200. }
  26201. /* harmony default export */ var color_list_picker = (ColorListPicker);
  26202. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/constants.js
  26203. const COLOR_POPOVER_PROPS = {
  26204. className: 'components-custom-gradient-picker__color-picker-popover',
  26205. position: 'top'
  26206. };
  26207. const GRADIENT_MARKERS_WIDTH = 18;
  26208. const INSERT_POINT_WIDTH = 23;
  26209. const MINIMUM_ABSOLUTE_LEFT_POSITION = 5;
  26210. const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10;
  26211. const MINIMUM_DISTANCE_BETWEEN_POINTS = 0;
  26212. const MINIMUM_SIGNIFICANT_MOVE = 5;
  26213. const KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
  26214. const MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2;
  26215. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/utils.js
  26216. /**
  26217. * Internal dependencies
  26218. */
  26219. /**
  26220. * Control point for the gradient bar.
  26221. *
  26222. * @typedef {Object} ControlPoint
  26223. * @property {string} color Color of the control point.
  26224. * @property {number} position Integer position of the control point as a percentage.
  26225. */
  26226. /**
  26227. * Color as parsed from the gradient by gradient-parser.
  26228. *
  26229. * @typedef {Object} Color
  26230. * @property {string} r Red component.
  26231. * @property {string} g Green component.
  26232. * @property {string} b Green component.
  26233. * @property {string} [a] Optional alpha component.
  26234. */
  26235. /**
  26236. * Clamps a number between 0 and 100.
  26237. *
  26238. * @param {number} value Value to clamp.
  26239. *
  26240. * @return {number} Value clamped between 0 and 100.
  26241. */
  26242. function clampPercent(value) {
  26243. return Math.max(0, Math.min(100, value));
  26244. }
  26245. /**
  26246. * Check if a control point is overlapping with another.
  26247. *
  26248. * @param {ControlPoint[]} value Array of control points.
  26249. * @param {number} initialIndex Index of the position to test.
  26250. * @param {number} newPosition New position of the control point.
  26251. * @param {number} minDistance Distance considered to be overlapping.
  26252. *
  26253. * @return {boolean} True if the point is overlapping.
  26254. */
  26255. function isOverlapping(value, initialIndex, newPosition, minDistance = MINIMUM_DISTANCE_BETWEEN_POINTS) {
  26256. const initialPosition = value[initialIndex].position;
  26257. const minPosition = Math.min(initialPosition, newPosition);
  26258. const maxPosition = Math.max(initialPosition, newPosition);
  26259. return value.some(({
  26260. position
  26261. }, index) => {
  26262. return index !== initialIndex && (Math.abs(position - newPosition) < minDistance || minPosition < position && position < maxPosition);
  26263. });
  26264. }
  26265. /**
  26266. * Adds a control point from an array and returns the new array.
  26267. *
  26268. * @param {ControlPoint[]} points Array of control points.
  26269. * @param {number} position Position to insert the new point.
  26270. * @param {Color} color Color to update the control point at index.
  26271. *
  26272. * @return {ControlPoint[]} New array of control points.
  26273. */
  26274. function addControlPoint(points, position, color) {
  26275. const nextIndex = points.findIndex(point => point.position > position);
  26276. const newPoint = {
  26277. color,
  26278. position
  26279. };
  26280. const newPoints = points.slice();
  26281. newPoints.splice(nextIndex - 1, 0, newPoint);
  26282. return newPoints;
  26283. }
  26284. /**
  26285. * Removes a control point from an array and returns the new array.
  26286. *
  26287. * @param {ControlPoint[]} points Array of control points.
  26288. * @param {number} index Index to remove.
  26289. *
  26290. * @return {ControlPoint[]} New array of control points.
  26291. */
  26292. function removeControlPoint(points, index) {
  26293. return points.filter((point, pointIndex) => {
  26294. return pointIndex !== index;
  26295. });
  26296. }
  26297. /**
  26298. * Updates a control point from an array and returns the new array.
  26299. *
  26300. * @param {ControlPoint[]} points Array of control points.
  26301. * @param {number} index Index to update.
  26302. * @param {ControlPoint[]} newPoint New control point to replace the index.
  26303. *
  26304. * @return {ControlPoint[]} New array of control points.
  26305. */
  26306. function updateControlPoint(points, index, newPoint) {
  26307. const newValue = points.slice();
  26308. newValue[index] = newPoint;
  26309. return newValue;
  26310. }
  26311. /**
  26312. * Updates the position of a control point from an array and returns the new array.
  26313. *
  26314. * @param {ControlPoint[]} points Array of control points.
  26315. * @param {number} index Index to update.
  26316. * @param {number} newPosition Position to move the control point at index.
  26317. *
  26318. * @return {ControlPoint[]} New array of control points.
  26319. */
  26320. function updateControlPointPosition(points, index, newPosition) {
  26321. if (isOverlapping(points, index, newPosition)) {
  26322. return points;
  26323. }
  26324. const newPoint = { ...points[index],
  26325. position: newPosition
  26326. };
  26327. return updateControlPoint(points, index, newPoint);
  26328. }
  26329. /**
  26330. * Updates the position of a control point from an array and returns the new array.
  26331. *
  26332. * @param {ControlPoint[]} points Array of control points.
  26333. * @param {number} index Index to update.
  26334. * @param {Color} newColor Color to update the control point at index.
  26335. *
  26336. * @return {ControlPoint[]} New array of control points.
  26337. */
  26338. function updateControlPointColor(points, index, newColor) {
  26339. const newPoint = { ...points[index],
  26340. color: newColor
  26341. };
  26342. return updateControlPoint(points, index, newPoint);
  26343. }
  26344. /**
  26345. * Updates the position of a control point from an array and returns the new array.
  26346. *
  26347. * @param {ControlPoint[]} points Array of control points.
  26348. * @param {number} position Position of the color stop.
  26349. * @param {string} newColor Color to update the control point at index.
  26350. *
  26351. * @return {ControlPoint[]} New array of control points.
  26352. */
  26353. function updateControlPointColorByPosition(points, position, newColor) {
  26354. const index = points.findIndex(point => point.position === position);
  26355. return updateControlPointColor(points, index, newColor);
  26356. }
  26357. /**
  26358. * Gets the horizontal coordinate when dragging a control point with the mouse.
  26359. *
  26360. * @param {number} mouseXCoordinate Horizontal coordinate of the mouse position.
  26361. * @param {Element} containerElement Container for the gradient picker.
  26362. * @param {number} positionedElementWidth Width of the positioned element.
  26363. *
  26364. * @return {number} Whole number percentage from the left.
  26365. */
  26366. function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElement, positionedElementWidth) {
  26367. if (!containerElement) {
  26368. return;
  26369. }
  26370. const {
  26371. x,
  26372. width
  26373. } = containerElement.getBoundingClientRect();
  26374. const absolutePositionValue = mouseXCoordinate - x - MINIMUM_ABSOLUTE_LEFT_POSITION - positionedElementWidth / 2;
  26375. const availableWidth = width - MINIMUM_ABSOLUTE_LEFT_POSITION - INSERT_POINT_WIDTH;
  26376. return Math.round(clampPercent(absolutePositionValue * 100 / availableWidth));
  26377. }
  26378. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/control-points.js
  26379. /**
  26380. * External dependencies
  26381. */
  26382. /**
  26383. * WordPress dependencies
  26384. */
  26385. /**
  26386. * Internal dependencies
  26387. */
  26388. function ControlPointKeyboardMove({
  26389. value: position,
  26390. onChange,
  26391. children
  26392. }) {
  26393. const shortcuts = {
  26394. right(event) {
  26395. // Stop propagation of the key press event to avoid focus moving
  26396. // to another editor area.
  26397. event.stopPropagation();
  26398. const newPosition = clampPercent(position + KEYBOARD_CONTROL_POINT_VARIATION);
  26399. onChange(newPosition);
  26400. },
  26401. left(event) {
  26402. // Stop propagation of the key press event to avoid focus moving
  26403. // to another editor area.
  26404. event.stopPropagation();
  26405. const newPosition = clampPercent(position - KEYBOARD_CONTROL_POINT_VARIATION);
  26406. onChange(newPosition);
  26407. }
  26408. };
  26409. return Object(external_wp_element_["createElement"])(keyboard_shortcuts, {
  26410. shortcuts: shortcuts
  26411. }, children);
  26412. }
  26413. function ControlPointButton({
  26414. isOpen,
  26415. position,
  26416. color,
  26417. onChange,
  26418. ...additionalProps
  26419. }) {
  26420. const instanceId = Object(external_wp_compose_["useInstanceId"])(ControlPointButton);
  26421. const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`;
  26422. return Object(external_wp_element_["createElement"])(ControlPointKeyboardMove, {
  26423. value: position,
  26424. onChange: onChange
  26425. }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  26426. "aria-label": Object(external_wp_i18n_["sprintf"])( // translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).
  26427. Object(external_wp_i18n_["__"])('Gradient control point at position %1$s%% with color code %2$s.'), position, color),
  26428. "aria-describedby": descriptionId,
  26429. "aria-haspopup": "true",
  26430. "aria-expanded": isOpen,
  26431. className: classnames_default()('components-custom-gradient-picker__control-point-button', {
  26432. 'is-active': isOpen
  26433. }),
  26434. style: {
  26435. left: `${position}%`
  26436. }
  26437. }, additionalProps)), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  26438. id: descriptionId
  26439. }, Object(external_wp_i18n_["__"])('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.')));
  26440. }
  26441. function ControlPoints({
  26442. disableRemove,
  26443. disableAlpha,
  26444. gradientPickerDomRef,
  26445. ignoreMarkerPosition,
  26446. value: controlPoints,
  26447. onChange,
  26448. onStartControlPointChange,
  26449. onStopControlPointChange
  26450. }) {
  26451. const controlPointMoveState = Object(external_wp_element_["useRef"])();
  26452. const onMouseMove = event => {
  26453. const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, GRADIENT_MARKERS_WIDTH);
  26454. const {
  26455. initialPosition,
  26456. index,
  26457. significantMoveHappened
  26458. } = controlPointMoveState.current;
  26459. if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {
  26460. controlPointMoveState.current.significantMoveHappened = true;
  26461. }
  26462. onChange(updateControlPointPosition(controlPoints, index, relativePosition));
  26463. };
  26464. const cleanEventListeners = () => {
  26465. if (window && window.removeEventListener && controlPointMoveState.current && controlPointMoveState.current.listenersActivated) {
  26466. window.removeEventListener('mousemove', onMouseMove);
  26467. window.removeEventListener('mouseup', cleanEventListeners);
  26468. onStopControlPointChange();
  26469. controlPointMoveState.current.listenersActivated = false;
  26470. }
  26471. };
  26472. Object(external_wp_element_["useEffect"])(() => {
  26473. return () => {
  26474. cleanEventListeners();
  26475. };
  26476. }, []);
  26477. return controlPoints.map((point, index) => {
  26478. const initialPosition = point === null || point === void 0 ? void 0 : point.position;
  26479. return ignoreMarkerPosition !== initialPosition && Object(external_wp_element_["createElement"])(Dropdown, {
  26480. key: index,
  26481. onClose: onStopControlPointChange,
  26482. renderToggle: ({
  26483. isOpen,
  26484. onToggle
  26485. }) => Object(external_wp_element_["createElement"])(ControlPointButton, {
  26486. key: index,
  26487. onClick: () => {
  26488. if (controlPointMoveState.current && controlPointMoveState.current.significantMoveHappened) {
  26489. return;
  26490. }
  26491. if (isOpen) {
  26492. onStopControlPointChange();
  26493. } else {
  26494. onStartControlPointChange();
  26495. }
  26496. onToggle();
  26497. },
  26498. onMouseDown: () => {
  26499. if (window && window.addEventListener) {
  26500. controlPointMoveState.current = {
  26501. initialPosition,
  26502. index,
  26503. significantMoveHappened: false,
  26504. listenersActivated: true
  26505. };
  26506. onStartControlPointChange();
  26507. window.addEventListener('mousemove', onMouseMove);
  26508. window.addEventListener('mouseup', cleanEventListeners);
  26509. }
  26510. },
  26511. isOpen: isOpen,
  26512. position: point.position,
  26513. color: point.color,
  26514. onChange: newPosition => {
  26515. onChange(updateControlPointPosition(controlPoints, index, newPosition));
  26516. }
  26517. }),
  26518. renderContent: ({
  26519. onClose
  26520. }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
  26521. disableAlpha: disableAlpha,
  26522. color: point.color,
  26523. onChangeComplete: ({
  26524. color
  26525. }) => {
  26526. onChange(updateControlPointColor(controlPoints, index, color.toRgbString()));
  26527. }
  26528. }), !disableRemove && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  26529. className: "components-custom-gradient-picker__remove-control-point",
  26530. onClick: () => {
  26531. onChange(removeControlPoint(controlPoints, index));
  26532. onClose();
  26533. },
  26534. isLink: true
  26535. }, Object(external_wp_i18n_["__"])('Remove Control Point'))),
  26536. popoverProps: COLOR_POPOVER_PROPS
  26537. });
  26538. });
  26539. }
  26540. function InsertPoint({
  26541. value: controlPoints,
  26542. onChange,
  26543. onOpenInserter,
  26544. onCloseInserter,
  26545. insertPosition,
  26546. disableAlpha
  26547. }) {
  26548. const [alreadyInsertedPoint, setAlreadyInsertedPoint] = Object(external_wp_element_["useState"])(false);
  26549. return Object(external_wp_element_["createElement"])(Dropdown, {
  26550. className: "components-custom-gradient-picker__inserter",
  26551. onClose: () => {
  26552. onCloseInserter();
  26553. },
  26554. renderToggle: ({
  26555. isOpen,
  26556. onToggle
  26557. }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  26558. "aria-expanded": isOpen,
  26559. "aria-haspopup": "true",
  26560. onClick: () => {
  26561. if (isOpen) {
  26562. onCloseInserter();
  26563. } else {
  26564. setAlreadyInsertedPoint(false);
  26565. onOpenInserter();
  26566. }
  26567. onToggle();
  26568. },
  26569. className: "components-custom-gradient-picker__insert-point",
  26570. icon: plus["a" /* default */],
  26571. style: {
  26572. left: insertPosition !== null ? `${insertPosition}%` : undefined
  26573. }
  26574. }),
  26575. renderContent: () => Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
  26576. disableAlpha: disableAlpha,
  26577. onChangeComplete: ({
  26578. color
  26579. }) => {
  26580. if (!alreadyInsertedPoint) {
  26581. onChange(addControlPoint(controlPoints, insertPosition, color.toRgbString()));
  26582. setAlreadyInsertedPoint(true);
  26583. } else {
  26584. onChange(updateControlPointColorByPosition(controlPoints, insertPosition, color.toRgbString()));
  26585. }
  26586. }
  26587. }),
  26588. popoverProps: COLOR_POPOVER_PROPS
  26589. });
  26590. }
  26591. ControlPoints.InsertPoint = InsertPoint;
  26592. /* harmony default export */ var control_points = (ControlPoints);
  26593. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/index.js
  26594. /**
  26595. * External dependencies
  26596. */
  26597. /**
  26598. * WordPress dependencies
  26599. */
  26600. /**
  26601. * Internal dependencies
  26602. */
  26603. function customGradientBarReducer(state, action) {
  26604. switch (action.type) {
  26605. case 'MOVE_INSERTER':
  26606. if (state.id === 'IDLE' || state.id === 'MOVING_INSERTER') {
  26607. return {
  26608. id: 'MOVING_INSERTER',
  26609. insertPosition: action.insertPosition
  26610. };
  26611. }
  26612. break;
  26613. case 'STOP_INSERTER_MOVE':
  26614. if (state.id === 'MOVING_INSERTER') {
  26615. return {
  26616. id: 'IDLE'
  26617. };
  26618. }
  26619. break;
  26620. case 'OPEN_INSERTER':
  26621. if (state.id === 'MOVING_INSERTER') {
  26622. return {
  26623. id: 'INSERTING_CONTROL_POINT',
  26624. insertPosition: state.insertPosition
  26625. };
  26626. }
  26627. break;
  26628. case 'CLOSE_INSERTER':
  26629. if (state.id === 'INSERTING_CONTROL_POINT') {
  26630. return {
  26631. id: 'IDLE'
  26632. };
  26633. }
  26634. break;
  26635. case 'START_CONTROL_CHANGE':
  26636. if (state.id === 'IDLE') {
  26637. return {
  26638. id: 'MOVING_CONTROL_POINT'
  26639. };
  26640. }
  26641. break;
  26642. case 'STOP_CONTROL_CHANGE':
  26643. if (state.id === 'MOVING_CONTROL_POINT') {
  26644. return {
  26645. id: 'IDLE'
  26646. };
  26647. }
  26648. break;
  26649. }
  26650. return state;
  26651. }
  26652. const customGradientBarReducerInitialState = {
  26653. id: 'IDLE'
  26654. };
  26655. function CustomGradientBar({
  26656. background,
  26657. hasGradient,
  26658. value: controlPoints,
  26659. onChange,
  26660. disableInserter = false,
  26661. disableAlpha = false
  26662. }) {
  26663. const gradientPickerDomRef = Object(external_wp_element_["useRef"])();
  26664. const [gradientBarState, gradientBarStateDispatch] = Object(external_wp_element_["useReducer"])(customGradientBarReducer, customGradientBarReducerInitialState);
  26665. const onMouseEnterAndMove = event => {
  26666. const insertPosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current, INSERT_POINT_WIDTH); // If the insert point is close to an existing control point don't show it.
  26667. if (Object(external_lodash_["some"])(controlPoints, ({
  26668. position
  26669. }) => {
  26670. return Math.abs(insertPosition - position) < MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
  26671. })) {
  26672. if (gradientBarState.id === 'MOVING_INSERTER') {
  26673. gradientBarStateDispatch({
  26674. type: 'STOP_INSERTER_MOVE'
  26675. });
  26676. }
  26677. return;
  26678. }
  26679. gradientBarStateDispatch({
  26680. type: 'MOVE_INSERTER',
  26681. insertPosition
  26682. });
  26683. };
  26684. const onMouseLeave = () => {
  26685. gradientBarStateDispatch({
  26686. type: 'STOP_INSERTER_MOVE'
  26687. });
  26688. };
  26689. const isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';
  26690. const isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT';
  26691. return Object(external_wp_element_["createElement"])("div", {
  26692. ref: gradientPickerDomRef,
  26693. className: classnames_default()('components-custom-gradient-picker__gradient-bar', {
  26694. 'has-gradient': hasGradient
  26695. }),
  26696. onMouseEnter: onMouseEnterAndMove,
  26697. onMouseMove: onMouseEnterAndMove,
  26698. style: {
  26699. background
  26700. },
  26701. onMouseLeave: onMouseLeave
  26702. }, Object(external_wp_element_["createElement"])("div", {
  26703. className: "components-custom-gradient-picker__markers-container"
  26704. }, !disableInserter && (isMovingInserter || isInsertingControlPoint) && Object(external_wp_element_["createElement"])(control_points.InsertPoint, {
  26705. disableAlpha: disableAlpha,
  26706. insertPosition: gradientBarState.insertPosition,
  26707. value: controlPoints,
  26708. onChange: onChange,
  26709. onOpenInserter: () => {
  26710. gradientBarStateDispatch({
  26711. type: 'OPEN_INSERTER'
  26712. });
  26713. },
  26714. onCloseInserter: () => {
  26715. gradientBarStateDispatch({
  26716. type: 'CLOSE_INSERTER'
  26717. });
  26718. }
  26719. }), Object(external_wp_element_["createElement"])(control_points, {
  26720. disableAlpha: disableAlpha,
  26721. disableRemove: disableInserter,
  26722. gradientPickerDomRef: gradientPickerDomRef,
  26723. ignoreMarkerPosition: isInsertingControlPoint ? gradientBarState.insertPosition : undefined,
  26724. value: controlPoints,
  26725. onChange: onChange,
  26726. onStartControlPointChange: () => {
  26727. gradientBarStateDispatch({
  26728. type: 'START_CONTROL_CHANGE'
  26729. });
  26730. },
  26731. onStopControlPointChange: () => {
  26732. gradientBarStateDispatch({
  26733. type: 'STOP_CONTROL_CHANGE'
  26734. });
  26735. }
  26736. })));
  26737. }
  26738. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/custom-duotone-bar.js
  26739. /**
  26740. * Internal dependencies
  26741. */
  26742. const PLACEHOLDER_VALUES = ['#333', '#CCC'];
  26743. function CustomDuotoneBar({
  26744. value,
  26745. onChange
  26746. }) {
  26747. const hasGradient = !!value;
  26748. const values = hasGradient ? value : PLACEHOLDER_VALUES;
  26749. const background = getGradientFromCSSColors(values);
  26750. const controlPoints = getColorStopsFromColors(values);
  26751. return Object(external_wp_element_["createElement"])(CustomGradientBar, {
  26752. disableInserter: true,
  26753. disableAlpha: true,
  26754. background: background,
  26755. hasGradient: hasGradient,
  26756. value: controlPoints,
  26757. onChange: newColorStops => {
  26758. const newValue = getColorsFromColorStops(newColorStops);
  26759. onChange(newValue);
  26760. }
  26761. });
  26762. }
  26763. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/duotone-picker.js
  26764. /**
  26765. * External dependencies
  26766. */
  26767. /**
  26768. * WordPress dependencies
  26769. */
  26770. /**
  26771. * Internal dependencies
  26772. */
  26773. function DuotonePicker({
  26774. colorPalette,
  26775. duotonePalette,
  26776. disableCustomColors,
  26777. disableCustomDuotone,
  26778. value,
  26779. onChange
  26780. }) {
  26781. const [defaultDark, defaultLight] = Object(external_wp_element_["useMemo"])(() => getDefaultColors(colorPalette), [colorPalette]);
  26782. return Object(external_wp_element_["createElement"])(CircularOptionPicker, {
  26783. options: duotonePalette.map(({
  26784. colors,
  26785. slug,
  26786. name
  26787. }) => {
  26788. const style = {
  26789. background: getGradientFromCSSColors(colors, '135deg'),
  26790. color: 'transparent'
  26791. };
  26792. const tooltipText = name !== null && name !== void 0 ? name : Object(external_wp_i18n_["sprintf"])( // translators: %s: duotone code e.g: "dark-grayscale" or "7f7f7f-ffffff".
  26793. Object(external_wp_i18n_["__"])('Duotone code: %s'), slug);
  26794. const label = name ? Object(external_wp_i18n_["sprintf"])( // translators: %s: The name of the option e.g: "Dark grayscale".
  26795. Object(external_wp_i18n_["__"])('Duotone: %s'), name) : tooltipText;
  26796. const isSelected = Object(external_lodash_["isEqual"])(colors, value);
  26797. return Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
  26798. key: slug,
  26799. value: colors,
  26800. isSelected: isSelected,
  26801. "aria-label": label,
  26802. tooltipText: tooltipText,
  26803. style: style,
  26804. onClick: () => {
  26805. onChange(isSelected ? undefined : colors);
  26806. }
  26807. });
  26808. }),
  26809. actions: Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
  26810. onClick: () => onChange(undefined)
  26811. }, Object(external_wp_i18n_["__"])('Clear'))
  26812. }, !disableCustomColors && !disableCustomDuotone && Object(external_wp_element_["createElement"])(CustomDuotoneBar, {
  26813. value: value,
  26814. onChange: onChange
  26815. }), !disableCustomDuotone && Object(external_wp_element_["createElement"])(color_list_picker, {
  26816. labels: [Object(external_wp_i18n_["__"])('Shadows'), Object(external_wp_i18n_["__"])('Highlights')],
  26817. colors: colorPalette,
  26818. value: value,
  26819. disableCustomColors: disableCustomColors,
  26820. onChange: newColors => {
  26821. if (!newColors[0]) {
  26822. newColors[0] = defaultDark;
  26823. }
  26824. if (!newColors[1]) {
  26825. newColors[1] = defaultLight;
  26826. }
  26827. const newValue = newColors.length >= 2 ? newColors : undefined;
  26828. onChange(newValue);
  26829. }
  26830. }));
  26831. }
  26832. /* harmony default export */ var duotone_picker = (DuotonePicker);
  26833. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
  26834. var external = __webpack_require__("K+tz");
  26835. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/styles/external-link-styles.js
  26836. function external_link_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  26837. /**
  26838. * WordPress dependencies
  26839. */
  26840. const StyledIcon = /*#__PURE__*/styled_base_browser_esm(build_module_icon["a" /* default */], {
  26841. target: "etxm6pv0",
  26842. label: "StyledIcon"
  26843. })( true ? {
  26844. name: "i8uvf3",
  26845. styles: "width:1.4em;height:1.4em;margin:-0.2em 0.1em 0;vertical-align:middle;fill:currentColor;"
  26846. } : undefined);
  26847. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/index.js
  26848. /**
  26849. * External dependencies
  26850. */
  26851. /**
  26852. * WordPress dependencies
  26853. */
  26854. /**
  26855. * Internal dependencies
  26856. */
  26857. function ExternalLink({
  26858. href,
  26859. children,
  26860. className,
  26861. rel = '',
  26862. ...additionalProps
  26863. }, ref) {
  26864. rel = Object(external_lodash_["uniq"])(Object(external_lodash_["compact"])([...rel.split(' '), 'external', 'noreferrer', 'noopener'])).join(' ');
  26865. const classes = classnames_default()('components-external-link', className);
  26866. return (
  26867. /* eslint-disable react/jsx-no-target-blank */
  26868. Object(external_wp_element_["createElement"])("a", Object(esm_extends["a" /* default */])({}, additionalProps, {
  26869. className: classes,
  26870. href: href,
  26871. target: "_blank",
  26872. rel: rel,
  26873. ref: ref
  26874. }), children, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  26875. as: "span"
  26876. },
  26877. /* translators: accessibility text */
  26878. Object(external_wp_i18n_["__"])('(opens in a new tab)')), Object(external_wp_element_["createElement"])(StyledIcon, {
  26879. icon: external["a" /* default */],
  26880. className: "components-external-link__icon"
  26881. }))
  26882. /* eslint-enable react/jsx-no-target-blank */
  26883. );
  26884. }
  26885. /* harmony default export */ var external_link = (Object(external_wp_element_["forwardRef"])(ExternalLink));
  26886. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-picker-style.js
  26887. function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  26888. /**
  26889. * Internal dependencies
  26890. */
  26891. const MediaWrapper = styled_base_browser_esm("div", {
  26892. target: "e11wezi70",
  26893. label: "MediaWrapper"
  26894. })( true ? {
  26895. name: "4wwkjz",
  26896. styles: "background-color:transparent;box-sizing:border-box;text-align:center;width:100%;"
  26897. } : undefined);
  26898. const MediaContainer = styled_base_browser_esm("div", {
  26899. target: "e11wezi71",
  26900. label: "MediaContainer"
  26901. })( true ? {
  26902. name: "1q0l1fq",
  26903. styles: "align-items:center;box-sizing:border-box;box-shadow:0 0 0 1px rgba( 0,0,0,0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"
  26904. } : undefined);
  26905. const MediaPlaceholder = styled_base_browser_esm("div", {
  26906. target: "e11wezi72",
  26907. label: "MediaPlaceholder"
  26908. })("background:", COLORS.lightGray[300], ";box-sizing:border-box;height:170px;max-width:280px;min-width:200px;width:100%;" + ( true ? "" : undefined));
  26909. const focal_point_picker_style_UnitControl = /*#__PURE__*/styled_base_browser_esm(unit_control, {
  26910. target: "e11wezi73",
  26911. label: "UnitControl"
  26912. })( true ? {
  26913. name: "v7v99c",
  26914. styles: "width:100px;"
  26915. } : undefined);
  26916. const ControlWrapper = /*#__PURE__*/styled_base_browser_esm(flex_component, {
  26917. target: "e11wezi74",
  26918. label: "ControlWrapper"
  26919. })( true ? {
  26920. name: "lqoi1w",
  26921. styles: "max-width:320px;padding:1em 0;"
  26922. } : undefined);
  26923. const GridView = styled_base_browser_esm("div", {
  26924. target: "e11wezi75",
  26925. label: "GridView"
  26926. })("box-sizing:border-box;left:50%;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%,-50%,0 );transition:opacity 120ms linear;z-index:1;", ({
  26927. isActive
  26928. }) => isActive && `
  26929. opacity: 1;
  26930. `, true ? "" : undefined);
  26931. const GridLine = styled_base_browser_esm("div", {
  26932. target: "e11wezi76",
  26933. label: "GridLine"
  26934. })( true ? {
  26935. name: "18dz4sk",
  26936. styles: "box-sizing:border-box;background:white;box-shadow:0 0 2px rgba( 0,0,0,0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 );"
  26937. } : undefined);
  26938. const GridLineX = /*#__PURE__*/styled_base_browser_esm(GridLine, {
  26939. target: "e11wezi77",
  26940. label: "GridLineX"
  26941. })( true ? {
  26942. name: "1u4twh6",
  26943. styles: "height:1px;left:0;right:0;"
  26944. } : undefined);
  26945. const GridLineY = /*#__PURE__*/styled_base_browser_esm(GridLine, {
  26946. target: "e11wezi78",
  26947. label: "GridLineY"
  26948. })( true ? {
  26949. name: "13gvipf",
  26950. styles: "width:1px;top:0;bottom:0;"
  26951. } : undefined);
  26952. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/utils.js
  26953. const INITIAL_BOUNDS = {
  26954. top: 0,
  26955. left: 0,
  26956. bottom: 0,
  26957. right: 0,
  26958. width: 0,
  26959. height: 0
  26960. };
  26961. const VIDEO_EXTENSIONS = ['avi', 'mpg', 'mpeg', 'mov', 'mp4', 'm4v', 'ogg', 'ogv', 'webm', 'wmv'];
  26962. /**
  26963. * Gets the extension of a file name.
  26964. *
  26965. * @param {string} filename The file name.
  26966. * @return {string} The extension of the file name.
  26967. */
  26968. function getExtension(filename = '') {
  26969. const parts = filename.split('.');
  26970. return parts[parts.length - 1];
  26971. }
  26972. /**
  26973. * Checks if a file is a video.
  26974. *
  26975. * @param {string} filename The file name.
  26976. * @return {boolean} Whether the file is a video.
  26977. */
  26978. function isVideoType(filename = '') {
  26979. if (!filename) return false;
  26980. return VIDEO_EXTENSIONS.includes(getExtension(filename));
  26981. }
  26982. /**
  26983. * Transforms a fraction value to a percentage value.
  26984. *
  26985. * @param {number} fraction The fraction value.
  26986. * @return {number} A percentage value.
  26987. */
  26988. function fractionToPercentage(fraction) {
  26989. return Math.round(fraction * 100);
  26990. }
  26991. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/controls.js
  26992. /**
  26993. * External dependencies
  26994. */
  26995. /**
  26996. * WordPress dependencies
  26997. */
  26998. /**
  26999. * Internal dependencies
  27000. */
  27001. const TEXTCONTROL_MIN = 0;
  27002. const TEXTCONTROL_MAX = 100;
  27003. function FocalPointPickerControls({
  27004. onChange = external_lodash_["noop"],
  27005. percentages = {
  27006. x: 0.5,
  27007. y: 0.5
  27008. }
  27009. }) {
  27010. const valueX = fractionToPercentage(percentages.x);
  27011. const valueY = fractionToPercentage(percentages.y);
  27012. const handleOnXChange = next => {
  27013. onChange({ ...percentages,
  27014. x: parseInt(next) / 100
  27015. });
  27016. };
  27017. const handleOnYChange = next => {
  27018. onChange({ ...percentages,
  27019. y: parseInt(next) / 100
  27020. });
  27021. };
  27022. return Object(external_wp_element_["createElement"])(ControlWrapper, {
  27023. className: "focal-point-picker__controls"
  27024. }, Object(external_wp_element_["createElement"])(controls_UnitControl, {
  27025. label: Object(external_wp_i18n_["__"])('Left'),
  27026. value: valueX,
  27027. onChange: handleOnXChange,
  27028. dragDirection: "e"
  27029. }), Object(external_wp_element_["createElement"])(controls_UnitControl, {
  27030. label: Object(external_wp_i18n_["__"])('Top'),
  27031. value: valueY,
  27032. onChange: handleOnYChange,
  27033. dragDirection: "s"
  27034. }));
  27035. }
  27036. function controls_UnitControl(props) {
  27037. return Object(external_wp_element_["createElement"])(focal_point_picker_style_UnitControl, Object(esm_extends["a" /* default */])({
  27038. className: "focal-point-picker__controls-position-unit-control",
  27039. labelPosition: "side",
  27040. max: TEXTCONTROL_MAX,
  27041. min: TEXTCONTROL_MIN,
  27042. unit: "%",
  27043. units: [{
  27044. value: '%',
  27045. label: '%'
  27046. }]
  27047. }, props));
  27048. }
  27049. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/styles/focal-point-style.js
  27050. function focal_point_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  27051. /**
  27052. * WordPress dependencies
  27053. */
  27054. /**
  27055. * Internal dependencies
  27056. */
  27057. const FocalPointWrapper = styled_base_browser_esm("div", {
  27058. target: "eas61re0",
  27059. label: "FocalPointWrapper"
  27060. })("background-color:transparent;box-sizing:border-box;cursor:grab;height:30px;margin:-15px 0 0 -15px;opacity:0.8;position:absolute;user-select:none;width:30px;will-change:transform;z-index:10000;", ({
  27061. isDragging
  27062. }) => isDragging && 'cursor: grabbing;', true ? "" : undefined);
  27063. const PointerIconSVG = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["SVG"], {
  27064. target: "eas61re1",
  27065. label: "PointerIconSVG"
  27066. })( true ? {
  27067. name: "1fp1hff",
  27068. styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%;"
  27069. } : undefined);
  27070. const PointerIconPathOutline = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["Path"], {
  27071. target: "eas61re2",
  27072. label: "PointerIconPathOutline"
  27073. })( true ? {
  27074. name: "j4aqsr",
  27075. styles: "fill:white;"
  27076. } : undefined);
  27077. const PointerIconPathFill = /*#__PURE__*/styled_base_browser_esm(external_wp_primitives_["Path"], {
  27078. target: "eas61re3",
  27079. label: "PointerIconPathFill"
  27080. })("fill:", COLORS.blue.wordpress[700], ";fill:", COLORS.ui.theme, ";" + ( true ? "" : undefined));
  27081. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/focal-point.js
  27082. /**
  27083. * Internal dependencies
  27084. */
  27085. /**
  27086. * External dependencies
  27087. */
  27088. function FocalPoint({
  27089. coordinates = {
  27090. left: '50%',
  27091. top: '50%'
  27092. },
  27093. ...props
  27094. }) {
  27095. const classes = classnames_default()('components-focal-point-picker__icon_container');
  27096. const style = {
  27097. left: coordinates.left,
  27098. top: coordinates.top
  27099. };
  27100. return Object(external_wp_element_["createElement"])(FocalPointWrapper, Object(esm_extends["a" /* default */])({}, props, {
  27101. className: classes,
  27102. style: style
  27103. }), Object(external_wp_element_["createElement"])(PointerIconSVG, {
  27104. className: "components-focal-point-picker__icon",
  27105. xmlns: "http://www.w3.org/2000/svg",
  27106. viewBox: "0 0 30 30"
  27107. }, Object(external_wp_element_["createElement"])(PointerIconPathOutline, {
  27108. className: "components-focal-point-picker__icon-outline",
  27109. d: "M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"
  27110. }), Object(external_wp_element_["createElement"])(PointerIconPathFill, {
  27111. className: "components-focal-point-picker__icon-fill",
  27112. d: "M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z"
  27113. })));
  27114. }
  27115. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/grid.js
  27116. /**
  27117. * WordPress dependencies
  27118. */
  27119. /**
  27120. * Internal dependencies
  27121. */
  27122. const {
  27123. clearTimeout: grid_clearTimeout,
  27124. setTimeout: grid_setTimeout
  27125. } = typeof window !== 'undefined' ? window : {};
  27126. function FocalPointPickerGrid({
  27127. bounds = {},
  27128. value,
  27129. ...props
  27130. }) {
  27131. const animationProps = useRevealAnimation(value);
  27132. const style = {
  27133. width: bounds.width,
  27134. height: bounds.height
  27135. };
  27136. return Object(external_wp_element_["createElement"])(GridView, Object(esm_extends["a" /* default */])({}, props, animationProps, {
  27137. className: "components-focal-point-picker__grid",
  27138. style: style
  27139. }), Object(external_wp_element_["createElement"])(GridLineX, {
  27140. style: {
  27141. top: '33%'
  27142. }
  27143. }), Object(external_wp_element_["createElement"])(GridLineX, {
  27144. style: {
  27145. top: '66%'
  27146. }
  27147. }), Object(external_wp_element_["createElement"])(GridLineY, {
  27148. style: {
  27149. left: '33%'
  27150. }
  27151. }), Object(external_wp_element_["createElement"])(GridLineY, {
  27152. style: {
  27153. left: '66%'
  27154. }
  27155. }));
  27156. }
  27157. /**
  27158. * Custom hook that renders the "flash" animation whenever the value changes.
  27159. *
  27160. * @param {string} value Value of (box) side.
  27161. */
  27162. function useRevealAnimation(value) {
  27163. const [isActive, setIsActive] = Object(external_wp_element_["useState"])(false);
  27164. use_update_effect(() => {
  27165. setIsActive(true);
  27166. const timeout = grid_setTimeout(() => {
  27167. setIsActive(false);
  27168. }, 600);
  27169. return () => grid_clearTimeout(timeout);
  27170. }, [value]);
  27171. return {
  27172. isActive
  27173. };
  27174. }
  27175. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/media.js
  27176. /**
  27177. * External dependencies
  27178. */
  27179. /**
  27180. * WordPress dependencies
  27181. */
  27182. /**
  27183. * Internal dependencies
  27184. */
  27185. function Media({
  27186. alt,
  27187. autoPlay,
  27188. src,
  27189. onLoad = external_lodash_["noop"],
  27190. mediaRef,
  27191. // Exposing muted prop for test rendering purposes
  27192. // https://github.com/testing-library/react-testing-library/issues/470
  27193. muted = true,
  27194. ...props
  27195. }) {
  27196. if (!src) {
  27197. return Object(external_wp_element_["createElement"])(MediaPlaceholderElement, {
  27198. className: "components-focal-point-picker__media components-focal-point-picker__media--placeholder",
  27199. onLoad: onLoad,
  27200. mediaRef: mediaRef
  27201. });
  27202. }
  27203. const isVideo = isVideoType(src);
  27204. return isVideo ? Object(external_wp_element_["createElement"])("video", Object(esm_extends["a" /* default */])({}, props, {
  27205. autoPlay: autoPlay,
  27206. className: "components-focal-point-picker__media components-focal-point-picker__media--video",
  27207. loop: true,
  27208. muted: muted,
  27209. onLoadedData: onLoad,
  27210. ref: mediaRef,
  27211. src: src
  27212. })) : Object(external_wp_element_["createElement"])("img", Object(esm_extends["a" /* default */])({}, props, {
  27213. alt: alt,
  27214. className: "components-focal-point-picker__media components-focal-point-picker__media--image",
  27215. onLoad: onLoad,
  27216. ref: mediaRef,
  27217. src: src
  27218. }));
  27219. }
  27220. function MediaPlaceholderElement({
  27221. mediaRef,
  27222. onLoad = external_lodash_["noop"],
  27223. ...props
  27224. }) {
  27225. const onLoadRef = Object(external_wp_element_["useRef"])(onLoad);
  27226. /**
  27227. * This async callback mimics the onLoad (img) / onLoadedData (video) callback
  27228. * for media elements. It is used in the main <FocalPointPicker /> component
  27229. * to calculate the dimensions + boundaries for positioning.
  27230. */
  27231. Object(external_wp_element_["useLayoutEffect"])(() => {
  27232. window.requestAnimationFrame(() => {
  27233. onLoadRef.current();
  27234. });
  27235. }, []);
  27236. return Object(external_wp_element_["createElement"])(MediaPlaceholder, Object(esm_extends["a" /* default */])({
  27237. ref: mediaRef
  27238. }, props));
  27239. }
  27240. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/index.js
  27241. /**
  27242. * External dependencies
  27243. */
  27244. /**
  27245. * WordPress dependencies
  27246. */
  27247. /**
  27248. * Internal dependencies
  27249. */
  27250. class focal_point_picker_FocalPointPicker extends external_wp_element_["Component"] {
  27251. constructor(props) {
  27252. super(...arguments);
  27253. this.state = {
  27254. isDragging: false,
  27255. bounds: INITIAL_BOUNDS,
  27256. percentages: props.value
  27257. };
  27258. this.containerRef = Object(external_wp_element_["createRef"])();
  27259. this.mediaRef = Object(external_wp_element_["createRef"])();
  27260. this.onMouseDown = this.startDrag.bind(this);
  27261. this.onMouseUp = this.stopDrag.bind(this);
  27262. this.onKeyDown = this.onKeyDown.bind(this);
  27263. this.onMouseMove = this.doDrag.bind(this);
  27264. this.ifDraggingStop = () => {
  27265. if (this.state.isDragging) {
  27266. this.stopDrag();
  27267. }
  27268. };
  27269. this.onChangeAtControls = value => {
  27270. this.updateValue(value);
  27271. this.props.onChange(value);
  27272. };
  27273. this.updateBounds = this.updateBounds.bind(this);
  27274. this.updateValue = this.updateValue.bind(this);
  27275. }
  27276. componentDidMount() {
  27277. const {
  27278. defaultView
  27279. } = this.containerRef.current.ownerDocument;
  27280. defaultView.addEventListener('resize', this.updateBounds);
  27281. /*
  27282. * Set initial bound values.
  27283. *
  27284. * This is necessary for Safari:
  27285. * https://github.com/WordPress/gutenberg/issues/25814
  27286. */
  27287. this.updateBounds();
  27288. }
  27289. componentDidUpdate(prevProps) {
  27290. if (prevProps.url !== this.props.url) {
  27291. this.ifDraggingStop();
  27292. }
  27293. /*
  27294. * Handles cases where the incoming value changes.
  27295. * An example is the values resetting based on an UNDO action.
  27296. */
  27297. const {
  27298. isDragging,
  27299. percentages: {
  27300. x,
  27301. y
  27302. }
  27303. } = this.state;
  27304. const {
  27305. value
  27306. } = this.props;
  27307. if (!isDragging && (value.x !== x || value.y !== y)) {
  27308. this.setState({
  27309. percentages: this.props.value
  27310. });
  27311. }
  27312. }
  27313. componentWillUnmount() {
  27314. const {
  27315. defaultView
  27316. } = this.containerRef.current.ownerDocument;
  27317. defaultView.removeEventListener('resize', this.updateBounds);
  27318. this.ifDraggingStop();
  27319. }
  27320. calculateBounds() {
  27321. const bounds = INITIAL_BOUNDS;
  27322. if (!this.mediaRef.current) {
  27323. return bounds;
  27324. } // Prevent division by zero when updateBounds runs in componentDidMount
  27325. if (this.mediaRef.current.clientWidth === 0 || this.mediaRef.current.clientHeight === 0) {
  27326. return bounds;
  27327. }
  27328. const dimensions = {
  27329. width: this.mediaRef.current.clientWidth,
  27330. height: this.mediaRef.current.clientHeight
  27331. };
  27332. const pickerDimensions = this.pickerDimensions();
  27333. const widthRatio = pickerDimensions.width / dimensions.width;
  27334. const heightRatio = pickerDimensions.height / dimensions.height;
  27335. if (heightRatio >= widthRatio) {
  27336. bounds.width = bounds.right = pickerDimensions.width;
  27337. bounds.height = dimensions.height * widthRatio;
  27338. bounds.top = (pickerDimensions.height - bounds.height) / 2;
  27339. bounds.bottom = bounds.top + bounds.height;
  27340. } else {
  27341. bounds.height = bounds.bottom = pickerDimensions.height;
  27342. bounds.width = dimensions.width * heightRatio;
  27343. bounds.left = (pickerDimensions.width - bounds.width) / 2;
  27344. bounds.right = bounds.left + bounds.width;
  27345. }
  27346. return bounds;
  27347. }
  27348. updateValue(nextValue = {}) {
  27349. const {
  27350. x,
  27351. y
  27352. } = nextValue;
  27353. const nextPercentage = {
  27354. x: parseFloat(x).toFixed(2),
  27355. y: parseFloat(y).toFixed(2)
  27356. };
  27357. this.setState({
  27358. percentages: nextPercentage
  27359. });
  27360. }
  27361. updateBounds() {
  27362. this.setState({
  27363. bounds: this.calculateBounds()
  27364. });
  27365. }
  27366. startDrag(event) {
  27367. var _this$props$onDragSta, _this$props;
  27368. event.persist();
  27369. this.containerRef.current.focus();
  27370. this.setState({
  27371. isDragging: true
  27372. });
  27373. const {
  27374. ownerDocument
  27375. } = this.containerRef.current;
  27376. ownerDocument.addEventListener('mouseup', this.onMouseUp);
  27377. ownerDocument.addEventListener('mousemove', this.onMouseMove);
  27378. const value = this.getValueFromPoint({
  27379. x: event.pageX,
  27380. y: event.pageY
  27381. }, event.shiftKey);
  27382. this.updateValue(value);
  27383. (_this$props$onDragSta = (_this$props = this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props, value, event);
  27384. }
  27385. stopDrag(event) {
  27386. var _this$props$onDragEnd, _this$props2;
  27387. const {
  27388. ownerDocument
  27389. } = this.containerRef.current;
  27390. ownerDocument.removeEventListener('mouseup', this.onMouseUp);
  27391. ownerDocument.removeEventListener('mousemove', this.onMouseMove);
  27392. this.setState({
  27393. isDragging: false
  27394. }, () => {
  27395. this.props.onChange(this.state.percentages);
  27396. });
  27397. (_this$props$onDragEnd = (_this$props2 = this.props).onDragEnd) === null || _this$props$onDragEnd === void 0 ? void 0 : _this$props$onDragEnd.call(_this$props2, event);
  27398. }
  27399. onKeyDown(event) {
  27400. const {
  27401. keyCode,
  27402. shiftKey
  27403. } = event;
  27404. if (![external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]].includes(keyCode)) return;
  27405. event.preventDefault();
  27406. const next = { ...this.state.percentages
  27407. };
  27408. const step = shiftKey ? 0.1 : 0.01;
  27409. const delta = keyCode === external_wp_keycodes_["UP"] || keyCode === external_wp_keycodes_["LEFT"] ? -1 * step : step;
  27410. const axis = keyCode === external_wp_keycodes_["UP"] || keyCode === external_wp_keycodes_["DOWN"] ? 'y' : 'x';
  27411. const value = parseFloat(next[axis]) + delta;
  27412. next[axis] = roundClamp(value, 0, 1, step);
  27413. this.updateValue(next);
  27414. this.props.onChange(next);
  27415. }
  27416. doDrag(event) {
  27417. var _this$props$onDrag, _this$props3;
  27418. // Prevents text-selection when dragging.
  27419. event.preventDefault();
  27420. const value = this.getValueFromPoint({
  27421. x: event.pageX,
  27422. y: event.pageY
  27423. }, event.shiftKey);
  27424. this.updateValue(value);
  27425. (_this$props$onDrag = (_this$props3 = this.props).onDrag) === null || _this$props$onDrag === void 0 ? void 0 : _this$props$onDrag.call(_this$props3, value, event);
  27426. }
  27427. getValueFromPoint(point, byTenths) {
  27428. const {
  27429. bounds
  27430. } = this.state;
  27431. const pickerDimensions = this.pickerDimensions();
  27432. const relativePoint = {
  27433. left: point.x - pickerDimensions.left,
  27434. top: point.y - pickerDimensions.top
  27435. };
  27436. const left = Math.max(bounds.left, Math.min(relativePoint.left, bounds.right));
  27437. const top = Math.max(bounds.top, Math.min(relativePoint.top, bounds.bottom));
  27438. let nextX = (left - bounds.left) / (pickerDimensions.width - bounds.left * 2);
  27439. let nextY = (top - bounds.top) / (pickerDimensions.height - bounds.top * 2); // Enables holding shift to jump values by 10%
  27440. const step = byTenths ? 0.1 : 0.01;
  27441. nextX = roundClamp(nextX, 0, 1, step);
  27442. nextY = roundClamp(nextY, 0, 1, step);
  27443. return {
  27444. x: nextX,
  27445. y: nextY
  27446. };
  27447. }
  27448. pickerDimensions() {
  27449. const containerNode = this.containerRef.current;
  27450. if (!containerNode) {
  27451. return {
  27452. width: 0,
  27453. height: 0,
  27454. left: 0,
  27455. top: 0
  27456. };
  27457. }
  27458. const {
  27459. clientHeight,
  27460. clientWidth
  27461. } = containerNode;
  27462. const {
  27463. top,
  27464. left
  27465. } = containerNode.getBoundingClientRect();
  27466. return {
  27467. width: clientWidth,
  27468. height: clientHeight,
  27469. top: top + document.body.scrollTop,
  27470. left
  27471. };
  27472. }
  27473. iconCoordinates() {
  27474. const {
  27475. bounds,
  27476. percentages: {
  27477. x,
  27478. y
  27479. }
  27480. } = this.state;
  27481. if (bounds.left === undefined || bounds.top === undefined) {
  27482. return {
  27483. left: '50%',
  27484. top: '50%'
  27485. };
  27486. }
  27487. const {
  27488. width,
  27489. height
  27490. } = this.pickerDimensions();
  27491. return {
  27492. left: x * (width - bounds.left * 2) + bounds.left,
  27493. top: y * (height - bounds.top * 2) + bounds.top
  27494. };
  27495. }
  27496. render() {
  27497. const {
  27498. autoPlay,
  27499. className,
  27500. help,
  27501. instanceId,
  27502. label,
  27503. url
  27504. } = this.props;
  27505. const {
  27506. bounds,
  27507. isDragging,
  27508. percentages
  27509. } = this.state;
  27510. const iconCoordinates = this.iconCoordinates();
  27511. const classes = classnames_default()('components-focal-point-picker-control', className);
  27512. const id = `inspector-focal-point-picker-control-${instanceId}`;
  27513. return Object(external_wp_element_["createElement"])(base_control, {
  27514. label: label,
  27515. id: id,
  27516. help: help,
  27517. className: classes
  27518. }, Object(external_wp_element_["createElement"])(MediaWrapper, {
  27519. className: "components-focal-point-picker-wrapper"
  27520. }, Object(external_wp_element_["createElement"])(MediaContainer, {
  27521. className: "components-focal-point-picker",
  27522. onKeyDown: this.onKeyDown,
  27523. onMouseDown: this.onMouseDown,
  27524. onBlur: this.ifDraggingStop,
  27525. ref: this.containerRef,
  27526. role: "button",
  27527. tabIndex: "-1"
  27528. }, Object(external_wp_element_["createElement"])(FocalPointPickerGrid, {
  27529. bounds: bounds,
  27530. value: percentages.x + percentages.y
  27531. }), Object(external_wp_element_["createElement"])(Media, {
  27532. alt: Object(external_wp_i18n_["__"])('Media preview'),
  27533. autoPlay: autoPlay,
  27534. mediaRef: this.mediaRef,
  27535. onLoad: this.updateBounds,
  27536. src: url
  27537. }), Object(external_wp_element_["createElement"])(FocalPoint, {
  27538. coordinates: iconCoordinates,
  27539. isDragging: isDragging
  27540. }))), Object(external_wp_element_["createElement"])(FocalPointPickerControls, {
  27541. percentages: percentages,
  27542. onChange: this.onChangeAtControls
  27543. }));
  27544. }
  27545. }
  27546. focal_point_picker_FocalPointPicker.defaultProps = {
  27547. autoPlay: true,
  27548. value: {
  27549. x: 0.5,
  27550. y: 0.5
  27551. },
  27552. url: null
  27553. };
  27554. /* harmony default export */ var focal_point_picker = (Object(external_wp_compose_["withInstanceId"])(focal_point_picker_FocalPointPicker));
  27555. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js
  27556. /**
  27557. * WordPress dependencies
  27558. */
  27559. function FocusableIframe({
  27560. iframeRef,
  27561. ...props
  27562. }) {
  27563. const fallbackRef = Object(external_wp_element_["useRef"])();
  27564. const ref = Object(external_wp_compose_["useMergeRefs"])([iframeRef, fallbackRef]);
  27565. Object(external_wp_element_["useEffect"])(() => {
  27566. const iframe = fallbackRef.current;
  27567. const {
  27568. ownerDocument
  27569. } = iframe;
  27570. const {
  27571. defaultView
  27572. } = ownerDocument;
  27573. /**
  27574. * Checks whether the iframe is the activeElement, inferring that it has
  27575. * then received focus, and calls the `onFocus` prop callback.
  27576. */
  27577. function checkFocus() {
  27578. if (ownerDocument.activeElement !== iframe) {
  27579. return;
  27580. }
  27581. iframe.focus();
  27582. }
  27583. defaultView.addEventListener('blur', checkFocus);
  27584. return () => {
  27585. defaultView.removeEventListener('blur', checkFocus);
  27586. };
  27587. }, []); // Disable reason: The rendered iframe is a pass-through component,
  27588. // assigning props inherited from the rendering parent. It's the
  27589. // responsibility of the parent to assign a title.
  27590. // eslint-disable-next-line jsx-a11y/iframe-has-title
  27591. return Object(external_wp_element_["createElement"])("iframe", Object(esm_extends["a" /* default */])({
  27592. ref: ref
  27593. }, props));
  27594. }
  27595. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js
  27596. var text_color = __webpack_require__("uGfJ");
  27597. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/utils.js
  27598. /**
  27599. * External dependencies
  27600. */
  27601. /**
  27602. * WordPress dependencies
  27603. */
  27604. /**
  27605. * Internal dependencies
  27606. */
  27607. /**
  27608. * A float supported clamp function for a specific value.
  27609. *
  27610. * @param {number|null} value The value to clamp.
  27611. * @param {number} min The minimum value.
  27612. * @param {number} max The maximum value.
  27613. *
  27614. * @return {number} A (float) number
  27615. */
  27616. function floatClamp(value, min, max) {
  27617. if (typeof value !== 'number') {
  27618. return null;
  27619. }
  27620. return parseFloat(Object(external_lodash_["clamp"])(value, min, max));
  27621. }
  27622. /**
  27623. * Hook to store a clamped value, derived from props.
  27624. *
  27625. * @param {Object} settings Hook settings.
  27626. * @param {number} settings.min The minimum value.
  27627. * @param {number} settings.max The maximum value.
  27628. * @param {number} settings.value The current value.
  27629. * @param {any} settings.initial The initial value.
  27630. *
  27631. * @return {[*, Function]} The controlled value and the value setter.
  27632. */
  27633. function useControlledRangeValue({
  27634. min,
  27635. max,
  27636. value: valueProp,
  27637. initial
  27638. }) {
  27639. const [state, setInternalState] = use_controlled_state(floatClamp(valueProp, min, max), {
  27640. initial,
  27641. fallback: null
  27642. });
  27643. const setState = Object(external_wp_element_["useCallback"])(nextValue => {
  27644. if (nextValue === null) {
  27645. setInternalState(null);
  27646. } else {
  27647. setInternalState(floatClamp(nextValue, min, max));
  27648. }
  27649. }, [min, max]);
  27650. return [state, setState];
  27651. }
  27652. /**
  27653. * Hook to encapsulate the debouncing "hover" to better handle the showing
  27654. * and hiding of the Tooltip.
  27655. *
  27656. * @param {Object} settings Hook settings.
  27657. * @param {Function} [settings.onShow=noop] A callback function invoked when the element is shown.
  27658. * @param {Function} [settings.onHide=noop] A callback function invoked when the element is hidden.
  27659. * @param {Function} [settings.onMouseMove=noop] A callback function invoked when the mouse is moved.
  27660. * @param {Function} [settings.onMouseLeave=noop] A callback function invoked when the mouse is moved out of the element.
  27661. * @param {number} [settings.timeout=300] Timeout before the element is shown or hidden.
  27662. *
  27663. * @return {Object} Bound properties for use on a React.Node.
  27664. */
  27665. function useDebouncedHoverInteraction({
  27666. onHide = external_lodash_["noop"],
  27667. onMouseLeave = external_lodash_["noop"],
  27668. onMouseMove = external_lodash_["noop"],
  27669. onShow = external_lodash_["noop"],
  27670. timeout = 300
  27671. }) {
  27672. const [show, setShow] = Object(external_wp_element_["useState"])(false);
  27673. const timeoutRef = Object(external_wp_element_["useRef"])();
  27674. const setDebouncedTimeout = Object(external_wp_element_["useCallback"])(callback => {
  27675. window.clearTimeout(timeoutRef.current);
  27676. timeoutRef.current = setTimeout(callback, timeout);
  27677. }, [timeout]);
  27678. const handleOnMouseMove = Object(external_wp_element_["useCallback"])(event => {
  27679. onMouseMove(event);
  27680. setDebouncedTimeout(() => {
  27681. if (!show) {
  27682. setShow(true);
  27683. onShow();
  27684. }
  27685. });
  27686. }, []);
  27687. const handleOnMouseLeave = Object(external_wp_element_["useCallback"])(event => {
  27688. onMouseLeave(event);
  27689. setDebouncedTimeout(() => {
  27690. setShow(false);
  27691. onHide();
  27692. });
  27693. }, []);
  27694. Object(external_wp_element_["useEffect"])(() => {
  27695. return () => {
  27696. window.clearTimeout(timeoutRef.current);
  27697. };
  27698. });
  27699. return {
  27700. onMouseMove: handleOnMouseMove,
  27701. onMouseLeave: handleOnMouseLeave
  27702. };
  27703. }
  27704. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/styles/range-control-styles.js
  27705. function range_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  27706. /**
  27707. * External dependencies
  27708. */
  27709. /**
  27710. * Internal dependencies
  27711. */
  27712. var range_control_styles_ref = true ? {
  27713. name: "tdik1c",
  27714. styles: "height:30px;min-height:30px;"
  27715. } : undefined;
  27716. const rangeHeight = () => range_control_styles_ref;
  27717. const thumbSize = 20;
  27718. const range_control_styles_Root = styled_base_browser_esm("div", {
  27719. target: "exqw8y20",
  27720. label: "Root"
  27721. })( true ? {
  27722. name: "44oaj8",
  27723. styles: "-webkit-tap-highlight-color:transparent;box-sizing:border-box;align-items:flex-start;display:inline-flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;"
  27724. } : undefined);
  27725. const wrapperColor = ({
  27726. color: colorProp = COLORS.ui.borderFocus
  27727. }) => {
  27728. return /*#__PURE__*/css_browser_esm({
  27729. color: colorProp
  27730. }, true ? "" : undefined);
  27731. };
  27732. const wrapperMargin = ({
  27733. marks
  27734. }) => /*#__PURE__*/css_browser_esm({
  27735. marginBottom: marks ? 16 : null
  27736. }, true ? "" : undefined);
  27737. const range_control_styles_Wrapper = styled_base_browser_esm("div", {
  27738. target: "exqw8y21",
  27739. label: "Wrapper"
  27740. })("box-sizing:border-box;color:", COLORS.blue.medium.focus, ";display:block;flex:1;padding-top:15px;position:relative;width:100%;", wrapperColor, ";", rangeHeight, ";", wrapperMargin, ";", rtl_rtl({
  27741. marginLeft: 10
  27742. }), true ? "" : undefined);
  27743. const BeforeIconWrapper = styled_base_browser_esm("span", {
  27744. target: "exqw8y22",
  27745. label: "BeforeIconWrapper"
  27746. })("margin-top:3px;", rtl_rtl({
  27747. marginRight: 6
  27748. }), true ? "" : undefined);
  27749. const AfterIconWrapper = styled_base_browser_esm("span", {
  27750. target: "exqw8y23",
  27751. label: "AfterIconWrapper"
  27752. })("margin-top:3px;", rtl_rtl({
  27753. marginLeft: 16
  27754. }), true ? "" : undefined);
  27755. const railBackgroundColor = ({
  27756. disabled,
  27757. railColor
  27758. }) => {
  27759. let background = railColor || null;
  27760. if (disabled) {
  27761. background = COLORS.lightGray[400];
  27762. }
  27763. return /*#__PURE__*/css_browser_esm({
  27764. background
  27765. }, true ? "" : undefined);
  27766. };
  27767. const Rail = styled_base_browser_esm("span", {
  27768. target: "exqw8y24",
  27769. label: "Rail"
  27770. })("background-color:", COLORS.lightGray[600], ";box-sizing:border-box;left:0;pointer-events:none;right:0;display:block;height:3px;position:absolute;margin-top:14px;top:0;", railBackgroundColor, ";" + ( true ? "" : undefined));
  27771. const trackBackgroundColor = ({
  27772. disabled,
  27773. trackColor
  27774. }) => {
  27775. let background = trackColor || 'currentColor';
  27776. if (disabled) {
  27777. background = COLORS.lightGray[800];
  27778. }
  27779. return /*#__PURE__*/css_browser_esm({
  27780. background
  27781. }, true ? "" : undefined);
  27782. };
  27783. const Track = styled_base_browser_esm("span", {
  27784. target: "exqw8y25",
  27785. label: "Track"
  27786. })("background-color:currentColor;border-radius:1px;box-sizing:border-box;height:3px;pointer-events:none;display:block;position:absolute;margin-top:14px;top:0;", trackBackgroundColor, ";" + ( true ? "" : undefined));
  27787. const MarksWrapper = styled_base_browser_esm("span", {
  27788. target: "exqw8y26",
  27789. label: "MarksWrapper"
  27790. })( true ? {
  27791. name: "8d21nl",
  27792. styles: "box-sizing:border-box;display:block;pointer-events:none;position:relative;width:100%;user-select:none;"
  27793. } : undefined);
  27794. const markFill = ({
  27795. disabled,
  27796. isFilled
  27797. }) => {
  27798. let backgroundColor = isFilled ? 'currentColor' : COLORS.lightGray[600];
  27799. if (disabled) {
  27800. backgroundColor = COLORS.lightGray[800];
  27801. }
  27802. return /*#__PURE__*/css_browser_esm({
  27803. backgroundColor
  27804. }, true ? "" : undefined);
  27805. };
  27806. const Mark = styled_base_browser_esm("span", {
  27807. target: "exqw8y27",
  27808. label: "Mark"
  27809. })("box-sizing:border-box;height:9px;left:0;position:absolute;top:-4px;width:1px;", markFill, ";" + ( true ? "" : undefined));
  27810. const markLabelFill = ({
  27811. isFilled
  27812. }) => {
  27813. return /*#__PURE__*/css_browser_esm({
  27814. color: isFilled ? COLORS.darkGray[300] : COLORS.lightGray[600]
  27815. }, true ? "" : undefined);
  27816. };
  27817. const MarkLabel = styled_base_browser_esm("span", {
  27818. target: "exqw8y28",
  27819. label: "MarkLabel"
  27820. })("box-sizing:border-box;color:", COLORS.lightGray[600], ";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;", markLabelFill, ";" + ( true ? "" : undefined));
  27821. const ThumbWrapper = styled_base_browser_esm("span", {
  27822. target: "exqw8y29",
  27823. label: "ThumbWrapper"
  27824. })("align-items:center;box-sizing:border-box;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:5px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;", rtl_rtl({
  27825. marginLeft: -10
  27826. }), true ? "" : undefined);
  27827. const thumbFocus = ({
  27828. isFocused
  27829. }) => {
  27830. return /*#__PURE__*/css_browser_esm({
  27831. borderColor: isFocused ? COLORS.ui.borderFocus : COLORS.darkGray[200],
  27832. boxShadow: isFocused ? `
  27833. 0 0 0 1px ${COLORS.ui.borderFocus}
  27834. ` : `
  27835. 0 0 0 rgba(0, 0, 0, 0)
  27836. `
  27837. }, true ? "" : undefined);
  27838. };
  27839. const Thumb = styled_base_browser_esm("span", {
  27840. target: "exqw8y210",
  27841. label: "Thumb"
  27842. })("align-items:center;background-color:white;border-radius:50%;border:1px solid ", COLORS.darkGray[200], ";box-sizing:border-box;height:100%;outline:0;position:absolute;user-select:none;width:100%;", thumbFocus, ";" + ( true ? "" : undefined));
  27843. const InputRange = styled_base_browser_esm("input", {
  27844. target: "exqw8y211",
  27845. label: "InputRange"
  27846. })("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : undefined));
  27847. const tooltipShow = ({
  27848. show
  27849. }) => {
  27850. return /*#__PURE__*/css_browser_esm({
  27851. opacity: show ? 1 : 0
  27852. }, true ? "" : undefined);
  27853. };
  27854. var range_control_styles_ref2 = true ? {
  27855. name: "5qqmyx",
  27856. styles: "top:-80%;"
  27857. } : undefined;
  27858. var range_control_styles_ref3 = true ? {
  27859. name: "eda4eg",
  27860. styles: "bottom:-80%;"
  27861. } : undefined;
  27862. const tooltipPosition = ({
  27863. position
  27864. }) => {
  27865. const isTop = position === 'top';
  27866. if (isTop) {
  27867. return range_control_styles_ref2;
  27868. }
  27869. return range_control_styles_ref3;
  27870. };
  27871. const range_control_styles_Tooltip = styled_base_browser_esm("span", {
  27872. target: "exqw8y212",
  27873. label: "Tooltip"
  27874. })("background:", COLORS.ui.border, ";border-radius:2px;box-sizing:border-box;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;", tooltipShow, ";", tooltipPosition, ";", reduceMotion('transition'), ";", rtl_rtl({
  27875. transform: 'translateX(-50%)'
  27876. }, {
  27877. transform: 'translateX(50%)'
  27878. }), true ? "" : undefined); // @todo: Refactor RangeControl with latest HStack configuration
  27879. // @wordpress/components/ui/hstack
  27880. const InputNumber = /*#__PURE__*/styled_base_browser_esm(number_control, {
  27881. target: "exqw8y213",
  27882. label: "InputNumber"
  27883. })("box-sizing:border-box;display:inline-block;font-size:13px;margin-top:0;width:", space(8), " !important;input[type='number']&{", rangeHeight, ";}", rtl_rtl({
  27884. marginLeft: `${space(2)} !important`
  27885. }), true ? "" : undefined);
  27886. const ActionRightWrapper = styled_base_browser_esm("span", {
  27887. target: "exqw8y214",
  27888. label: "ActionRightWrapper"
  27889. })("box-sizing:border-box;display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl_rtl({
  27890. marginLeft: 8
  27891. }), true ? "" : undefined);
  27892. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/input-range.js
  27893. /**
  27894. * External dependencies
  27895. */
  27896. /**
  27897. * WordPress dependencies
  27898. */
  27899. /**
  27900. * Internal dependencies
  27901. */
  27902. function input_range_InputRange({
  27903. describedBy,
  27904. isShiftStepEnabled = true,
  27905. label,
  27906. onHideTooltip = external_lodash_["noop"],
  27907. onMouseLeave = external_lodash_["noop"],
  27908. step = 1,
  27909. onBlur = external_lodash_["noop"],
  27910. onChange = external_lodash_["noop"],
  27911. onFocus = external_lodash_["noop"],
  27912. onMouseMove = external_lodash_["noop"],
  27913. onShowTooltip = external_lodash_["noop"],
  27914. shiftStep = 10,
  27915. value,
  27916. ...props
  27917. }, ref) {
  27918. const jumpStep = use_jump_step({
  27919. step,
  27920. shiftStep,
  27921. isShiftStepEnabled
  27922. });
  27923. const hoverInteractions = useDebouncedHoverInteraction({
  27924. onHide: onHideTooltip,
  27925. onMouseLeave,
  27926. onMouseMove,
  27927. onShow: onShowTooltip
  27928. });
  27929. return Object(external_wp_element_["createElement"])(InputRange, Object(esm_extends["a" /* default */])({}, props, hoverInteractions, {
  27930. "aria-describedby": describedBy,
  27931. "aria-label": label,
  27932. "aria-hidden": false,
  27933. onBlur: onBlur,
  27934. onChange: onChange,
  27935. onFocus: onFocus,
  27936. ref: ref,
  27937. step: jumpStep,
  27938. tabIndex: 0,
  27939. type: "range",
  27940. value: value
  27941. }));
  27942. }
  27943. const input_range_ForwardedComponent = Object(external_wp_element_["forwardRef"])(input_range_InputRange);
  27944. /* harmony default export */ var input_range = (input_range_ForwardedComponent);
  27945. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/mark.js
  27946. /**
  27947. * External dependencies
  27948. */
  27949. /**
  27950. * Internal dependencies
  27951. */
  27952. function RangeMark({
  27953. className,
  27954. isFilled = false,
  27955. label,
  27956. style = {},
  27957. ...props
  27958. }) {
  27959. const classes = classnames_default()('components-range-control__mark', isFilled && 'is-filled', className);
  27960. const labelClasses = classnames_default()('components-range-control__mark-label', isFilled && 'is-filled');
  27961. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Mark, Object(esm_extends["a" /* default */])({}, props, {
  27962. "aria-hidden": "true",
  27963. className: classes,
  27964. isFilled: isFilled,
  27965. style: style
  27966. })), label && Object(external_wp_element_["createElement"])(MarkLabel, {
  27967. "aria-hidden": "true",
  27968. className: labelClasses,
  27969. isFilled: isFilled,
  27970. style: style
  27971. }, label));
  27972. }
  27973. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/rail.js
  27974. /**
  27975. * WordPress dependencies
  27976. */
  27977. /**
  27978. * Internal dependencies
  27979. */
  27980. function RangeRail({
  27981. disabled = false,
  27982. marks = false,
  27983. min = 0,
  27984. max = 100,
  27985. step = 1,
  27986. value = 0,
  27987. ...restProps
  27988. }) {
  27989. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(Rail, Object(esm_extends["a" /* default */])({
  27990. disabled: disabled
  27991. }, restProps)), marks && Object(external_wp_element_["createElement"])(Marks, {
  27992. disabled: disabled,
  27993. marks: marks,
  27994. min: min,
  27995. max: max,
  27996. step: step,
  27997. value: value
  27998. }));
  27999. }
  28000. function Marks({
  28001. disabled = false,
  28002. marks = false,
  28003. min = 0,
  28004. max = 100,
  28005. step = 1,
  28006. value = 0
  28007. }) {
  28008. const marksData = useMarks({
  28009. marks,
  28010. min,
  28011. max,
  28012. step,
  28013. value
  28014. });
  28015. return Object(external_wp_element_["createElement"])(MarksWrapper, {
  28016. "aria-hidden": "true",
  28017. className: "components-range-control__marks"
  28018. }, marksData.map(mark => Object(external_wp_element_["createElement"])(RangeMark, Object(esm_extends["a" /* default */])({}, mark, {
  28019. key: mark.key,
  28020. "aria-hidden": "true",
  28021. disabled: disabled
  28022. }))));
  28023. }
  28024. function useMarks({
  28025. marks,
  28026. min = 0,
  28027. max = 100,
  28028. step = 1,
  28029. value = 0
  28030. }) {
  28031. if (!marks) {
  28032. return [];
  28033. }
  28034. const range = max - min;
  28035. if (!Array.isArray(marks)) {
  28036. marks = [];
  28037. const count = 1 + Math.round(range / step);
  28038. while (count > marks.push({
  28039. value: step * marks.length + min
  28040. }));
  28041. }
  28042. const placedMarks = [];
  28043. marks.forEach((mark, index) => {
  28044. if (mark.value < min || mark.value > max) {
  28045. return;
  28046. }
  28047. const key = `mark-${index}`;
  28048. const isFilled = mark.value <= value;
  28049. const offset = `${(mark.value - min) / range * 100}%`;
  28050. const offsetStyle = {
  28051. [Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left']: offset
  28052. };
  28053. placedMarks.push({ ...mark,
  28054. isFilled,
  28055. key,
  28056. style: offsetStyle
  28057. });
  28058. });
  28059. return placedMarks;
  28060. }
  28061. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/tooltip.js
  28062. /**
  28063. * External dependencies
  28064. */
  28065. /**
  28066. * WordPress dependencies
  28067. */
  28068. /**
  28069. * Internal dependencies
  28070. */
  28071. const TOOLTIP_OFFSET_HEIGHT = 32;
  28072. function SimpleTooltip({
  28073. className,
  28074. inputRef,
  28075. position: positionProp = 'auto',
  28076. show = false,
  28077. style = {},
  28078. value = 0,
  28079. renderTooltipContent = v => v,
  28080. zIndex = 100,
  28081. ...restProps
  28082. }) {
  28083. const position = useTooltipPosition({
  28084. inputRef,
  28085. position: positionProp
  28086. });
  28087. const classes = classnames_default()('components-simple-tooltip', className);
  28088. const styles = { ...style,
  28089. zIndex
  28090. };
  28091. return Object(external_wp_element_["createElement"])(range_control_styles_Tooltip, Object(esm_extends["a" /* default */])({}, restProps, {
  28092. "aria-hidden": show,
  28093. className: classes,
  28094. position: position,
  28095. show: show,
  28096. role: "tooltip",
  28097. style: styles
  28098. }), renderTooltipContent(value));
  28099. }
  28100. function useTooltipPosition({
  28101. inputRef,
  28102. position: positionProp
  28103. }) {
  28104. const [position, setPosition] = Object(external_wp_element_["useState"])('top');
  28105. const calculatePosition = Object(external_wp_element_["useCallback"])(() => {
  28106. if (inputRef && inputRef.current) {
  28107. let nextPosition = positionProp;
  28108. if (positionProp === 'auto') {
  28109. const {
  28110. top
  28111. } = inputRef.current.getBoundingClientRect();
  28112. const isOffscreenTop = top - TOOLTIP_OFFSET_HEIGHT < 0;
  28113. nextPosition = isOffscreenTop ? 'bottom' : 'top';
  28114. }
  28115. setPosition(nextPosition);
  28116. }
  28117. }, [positionProp]);
  28118. Object(external_wp_element_["useEffect"])(() => {
  28119. calculatePosition();
  28120. }, [calculatePosition]);
  28121. Object(external_wp_element_["useEffect"])(() => {
  28122. window.addEventListener('resize', calculatePosition);
  28123. return () => {
  28124. window.removeEventListener('resize', calculatePosition);
  28125. };
  28126. });
  28127. return position;
  28128. }
  28129. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/index.js
  28130. /**
  28131. * External dependencies
  28132. */
  28133. /**
  28134. * WordPress dependencies
  28135. */
  28136. /**
  28137. * Internal dependencies
  28138. */
  28139. function RangeControl({
  28140. afterIcon,
  28141. allowReset = false,
  28142. beforeIcon,
  28143. className,
  28144. currentInput,
  28145. color: colorProp = COLORS.ui.theme,
  28146. disabled = false,
  28147. help,
  28148. initialPosition,
  28149. isShiftStepEnabled = true,
  28150. label,
  28151. marks = false,
  28152. max = 100,
  28153. min = 0,
  28154. onBlur = external_lodash_["noop"],
  28155. onChange = external_lodash_["noop"],
  28156. onFocus = external_lodash_["noop"],
  28157. onMouseMove = external_lodash_["noop"],
  28158. onMouseLeave = external_lodash_["noop"],
  28159. railColor,
  28160. resetFallbackValue,
  28161. renderTooltipContent = v => v,
  28162. showTooltip: showTooltipProp,
  28163. shiftStep = 10,
  28164. step = 1,
  28165. trackColor,
  28166. value: valueProp,
  28167. withInputField = true,
  28168. ...props
  28169. }, ref) {
  28170. var _inputRef$current;
  28171. const [value, setValue] = useControlledRangeValue({
  28172. min,
  28173. max,
  28174. value: valueProp,
  28175. initial: initialPosition
  28176. });
  28177. const isResetPendent = Object(external_wp_element_["useRef"])(false);
  28178. const [showTooltip, setShowTooltip] = Object(external_wp_element_["useState"])(showTooltipProp);
  28179. const [isFocused, setIsFocused] = Object(external_wp_element_["useState"])(false);
  28180. const inputRef = Object(external_wp_element_["useRef"])();
  28181. const setRef = nodeRef => {
  28182. inputRef.current = nodeRef;
  28183. if (ref) {
  28184. ref(nodeRef);
  28185. }
  28186. };
  28187. const isCurrentlyFocused = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.matches(':focus');
  28188. const isThumbFocused = !disabled && isFocused;
  28189. const isValueReset = value === null;
  28190. const currentValue = value !== undefined ? value : currentInput;
  28191. const inputSliderValue = isValueReset ? '' : currentValue;
  28192. const rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
  28193. const calculatedFillValue = (value - min) / (max - min) * 100;
  28194. const fillValue = isValueReset ? 50 : calculatedFillValue;
  28195. const fillValueOffset = `${Object(external_lodash_["clamp"])(fillValue, 0, 100)}%`;
  28196. const classes = classnames_default()('components-range-control', className);
  28197. const wrapperClasses = classnames_default()('components-range-control__wrapper', !!marks && 'is-marked');
  28198. const id = Object(external_wp_compose_["useInstanceId"])(RangeControl, 'inspector-range-control');
  28199. const describedBy = !!help ? `${id}__help` : undefined;
  28200. const enableTooltip = showTooltipProp !== false && Object(external_lodash_["isFinite"])(value);
  28201. const handleOnRangeChange = event => {
  28202. const nextValue = parseFloat(event.target.value);
  28203. setValue(nextValue);
  28204. onChange(nextValue);
  28205. };
  28206. const handleOnChange = nextValue => {
  28207. nextValue = parseFloat(nextValue);
  28208. setValue(nextValue);
  28209. /*
  28210. * Calls onChange only when nextValue is numeric
  28211. * otherwise may queue a reset for the blur event.
  28212. */
  28213. if (!isNaN(nextValue)) {
  28214. if (nextValue < min || nextValue > max) {
  28215. nextValue = floatClamp(nextValue, min, max);
  28216. }
  28217. onChange(nextValue);
  28218. isResetPendent.current = false;
  28219. } else if (allowReset) {
  28220. isResetPendent.current = true;
  28221. }
  28222. };
  28223. const handleOnInputNumberBlur = () => {
  28224. if (isResetPendent.current) {
  28225. handleOnReset();
  28226. isResetPendent.current = false;
  28227. }
  28228. };
  28229. const handleOnReset = () => {
  28230. let resetValue = parseFloat(resetFallbackValue);
  28231. let onChangeResetValue = resetValue;
  28232. if (isNaN(resetValue)) {
  28233. resetValue = null;
  28234. onChangeResetValue = undefined;
  28235. }
  28236. setValue(resetValue);
  28237. /**
  28238. * Previously, this callback would always receive undefined as
  28239. * an argument. This behavior is unexpected, specifically
  28240. * when resetFallbackValue is defined.
  28241. *
  28242. * The value of undefined is not ideal. Passing it through
  28243. * to internal <input /> elements would change it from a
  28244. * controlled component to an uncontrolled component.
  28245. *
  28246. * For now, to minimize unexpected regressions, we're going to
  28247. * preserve the undefined callback argument, except when a
  28248. * resetFallbackValue is defined.
  28249. */
  28250. onChange(onChangeResetValue);
  28251. };
  28252. const handleShowTooltip = () => setShowTooltip(true);
  28253. const handleHideTooltip = () => setShowTooltip(false);
  28254. const handleOnBlur = event => {
  28255. onBlur(event);
  28256. setIsFocused(false);
  28257. handleHideTooltip();
  28258. };
  28259. const handleOnFocus = event => {
  28260. onFocus(event);
  28261. setIsFocused(true);
  28262. handleShowTooltip();
  28263. };
  28264. const offsetStyle = {
  28265. [Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left']: fillValueOffset
  28266. };
  28267. return Object(external_wp_element_["createElement"])(base_control, {
  28268. className: classes,
  28269. label: label,
  28270. id: id,
  28271. help: help
  28272. }, Object(external_wp_element_["createElement"])(range_control_styles_Root, {
  28273. className: "components-range-control__root"
  28274. }, beforeIcon && Object(external_wp_element_["createElement"])(BeforeIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  28275. icon: beforeIcon
  28276. })), Object(external_wp_element_["createElement"])(range_control_styles_Wrapper, {
  28277. className: wrapperClasses,
  28278. color: colorProp,
  28279. marks: !!marks
  28280. }, Object(external_wp_element_["createElement"])(input_range, Object(esm_extends["a" /* default */])({}, props, {
  28281. className: "components-range-control__slider",
  28282. describedBy: describedBy,
  28283. disabled: disabled,
  28284. id: id,
  28285. isShiftStepEnabled: isShiftStepEnabled,
  28286. label: label,
  28287. max: max,
  28288. min: min,
  28289. onBlur: handleOnBlur,
  28290. onChange: handleOnRangeChange,
  28291. onFocus: handleOnFocus,
  28292. onMouseMove: onMouseMove,
  28293. onMouseLeave: onMouseLeave,
  28294. ref: setRef,
  28295. shiftStep: shiftStep,
  28296. step: step,
  28297. value: inputSliderValue
  28298. })), Object(external_wp_element_["createElement"])(RangeRail, {
  28299. "aria-hidden": true,
  28300. disabled: disabled,
  28301. marks: marks,
  28302. max: max,
  28303. min: min,
  28304. railColor: railColor,
  28305. step: step,
  28306. value: rangeFillValue
  28307. }), Object(external_wp_element_["createElement"])(Track, {
  28308. "aria-hidden": true,
  28309. className: "components-range-control__track",
  28310. disabled: disabled,
  28311. style: {
  28312. width: fillValueOffset
  28313. },
  28314. trackColor: trackColor
  28315. }), Object(external_wp_element_["createElement"])(ThumbWrapper, {
  28316. style: offsetStyle
  28317. }, Object(external_wp_element_["createElement"])(Thumb, {
  28318. "aria-hidden": true,
  28319. isFocused: isThumbFocused
  28320. })), enableTooltip && Object(external_wp_element_["createElement"])(SimpleTooltip, {
  28321. className: "components-range-control__tooltip",
  28322. inputRef: inputRef,
  28323. renderTooltipContent: renderTooltipContent,
  28324. show: isCurrentlyFocused || showTooltip,
  28325. style: offsetStyle,
  28326. value: value
  28327. })), afterIcon && Object(external_wp_element_["createElement"])(AfterIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  28328. icon: afterIcon
  28329. })), withInputField && Object(external_wp_element_["createElement"])(InputNumber, {
  28330. "aria-label": label,
  28331. className: "components-range-control__number",
  28332. disabled: disabled,
  28333. inputMode: "decimal",
  28334. isShiftStepEnabled: isShiftStepEnabled,
  28335. max: max,
  28336. min: min,
  28337. onBlur: handleOnInputNumberBlur,
  28338. onChange: handleOnChange,
  28339. shiftStep: shiftStep,
  28340. step: step,
  28341. value: inputSliderValue
  28342. }), allowReset && Object(external_wp_element_["createElement"])(ActionRightWrapper, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  28343. className: "components-range-control__reset",
  28344. disabled: disabled || value === undefined,
  28345. isSecondary: true,
  28346. isSmall: true,
  28347. onClick: handleOnReset
  28348. }, Object(external_wp_i18n_["__"])('Reset')))));
  28349. }
  28350. const range_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(RangeControl);
  28351. /* harmony default export */ var range_control = (range_control_ForwardedComponent);
  28352. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/index.js
  28353. /**
  28354. * External dependencies
  28355. */
  28356. /**
  28357. * WordPress dependencies
  28358. */
  28359. /**
  28360. * Internal dependencies
  28361. */
  28362. const DEFAULT_FONT_SIZE = 'default';
  28363. const CUSTOM_FONT_SIZE = 'custom';
  28364. const MAX_FONT_SIZE_DISPLAY = '25px';
  28365. function getSelectValueFromFontSize(fontSizes, value) {
  28366. if (value) {
  28367. const fontSizeValue = fontSizes.find(font => font.size === value);
  28368. return fontSizeValue ? fontSizeValue.slug : CUSTOM_FONT_SIZE;
  28369. }
  28370. return DEFAULT_FONT_SIZE;
  28371. }
  28372. function getSelectOptions(optionsArray, disableCustomFontSizes) {
  28373. if (disableCustomFontSizes && !optionsArray.length) {
  28374. return null;
  28375. }
  28376. optionsArray = [{
  28377. slug: DEFAULT_FONT_SIZE,
  28378. name: Object(external_wp_i18n_["__"])('Default')
  28379. }, ...optionsArray, ...(disableCustomFontSizes ? [] : [{
  28380. slug: CUSTOM_FONT_SIZE,
  28381. name: Object(external_wp_i18n_["__"])('Custom')
  28382. }])];
  28383. return optionsArray.map(option => ({
  28384. key: option.slug,
  28385. name: option.name,
  28386. size: option.size,
  28387. style: {
  28388. fontSize: `min( ${option.size}, ${MAX_FONT_SIZE_DISPLAY} )`
  28389. }
  28390. }));
  28391. }
  28392. function FontSizePicker({
  28393. fallbackFontSize,
  28394. fontSizes = [],
  28395. disableCustomFontSizes = false,
  28396. onChange,
  28397. value,
  28398. withSlider = false
  28399. }, ref) {
  28400. const hasUnits = Object(external_lodash_["isString"])(value) || fontSizes[0] && Object(external_lodash_["isString"])(fontSizes[0].size);
  28401. let noUnitsValue;
  28402. if (!hasUnits) {
  28403. noUnitsValue = value;
  28404. } else {
  28405. noUnitsValue = parseInt(value);
  28406. }
  28407. const isPixelValue = Object(external_lodash_["isNumber"])(value) || Object(external_lodash_["isString"])(value) && value.endsWith('px');
  28408. const units = useCustomUnits({
  28409. availableUnits: ['px', 'em', 'rem']
  28410. });
  28411. const options = Object(external_wp_element_["useMemo"])(() => getSelectOptions(fontSizes, disableCustomFontSizes), [fontSizes, disableCustomFontSizes]);
  28412. if (!options) {
  28413. return null;
  28414. }
  28415. const selectedFontSizeSlug = getSelectValueFromFontSize(fontSizes, value);
  28416. return Object(external_wp_element_["createElement"])("fieldset", Object(esm_extends["a" /* default */])({
  28417. className: "components-font-size-picker"
  28418. }, ref ? {} : {
  28419. ref
  28420. }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  28421. as: "legend"
  28422. }, Object(external_wp_i18n_["__"])('Font size')), Object(external_wp_element_["createElement"])("div", {
  28423. className: "components-font-size-picker__controls"
  28424. }, fontSizes.length > 0 && Object(external_wp_element_["createElement"])(CustomSelectControl, {
  28425. className: 'components-font-size-picker__select',
  28426. label: Object(external_wp_i18n_["__"])('Font size'),
  28427. options: options,
  28428. value: options.find(option => option.key === selectedFontSizeSlug),
  28429. onChange: ({
  28430. selectedItem
  28431. }) => {
  28432. if (hasUnits) {
  28433. onChange(selectedItem.size);
  28434. } else {
  28435. onChange(Number(selectedItem.size));
  28436. }
  28437. }
  28438. }), !withSlider && !disableCustomFontSizes && Object(external_wp_element_["createElement"])(unit_control, {
  28439. label: Object(external_wp_i18n_["__"])('Custom'),
  28440. labelPosition: "top",
  28441. __unstableInputWidth: "60px",
  28442. value: value,
  28443. onChange: nextSize => {
  28444. if (0 === parseFloat(nextSize) || !nextSize) {
  28445. onChange(undefined);
  28446. } else {
  28447. onChange(hasUnits ? nextSize : parseInt(nextSize, 10));
  28448. }
  28449. },
  28450. units: hasUnits ? units : false
  28451. }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  28452. className: "components-color-palette__clear",
  28453. disabled: value === undefined,
  28454. onClick: () => {
  28455. onChange(undefined);
  28456. },
  28457. isSmall: true,
  28458. isSecondary: true
  28459. }, Object(external_wp_i18n_["__"])('Reset'))), withSlider && Object(external_wp_element_["createElement"])(range_control, {
  28460. className: "components-font-size-picker__custom-input",
  28461. label: Object(external_wp_i18n_["__"])('Custom Size'),
  28462. value: isPixelValue && noUnitsValue || '',
  28463. initialPosition: fallbackFontSize,
  28464. onChange: newValue => {
  28465. onChange(hasUnits ? newValue + 'px' : newValue);
  28466. },
  28467. min: 12,
  28468. max: 100,
  28469. beforeIcon: text_color["a" /* default */],
  28470. afterIcon: text_color["a" /* default */]
  28471. }));
  28472. }
  28473. /* harmony default export */ var font_size_picker = (Object(external_wp_element_["forwardRef"])(FontSizePicker));
  28474. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-file-upload/index.js
  28475. /**
  28476. * WordPress dependencies
  28477. */
  28478. /**
  28479. * Internal dependencies
  28480. */
  28481. function FormFileUpload({
  28482. accept,
  28483. children,
  28484. multiple = false,
  28485. onChange,
  28486. render,
  28487. ...props
  28488. }) {
  28489. const ref = Object(external_wp_element_["useRef"])();
  28490. const openFileDialog = () => {
  28491. ref.current.click();
  28492. };
  28493. const ui = render ? render({
  28494. openFileDialog
  28495. }) : Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  28496. onClick: openFileDialog
  28497. }, props), children);
  28498. return Object(external_wp_element_["createElement"])("div", {
  28499. className: "components-form-file-upload"
  28500. }, ui, Object(external_wp_element_["createElement"])("input", {
  28501. type: "file",
  28502. ref: ref,
  28503. multiple: multiple,
  28504. style: {
  28505. display: 'none'
  28506. },
  28507. accept: accept,
  28508. onChange: onChange
  28509. }));
  28510. }
  28511. /* harmony default export */ var form_file_upload = (FormFileUpload);
  28512. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-toggle/index.js
  28513. /**
  28514. * External dependencies
  28515. */
  28516. function FormToggle({
  28517. className,
  28518. checked,
  28519. id,
  28520. disabled,
  28521. onChange = external_lodash_["noop"],
  28522. ...props
  28523. }) {
  28524. const wrapperClasses = classnames_default()('components-form-toggle', className, {
  28525. 'is-checked': checked,
  28526. 'is-disabled': disabled
  28527. });
  28528. return Object(external_wp_element_["createElement"])("span", {
  28529. className: wrapperClasses
  28530. }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
  28531. className: "components-form-toggle__input",
  28532. id: id,
  28533. type: "checkbox",
  28534. checked: checked,
  28535. onChange: onChange,
  28536. disabled: disabled
  28537. }, props)), Object(external_wp_element_["createElement"])("span", {
  28538. className: "components-form-toggle__track"
  28539. }), Object(external_wp_element_["createElement"])("span", {
  28540. className: "components-form-toggle__thumb"
  28541. }));
  28542. }
  28543. /* harmony default export */ var form_toggle = (FormToggle);
  28544. // EXTERNAL MODULE: external ["wp","isShallowEqual"]
  28545. var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
  28546. var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
  28547. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token.js
  28548. /**
  28549. * External dependencies
  28550. */
  28551. /**
  28552. * WordPress dependencies
  28553. */
  28554. /**
  28555. * Internal dependencies
  28556. */
  28557. function Token({
  28558. value,
  28559. status,
  28560. title,
  28561. displayTransform,
  28562. isBorderless = false,
  28563. disabled = false,
  28564. onClickRemove = external_lodash_["noop"],
  28565. onMouseEnter,
  28566. onMouseLeave,
  28567. messages,
  28568. termPosition,
  28569. termsCount
  28570. }) {
  28571. const instanceId = Object(external_wp_compose_["useInstanceId"])(Token);
  28572. const tokenClasses = classnames_default()('components-form-token-field__token', {
  28573. 'is-error': 'error' === status,
  28574. 'is-success': 'success' === status,
  28575. 'is-validating': 'validating' === status,
  28576. 'is-borderless': isBorderless,
  28577. 'is-disabled': disabled
  28578. });
  28579. const onClick = () => onClickRemove({
  28580. value
  28581. });
  28582. const transformedValue = displayTransform(value);
  28583. const termPositionAndCount = Object(external_wp_i18n_["sprintf"])(
  28584. /* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
  28585. Object(external_wp_i18n_["__"])('%1$s (%2$s of %3$s)'), transformedValue, termPosition, termsCount);
  28586. return Object(external_wp_element_["createElement"])("span", {
  28587. className: tokenClasses,
  28588. onMouseEnter: onMouseEnter,
  28589. onMouseLeave: onMouseLeave,
  28590. title: title
  28591. }, Object(external_wp_element_["createElement"])("span", {
  28592. className: "components-form-token-field__token-text",
  28593. id: `components-form-token-field__token-text-${instanceId}`
  28594. }, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  28595. as: "span"
  28596. }, termPositionAndCount), Object(external_wp_element_["createElement"])("span", {
  28597. "aria-hidden": "true"
  28598. }, transformedValue)), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  28599. className: "components-form-token-field__remove-token",
  28600. icon: close_small["a" /* default */],
  28601. onClick: !disabled && onClick,
  28602. label: messages.remove,
  28603. "aria-describedby": `components-form-token-field__token-text-${instanceId}`
  28604. }));
  28605. }
  28606. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js
  28607. /**
  28608. * WordPress dependencies
  28609. */
  28610. /**
  28611. * A Higher Order Component used to be provide speak and debounced speak
  28612. * functions.
  28613. *
  28614. * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak
  28615. *
  28616. * @param {WPComponent} Component The component to be wrapped.
  28617. *
  28618. * @return {WPComponent} The wrapped component.
  28619. */
  28620. /* harmony default export */ var with_spoken_messages = (Object(external_wp_compose_["createHigherOrderComponent"])(Component => props => Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({}, props, {
  28621. speak: external_wp_a11y_["speak"],
  28622. debouncedSpeak: Object(external_wp_compose_["useDebounce"])(external_wp_a11y_["speak"], 500)
  28623. })), 'withSpokenMessages'));
  28624. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/index.js
  28625. /**
  28626. * External dependencies
  28627. */
  28628. /**
  28629. * WordPress dependencies
  28630. */
  28631. /**
  28632. * Internal dependencies
  28633. */
  28634. const form_token_field_initialState = {
  28635. incompleteTokenValue: '',
  28636. inputOffsetFromEnd: 0,
  28637. isActive: false,
  28638. isExpanded: false,
  28639. selectedSuggestionIndex: -1,
  28640. selectedSuggestionScroll: false
  28641. };
  28642. class form_token_field_FormTokenField extends external_wp_element_["Component"] {
  28643. constructor() {
  28644. super(...arguments);
  28645. this.state = form_token_field_initialState;
  28646. this.onKeyDown = this.onKeyDown.bind(this);
  28647. this.onKeyPress = this.onKeyPress.bind(this);
  28648. this.onFocus = this.onFocus.bind(this);
  28649. this.onBlur = this.onBlur.bind(this);
  28650. this.deleteTokenBeforeInput = this.deleteTokenBeforeInput.bind(this);
  28651. this.deleteTokenAfterInput = this.deleteTokenAfterInput.bind(this);
  28652. this.addCurrentToken = this.addCurrentToken.bind(this);
  28653. this.onContainerTouched = this.onContainerTouched.bind(this);
  28654. this.renderToken = this.renderToken.bind(this);
  28655. this.onTokenClickRemove = this.onTokenClickRemove.bind(this);
  28656. this.onSuggestionHovered = this.onSuggestionHovered.bind(this);
  28657. this.onSuggestionSelected = this.onSuggestionSelected.bind(this);
  28658. this.onInputChange = this.onInputChange.bind(this);
  28659. this.bindInput = this.bindInput.bind(this);
  28660. this.bindTokensAndInput = this.bindTokensAndInput.bind(this);
  28661. this.updateSuggestions = this.updateSuggestions.bind(this);
  28662. }
  28663. componentDidUpdate(prevProps) {
  28664. // Make sure to focus the input when the isActive state is true.
  28665. if (this.state.isActive && !this.input.hasFocus()) {
  28666. this.input.focus();
  28667. }
  28668. const {
  28669. suggestions,
  28670. value
  28671. } = this.props;
  28672. const suggestionsDidUpdate = !external_wp_isShallowEqual_default()(suggestions, prevProps.suggestions);
  28673. if (suggestionsDidUpdate || value !== prevProps.value) {
  28674. this.updateSuggestions(suggestionsDidUpdate);
  28675. }
  28676. }
  28677. static getDerivedStateFromProps(props, state) {
  28678. if (!props.disabled || !state.isActive) {
  28679. return null;
  28680. }
  28681. return {
  28682. isActive: false,
  28683. incompleteTokenValue: ''
  28684. };
  28685. }
  28686. bindInput(ref) {
  28687. this.input = ref;
  28688. }
  28689. bindTokensAndInput(ref) {
  28690. this.tokensAndInput = ref;
  28691. }
  28692. onFocus(event) {
  28693. const {
  28694. __experimentalExpandOnFocus
  28695. } = this.props; // If focus is on the input or on the container, set the isActive state to true.
  28696. if (this.input.hasFocus() || event.target === this.tokensAndInput) {
  28697. this.setState({
  28698. isActive: true,
  28699. isExpanded: !!__experimentalExpandOnFocus || this.state.isExpanded
  28700. });
  28701. } else {
  28702. /*
  28703. * Otherwise, focus is on one of the token "remove" buttons and we
  28704. * set the isActive state to false to prevent the input to be
  28705. * re-focused, see componentDidUpdate().
  28706. */
  28707. this.setState({
  28708. isActive: false
  28709. });
  28710. }
  28711. if ('function' === typeof this.props.onFocus) {
  28712. this.props.onFocus(event);
  28713. }
  28714. }
  28715. onBlur() {
  28716. if (this.inputHasValidValue()) {
  28717. this.setState({
  28718. isActive: false
  28719. });
  28720. } else {
  28721. this.setState(form_token_field_initialState);
  28722. }
  28723. }
  28724. onKeyDown(event) {
  28725. let preventDefault = false;
  28726. switch (event.keyCode) {
  28727. case external_wp_keycodes_["BACKSPACE"]:
  28728. preventDefault = this.handleDeleteKey(this.deleteTokenBeforeInput);
  28729. break;
  28730. case external_wp_keycodes_["ENTER"]:
  28731. preventDefault = this.addCurrentToken();
  28732. break;
  28733. case external_wp_keycodes_["LEFT"]:
  28734. preventDefault = this.handleLeftArrowKey();
  28735. break;
  28736. case external_wp_keycodes_["UP"]:
  28737. preventDefault = this.handleUpArrowKey();
  28738. break;
  28739. case external_wp_keycodes_["RIGHT"]:
  28740. preventDefault = this.handleRightArrowKey();
  28741. break;
  28742. case external_wp_keycodes_["DOWN"]:
  28743. preventDefault = this.handleDownArrowKey();
  28744. break;
  28745. case external_wp_keycodes_["DELETE"]:
  28746. preventDefault = this.handleDeleteKey(this.deleteTokenAfterInput);
  28747. break;
  28748. case external_wp_keycodes_["SPACE"]:
  28749. if (this.props.tokenizeOnSpace) {
  28750. preventDefault = this.addCurrentToken();
  28751. }
  28752. break;
  28753. case external_wp_keycodes_["ESCAPE"]:
  28754. preventDefault = this.handleEscapeKey(event);
  28755. event.stopPropagation();
  28756. break;
  28757. default:
  28758. break;
  28759. }
  28760. if (preventDefault) {
  28761. event.preventDefault();
  28762. }
  28763. }
  28764. onKeyPress(event) {
  28765. let preventDefault = false;
  28766. switch (event.charCode) {
  28767. case 44:
  28768. // comma
  28769. preventDefault = this.handleCommaKey();
  28770. break;
  28771. default:
  28772. break;
  28773. }
  28774. if (preventDefault) {
  28775. event.preventDefault();
  28776. }
  28777. }
  28778. onContainerTouched(event) {
  28779. // Prevent clicking/touching the tokensAndInput container from blurring
  28780. // the input and adding the current token.
  28781. if (event.target === this.tokensAndInput && this.state.isActive) {
  28782. event.preventDefault();
  28783. }
  28784. }
  28785. onTokenClickRemove(event) {
  28786. this.deleteToken(event.value);
  28787. this.input.focus();
  28788. }
  28789. onSuggestionHovered(suggestion) {
  28790. const index = this.getMatchingSuggestions().indexOf(suggestion);
  28791. if (index >= 0) {
  28792. this.setState({
  28793. selectedSuggestionIndex: index,
  28794. selectedSuggestionScroll: false
  28795. });
  28796. }
  28797. }
  28798. onSuggestionSelected(suggestion) {
  28799. this.addNewToken(suggestion);
  28800. }
  28801. onInputChange(event) {
  28802. const text = event.value;
  28803. const separator = this.props.tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
  28804. const items = text.split(separator);
  28805. const tokenValue = Object(external_lodash_["last"])(items) || '';
  28806. if (items.length > 1) {
  28807. this.addNewTokens(items.slice(0, -1));
  28808. }
  28809. this.setState({
  28810. incompleteTokenValue: tokenValue
  28811. }, this.updateSuggestions);
  28812. this.props.onInputChange(tokenValue);
  28813. }
  28814. handleDeleteKey(deleteToken) {
  28815. let preventDefault = false;
  28816. if (this.input.hasFocus() && this.isInputEmpty()) {
  28817. deleteToken();
  28818. preventDefault = true;
  28819. }
  28820. return preventDefault;
  28821. }
  28822. handleLeftArrowKey() {
  28823. let preventDefault = false;
  28824. if (this.isInputEmpty()) {
  28825. this.moveInputBeforePreviousToken();
  28826. preventDefault = true;
  28827. }
  28828. return preventDefault;
  28829. }
  28830. handleRightArrowKey() {
  28831. let preventDefault = false;
  28832. if (this.isInputEmpty()) {
  28833. this.moveInputAfterNextToken();
  28834. preventDefault = true;
  28835. }
  28836. return preventDefault;
  28837. }
  28838. handleUpArrowKey() {
  28839. this.setState((state, props) => ({
  28840. selectedSuggestionIndex: (state.selectedSuggestionIndex === 0 ? this.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length : state.selectedSuggestionIndex) - 1,
  28841. selectedSuggestionScroll: true
  28842. }));
  28843. return true; // preventDefault
  28844. }
  28845. handleDownArrowKey() {
  28846. this.setState((state, props) => ({
  28847. selectedSuggestionIndex: (state.selectedSuggestionIndex + 1) % this.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length,
  28848. selectedSuggestionScroll: true
  28849. }));
  28850. return true; // preventDefault
  28851. }
  28852. handleEscapeKey(event) {
  28853. this.setState({
  28854. incompleteTokenValue: event.target.value,
  28855. isExpanded: false,
  28856. selectedSuggestionIndex: -1,
  28857. selectedSuggestionScroll: false
  28858. });
  28859. return true; // preventDefault
  28860. }
  28861. handleCommaKey() {
  28862. if (this.inputHasValidValue()) {
  28863. this.addNewToken(this.state.incompleteTokenValue);
  28864. }
  28865. return true; // preventDefault
  28866. }
  28867. moveInputToIndex(index) {
  28868. this.setState((state, props) => ({
  28869. inputOffsetFromEnd: props.value.length - Math.max(index, -1) - 1
  28870. }));
  28871. }
  28872. moveInputBeforePreviousToken() {
  28873. this.setState((state, props) => ({
  28874. inputOffsetFromEnd: Math.min(state.inputOffsetFromEnd + 1, props.value.length)
  28875. }));
  28876. }
  28877. moveInputAfterNextToken() {
  28878. this.setState(state => ({
  28879. inputOffsetFromEnd: Math.max(state.inputOffsetFromEnd - 1, 0)
  28880. }));
  28881. }
  28882. deleteTokenBeforeInput() {
  28883. const index = this.getIndexOfInput() - 1;
  28884. if (index > -1) {
  28885. this.deleteToken(this.props.value[index]);
  28886. }
  28887. }
  28888. deleteTokenAfterInput() {
  28889. const index = this.getIndexOfInput();
  28890. if (index < this.props.value.length) {
  28891. this.deleteToken(this.props.value[index]); // update input offset since it's the offset from the last token
  28892. this.moveInputToIndex(index);
  28893. }
  28894. }
  28895. addCurrentToken() {
  28896. let preventDefault = false;
  28897. const selectedSuggestion = this.getSelectedSuggestion();
  28898. if (selectedSuggestion) {
  28899. this.addNewToken(selectedSuggestion);
  28900. preventDefault = true;
  28901. } else if (this.inputHasValidValue()) {
  28902. this.addNewToken(this.state.incompleteTokenValue);
  28903. preventDefault = true;
  28904. }
  28905. return preventDefault;
  28906. }
  28907. addNewTokens(tokens) {
  28908. const tokensToAdd = Object(external_lodash_["uniq"])(tokens.map(this.props.saveTransform).filter(Boolean).filter(token => !this.valueContainsToken(token)));
  28909. if (tokensToAdd.length > 0) {
  28910. const newValue = Object(external_lodash_["clone"])(this.props.value);
  28911. newValue.splice.apply(newValue, [this.getIndexOfInput(), 0].concat(tokensToAdd));
  28912. this.props.onChange(newValue);
  28913. }
  28914. }
  28915. addNewToken(token) {
  28916. const {
  28917. __experimentalExpandOnFocus,
  28918. __experimentalValidateInput
  28919. } = this.props;
  28920. if (!__experimentalValidateInput(token)) {
  28921. this.props.speak(this.props.messages.__experimentalInvalid, 'assertive');
  28922. return;
  28923. }
  28924. this.addNewTokens([token]);
  28925. this.props.speak(this.props.messages.added, 'assertive');
  28926. this.setState({
  28927. incompleteTokenValue: '',
  28928. selectedSuggestionIndex: -1,
  28929. selectedSuggestionScroll: false,
  28930. isExpanded: !__experimentalExpandOnFocus
  28931. });
  28932. if (this.state.isActive) {
  28933. this.input.focus();
  28934. }
  28935. }
  28936. deleteToken(token) {
  28937. const newTokens = this.props.value.filter(item => {
  28938. return this.getTokenValue(item) !== this.getTokenValue(token);
  28939. });
  28940. this.props.onChange(newTokens);
  28941. this.props.speak(this.props.messages.removed, 'assertive');
  28942. }
  28943. getTokenValue(token) {
  28944. if ('object' === typeof token) {
  28945. return token.value;
  28946. }
  28947. return token;
  28948. }
  28949. getMatchingSuggestions(searchValue = this.state.incompleteTokenValue, suggestions = this.props.suggestions, value = this.props.value, maxSuggestions = this.props.maxSuggestions, saveTransform = this.props.saveTransform) {
  28950. let match = saveTransform(searchValue);
  28951. const startsWithMatch = [];
  28952. const containsMatch = [];
  28953. if (match.length === 0) {
  28954. suggestions = Object(external_lodash_["difference"])(suggestions, value);
  28955. } else {
  28956. match = match.toLocaleLowerCase();
  28957. Object(external_lodash_["each"])(suggestions, suggestion => {
  28958. const index = suggestion.toLocaleLowerCase().indexOf(match);
  28959. if (value.indexOf(suggestion) === -1) {
  28960. if (index === 0) {
  28961. startsWithMatch.push(suggestion);
  28962. } else if (index > 0) {
  28963. containsMatch.push(suggestion);
  28964. }
  28965. }
  28966. });
  28967. suggestions = startsWithMatch.concat(containsMatch);
  28968. }
  28969. return Object(external_lodash_["take"])(suggestions, maxSuggestions);
  28970. }
  28971. getSelectedSuggestion() {
  28972. if (this.state.selectedSuggestionIndex !== -1) {
  28973. return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex];
  28974. }
  28975. }
  28976. valueContainsToken(token) {
  28977. return Object(external_lodash_["some"])(this.props.value, item => {
  28978. return this.getTokenValue(token) === this.getTokenValue(item);
  28979. });
  28980. }
  28981. getIndexOfInput() {
  28982. return this.props.value.length - this.state.inputOffsetFromEnd;
  28983. }
  28984. isInputEmpty() {
  28985. return this.state.incompleteTokenValue.length === 0;
  28986. }
  28987. inputHasValidValue() {
  28988. return this.props.saveTransform(this.state.incompleteTokenValue).length > 0;
  28989. }
  28990. updateSuggestions(resetSelectedSuggestion = true) {
  28991. const {
  28992. __experimentalExpandOnFocus
  28993. } = this.props;
  28994. const {
  28995. incompleteTokenValue
  28996. } = this.state;
  28997. const inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
  28998. const matchingSuggestions = this.getMatchingSuggestions(incompleteTokenValue);
  28999. const hasMatchingSuggestions = matchingSuggestions.length > 0;
  29000. const newState = {
  29001. isExpanded: __experimentalExpandOnFocus || inputHasMinimumChars && hasMatchingSuggestions
  29002. };
  29003. if (resetSelectedSuggestion) {
  29004. newState.selectedSuggestionIndex = -1;
  29005. newState.selectedSuggestionScroll = false;
  29006. }
  29007. this.setState(newState);
  29008. if (inputHasMinimumChars) {
  29009. const {
  29010. debouncedSpeak
  29011. } = this.props;
  29012. const message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])(
  29013. /* translators: %d: number of results. */
  29014. Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.');
  29015. debouncedSpeak(message, 'assertive');
  29016. }
  29017. }
  29018. renderTokensAndInput() {
  29019. const components = Object(external_lodash_["map"])(this.props.value, this.renderToken);
  29020. components.splice(this.getIndexOfInput(), 0, this.renderInput());
  29021. return components;
  29022. }
  29023. renderToken(token, index, tokens) {
  29024. const value = this.getTokenValue(token);
  29025. const status = token.status ? token.status : undefined;
  29026. const termPosition = index + 1;
  29027. const termsCount = tokens.length;
  29028. return Object(external_wp_element_["createElement"])(Token, {
  29029. key: 'token-' + value,
  29030. value: value,
  29031. status: status,
  29032. title: token.title,
  29033. displayTransform: this.props.displayTransform,
  29034. onClickRemove: this.onTokenClickRemove,
  29035. isBorderless: token.isBorderless || this.props.isBorderless,
  29036. onMouseEnter: token.onMouseEnter,
  29037. onMouseLeave: token.onMouseLeave,
  29038. disabled: 'error' !== status && this.props.disabled,
  29039. messages: this.props.messages,
  29040. termsCount: termsCount,
  29041. termPosition: termPosition
  29042. });
  29043. }
  29044. renderInput() {
  29045. const {
  29046. autoCapitalize,
  29047. autoComplete,
  29048. maxLength,
  29049. placeholder,
  29050. value,
  29051. instanceId
  29052. } = this.props;
  29053. let props = {
  29054. instanceId,
  29055. autoCapitalize,
  29056. autoComplete,
  29057. placeholder: value.length === 0 ? placeholder : '',
  29058. ref: this.bindInput,
  29059. key: 'input',
  29060. disabled: this.props.disabled,
  29061. value: this.state.incompleteTokenValue,
  29062. onBlur: this.onBlur,
  29063. isExpanded: this.state.isExpanded,
  29064. selectedSuggestionIndex: this.state.selectedSuggestionIndex
  29065. };
  29066. if (!(maxLength && value.length >= maxLength)) {
  29067. props = { ...props,
  29068. onChange: this.onInputChange
  29069. };
  29070. }
  29071. return Object(external_wp_element_["createElement"])(token_input, props);
  29072. }
  29073. render() {
  29074. const {
  29075. disabled,
  29076. label = Object(external_wp_i18n_["__"])('Add item'),
  29077. instanceId,
  29078. className,
  29079. __experimentalShowHowTo
  29080. } = this.props;
  29081. const {
  29082. isExpanded
  29083. } = this.state;
  29084. const classes = classnames_default()(className, 'components-form-token-field__input-container', {
  29085. 'is-active': this.state.isActive,
  29086. 'is-disabled': disabled
  29087. });
  29088. let tokenFieldProps = {
  29089. className: 'components-form-token-field',
  29090. tabIndex: '-1'
  29091. };
  29092. const matchingSuggestions = this.getMatchingSuggestions();
  29093. if (!disabled) {
  29094. tokenFieldProps = Object.assign({}, tokenFieldProps, {
  29095. onKeyDown: this.onKeyDown,
  29096. onKeyPress: this.onKeyPress,
  29097. onFocus: this.onFocus
  29098. });
  29099. } // Disable reason: There is no appropriate role which describes the
  29100. // input container intended accessible usability.
  29101. // TODO: Refactor click detection to use blur to stop propagation.
  29102. /* eslint-disable jsx-a11y/no-static-element-interactions */
  29103. return Object(external_wp_element_["createElement"])("div", tokenFieldProps, Object(external_wp_element_["createElement"])("label", {
  29104. htmlFor: `components-form-token-input-${instanceId}`,
  29105. className: "components-form-token-field__label"
  29106. }, label), Object(external_wp_element_["createElement"])("div", {
  29107. ref: this.bindTokensAndInput,
  29108. className: classes,
  29109. tabIndex: "-1",
  29110. onMouseDown: this.onContainerTouched,
  29111. onTouchStart: this.onContainerTouched
  29112. }, this.renderTokensAndInput(), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, {
  29113. instanceId: instanceId,
  29114. match: this.props.saveTransform(this.state.incompleteTokenValue),
  29115. displayTransform: this.props.displayTransform,
  29116. suggestions: matchingSuggestions,
  29117. selectedIndex: this.state.selectedSuggestionIndex,
  29118. scrollIntoView: this.state.selectedSuggestionScroll,
  29119. onHover: this.onSuggestionHovered,
  29120. onSelect: this.onSuggestionSelected
  29121. })), __experimentalShowHowTo && Object(external_wp_element_["createElement"])("p", {
  29122. id: `components-form-token-suggestions-howto-${instanceId}`,
  29123. className: "components-form-token-field__help"
  29124. }, this.props.tokenizeOnSpace ? Object(external_wp_i18n_["__"])('Separate with commas, spaces, or the Enter key.') : Object(external_wp_i18n_["__"])('Separate with commas or the Enter key.')));
  29125. /* eslint-enable jsx-a11y/no-static-element-interactions */
  29126. }
  29127. }
  29128. form_token_field_FormTokenField.defaultProps = {
  29129. suggestions: Object.freeze([]),
  29130. maxSuggestions: 100,
  29131. value: Object.freeze([]),
  29132. displayTransform: external_lodash_["identity"],
  29133. saveTransform: token => token.trim(),
  29134. onChange: () => {},
  29135. onInputChange: () => {},
  29136. isBorderless: false,
  29137. disabled: false,
  29138. tokenizeOnSpace: false,
  29139. messages: {
  29140. added: Object(external_wp_i18n_["__"])('Item added.'),
  29141. removed: Object(external_wp_i18n_["__"])('Item removed.'),
  29142. remove: Object(external_wp_i18n_["__"])('Remove item'),
  29143. __experimentalInvalid: Object(external_wp_i18n_["__"])('Invalid item')
  29144. },
  29145. __experimentalExpandOnFocus: false,
  29146. __experimentalValidateInput: () => true,
  29147. __experimentalShowHowTo: true
  29148. };
  29149. /* harmony default export */ var form_token_field = (with_spoken_messages(Object(external_wp_compose_["withInstanceId"])(form_token_field_FormTokenField)));
  29150. // EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js
  29151. var build_node = __webpack_require__("Jx1U");
  29152. var node_default = /*#__PURE__*/__webpack_require__.n(build_node);
  29153. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js
  29154. /**
  29155. * WordPress dependencies
  29156. */
  29157. const DEFAULT_GRADIENT = 'linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)';
  29158. const DEFAULT_LINEAR_GRADIENT_ANGLE = 180;
  29159. const HORIZONTAL_GRADIENT_ORIENTATION = {
  29160. type: 'angular',
  29161. value: 90
  29162. };
  29163. const GRADIENT_OPTIONS = [{
  29164. value: 'linear-gradient',
  29165. label: Object(external_wp_i18n_["__"])('Linear')
  29166. }, {
  29167. value: 'radial-gradient',
  29168. label: Object(external_wp_i18n_["__"])('Radial')
  29169. }];
  29170. const DIRECTIONAL_ORIENTATION_ANGLE_MAP = {
  29171. top: 0,
  29172. 'top right': 45,
  29173. 'right top': 45,
  29174. right: 90,
  29175. 'right bottom': 135,
  29176. 'bottom right': 135,
  29177. bottom: 180,
  29178. 'bottom left': 225,
  29179. 'left bottom': 225,
  29180. left: 270,
  29181. 'top left': 315,
  29182. 'left top': 315
  29183. };
  29184. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/serializer.js
  29185. /**
  29186. * External dependencies
  29187. */
  29188. function serializeGradientColor({
  29189. type,
  29190. value
  29191. }) {
  29192. if (type === 'literal') {
  29193. return value;
  29194. }
  29195. if (type === 'hex') {
  29196. return `#${value}`;
  29197. }
  29198. return `${type}(${value.join(',')})`;
  29199. }
  29200. function serializeGradientPosition(position) {
  29201. if (!position) {
  29202. return '';
  29203. }
  29204. const {
  29205. value,
  29206. type
  29207. } = position;
  29208. return `${value}${type}`;
  29209. }
  29210. function serializeGradientColorStop({
  29211. type,
  29212. value,
  29213. length
  29214. }) {
  29215. return `${serializeGradientColor({
  29216. type,
  29217. value
  29218. })} ${serializeGradientPosition(length)}`;
  29219. }
  29220. function serializeGradientOrientation(orientation) {
  29221. if (!orientation || orientation.type !== 'angular') {
  29222. return;
  29223. }
  29224. return `${orientation.value}deg`;
  29225. }
  29226. function serializeGradient({
  29227. type,
  29228. orientation,
  29229. colorStops
  29230. }) {
  29231. const serializedOrientation = serializeGradientOrientation(orientation);
  29232. const serializedColorStops = colorStops.sort((colorStop1, colorStop2) => {
  29233. return Object(external_lodash_["get"])(colorStop1, ['length', 'value'], 0) - Object(external_lodash_["get"])(colorStop2, ['length', 'value'], 0);
  29234. }).map(serializeGradientColorStop);
  29235. return `${type}(${Object(external_lodash_["compact"])([serializedOrientation, ...serializedColorStops]).join(',')})`;
  29236. }
  29237. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/utils.js
  29238. /**
  29239. * External dependencies
  29240. */
  29241. /**
  29242. * Internal dependencies
  29243. */
  29244. function getLinearGradientRepresentationOfARadial(gradientAST) {
  29245. return serializeGradient({
  29246. type: 'linear-gradient',
  29247. orientation: HORIZONTAL_GRADIENT_ORIENTATION,
  29248. colorStops: gradientAST.colorStops
  29249. });
  29250. }
  29251. function hasUnsupportedLength(item) {
  29252. return item.length === undefined || item.length.type !== '%';
  29253. }
  29254. function getGradientAstWithDefault(value) {
  29255. var _gradientAST$orientat;
  29256. // gradientAST will contain the gradient AST as parsed by gradient-parser npm module.
  29257. // More information of its structure available at https://www.npmjs.com/package/gradient-parser#ast.
  29258. let gradientAST;
  29259. try {
  29260. gradientAST = node_default.a.parse(value)[0];
  29261. gradientAST.value = value;
  29262. } catch (error) {
  29263. gradientAST = node_default.a.parse(DEFAULT_GRADIENT)[0];
  29264. gradientAST.value = DEFAULT_GRADIENT;
  29265. }
  29266. if (((_gradientAST$orientat = gradientAST.orientation) === null || _gradientAST$orientat === void 0 ? void 0 : _gradientAST$orientat.type) === 'directional') {
  29267. gradientAST.orientation.type = 'angular';
  29268. gradientAST.orientation.value = DIRECTIONAL_ORIENTATION_ANGLE_MAP[gradientAST.orientation.value].toString();
  29269. }
  29270. if (gradientAST.colorStops.some(hasUnsupportedLength)) {
  29271. const {
  29272. colorStops
  29273. } = gradientAST;
  29274. const step = 100 / (colorStops.length - 1);
  29275. colorStops.forEach((stop, index) => {
  29276. stop.length = {
  29277. value: step * index,
  29278. type: '%'
  29279. };
  29280. });
  29281. gradientAST.value = serializeGradient(gradientAST);
  29282. }
  29283. return gradientAST;
  29284. }
  29285. function getGradientAstWithControlPoints(gradientAST, newControlPoints) {
  29286. return { ...gradientAST,
  29287. colorStops: newControlPoints.map(({
  29288. position,
  29289. color
  29290. }) => {
  29291. const {
  29292. r,
  29293. g,
  29294. b,
  29295. a
  29296. } = tinycolor_default()(color).toRgb();
  29297. return {
  29298. length: {
  29299. type: '%',
  29300. value: position.toString()
  29301. },
  29302. type: a < 1 ? 'rgba' : 'rgb',
  29303. value: a < 1 ? [r, g, b, a] : [r, g, b]
  29304. };
  29305. })
  29306. };
  29307. }
  29308. function getStopCssColor(colorStop) {
  29309. switch (colorStop.type) {
  29310. case 'hex':
  29311. return `#${colorStop.value}`;
  29312. case 'literal':
  29313. return colorStop.value;
  29314. case 'rgb':
  29315. case 'rgba':
  29316. return `${colorStop.type}(${colorStop.value.join(',')})`;
  29317. default:
  29318. // Should be unreachable if passing an AST from gradient-parser.
  29319. // See https://github.com/rafaelcaricio/gradient-parser#ast.
  29320. return 'transparent';
  29321. }
  29322. }
  29323. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js
  29324. function custom_gradient_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  29325. /**
  29326. * Internal dependencies
  29327. */
  29328. const SelectWrapper = /*#__PURE__*/styled_base_browser_esm(flex_block_component, {
  29329. target: "e99xvul0",
  29330. label: "SelectWrapper"
  29331. })( true ? {
  29332. name: "otv6bo",
  29333. styles: "flex-grow:5;"
  29334. } : undefined);
  29335. const AccessoryWrapper = /*#__PURE__*/styled_base_browser_esm(flex_block_component, {
  29336. target: "e99xvul1",
  29337. label: "AccessoryWrapper"
  29338. })( true ? {
  29339. name: "gmtefn",
  29340. styles: "flex-grow:4;"
  29341. } : undefined);
  29342. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js
  29343. /**
  29344. * External dependencies
  29345. */
  29346. /**
  29347. * WordPress dependencies
  29348. */
  29349. /**
  29350. * Internal dependencies
  29351. */
  29352. const GradientAnglePicker = ({
  29353. gradientAST,
  29354. hasGradient,
  29355. onChange
  29356. }) => {
  29357. const angle = Object(external_lodash_["get"])(gradientAST, ['orientation', 'value'], DEFAULT_LINEAR_GRADIENT_ANGLE);
  29358. const onAngleChange = newAngle => {
  29359. onChange(serializeGradient({ ...gradientAST,
  29360. orientation: {
  29361. type: 'angular',
  29362. value: newAngle
  29363. }
  29364. }));
  29365. };
  29366. return Object(external_wp_element_["createElement"])(AnglePickerControl, {
  29367. hideLabelFromVision: true,
  29368. onChange: onAngleChange,
  29369. value: hasGradient ? angle : ''
  29370. });
  29371. };
  29372. const GradientTypePicker = ({
  29373. gradientAST,
  29374. hasGradient,
  29375. onChange
  29376. }) => {
  29377. const {
  29378. type
  29379. } = gradientAST;
  29380. const onSetLinearGradient = () => {
  29381. onChange(serializeGradient({ ...gradientAST,
  29382. ...(gradientAST.orientation ? {} : {
  29383. orientation: HORIZONTAL_GRADIENT_ORIENTATION
  29384. }),
  29385. type: 'linear-gradient'
  29386. }));
  29387. };
  29388. const onSetRadialGradient = () => {
  29389. onChange(serializeGradient({ ...Object(external_lodash_["omit"])(gradientAST, ['orientation']),
  29390. type: 'radial-gradient'
  29391. }));
  29392. };
  29393. const handleOnChange = next => {
  29394. if (next === 'linear-gradient') {
  29395. onSetLinearGradient();
  29396. }
  29397. if (next === 'radial-gradient') {
  29398. onSetRadialGradient();
  29399. }
  29400. };
  29401. return Object(external_wp_element_["createElement"])(select_control, {
  29402. className: "components-custom-gradient-picker__type-picker",
  29403. label: Object(external_wp_i18n_["__"])('Type'),
  29404. labelPosition: 'side',
  29405. onChange: handleOnChange,
  29406. options: GRADIENT_OPTIONS,
  29407. value: hasGradient && type
  29408. });
  29409. };
  29410. function CustomGradientPicker({
  29411. value,
  29412. onChange
  29413. }) {
  29414. const gradientAST = getGradientAstWithDefault(value); // On radial gradients the bar should display a linear gradient.
  29415. // On radial gradients the bar represents a slice of the gradient from the center until the outside.
  29416. const background = gradientAST.type === 'radial-gradient' ? getLinearGradientRepresentationOfARadial(gradientAST) : gradientAST.value;
  29417. const hasGradient = gradientAST.value !== DEFAULT_GRADIENT; // Control points color option may be hex from presets, custom colors will be rgb.
  29418. // The position should always be a percentage.
  29419. const controlPoints = gradientAST.colorStops.map(colorStop => ({
  29420. color: getStopCssColor(colorStop),
  29421. position: parseInt(colorStop.length.value)
  29422. }));
  29423. return Object(external_wp_element_["createElement"])("div", {
  29424. className: "components-custom-gradient-picker"
  29425. }, Object(external_wp_element_["createElement"])(CustomGradientBar, {
  29426. background: background,
  29427. hasGradient: hasGradient,
  29428. value: controlPoints,
  29429. onChange: newControlPoints => {
  29430. onChange(serializeGradient(getGradientAstWithControlPoints(gradientAST, newControlPoints)));
  29431. }
  29432. }), Object(external_wp_element_["createElement"])(flex_component, {
  29433. gap: 3,
  29434. className: "components-custom-gradient-picker__ui-line"
  29435. }, Object(external_wp_element_["createElement"])(SelectWrapper, null, Object(external_wp_element_["createElement"])(GradientTypePicker, {
  29436. gradientAST: gradientAST,
  29437. hasGradient: hasGradient,
  29438. onChange: onChange
  29439. })), Object(external_wp_element_["createElement"])(AccessoryWrapper, null, gradientAST.type === 'linear-gradient' && Object(external_wp_element_["createElement"])(GradientAnglePicker, {
  29440. gradientAST: gradientAST,
  29441. hasGradient: hasGradient,
  29442. onChange: onChange
  29443. }))));
  29444. }
  29445. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/gradient-picker/index.js
  29446. /**
  29447. * External dependencies
  29448. */
  29449. /**
  29450. * WordPress dependencies
  29451. */
  29452. /**
  29453. * Internal dependencies
  29454. */
  29455. function GradientPicker({
  29456. className,
  29457. gradients,
  29458. onChange,
  29459. value,
  29460. clearable = true,
  29461. disableCustomGradients = false
  29462. }) {
  29463. const clearGradient = Object(external_wp_element_["useCallback"])(() => onChange(undefined), [onChange]);
  29464. const gradientOptions = Object(external_wp_element_["useMemo"])(() => {
  29465. return Object(external_lodash_["map"])(gradients, ({
  29466. gradient,
  29467. name
  29468. }) => Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
  29469. key: gradient,
  29470. value: gradient,
  29471. isSelected: value === gradient,
  29472. tooltipText: name || // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
  29473. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient code: %s'), gradient),
  29474. style: {
  29475. color: 'rgba( 0,0,0,0 )',
  29476. background: gradient
  29477. },
  29478. onClick: value === gradient ? clearGradient : () => onChange(gradient),
  29479. "aria-label": name ? // translators: %s: The name of the gradient e.g: "Angular red to blue".
  29480. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient: %s'), name) : // translators: %s: gradient code e.g: "linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);".
  29481. Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Gradient code: %s'), gradient)
  29482. }));
  29483. }, [gradients, value, onChange, clearGradient]);
  29484. return Object(external_wp_element_["createElement"])(CircularOptionPicker, {
  29485. className: className,
  29486. options: gradientOptions,
  29487. actions: clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
  29488. onClick: clearGradient
  29489. }, Object(external_wp_i18n_["__"])('Clear'))
  29490. }, !disableCustomGradients && Object(external_wp_element_["createElement"])(CustomGradientPicker, {
  29491. value: value,
  29492. onChange: onChange
  29493. }));
  29494. }
  29495. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/utils.js
  29496. const utils_ALIGNMENTS = {
  29497. bottom: {
  29498. alignItems: 'flex-end',
  29499. justifyContent: 'center'
  29500. },
  29501. bottomLeft: {
  29502. alignItems: 'flex-start',
  29503. justifyContent: 'flex-end'
  29504. },
  29505. bottomRight: {
  29506. alignItems: 'flex-end',
  29507. justifyContent: 'flex-end'
  29508. },
  29509. center: {
  29510. alignItems: 'center',
  29511. justifyContent: 'center'
  29512. },
  29513. spaced: {
  29514. alignItems: 'center',
  29515. justifyContent: 'space-between'
  29516. },
  29517. left: {
  29518. alignItems: 'center',
  29519. justifyContent: 'flex-start'
  29520. },
  29521. right: {
  29522. alignItems: 'center',
  29523. justifyContent: 'flex-end'
  29524. },
  29525. stretch: {
  29526. alignItems: 'stretch'
  29527. },
  29528. top: {
  29529. alignItems: 'flex-start',
  29530. justifyContent: 'center'
  29531. },
  29532. topLeft: {
  29533. alignItems: 'flex-start',
  29534. justifyContent: 'flex-start'
  29535. },
  29536. topRight: {
  29537. alignItems: 'flex-start',
  29538. justifyContent: 'flex-end'
  29539. }
  29540. };
  29541. /* eslint-disable jsdoc/valid-types */
  29542. /**
  29543. * @param {keyof typeof ALIGNMENTS | undefined} alignment
  29544. * @return {{ alignItems?: import('react').CSSProperties['alignItems'], justifyContent?: import('react').CSSProperties['justifyContent']}} CSS props for alignment
  29545. */
  29546. function getAlignmentProps(alignment) {
  29547. const alignmentProps = alignment ? utils_ALIGNMENTS[alignment] : {};
  29548. return alignmentProps;
  29549. }
  29550. /* eslint-enable jsdoc/valid-types */
  29551. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/hook.js
  29552. /**
  29553. * WordPress dependencies
  29554. */
  29555. /**
  29556. * Internal dependencies
  29557. */
  29558. /**
  29559. * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props
  29560. */
  29561. function useGrid(props) {
  29562. const {
  29563. align,
  29564. alignment,
  29565. className,
  29566. columnGap,
  29567. columns = 2,
  29568. gap = 3,
  29569. isInline = false,
  29570. justify,
  29571. rowGap,
  29572. rows,
  29573. templateColumns,
  29574. templateRows,
  29575. ...otherProps
  29576. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Grid');
  29577. const columnsAsArray = Array.isArray(columns) ? columns : [columns];
  29578. const column = useResponsiveValue(columnsAsArray);
  29579. const rowsAsArray = Array.isArray(rows) ? rows : [rows];
  29580. const row = useResponsiveValue(rowsAsArray);
  29581. const gridTemplateColumns = templateColumns || !!columns && `repeat(${column}, 1fr)`;
  29582. const gridTemplateRows = templateRows || !!rows && `repeat(${row}, 1fr)`;
  29583. const classes = Object(external_wp_element_["useMemo"])(() => {
  29584. const alignmentProps = getAlignmentProps(alignment);
  29585. const gridClasses = /*#__PURE__*/Object(emotion_esm["a" /* css */])({
  29586. alignItems: align,
  29587. display: isInline ? 'inline-grid' : 'grid',
  29588. gap: `calc( ${config_values.gridBase} * ${gap} )`,
  29589. gridTemplateColumns: gridTemplateColumns || undefined,
  29590. gridTemplateRows: gridTemplateRows || undefined,
  29591. gridRowGap: rowGap,
  29592. gridColumnGap: columnGap,
  29593. justifyContent: justify,
  29594. verticalAlign: isInline ? 'middle' : undefined,
  29595. ...alignmentProps
  29596. }, ";label:gridClasses;" + ( true ? "" : undefined));
  29597. return Object(emotion_esm["b" /* cx */])(gridClasses, className);
  29598. }, [align, alignment, className, columnGap, gap, gridTemplateColumns, gridTemplateRows, isInline, justify, rowGap]);
  29599. return { ...otherProps,
  29600. className: classes
  29601. };
  29602. }
  29603. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/component.js
  29604. /**
  29605. * Internal dependencies
  29606. */
  29607. /**
  29608. * `Grid` is a primitive layout component that can arrange content in a grid configuration.
  29609. *
  29610. * @example
  29611. * ```jsx
  29612. * import {
  29613. * __experimentalGrid as Grid,
  29614. * __experimentalText as Text
  29615. * } from `@wordpress/components`;
  29616. *
  29617. * function Example() {
  29618. * return (
  29619. * <Grid columns={ 3 }>
  29620. * <Text>Code</Text>
  29621. * <Text>is</Text>
  29622. * <Text>Poetry</Text>
  29623. * </Grid>
  29624. * );
  29625. * }
  29626. * ```
  29627. */
  29628. const Grid = create_component_createComponent({
  29629. as: 'div',
  29630. useHook: useGrid,
  29631. name: 'Grid'
  29632. });
  29633. /* harmony default export */ var grid_component = (Grid);
  29634. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/frame.js
  29635. /**
  29636. * External dependencies
  29637. */
  29638. /**
  29639. * WordPress dependencies
  29640. */
  29641. /**
  29642. * Internal dependencies
  29643. */
  29644. function ModalFrameContent({
  29645. overlayClassName,
  29646. contentLabel,
  29647. aria: {
  29648. describedby,
  29649. labelledby
  29650. },
  29651. children,
  29652. className,
  29653. role,
  29654. style,
  29655. focusOnMount,
  29656. shouldCloseOnEsc,
  29657. onRequestClose
  29658. }) {
  29659. function handleEscapeKeyDown(event) {
  29660. if (shouldCloseOnEsc && event.keyCode === external_wp_keycodes_["ESCAPE"]) {
  29661. event.stopPropagation();
  29662. if (onRequestClose) {
  29663. onRequestClose(event);
  29664. }
  29665. }
  29666. }
  29667. const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])(focusOnMount);
  29668. const constrainedTabbingRef = Object(external_wp_compose_["useConstrainedTabbing"])();
  29669. const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])();
  29670. return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
  29671. Object(external_wp_element_["createElement"])("div", {
  29672. className: classnames_default()('components-modal__screen-overlay', overlayClassName),
  29673. onKeyDown: handleEscapeKeyDown
  29674. }, Object(external_wp_element_["createElement"])("div", {
  29675. className: classnames_default()('components-modal__frame', className),
  29676. style: style,
  29677. ref: Object(external_wp_compose_["useMergeRefs"])([constrainedTabbingRef, focusReturnRef, focusOnMountRef]),
  29678. role: role,
  29679. "aria-label": contentLabel,
  29680. "aria-labelledby": contentLabel ? null : labelledby,
  29681. "aria-describedby": describedby,
  29682. tabIndex: "-1"
  29683. }, children))
  29684. );
  29685. }
  29686. class frame_ModalFrame extends external_wp_element_["Component"] {
  29687. constructor() {
  29688. super(...arguments);
  29689. this.handleFocusOutside = this.handleFocusOutside.bind(this);
  29690. }
  29691. /**
  29692. * Callback function called when clicked outside the modal.
  29693. *
  29694. * @param {Object} event Mouse click event.
  29695. */
  29696. handleFocusOutside(event) {
  29697. if (this.props.shouldCloseOnClickOutside && this.props.onRequestClose) {
  29698. this.props.onRequestClose(event);
  29699. }
  29700. }
  29701. /**
  29702. * Renders the modal frame element.
  29703. *
  29704. * @return {WPElement} The modal frame element.
  29705. */
  29706. render() {
  29707. return Object(external_wp_element_["createElement"])(ModalFrameContent, this.props);
  29708. }
  29709. }
  29710. /* harmony default export */ var modal_frame = (with_focus_outside(frame_ModalFrame));
  29711. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/header.js
  29712. /**
  29713. * WordPress dependencies
  29714. */
  29715. /**
  29716. * Internal dependencies
  29717. */
  29718. const ModalHeader = ({
  29719. icon,
  29720. title,
  29721. onClose,
  29722. closeLabel,
  29723. headingId,
  29724. isDismissible
  29725. }) => {
  29726. const label = closeLabel ? closeLabel : Object(external_wp_i18n_["__"])('Close dialog');
  29727. return Object(external_wp_element_["createElement"])("div", {
  29728. className: "components-modal__header"
  29729. }, Object(external_wp_element_["createElement"])("div", {
  29730. className: "components-modal__header-heading-container"
  29731. }, icon && Object(external_wp_element_["createElement"])("span", {
  29732. className: "components-modal__icon-container",
  29733. "aria-hidden": true
  29734. }, icon), title && Object(external_wp_element_["createElement"])("h1", {
  29735. id: headingId,
  29736. className: "components-modal__header-heading"
  29737. }, title)), isDismissible && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  29738. onClick: onClose,
  29739. icon: close_small["a" /* default */],
  29740. label: label
  29741. }));
  29742. };
  29743. /* harmony default export */ var modal_header = (ModalHeader);
  29744. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/aria-helper.js
  29745. /**
  29746. * External dependencies
  29747. */
  29748. const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
  29749. let hiddenElements = [],
  29750. isHidden = false;
  29751. /**
  29752. * Hides all elements in the body element from screen-readers except
  29753. * the provided element and elements that should not be hidden from
  29754. * screen-readers.
  29755. *
  29756. * The reason we do this is because `aria-modal="true"` currently is bugged
  29757. * in Safari, and support is spotty in other browsers overall. In the future
  29758. * we should consider removing these helper functions in favor of
  29759. * `aria-modal="true"`.
  29760. *
  29761. * @param {Element} unhiddenElement The element that should not be hidden.
  29762. */
  29763. function hideApp(unhiddenElement) {
  29764. if (isHidden) {
  29765. return;
  29766. }
  29767. const elements = document.body.children;
  29768. Object(external_lodash_["forEach"])(elements, element => {
  29769. if (element === unhiddenElement) {
  29770. return;
  29771. }
  29772. if (elementShouldBeHidden(element)) {
  29773. element.setAttribute('aria-hidden', 'true');
  29774. hiddenElements.push(element);
  29775. }
  29776. });
  29777. isHidden = true;
  29778. }
  29779. /**
  29780. * Determines if the passed element should not be hidden from screen readers.
  29781. *
  29782. * @param {HTMLElement} element The element that should be checked.
  29783. *
  29784. * @return {boolean} Whether the element should not be hidden from screen-readers.
  29785. */
  29786. function elementShouldBeHidden(element) {
  29787. const role = element.getAttribute('role');
  29788. return !(element.tagName === 'SCRIPT' || element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || LIVE_REGION_ARIA_ROLES.has(role));
  29789. }
  29790. /**
  29791. * Makes all elements in the body that have been hidden by `hideApp`
  29792. * visible again to screen-readers.
  29793. */
  29794. function showApp() {
  29795. if (!isHidden) {
  29796. return;
  29797. }
  29798. Object(external_lodash_["forEach"])(hiddenElements, element => {
  29799. element.removeAttribute('aria-hidden');
  29800. });
  29801. hiddenElements = [];
  29802. isHidden = false;
  29803. }
  29804. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js
  29805. /**
  29806. * WordPress dependencies
  29807. */
  29808. /**
  29809. * Internal dependencies
  29810. */
  29811. // Used to count the number of open modals.
  29812. let modal_parentElement,
  29813. openModalCount = 0;
  29814. class modal_Modal extends external_wp_element_["Component"] {
  29815. constructor(props) {
  29816. super(props);
  29817. this.prepareDOM();
  29818. }
  29819. /**
  29820. * Appends the modal's node to the DOM, so the portal can render the
  29821. * modal in it. Also calls the openFirstModal when this is the first modal to be
  29822. * opened.
  29823. */
  29824. componentDidMount() {
  29825. openModalCount++;
  29826. if (openModalCount === 1) {
  29827. this.openFirstModal();
  29828. }
  29829. }
  29830. /**
  29831. * Removes the modal's node from the DOM. Also calls closeLastModal when this is
  29832. * the last modal to be closed.
  29833. */
  29834. componentWillUnmount() {
  29835. openModalCount--;
  29836. if (openModalCount === 0) {
  29837. this.closeLastModal();
  29838. }
  29839. this.cleanDOM();
  29840. }
  29841. /**
  29842. * Prepares the DOM for the modals to be rendered.
  29843. *
  29844. * Every modal is mounted in a separate div appended to a parent div
  29845. * that is appended to the document body.
  29846. *
  29847. * The parent div will be created if it does not yet exist, and the
  29848. * separate div for this specific modal will be appended to that.
  29849. */
  29850. prepareDOM() {
  29851. if (!modal_parentElement) {
  29852. modal_parentElement = document.createElement('div');
  29853. document.body.appendChild(modal_parentElement);
  29854. }
  29855. this.node = document.createElement('div');
  29856. modal_parentElement.appendChild(this.node);
  29857. }
  29858. /**
  29859. * Removes the specific mounting point for this modal from the DOM.
  29860. */
  29861. cleanDOM() {
  29862. modal_parentElement.removeChild(this.node);
  29863. }
  29864. /**
  29865. * Prepares the DOM for this modal and any additional modal to be mounted.
  29866. *
  29867. * It appends an additional div to the body for the modals to be rendered in,
  29868. * it hides any other elements from screen-readers and adds an additional class
  29869. * to the body to prevent scrolling while the modal is open.
  29870. */
  29871. openFirstModal() {
  29872. hideApp(modal_parentElement);
  29873. document.body.classList.add(this.props.bodyOpenClassName);
  29874. }
  29875. /**
  29876. * Cleans up the DOM after the last modal is closed and makes the app available
  29877. * for screen-readers again.
  29878. */
  29879. closeLastModal() {
  29880. document.body.classList.remove(this.props.bodyOpenClassName);
  29881. showApp();
  29882. }
  29883. /**
  29884. * Renders the modal.
  29885. *
  29886. * @return {WPElement} The modal element.
  29887. */
  29888. render() {
  29889. const {
  29890. onRequestClose,
  29891. title,
  29892. icon,
  29893. closeButtonLabel,
  29894. children,
  29895. aria,
  29896. instanceId,
  29897. isDismissible,
  29898. isDismissable,
  29899. //Deprecated
  29900. // Many of the documented props for Modal are passed straight through
  29901. // to the ModalFrame component and handled there.
  29902. ...otherProps
  29903. } = this.props;
  29904. const headingId = title ? `components-modal-header-${instanceId}` : aria.labelledby;
  29905. if (isDismissable) {
  29906. external_wp_deprecated_default()('isDismissable prop of the Modal component', {
  29907. since: '5.4',
  29908. alternative: 'isDismissible prop (renamed) of the Modal component'
  29909. });
  29910. } // Disable reason: this stops mouse events from triggering tooltips and
  29911. // other elements underneath the modal overlay.
  29912. return Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(modal_frame, Object(esm_extends["a" /* default */])({
  29913. onRequestClose: onRequestClose,
  29914. aria: {
  29915. labelledby: headingId,
  29916. describedby: aria.describedby
  29917. }
  29918. }, otherProps), Object(external_wp_element_["createElement"])("div", {
  29919. className: 'components-modal__content',
  29920. role: "document"
  29921. }, Object(external_wp_element_["createElement"])(modal_header, {
  29922. closeLabel: closeButtonLabel,
  29923. headingId: title && headingId,
  29924. icon: icon,
  29925. isDismissible: isDismissible || isDismissable,
  29926. onClose: onRequestClose,
  29927. title: title
  29928. }), children)), this.node);
  29929. }
  29930. }
  29931. modal_Modal.defaultProps = {
  29932. bodyOpenClassName: 'modal-open',
  29933. role: 'dialog',
  29934. title: null,
  29935. focusOnMount: true,
  29936. shouldCloseOnEsc: true,
  29937. shouldCloseOnClickOutside: true,
  29938. isDismissible: true,
  29939. /* accessibility */
  29940. aria: {
  29941. labelledby: null,
  29942. describedby: null
  29943. }
  29944. };
  29945. /* harmony default export */ var modal = (Object(external_wp_compose_["withInstanceId"])(modal_Modal));
  29946. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/icons.js
  29947. /**
  29948. * WordPress dependencies
  29949. */
  29950. const PageControlIcon = ({
  29951. isSelected
  29952. }) => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  29953. width: "8",
  29954. height: "8",
  29955. fill: "none",
  29956. xmlns: "http://www.w3.org/2000/svg"
  29957. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Circle"], {
  29958. cx: "4",
  29959. cy: "4",
  29960. r: "4",
  29961. fill: isSelected ? '#419ECD' : '#E1E3E6'
  29962. }));
  29963. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page-control.js
  29964. /**
  29965. * External dependencies
  29966. */
  29967. /**
  29968. * WordPress dependencies
  29969. */
  29970. /**
  29971. * Internal dependencies
  29972. */
  29973. function PageControl({
  29974. currentPage,
  29975. numberOfPages,
  29976. setCurrentPage
  29977. }) {
  29978. return Object(external_wp_element_["createElement"])("ul", {
  29979. className: "components-guide__page-control",
  29980. "aria-label": Object(external_wp_i18n_["__"])('Guide controls')
  29981. }, Object(external_lodash_["times"])(numberOfPages, page => Object(external_wp_element_["createElement"])("li", {
  29982. key: page // Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current
  29983. ,
  29984. "aria-current": page === currentPage ? 'step' : undefined
  29985. }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  29986. key: page,
  29987. icon: Object(external_wp_element_["createElement"])(PageControlIcon, {
  29988. isSelected: page === currentPage
  29989. }),
  29990. "aria-label": Object(external_wp_i18n_["sprintf"])(
  29991. /* translators: 1: current page number 2: total number of pages */
  29992. Object(external_wp_i18n_["__"])('Page %1$d of %2$d'), page + 1, numberOfPages),
  29993. onClick: () => setCurrentPage(page)
  29994. }))));
  29995. }
  29996. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/finish-button.js
  29997. /**
  29998. * WordPress dependencies
  29999. */
  30000. /**
  30001. * Internal dependencies
  30002. */
  30003. function FinishButton(props) {
  30004. const ref = Object(external_wp_element_["useRef"])(); // Focus the button on mount if nothing else is focused. This prevents a
  30005. // focus loss when the 'Next' button is swapped out.
  30006. Object(external_wp_element_["useLayoutEffect"])(() => {
  30007. const {
  30008. ownerDocument
  30009. } = ref.current;
  30010. const {
  30011. activeElement,
  30012. body
  30013. } = ownerDocument;
  30014. if (!activeElement || activeElement === body) {
  30015. ref.current.focus();
  30016. }
  30017. }, []);
  30018. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, {
  30019. ref: ref
  30020. }));
  30021. }
  30022. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/index.js
  30023. /**
  30024. * External dependencies
  30025. */
  30026. /**
  30027. * WordPress dependencies
  30028. */
  30029. /**
  30030. * Internal dependencies
  30031. */
  30032. function Guide({
  30033. children,
  30034. className,
  30035. contentLabel,
  30036. finishButtonText,
  30037. onFinish,
  30038. pages = []
  30039. }) {
  30040. const [currentPage, setCurrentPage] = Object(external_wp_element_["useState"])(0);
  30041. Object(external_wp_element_["useEffect"])(() => {
  30042. if (external_wp_element_["Children"].count(children)) {
  30043. external_wp_deprecated_default()('Passing children to <Guide>', {
  30044. since: '5.5',
  30045. alternative: 'the `pages` prop'
  30046. });
  30047. }
  30048. }, [children]);
  30049. if (external_wp_element_["Children"].count(children)) {
  30050. pages = external_wp_element_["Children"].map(children, child => ({
  30051. content: child
  30052. }));
  30053. }
  30054. const canGoBack = currentPage > 0;
  30055. const canGoForward = currentPage < pages.length - 1;
  30056. const goBack = () => {
  30057. if (canGoBack) {
  30058. setCurrentPage(currentPage - 1);
  30059. }
  30060. };
  30061. const goForward = () => {
  30062. if (canGoForward) {
  30063. setCurrentPage(currentPage + 1);
  30064. }
  30065. };
  30066. if (pages.length === 0) {
  30067. return null;
  30068. }
  30069. return Object(external_wp_element_["createElement"])(modal, {
  30070. className: classnames_default()('components-guide', className),
  30071. contentLabel: contentLabel,
  30072. onRequestClose: onFinish
  30073. }, Object(external_wp_element_["createElement"])(keyboard_shortcuts, {
  30074. key: currentPage,
  30075. shortcuts: {
  30076. left: goBack,
  30077. right: goForward
  30078. }
  30079. }), Object(external_wp_element_["createElement"])("div", {
  30080. className: "components-guide__container"
  30081. }, Object(external_wp_element_["createElement"])("div", {
  30082. className: "components-guide__page"
  30083. }, pages[currentPage].image, pages.length > 1 && Object(external_wp_element_["createElement"])(PageControl, {
  30084. currentPage: currentPage,
  30085. numberOfPages: pages.length,
  30086. setCurrentPage: setCurrentPage
  30087. }), pages[currentPage].content, !canGoForward && Object(external_wp_element_["createElement"])(FinishButton, {
  30088. className: "components-guide__inline-finish-button",
  30089. onClick: onFinish
  30090. }, finishButtonText || Object(external_wp_i18n_["__"])('Finish'))), Object(external_wp_element_["createElement"])("div", {
  30091. className: "components-guide__footer"
  30092. }, canGoBack && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  30093. className: "components-guide__back-button",
  30094. onClick: goBack
  30095. }, Object(external_wp_i18n_["__"])('Previous')), canGoForward && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  30096. className: "components-guide__forward-button",
  30097. onClick: goForward
  30098. }, Object(external_wp_i18n_["__"])('Next')), !canGoForward && Object(external_wp_element_["createElement"])(FinishButton, {
  30099. className: "components-guide__finish-button",
  30100. onClick: onFinish
  30101. }, finishButtonText || Object(external_wp_i18n_["__"])('Finish')))));
  30102. }
  30103. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page.js
  30104. /**
  30105. * WordPress dependencies
  30106. */
  30107. function GuidePage(props) {
  30108. Object(external_wp_element_["useEffect"])(() => {
  30109. external_wp_deprecated_default()('<GuidePage>', {
  30110. since: '5.5',
  30111. alternative: 'the `pages` prop in <Guide>'
  30112. });
  30113. }, []);
  30114. return Object(external_wp_element_["createElement"])("div", props);
  30115. }
  30116. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/heading/hook.js
  30117. /**
  30118. * Internal dependencies
  30119. */
  30120. // eslint-disable-next-line no-duplicate-imports
  30121. function useHeading(props) {
  30122. const {
  30123. as: asProp,
  30124. level = 2,
  30125. ...otherProps
  30126. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Heading');
  30127. const as = asProp || `h${level}`;
  30128. const a11yProps = {};
  30129. if (typeof as === 'string' && as[0] !== 'h') {
  30130. // if not a semantic `h` element, add a11y props:
  30131. a11yProps.role = 'heading';
  30132. a11yProps['aria-level'] = level;
  30133. }
  30134. const textProps = useText({
  30135. color: COLORS.darkGray.heading,
  30136. size: getHeadingFontSize(level),
  30137. isBlock: true,
  30138. weight: config_values.fontWeightHeading,
  30139. ...otherProps
  30140. });
  30141. return { ...textProps,
  30142. ...a11yProps,
  30143. as
  30144. };
  30145. }
  30146. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/heading/component.js
  30147. /**
  30148. * Internal dependencies
  30149. */
  30150. /**
  30151. * `Heading` renders headings and titles using the library's typography system.
  30152. *
  30153. * @example
  30154. * ```jsx
  30155. * import { Heading } from `@wordpress/components/ui`
  30156. *
  30157. * function Example() {
  30158. * return <Heading>Code is Poetry</Heading>;
  30159. * }
  30160. * ```
  30161. */
  30162. const Heading = create_component_createComponent({
  30163. as: 'h1',
  30164. useHook: useHeading,
  30165. name: 'Heading'
  30166. });
  30167. /* harmony default export */ var heading_component = (Heading);
  30168. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/utils.js
  30169. /**
  30170. * External dependencies
  30171. */
  30172. /** @type {import('./types').Alignments} */
  30173. const h_stack_utils_ALIGNMENTS = {
  30174. bottom: {
  30175. align: 'flex-end',
  30176. justify: 'center'
  30177. },
  30178. bottomLeft: {
  30179. align: 'flex-start',
  30180. justify: 'flex-end'
  30181. },
  30182. bottomRight: {
  30183. align: 'flex-end',
  30184. justify: 'flex-end'
  30185. },
  30186. center: {
  30187. align: 'center',
  30188. justify: 'center'
  30189. },
  30190. edge: {
  30191. align: 'center',
  30192. justify: 'space-between'
  30193. },
  30194. left: {
  30195. align: 'center',
  30196. justify: 'flex-start'
  30197. },
  30198. right: {
  30199. align: 'center',
  30200. justify: 'flex-end'
  30201. },
  30202. stretch: {
  30203. align: 'stretch'
  30204. },
  30205. top: {
  30206. align: 'flex-start',
  30207. justify: 'center'
  30208. },
  30209. topLeft: {
  30210. align: 'flex-start',
  30211. justify: 'flex-start'
  30212. },
  30213. topRight: {
  30214. align: 'flex-start',
  30215. justify: 'flex-end'
  30216. }
  30217. };
  30218. /** @type {import('./types').Alignments} */
  30219. const V_ALIGNMENTS = {
  30220. bottom: {
  30221. justify: 'flex-end',
  30222. align: 'center'
  30223. },
  30224. bottomLeft: {
  30225. justify: 'flex-start',
  30226. align: 'flex-end'
  30227. },
  30228. bottomRight: {
  30229. justify: 'flex-end',
  30230. align: 'flex-end'
  30231. },
  30232. center: {
  30233. justify: 'center',
  30234. align: 'center'
  30235. },
  30236. edge: {
  30237. justify: 'space-between',
  30238. align: 'center'
  30239. },
  30240. left: {
  30241. justify: 'center',
  30242. align: 'flex-start'
  30243. },
  30244. right: {
  30245. justify: 'center',
  30246. align: 'flex-end'
  30247. },
  30248. stretch: {
  30249. justify: 'stretch'
  30250. },
  30251. top: {
  30252. justify: 'flex-start',
  30253. align: 'center'
  30254. },
  30255. topLeft: {
  30256. justify: 'flex-start',
  30257. align: 'flex-start'
  30258. },
  30259. topRight: {
  30260. justify: 'flex-start',
  30261. align: 'flex-end'
  30262. }
  30263. };
  30264. /* eslint-disable jsdoc/valid-types */
  30265. /**
  30266. * @param {import('./types').HStackAlignment | import('react').CSSProperties[ 'alignItems' ]} alignment Where to align.
  30267. * @param {import('../flex/types').FlexDirection} [direction='row'] Direction to align.
  30268. * @return {import('./types').AlignmentProps} Alignment props.
  30269. */
  30270. /* eslint-enable jsdoc/valid-types */
  30271. function utils_getAlignmentProps(alignment, direction = 'row') {
  30272. if (Object(external_lodash_["isNil"])(alignment)) {
  30273. return {};
  30274. }
  30275. const isVertical = direction === 'column';
  30276. const props = isVertical ? V_ALIGNMENTS : h_stack_utils_ALIGNMENTS;
  30277. const alignmentProps = alignment in props ? props[
  30278. /** @type {keyof typeof ALIGNMENTS} */
  30279. alignment] : {
  30280. align: alignment
  30281. };
  30282. return alignmentProps;
  30283. }
  30284. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/get-valid-children.js
  30285. /**
  30286. * External dependencies
  30287. */
  30288. // eslint-disable-next-line no-restricted-imports
  30289. /**
  30290. * WordPress dependencies
  30291. */
  30292. /**
  30293. * Gets a collection of available children elements from a React component's children prop.
  30294. *
  30295. * @param {import('react').ReactNode} children
  30296. *
  30297. * @return {import('react').ReactNodeArray} An array of available children.
  30298. */
  30299. function getValidChildren(children) {
  30300. if (typeof children === 'string') return [children];
  30301. return external_wp_element_["Children"].toArray(children).filter(child => Object(external_wp_element_["isValidElement"])(child));
  30302. }
  30303. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/hook.js
  30304. /**
  30305. * Internal dependencies
  30306. */
  30307. /**
  30308. *
  30309. * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props
  30310. */
  30311. function useHStack(props) {
  30312. const {
  30313. alignment = 'edge',
  30314. children,
  30315. direction,
  30316. spacing = 2,
  30317. ...otherProps
  30318. } = Object(use_context_system["a" /* useContextSystem */])(props, 'HStack');
  30319. const align = utils_getAlignmentProps(alignment, direction);
  30320. const validChildren = getValidChildren(children);
  30321. const clonedChildren = validChildren.map( // @ts-ignore
  30322. (
  30323. /** @type {import('react').ReactElement} */
  30324. child, index) => {
  30325. const _key = child.key || `hstack-${index}`;
  30326. const _isSpacer = Object(context_connect["b" /* hasConnectNamespace */])(child, ['Spacer']);
  30327. if (_isSpacer) {
  30328. return Object(external_wp_element_["createElement"])(flex_item_component, Object(esm_extends["a" /* default */])({
  30329. isBlock: true,
  30330. key: _key
  30331. }, child.props));
  30332. }
  30333. return child;
  30334. });
  30335. const propsForFlex = {
  30336. children: clonedChildren,
  30337. direction,
  30338. justify: 'center',
  30339. ...align,
  30340. ...otherProps,
  30341. gap: spacing
  30342. };
  30343. const flexProps = useFlex(propsForFlex);
  30344. return flexProps;
  30345. }
  30346. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/h-stack/component.js
  30347. /**
  30348. * Internal dependencies
  30349. */
  30350. /**
  30351. * `HStack` (Horizontal Stack) arranges child elements in a horizontal line.
  30352. *
  30353. * `HStack` can render anything inside.
  30354. *
  30355. * @example
  30356. * ```jsx
  30357. * import {
  30358. * __experimentalHStack as HStack,
  30359. * __experimentalText as Text,
  30360. * } from `@wordpress/components`;
  30361. *
  30362. * function Example() {
  30363. * return (
  30364. * <HStack>
  30365. * <Text>Code</Text>
  30366. * <Text>is</Text>
  30367. * <Text>Poetry</Text>
  30368. * </HStack>
  30369. * );
  30370. * }
  30371. * ```
  30372. */
  30373. const HStack = create_component_createComponent({
  30374. as: 'div',
  30375. useHook: useHStack,
  30376. name: 'HStack'
  30377. });
  30378. /* harmony default export */ var h_stack_component = (HStack);
  30379. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/deprecated.js
  30380. /**
  30381. * WordPress dependencies
  30382. */
  30383. /**
  30384. * Internal dependencies
  30385. */
  30386. function IconButton({
  30387. labelPosition,
  30388. size,
  30389. tooltip,
  30390. label,
  30391. ...props
  30392. }, ref) {
  30393. external_wp_deprecated_default()('wp.components.IconButton', {
  30394. since: '5.4',
  30395. alternative: 'wp.components.Button'
  30396. });
  30397. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, props, {
  30398. ref: ref,
  30399. tooltipPosition: labelPosition,
  30400. iconSize: size,
  30401. showTooltip: tooltip !== undefined ? !!tooltip : undefined,
  30402. label: tooltip || label
  30403. }));
  30404. }
  30405. /* harmony default export */ var deprecated = (Object(external_wp_element_["forwardRef"])(IconButton));
  30406. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-group/index.js
  30407. /**
  30408. * External dependencies
  30409. */
  30410. /**
  30411. * WordPress dependencies
  30412. */
  30413. function MenuGroup({
  30414. children,
  30415. className = '',
  30416. label,
  30417. hideSeparator
  30418. }) {
  30419. const instanceId = Object(external_wp_compose_["useInstanceId"])(MenuGroup);
  30420. if (!external_wp_element_["Children"].count(children)) {
  30421. return null;
  30422. }
  30423. const labelId = `components-menu-group-label-${instanceId}`;
  30424. const classNames = classnames_default()(className, 'components-menu-group', {
  30425. 'has-hidden-separator': hideSeparator
  30426. });
  30427. return Object(external_wp_element_["createElement"])("div", {
  30428. className: classNames
  30429. }, label && Object(external_wp_element_["createElement"])("div", {
  30430. className: "components-menu-group__label",
  30431. id: labelId,
  30432. "aria-hidden": "true"
  30433. }, label), Object(external_wp_element_["createElement"])("div", {
  30434. role: "group",
  30435. "aria-labelledby": label ? labelId : null
  30436. }, children));
  30437. }
  30438. /* harmony default export */ var menu_group = (MenuGroup);
  30439. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js
  30440. var build_module_shortcut = __webpack_require__("Cw+6");
  30441. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-item/index.js
  30442. /**
  30443. * External dependencies
  30444. */
  30445. /**
  30446. * WordPress dependencies
  30447. */
  30448. /**
  30449. * Internal dependencies
  30450. */
  30451. /**
  30452. * Renders a generic menu item for use inside the more menu.
  30453. *
  30454. * @param {Object} props Component props.
  30455. * @param {WPElement} props.children Element to render as child of button.
  30456. * @param {string} props.info Text to use as description for button text.
  30457. * @param {string} props.className Class to set on the container.
  30458. * @param {WPIcon} props.icon Button's `icon` prop.
  30459. * @param {string|Object} props.shortcut Shortcut's `shortcut` prop.
  30460. * @param {boolean} props.isSelected Whether or not the menu item is currently selected.
  30461. * @param {string} [props.role="menuitem"] ARIA role of the menu item.
  30462. * @param {Object} ref React Element ref.
  30463. *
  30464. * @return {WPComponent} The component to be rendered.
  30465. */
  30466. function MenuItem({
  30467. children,
  30468. info,
  30469. className,
  30470. icon,
  30471. shortcut,
  30472. isSelected,
  30473. role = 'menuitem',
  30474. ...props
  30475. }, ref) {
  30476. className = classnames_default()('components-menu-item__button', className);
  30477. if (info) {
  30478. children = Object(external_wp_element_["createElement"])("span", {
  30479. className: "components-menu-item__info-wrapper"
  30480. }, Object(external_wp_element_["createElement"])("span", {
  30481. className: "components-menu-item__item"
  30482. }, children), Object(external_wp_element_["createElement"])("span", {
  30483. className: "components-menu-item__info"
  30484. }, info));
  30485. }
  30486. if (icon && !Object(external_lodash_["isString"])(icon)) {
  30487. icon = Object(external_wp_element_["cloneElement"])(icon, {
  30488. className: 'components-menu-items__item-icon'
  30489. });
  30490. }
  30491. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  30492. ref: ref // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
  30493. ,
  30494. "aria-checked": role === 'menuitemcheckbox' || role === 'menuitemradio' ? isSelected : undefined,
  30495. role: role,
  30496. className: className
  30497. }, props), Object(external_wp_element_["createElement"])("span", {
  30498. className: "components-menu-item__item"
  30499. }, children), Object(external_wp_element_["createElement"])(build_module_shortcut["a" /* default */], {
  30500. className: "components-menu-item__shortcut",
  30501. shortcut: shortcut
  30502. }), icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  30503. icon: icon
  30504. }));
  30505. }
  30506. /* harmony default export */ var menu_item = (Object(external_wp_element_["forwardRef"])(MenuItem));
  30507. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
  30508. /**
  30509. * External dependencies
  30510. */
  30511. /**
  30512. * WordPress dependencies
  30513. */
  30514. /**
  30515. * Internal dependencies
  30516. */
  30517. function MenuItemsChoice({
  30518. choices = [],
  30519. onHover = external_lodash_["noop"],
  30520. onSelect,
  30521. value
  30522. }) {
  30523. return choices.map(item => {
  30524. const isSelected = value === item.value;
  30525. return Object(external_wp_element_["createElement"])(menu_item, {
  30526. key: item.value,
  30527. role: "menuitemradio",
  30528. icon: isSelected && check["a" /* default */],
  30529. info: item.info,
  30530. isSelected: isSelected,
  30531. shortcut: item.shortcut,
  30532. className: "components-menu-items-choice",
  30533. onClick: () => {
  30534. if (!isSelected) {
  30535. onSelect(item.value);
  30536. }
  30537. },
  30538. onMouseEnter: () => onHover(item.value),
  30539. onMouseLeave: () => onHover(null),
  30540. "aria-label": item['aria-label']
  30541. }, item.label);
  30542. });
  30543. }
  30544. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
  30545. var scroll_lock = __webpack_require__("k8OV");
  30546. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js
  30547. /**
  30548. * WordPress dependencies
  30549. */
  30550. /**
  30551. * Internal dependencies
  30552. */
  30553. function TabbableContainer({
  30554. eventToOffset,
  30555. ...props
  30556. }, ref) {
  30557. const innerEventToOffset = evt => {
  30558. const {
  30559. keyCode,
  30560. shiftKey
  30561. } = evt;
  30562. if (external_wp_keycodes_["TAB"] === keyCode) {
  30563. return shiftKey ? -1 : 1;
  30564. } // Allow custom handling of keys besides Tab.
  30565. //
  30566. // By default, TabbableContainer will move focus forward on Tab and
  30567. // backward on Shift+Tab. The handler below will be used for all other
  30568. // events. The semantics for `eventToOffset`'s return
  30569. // values are the following:
  30570. //
  30571. // - +1: move focus forward
  30572. // - -1: move focus backward
  30573. // - 0: don't move focus, but acknowledge event and thus stop it
  30574. // - undefined: do nothing, let the event propagate
  30575. if (eventToOffset) {
  30576. return eventToOffset(evt);
  30577. }
  30578. };
  30579. return Object(external_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({
  30580. ref: ref,
  30581. stopNavigationEvents: true,
  30582. onlyBrowserTabstops: true,
  30583. eventToOffset: innerEventToOffset
  30584. }, props));
  30585. }
  30586. /* harmony default export */ var tabbable = (Object(external_wp_element_["forwardRef"])(TabbableContainer));
  30587. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/constants.js
  30588. const ROOT_MENU = 'root';
  30589. const SEARCH_FOCUS_DELAY = 100;
  30590. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/context.js
  30591. /**
  30592. * External dependencies
  30593. */
  30594. /**
  30595. * WordPress dependencies
  30596. */
  30597. /**
  30598. * Internal dependencies
  30599. */
  30600. const NavigationContext = Object(external_wp_element_["createContext"])({
  30601. activeItem: undefined,
  30602. activeMenu: ROOT_MENU,
  30603. setActiveMenu: external_lodash_["noop"],
  30604. isMenuEmpty: external_lodash_["noop"],
  30605. navigationTree: {
  30606. items: {},
  30607. getItem: external_lodash_["noop"],
  30608. addItem: external_lodash_["noop"],
  30609. removeItem: external_lodash_["noop"],
  30610. menus: {},
  30611. getMenu: external_lodash_["noop"],
  30612. addMenu: external_lodash_["noop"],
  30613. removeMenu: external_lodash_["noop"],
  30614. childMenu: {},
  30615. traverseMenu: external_lodash_["noop"],
  30616. isMenuEmpty: external_lodash_["noop"]
  30617. }
  30618. });
  30619. const useNavigationContext = () => Object(external_wp_element_["useContext"])(NavigationContext);
  30620. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js
  30621. function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  30622. /**
  30623. * WordPress dependencies
  30624. */
  30625. /**
  30626. * Internal dependencies
  30627. */
  30628. const NavigationUI = styled_base_browser_esm("div", {
  30629. target: "ejwewyf0",
  30630. label: "NavigationUI"
  30631. })("width:100%;background-color:", G2.darkGray.primary, ";box-sizing:border-box;color:#f0f0f0;padding:0 ", space(2), ";overflow:hidden;" + ( true ? "" : undefined));
  30632. const MenuUI = styled_base_browser_esm("div", {
  30633. target: "ejwewyf1",
  30634. label: "MenuUI"
  30635. })("margin-top:", space(3), ";margin-bottom:", space(3), ";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:", space(3), ";}.components-navigation__group + .components-navigation__group{margin-top:", space(3), ";}" + ( true ? "" : undefined));
  30636. const MenuBackButtonUI = /*#__PURE__*/styled_base_browser_esm(build_module_button["a" /* default */], {
  30637. target: "ejwewyf2",
  30638. label: "MenuBackButtonUI"
  30639. })("&.is-tertiary{color:", G2.lightGray.ui, ";&:hover:not(:disabled ){color:#ddd;box-shadow:none;}&:active:not(:disabled ){background:transparent;color:#ddd;}}" + ( true ? "" : undefined));
  30640. const MenuTitleUI = styled_base_browser_esm("div", {
  30641. target: "ejwewyf3",
  30642. label: "MenuTitleUI"
  30643. })( true ? {
  30644. name: "16agjqd",
  30645. styles: "overflow:hidden;width:100%;"
  30646. } : undefined);
  30647. const MenuTitleHeadingUI = /*#__PURE__*/styled_base_browser_esm(text_component, {
  30648. target: "ejwewyf4",
  30649. label: "MenuTitleHeadingUI"
  30650. })("align-items:center;color:", G2.gray[100], ";display:flex;justify-content:space-between;margin-bottom:", space(1), ";padding:", () => Object(external_wp_i18n_["isRTL"])() ? `${space(0.5)} ${space(2)} ${space(0.5)} ${space(1.5)}` : `${space(0.5)} ${space(1.5)} ${space(0.5)} ${space(2)}`, ";" + ( true ? "" : undefined));
  30651. const MenuTitleActionsUI = styled_base_browser_esm("span", {
  30652. target: "ejwewyf5",
  30653. label: "MenuTitleActionsUI"
  30654. })("height:", space(3), ";.components-button.is-small{color:", G2.lightGray.ui, ";margin-right:", space(0.5), ";padding:0;&:active:not(:disabled ){background:none;color:", G2.gray[200], ";}&:hover:not(:disabled ){box-shadow:none;color:", G2.gray[200], ";}}" + ( true ? "" : undefined));
  30655. const MenuTitleSearchUI = styled_base_browser_esm("div", {
  30656. target: "ejwewyf6",
  30657. label: "MenuTitleSearchUI"
  30658. })("padding:0;position:relative;input{height:", space(4.5), ";margin-bottom:", space(1), ";padding-left:", space(4), ";padding-right:", space(4), ";&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}> svg{left:", space(0.5), ";position:absolute;top:6px;}.components-button.is-small{height:30px;padding:0;position:absolute;right:", space(1), ";top:3px;&:active:not(:disabled ){background:none;}&:hover:not(:disabled ){box-shadow:none;}}" + ( true ? "" : undefined));
  30659. const GroupTitleUI = /*#__PURE__*/styled_base_browser_esm(text_component, {
  30660. target: "ejwewyf7",
  30661. label: "GroupTitleUI"
  30662. })("margin-top:", space(1), ";padding:", () => Object(external_wp_i18n_["isRTL"])() ? `${space(0.5)} ${space(2)} ${space(0.5)} 0` : `${space(0.5)} 0 ${space(0.5)} ${space(2)}`, ";text-transform:uppercase;color:", G2.gray[100], ";" + ( true ? "" : undefined));
  30663. const ItemBaseUI = styled_base_browser_esm("li", {
  30664. target: "ejwewyf8",
  30665. label: "ItemBaseUI"
  30666. })("border-radius:2px;color:", G2.lightGray.ui, ";margin-bottom:0;button,a.components-button,a{width:100%;color:", G2.lightGray.ui, ";padding:", space(1), " ", space(2), ";", rtl_rtl({
  30667. textAlign: 'left'
  30668. }, {
  30669. textAlign: 'right'
  30670. }), " &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:#ddd;}}&.is-active{background-color:", UI.theme, ";color:", UI.textDark, ";button,a{color:", UI.textDark, ";}}svg path{color:", G2.lightGray.ui, ";}" + ( true ? "" : undefined));
  30671. const ItemUI = styled_base_browser_esm("div", {
  30672. target: "ejwewyf9",
  30673. label: "ItemUI"
  30674. })("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:", space(0.75), " ", space(2), ";font-weight:400;line-height:20px;width:100%;color:", G2.lightGray.ui, ";" + ( true ? "" : undefined));
  30675. const ItemBadgeUI = styled_base_browser_esm("span", {
  30676. target: "ejwewyf10",
  30677. label: "ItemBadgeUI"
  30678. })("margin-left:", () => Object(external_wp_i18n_["isRTL"])() ? '0' : space(1), ";margin-right:", () => Object(external_wp_i18n_["isRTL"])() ? space(1) : '0', ";display:inline-flex;padding:", space(0.5), " ", space(1.5), ";border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}", reduceMotion('animation'), ";" + ( true ? "" : undefined));
  30679. const ItemTitleUI = /*#__PURE__*/styled_base_browser_esm(text_component, {
  30680. target: "ejwewyf11",
  30681. label: "ItemTitleUI"
  30682. })(() => Object(external_wp_i18n_["isRTL"])() ? 'margin-left: auto;' : 'margin-right: auto;', " font-size:14px;line-height:20px;color:inherit;" + ( true ? "" : undefined));
  30683. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-navigation-tree-nodes.js
  30684. /**
  30685. * External dependencies
  30686. */
  30687. /**
  30688. * WordPress dependencies
  30689. */
  30690. const useNavigationTreeNodes = () => {
  30691. const [nodes, setNodes] = Object(external_wp_element_["useState"])({});
  30692. const getNode = key => nodes[key];
  30693. const addNode = (key, value) => setNodes(original => ({ ...original,
  30694. [key]: Object(external_lodash_["omit"])(value, 'children')
  30695. }));
  30696. const removeNode = key => setNodes(original => Object(external_lodash_["omit"])(original, key));
  30697. return {
  30698. nodes,
  30699. getNode,
  30700. addNode,
  30701. removeNode
  30702. };
  30703. };
  30704. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-create-navigation-tree.js
  30705. /**
  30706. * WordPress dependencies
  30707. */
  30708. /**
  30709. * Internal dependencies
  30710. */
  30711. const useCreateNavigationTree = () => {
  30712. const {
  30713. nodes: items,
  30714. getNode: getItem,
  30715. addNode: addItem,
  30716. removeNode: removeItem
  30717. } = useNavigationTreeNodes();
  30718. const {
  30719. nodes: menus,
  30720. getNode: getMenu,
  30721. addNode: addMenu,
  30722. removeNode: removeMenu
  30723. } = useNavigationTreeNodes();
  30724. /**
  30725. * Stores direct nested menus of menus
  30726. * This makes it easy to traverse menu tree
  30727. *
  30728. * Key is the menu prop of the menu
  30729. * Value is an array of menu keys
  30730. */
  30731. const [childMenu, setChildMenu] = Object(external_wp_element_["useState"])({});
  30732. const getChildMenu = menu => childMenu[menu] || [];
  30733. const traverseMenu = (startMenu, callback) => {
  30734. const visited = [];
  30735. let queue = [startMenu];
  30736. let current;
  30737. while (queue.length > 0) {
  30738. current = getMenu(queue.shift());
  30739. if (!current || visited.includes(current.menu)) {
  30740. continue;
  30741. }
  30742. visited.push(current.menu);
  30743. queue = [...queue, ...getChildMenu(current.menu)];
  30744. if (callback(current) === false) {
  30745. break;
  30746. }
  30747. }
  30748. };
  30749. const isMenuEmpty = menuToCheck => {
  30750. let isEmpty = true;
  30751. traverseMenu(menuToCheck, current => {
  30752. if (!current.isEmpty) {
  30753. isEmpty = false;
  30754. return false;
  30755. }
  30756. });
  30757. return isEmpty;
  30758. };
  30759. return {
  30760. items,
  30761. getItem,
  30762. addItem,
  30763. removeItem,
  30764. menus,
  30765. getMenu,
  30766. addMenu: (key, value) => {
  30767. setChildMenu(state => {
  30768. const newState = { ...state
  30769. };
  30770. if (!newState[value.parentMenu]) {
  30771. newState[value.parentMenu] = [];
  30772. }
  30773. newState[value.parentMenu].push(key);
  30774. return newState;
  30775. });
  30776. addMenu(key, value);
  30777. },
  30778. removeMenu,
  30779. childMenu,
  30780. traverseMenu,
  30781. isMenuEmpty
  30782. };
  30783. };
  30784. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/index.js
  30785. /**
  30786. * External dependencies
  30787. */
  30788. /**
  30789. * WordPress dependencies
  30790. */
  30791. /**
  30792. * Internal dependencies
  30793. */
  30794. function Navigation({
  30795. activeItem,
  30796. activeMenu = ROOT_MENU,
  30797. children,
  30798. className,
  30799. onActivateMenu = external_lodash_["noop"]
  30800. }) {
  30801. const [menu, setMenu] = Object(external_wp_element_["useState"])(activeMenu);
  30802. const [slideOrigin, setSlideOrigin] = Object(external_wp_element_["useState"])();
  30803. const navigationTree = useCreateNavigationTree();
  30804. const defaultSlideOrigin = Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left';
  30805. const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {
  30806. if (!navigationTree.getMenu(menuId)) {
  30807. return;
  30808. }
  30809. setSlideOrigin(slideInOrigin);
  30810. setMenu(menuId);
  30811. onActivateMenu(menuId);
  30812. }; // Used to prevent the sliding animation on mount
  30813. const isMounted = Object(external_wp_element_["useRef"])(false);
  30814. Object(external_wp_element_["useEffect"])(() => {
  30815. if (!isMounted.current) {
  30816. isMounted.current = true;
  30817. }
  30818. }, []);
  30819. Object(external_wp_element_["useEffect"])(() => {
  30820. if (activeMenu !== menu) {
  30821. setActiveMenu(activeMenu);
  30822. }
  30823. }, [activeMenu]);
  30824. const context = {
  30825. activeItem,
  30826. activeMenu: menu,
  30827. setActiveMenu,
  30828. navigationTree
  30829. };
  30830. const classes = classnames_default()('components-navigation', className);
  30831. const animateClassName = Object(animate["b" /* getAnimateClassName */])({
  30832. type: 'slide-in',
  30833. origin: slideOrigin
  30834. });
  30835. return Object(external_wp_element_["createElement"])(NavigationUI, {
  30836. className: classes
  30837. }, Object(external_wp_element_["createElement"])("div", {
  30838. key: menu,
  30839. className: classnames_default()({
  30840. [animateClassName]: isMounted.current && slideOrigin
  30841. })
  30842. }, Object(external_wp_element_["createElement"])(NavigationContext.Provider, {
  30843. value: context
  30844. }, children)));
  30845. }
  30846. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
  30847. var chevron_right = __webpack_require__("1iEr");
  30848. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
  30849. var chevron_left = __webpack_require__("2gm7");
  30850. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js
  30851. /**
  30852. * External dependencies
  30853. */
  30854. /**
  30855. * WordPress dependencies
  30856. */
  30857. /**
  30858. * Internal dependencies
  30859. */
  30860. function NavigationBackButton({
  30861. backButtonLabel,
  30862. className,
  30863. href,
  30864. onClick,
  30865. parentMenu
  30866. }, ref) {
  30867. var _navigationTree$getMe;
  30868. const {
  30869. setActiveMenu,
  30870. navigationTree
  30871. } = useNavigationContext();
  30872. const classes = classnames_default()('components-navigation__back-button', className);
  30873. const parentMenuTitle = (_navigationTree$getMe = navigationTree.getMenu(parentMenu)) === null || _navigationTree$getMe === void 0 ? void 0 : _navigationTree$getMe.title;
  30874. const handleOnClick = event => {
  30875. if (typeof onClick === 'function') {
  30876. onClick(event);
  30877. }
  30878. const animationDirection = Object(external_wp_i18n_["isRTL"])() ? 'left' : 'right';
  30879. if (parentMenu && !event.defaultPrevented) {
  30880. setActiveMenu(parentMenu, animationDirection);
  30881. }
  30882. };
  30883. const icon = Object(external_wp_i18n_["isRTL"])() ? chevron_right["a" /* default */] : chevron_left["a" /* default */];
  30884. return Object(external_wp_element_["createElement"])(MenuBackButtonUI, {
  30885. className: classes,
  30886. href: href,
  30887. isTertiary: true,
  30888. ref: ref,
  30889. onClick: handleOnClick
  30890. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  30891. icon: icon
  30892. }), backButtonLabel || parentMenuTitle || Object(external_wp_i18n_["__"])('Back'));
  30893. }
  30894. /* harmony default export */ var back_button = (Object(external_wp_element_["forwardRef"])(NavigationBackButton));
  30895. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/context.js
  30896. /**
  30897. * WordPress dependencies
  30898. */
  30899. const NavigationGroupContext = Object(external_wp_element_["createContext"])({
  30900. group: undefined
  30901. });
  30902. const useNavigationGroupContext = () => Object(external_wp_element_["useContext"])(NavigationGroupContext);
  30903. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/index.js
  30904. /**
  30905. * External dependencies
  30906. */
  30907. /**
  30908. * WordPress dependencies
  30909. */
  30910. /**
  30911. * Internal dependencies
  30912. */
  30913. function NavigationGroup({
  30914. children,
  30915. className,
  30916. title
  30917. }) {
  30918. const [groupId] = Object(external_wp_element_["useState"])(Object(external_lodash_["uniqueId"])('group-'));
  30919. const {
  30920. navigationTree: {
  30921. items
  30922. }
  30923. } = useNavigationContext();
  30924. const context = {
  30925. group: groupId
  30926. }; // Keep the children rendered to make sure invisible items are included in the navigation tree.
  30927. if (!Object(external_lodash_["find"])(items, {
  30928. group: groupId,
  30929. _isVisible: true
  30930. })) {
  30931. return Object(external_wp_element_["createElement"])(NavigationGroupContext.Provider, {
  30932. value: context
  30933. }, children);
  30934. }
  30935. const groupTitleId = `components-navigation__group-title-${groupId}`;
  30936. const classes = classnames_default()('components-navigation__group', className);
  30937. return Object(external_wp_element_["createElement"])(NavigationGroupContext.Provider, {
  30938. value: context
  30939. }, Object(external_wp_element_["createElement"])("li", {
  30940. className: classes
  30941. }, title && Object(external_wp_element_["createElement"])(GroupTitleUI, {
  30942. as: "h3",
  30943. className: "components-navigation__group-title",
  30944. id: groupTitleId,
  30945. variant: "caption"
  30946. }, title), Object(external_wp_element_["createElement"])("ul", {
  30947. "aria-labelledby": groupTitleId,
  30948. role: "group"
  30949. }, children)));
  30950. }
  30951. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base-content.js
  30952. /**
  30953. * Internal dependencies
  30954. */
  30955. function NavigationItemBaseContent(props) {
  30956. const {
  30957. badge,
  30958. title
  30959. } = props;
  30960. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, title && Object(external_wp_element_["createElement"])(ItemTitleUI, {
  30961. className: "components-navigation__item-title",
  30962. variant: "body.small",
  30963. as: "span"
  30964. }, title), badge && Object(external_wp_element_["createElement"])(ItemBadgeUI, {
  30965. className: "components-navigation__item-badge"
  30966. }, badge));
  30967. }
  30968. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/context.js
  30969. /**
  30970. * WordPress dependencies
  30971. */
  30972. const NavigationMenuContext = Object(external_wp_element_["createContext"])({
  30973. menu: undefined,
  30974. search: ''
  30975. });
  30976. const useNavigationMenuContext = () => Object(external_wp_element_["useContext"])(NavigationMenuContext);
  30977. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/utils.js
  30978. /**
  30979. * External dependencies
  30980. */
  30981. // @see packages/block-editor/src/components/inserter/search-items.js
  30982. const normalizeInput = input => Object(external_lodash_["deburr"])(input).replace(/^\//, '').toLowerCase();
  30983. const normalizedSearch = (title, search) => -1 !== normalizeInput(title).indexOf(normalizeInput(search));
  30984. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js
  30985. /**
  30986. * WordPress dependencies
  30987. */
  30988. /**
  30989. * Internal dependencies
  30990. */
  30991. const useNavigationTreeItem = (itemId, props) => {
  30992. const {
  30993. activeMenu,
  30994. navigationTree: {
  30995. addItem,
  30996. removeItem
  30997. }
  30998. } = useNavigationContext();
  30999. const {
  31000. group
  31001. } = useNavigationGroupContext();
  31002. const {
  31003. menu,
  31004. search
  31005. } = useNavigationMenuContext();
  31006. Object(external_wp_element_["useEffect"])(() => {
  31007. const isMenuActive = activeMenu === menu;
  31008. const isItemVisible = !search || normalizedSearch(props.title, search);
  31009. addItem(itemId, { ...props,
  31010. group,
  31011. menu,
  31012. _isVisible: isMenuActive && isItemVisible
  31013. });
  31014. return () => {
  31015. removeItem(itemId);
  31016. };
  31017. }, [activeMenu, search]);
  31018. };
  31019. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base.js
  31020. /**
  31021. * External dependencies
  31022. */
  31023. /**
  31024. * WordPress dependencies
  31025. */
  31026. /**
  31027. * Internal dependencies
  31028. */
  31029. function NavigationItemBase(props) {
  31030. var _navigationTree$getIt;
  31031. const {
  31032. children,
  31033. className,
  31034. ...restProps
  31035. } = props;
  31036. const [itemId] = Object(external_wp_element_["useState"])(Object(external_lodash_["uniqueId"])('item-'));
  31037. useNavigationTreeItem(itemId, props);
  31038. const {
  31039. navigationTree
  31040. } = useNavigationContext();
  31041. if (!((_navigationTree$getIt = navigationTree.getItem(itemId)) !== null && _navigationTree$getIt !== void 0 && _navigationTree$getIt._isVisible)) {
  31042. return null;
  31043. }
  31044. const classes = classnames_default()('components-navigation__item', className);
  31045. return Object(external_wp_element_["createElement"])(ItemBaseUI, Object(esm_extends["a" /* default */])({
  31046. className: classes
  31047. }, restProps), children);
  31048. }
  31049. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/index.js
  31050. /**
  31051. * External dependencies
  31052. */
  31053. /**
  31054. * WordPress dependencies
  31055. */
  31056. /**
  31057. * Internal dependencies
  31058. */
  31059. function NavigationItem(props) {
  31060. const {
  31061. badge,
  31062. children,
  31063. className,
  31064. href,
  31065. item,
  31066. navigateToMenu,
  31067. onClick = external_lodash_["noop"],
  31068. title,
  31069. hideIfTargetMenuEmpty,
  31070. isText,
  31071. ...restProps
  31072. } = props;
  31073. const {
  31074. activeItem,
  31075. setActiveMenu,
  31076. navigationTree: {
  31077. isMenuEmpty
  31078. }
  31079. } = useNavigationContext(); // If hideIfTargetMenuEmpty prop is true
  31080. // And the menu we are supposed to navigate to
  31081. // Is marked as empty, then we skip rendering the item
  31082. if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
  31083. return null;
  31084. }
  31085. const classes = classnames_default()(className, {
  31086. 'is-active': item && activeItem === item
  31087. });
  31088. const onItemClick = event => {
  31089. if (navigateToMenu) {
  31090. setActiveMenu(navigateToMenu);
  31091. }
  31092. onClick(event);
  31093. };
  31094. const icon = Object(external_wp_i18n_["isRTL"])() ? chevron_left["a" /* default */] : chevron_right["a" /* default */];
  31095. const baseProps = isText ? restProps : {
  31096. as: build_module_button["a" /* default */],
  31097. href,
  31098. onClick: onItemClick,
  31099. ...restProps
  31100. };
  31101. return Object(external_wp_element_["createElement"])(NavigationItemBase, Object(esm_extends["a" /* default */])({}, props, {
  31102. className: classes
  31103. }), children || Object(external_wp_element_["createElement"])(ItemUI, baseProps, Object(external_wp_element_["createElement"])(NavigationItemBaseContent, {
  31104. title: title,
  31105. badge: badge
  31106. }), navigateToMenu && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  31107. icon: icon
  31108. })));
  31109. }
  31110. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js
  31111. /**
  31112. * WordPress dependencies
  31113. */
  31114. /**
  31115. * Internal dependencies
  31116. */
  31117. const useNavigationTreeMenu = props => {
  31118. const {
  31119. navigationTree: {
  31120. addMenu,
  31121. removeMenu
  31122. }
  31123. } = useNavigationContext();
  31124. const key = props.menu || ROOT_MENU;
  31125. Object(external_wp_element_["useEffect"])(() => {
  31126. addMenu(key, { ...props,
  31127. menu: key
  31128. });
  31129. return () => {
  31130. removeMenu(key);
  31131. };
  31132. }, []);
  31133. };
  31134. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
  31135. var library_search = __webpack_require__("cGtP");
  31136. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js
  31137. /**
  31138. * External dependencies
  31139. */
  31140. /**
  31141. * WordPress dependencies
  31142. */
  31143. /**
  31144. * Internal dependencies
  31145. */
  31146. function MenuTitleSearch({
  31147. debouncedSpeak,
  31148. onCloseSearch,
  31149. onSearch,
  31150. search,
  31151. title
  31152. }) {
  31153. const {
  31154. navigationTree: {
  31155. items
  31156. }
  31157. } = useNavigationContext();
  31158. const {
  31159. menu
  31160. } = useNavigationMenuContext();
  31161. const inputRef = Object(external_wp_element_["useRef"])(); // Wait for the slide-in animation to complete before autofocusing the input.
  31162. // This prevents scrolling to the input during the animation.
  31163. Object(external_wp_element_["useEffect"])(() => {
  31164. const delayedFocus = setTimeout(() => {
  31165. inputRef.current.focus();
  31166. }, SEARCH_FOCUS_DELAY);
  31167. return () => {
  31168. clearTimeout(delayedFocus);
  31169. };
  31170. }, []);
  31171. Object(external_wp_element_["useEffect"])(() => {
  31172. if (!search) {
  31173. return;
  31174. }
  31175. const count = Object(external_lodash_["filter"])(items, '_isVisible').length;
  31176. const resultsFoundMessage = Object(external_wp_i18n_["sprintf"])(
  31177. /* translators: %d: number of results. */
  31178. Object(external_wp_i18n_["_n"])('%d result found.', '%d results found.', count), count);
  31179. debouncedSpeak(resultsFoundMessage);
  31180. }, [items, search]);
  31181. const onClose = () => {
  31182. onSearch('');
  31183. onCloseSearch();
  31184. };
  31185. function onKeyDown(event) {
  31186. if (event.keyCode === external_wp_keycodes_["ESCAPE"]) {
  31187. event.stopPropagation();
  31188. onClose();
  31189. }
  31190. }
  31191. const menuTitleId = `components-navigation__menu-title-${menu}`;
  31192. const inputId = `components-navigation__menu-title-search-${menu}`;
  31193. /* translators: placeholder for menu search box. %s: menu title */
  31194. const placeholder = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Search in %s'), title);
  31195. return Object(external_wp_element_["createElement"])(MenuTitleSearchUI, {
  31196. className: "components-navigation__menu-title-search"
  31197. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  31198. icon: library_search["a" /* default */]
  31199. }), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
  31200. as: "label",
  31201. htmlFor: inputId,
  31202. id: menuTitleId
  31203. }, placeholder), Object(external_wp_element_["createElement"])("input", {
  31204. autoComplete: "off",
  31205. className: "components-text-control__input",
  31206. id: inputId,
  31207. onChange: event => onSearch(event.target.value),
  31208. onKeyDown: onKeyDown,
  31209. placeholder: placeholder,
  31210. ref: inputRef,
  31211. type: "search",
  31212. value: search
  31213. }), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  31214. isSmall: true,
  31215. isTertiary: true,
  31216. label: Object(external_wp_i18n_["__"])('Close search'),
  31217. onClick: onClose
  31218. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  31219. icon: close_small["a" /* default */]
  31220. })));
  31221. }
  31222. /* harmony default export */ var menu_title_search = (with_spoken_messages(MenuTitleSearch));
  31223. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js
  31224. /**
  31225. * WordPress dependencies
  31226. */
  31227. /**
  31228. * Internal dependencies
  31229. */
  31230. function NavigationMenuTitle({
  31231. hasSearch,
  31232. onSearch,
  31233. search,
  31234. title,
  31235. titleAction
  31236. }) {
  31237. const [isSearching, setIsSearching] = Object(external_wp_element_["useState"])(false);
  31238. const {
  31239. menu
  31240. } = useNavigationMenuContext();
  31241. const searchButtonRef = Object(external_wp_element_["useRef"])();
  31242. if (!title) {
  31243. return null;
  31244. }
  31245. const onCloseSearch = () => {
  31246. setIsSearching(false); // Wait for the slide-in animation to complete before focusing the search button.
  31247. // eslint-disable-next-line @wordpress/react-no-unsafe-timeout
  31248. setTimeout(() => {
  31249. searchButtonRef.current.focus();
  31250. }, SEARCH_FOCUS_DELAY);
  31251. };
  31252. const menuTitleId = `components-navigation__menu-title-${menu}`;
  31253. /* translators: search button label for menu search box. %s: menu title */
  31254. const searchButtonLabel = Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Search in %s'), title);
  31255. return Object(external_wp_element_["createElement"])(MenuTitleUI, {
  31256. className: "components-navigation__menu-title"
  31257. }, !isSearching && Object(external_wp_element_["createElement"])(MenuTitleHeadingUI, {
  31258. as: "h2",
  31259. className: "components-navigation__menu-title-heading",
  31260. variant: "title.small"
  31261. }, Object(external_wp_element_["createElement"])("span", {
  31262. id: menuTitleId
  31263. }, title), (hasSearch || titleAction) && Object(external_wp_element_["createElement"])(MenuTitleActionsUI, null, titleAction, hasSearch && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  31264. isSmall: true,
  31265. isTertiary: true,
  31266. label: searchButtonLabel,
  31267. onClick: () => setIsSearching(true),
  31268. ref: searchButtonRef
  31269. }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  31270. icon: library_search["a" /* default */]
  31271. })))), isSearching && Object(external_wp_element_["createElement"])("div", {
  31272. className: Object(animate["b" /* getAnimateClassName */])({
  31273. type: 'slide-in',
  31274. origin: 'left'
  31275. })
  31276. }, Object(external_wp_element_["createElement"])(menu_title_search, {
  31277. onCloseSearch: onCloseSearch,
  31278. onSearch: onSearch,
  31279. search: search,
  31280. title: title
  31281. })));
  31282. }
  31283. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/search-no-results-found.js
  31284. /**
  31285. * External dependencies
  31286. */
  31287. /**
  31288. * WordPress dependencies
  31289. */
  31290. /**
  31291. * Internal dependencies
  31292. */
  31293. function NavigationSearchNoResultsFound({
  31294. search
  31295. }) {
  31296. const {
  31297. navigationTree: {
  31298. items
  31299. }
  31300. } = useNavigationContext();
  31301. const resultsCount = Object(external_lodash_["filter"])(items, '_isVisible').length;
  31302. if (!search || !!resultsCount) {
  31303. return null;
  31304. }
  31305. return Object(external_wp_element_["createElement"])(ItemBaseUI, null, Object(external_wp_element_["createElement"])(ItemUI, null, Object(external_wp_i18n_["__"])('No results found.'), " "));
  31306. }
  31307. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/index.js
  31308. /**
  31309. * External dependencies
  31310. */
  31311. /**
  31312. * WordPress dependencies
  31313. */
  31314. /**
  31315. * Internal dependencies
  31316. */
  31317. function NavigationMenu(props) {
  31318. const {
  31319. backButtonLabel,
  31320. children,
  31321. className,
  31322. hasSearch,
  31323. menu = ROOT_MENU,
  31324. onBackButtonClick,
  31325. onSearch: setControlledSearch,
  31326. parentMenu,
  31327. search: controlledSearch,
  31328. isSearchDebouncing,
  31329. title,
  31330. titleAction
  31331. } = props;
  31332. const [uncontrolledSearch, setUncontrolledSearch] = Object(external_wp_element_["useState"])('');
  31333. useNavigationTreeMenu(props);
  31334. const {
  31335. activeMenu
  31336. } = useNavigationContext();
  31337. const context = {
  31338. menu,
  31339. search: uncontrolledSearch
  31340. }; // Keep the children rendered to make sure invisible items are included in the navigation tree
  31341. if (activeMenu !== menu) {
  31342. return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, {
  31343. value: context
  31344. }, children);
  31345. }
  31346. const isControlledSearch = !!setControlledSearch;
  31347. const search = isControlledSearch ? controlledSearch : uncontrolledSearch;
  31348. const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch;
  31349. const menuTitleId = `components-navigation__menu-title-${menu}`;
  31350. const classes = classnames_default()('components-navigation__menu', className);
  31351. return Object(external_wp_element_["createElement"])(NavigationMenuContext.Provider, {
  31352. value: context
  31353. }, Object(external_wp_element_["createElement"])(MenuUI, {
  31354. className: classes
  31355. }, (parentMenu || onBackButtonClick) && Object(external_wp_element_["createElement"])(back_button, {
  31356. backButtonLabel: backButtonLabel,
  31357. parentMenu: parentMenu,
  31358. onClick: onBackButtonClick
  31359. }), Object(external_wp_element_["createElement"])(NavigationMenuTitle, {
  31360. hasSearch: hasSearch,
  31361. onSearch: onSearch,
  31362. search: search,
  31363. title: title,
  31364. titleAction: titleAction
  31365. }), Object(external_wp_element_["createElement"])(navigable_container_menu, null, Object(external_wp_element_["createElement"])("ul", {
  31366. "aria-labelledby": menuTitleId
  31367. }, children, search && !isSearchDebouncing && Object(external_wp_element_["createElement"])(NavigationSearchNoResultsFound, {
  31368. search: search
  31369. })))));
  31370. }
  31371. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js
  31372. /**
  31373. * External dependencies
  31374. */
  31375. /**
  31376. * WordPress dependencies
  31377. */
  31378. /**
  31379. * Internal dependencies
  31380. */
  31381. /** @typedef {import('@wordpress/element').WPElement} WPElement */
  31382. /**
  31383. * Custom hook which announces the message with the given politeness, if a
  31384. * valid message is provided.
  31385. *
  31386. * @param {string|WPElement} [message] Message to announce.
  31387. * @param {'polite'|'assertive'} politeness Politeness to announce.
  31388. */
  31389. function useSpokenMessage(message, politeness) {
  31390. const spokenMessage = typeof message === 'string' ? message : Object(external_wp_element_["renderToString"])(message);
  31391. Object(external_wp_element_["useEffect"])(() => {
  31392. if (spokenMessage) {
  31393. Object(external_wp_a11y_["speak"])(spokenMessage, politeness);
  31394. }
  31395. }, [spokenMessage, politeness]);
  31396. }
  31397. /**
  31398. * Given a notice status, returns an assumed default politeness for the status.
  31399. * Defaults to 'assertive'.
  31400. *
  31401. * @param {string} [status] Notice status.
  31402. *
  31403. * @return {'polite'|'assertive'} Notice politeness.
  31404. */
  31405. function getDefaultPoliteness(status) {
  31406. switch (status) {
  31407. case 'success':
  31408. case 'warning':
  31409. case 'info':
  31410. return 'polite';
  31411. case 'error':
  31412. default:
  31413. return 'assertive';
  31414. }
  31415. }
  31416. function Notice({
  31417. className,
  31418. status = 'info',
  31419. children,
  31420. spokenMessage = children,
  31421. onRemove = external_lodash_["noop"],
  31422. isDismissible = true,
  31423. actions = [],
  31424. politeness = getDefaultPoliteness(status),
  31425. __unstableHTML
  31426. }) {
  31427. useSpokenMessage(spokenMessage, politeness);
  31428. const classes = classnames_default()(className, 'components-notice', 'is-' + status, {
  31429. 'is-dismissible': isDismissible
  31430. });
  31431. if (__unstableHTML) {
  31432. children = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, children);
  31433. }
  31434. return Object(external_wp_element_["createElement"])("div", {
  31435. className: classes
  31436. }, Object(external_wp_element_["createElement"])("div", {
  31437. className: "components-notice__content"
  31438. }, children, Object(external_wp_element_["createElement"])("div", {
  31439. className: "components-notice__actions"
  31440. }, actions.map(({
  31441. className: buttonCustomClasses,
  31442. label,
  31443. isPrimary,
  31444. noDefaultClasses = false,
  31445. onClick,
  31446. url
  31447. }, index) => {
  31448. return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  31449. key: index,
  31450. href: url,
  31451. isPrimary: isPrimary,
  31452. isSecondary: !noDefaultClasses && !url,
  31453. isLink: !noDefaultClasses && !!url,
  31454. onClick: url ? undefined : onClick,
  31455. className: classnames_default()('components-notice__action', buttonCustomClasses)
  31456. }, label);
  31457. }))), isDismissible && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  31458. className: "components-notice__dismiss",
  31459. icon: library_close["a" /* default */],
  31460. label: Object(external_wp_i18n_["__"])('Dismiss this notice'),
  31461. onClick: onRemove,
  31462. showTooltip: false
  31463. }));
  31464. }
  31465. /* harmony default export */ var build_module_notice = (Notice);
  31466. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/list.js
  31467. /**
  31468. * External dependencies
  31469. */
  31470. /**
  31471. * Internal dependencies
  31472. */
  31473. /**
  31474. * Renders a list of notices.
  31475. *
  31476. * @param {Object} $0 Props passed to the component.
  31477. * @param {Array} $0.notices Array of notices to render.
  31478. * @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
  31479. * @param {Object} $0.className Name of the class used by the component.
  31480. * @param {Object} $0.children Array of children to be rendered inside the notice list.
  31481. * @return {Object} The rendered notices list.
  31482. */
  31483. function NoticeList({
  31484. notices,
  31485. onRemove = external_lodash_["noop"],
  31486. className,
  31487. children
  31488. }) {
  31489. const removeNotice = id => () => onRemove(id);
  31490. className = classnames_default()('components-notice-list', className);
  31491. return Object(external_wp_element_["createElement"])("div", {
  31492. className: className
  31493. }, children, [...notices].reverse().map(notice => Object(external_wp_element_["createElement"])(build_module_notice, Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
  31494. key: notice.id,
  31495. onRemove: removeNotice(notice.id)
  31496. }), notice.content)));
  31497. }
  31498. /* harmony default export */ var list = (NoticeList);
  31499. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/header.js
  31500. function PanelHeader({
  31501. label,
  31502. children
  31503. }) {
  31504. return Object(external_wp_element_["createElement"])("div", {
  31505. className: "components-panel__header"
  31506. }, label && Object(external_wp_element_["createElement"])("h2", null, label), children);
  31507. }
  31508. /* harmony default export */ var panel_header = (PanelHeader);
  31509. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/index.js
  31510. /**
  31511. * External dependencies
  31512. */
  31513. /**
  31514. * WordPress dependencies
  31515. */
  31516. /**
  31517. * Internal dependencies
  31518. */
  31519. function Panel({
  31520. header,
  31521. className,
  31522. children
  31523. }, ref) {
  31524. const classNames = classnames_default()(className, 'components-panel');
  31525. return Object(external_wp_element_["createElement"])("div", {
  31526. className: classNames,
  31527. ref: ref
  31528. }, header && Object(external_wp_element_["createElement"])(panel_header, {
  31529. label: header
  31530. }), children);
  31531. }
  31532. /* harmony default export */ var panel = (Object(external_wp_element_["forwardRef"])(Panel));
  31533. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/body.js
  31534. /**
  31535. * External dependencies
  31536. */
  31537. /**
  31538. * WordPress dependencies
  31539. */
  31540. /**
  31541. * Internal dependencies
  31542. */
  31543. function PanelBody({
  31544. buttonProps = {},
  31545. children,
  31546. className,
  31547. icon,
  31548. initialOpen,
  31549. onToggle = external_lodash_["noop"],
  31550. opened,
  31551. title,
  31552. scrollAfterOpen = true
  31553. }, ref) {
  31554. const [isOpened, setIsOpened] = use_controlled_state(opened, {
  31555. initial: initialOpen === undefined ? true : initialOpen
  31556. });
  31557. const nodeRef = Object(external_wp_element_["useRef"])(); // Defaults to 'smooth' scrolling
  31558. // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
  31559. const scrollBehavior = Object(external_wp_compose_["useReducedMotion"])() ? 'auto' : 'smooth';
  31560. const handleOnToggle = event => {
  31561. event.preventDefault();
  31562. const next = !isOpened;
  31563. setIsOpened(next);
  31564. onToggle(next);
  31565. }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value
  31566. const scrollAfterOpenRef = Object(external_wp_element_["useRef"])();
  31567. scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render
  31568. use_update_effect(() => {
  31569. var _nodeRef$current;
  31570. if (isOpened && scrollAfterOpenRef.current && (_nodeRef$current = nodeRef.current) !== null && _nodeRef$current !== void 0 && _nodeRef$current.scrollIntoView) {
  31571. /*
  31572. * Scrolls the content into view when visible.
  31573. * This improves the UX when there are multiple stacking <PanelBody />
  31574. * components in a scrollable container.
  31575. */
  31576. nodeRef.current.scrollIntoView({
  31577. inline: 'nearest',
  31578. block: 'nearest',
  31579. behavior: scrollBehavior
  31580. });
  31581. }
  31582. }, [isOpened, scrollBehavior]);
  31583. const classes = classnames_default()('components-panel__body', className, {
  31584. 'is-opened': isOpened
  31585. });
  31586. return Object(external_wp_element_["createElement"])("div", {
  31587. className: classes,
  31588. ref: Object(external_wp_compose_["useMergeRefs"])([nodeRef, ref])
  31589. }, Object(external_wp_element_["createElement"])(PanelBodyTitle, Object(esm_extends["a" /* default */])({
  31590. icon: icon,
  31591. isOpened: isOpened,
  31592. onClick: handleOnToggle,
  31593. title: title
  31594. }, buttonProps)), typeof children === 'function' ? children({
  31595. opened: isOpened
  31596. }) : isOpened && children);
  31597. }
  31598. const PanelBodyTitle = Object(external_wp_element_["forwardRef"])(({
  31599. isOpened,
  31600. icon,
  31601. title,
  31602. ...props
  31603. }, ref) => {
  31604. if (!title) return null;
  31605. return Object(external_wp_element_["createElement"])("h2", {
  31606. className: "components-panel__body-title"
  31607. }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  31608. className: "components-panel__body-toggle",
  31609. "aria-expanded": isOpened,
  31610. ref: ref
  31611. }, props), Object(external_wp_element_["createElement"])("span", {
  31612. "aria-hidden": "true"
  31613. }, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  31614. className: "components-panel__arrow",
  31615. icon: isOpened ? chevron_up["a" /* default */] : chevron_down["a" /* default */]
  31616. })), title, icon && Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  31617. icon: icon,
  31618. className: "components-panel__icon",
  31619. size: 20
  31620. })));
  31621. });
  31622. const body_ForwardedComponent = Object(external_wp_element_["forwardRef"])(PanelBody);
  31623. body_ForwardedComponent.displayName = 'PanelBody';
  31624. /* harmony default export */ var panel_body = (body_ForwardedComponent);
  31625. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/row.js
  31626. /**
  31627. * External dependencies
  31628. */
  31629. /**
  31630. * WordPress dependencies
  31631. */
  31632. const PanelRow = Object(external_wp_element_["forwardRef"])(({
  31633. className,
  31634. children
  31635. }, ref) => Object(external_wp_element_["createElement"])("div", {
  31636. className: classnames_default()('components-panel__row', className),
  31637. ref: ref
  31638. }, children));
  31639. /* harmony default export */ var panel_row = (PanelRow);
  31640. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/placeholder/index.js
  31641. /**
  31642. * External dependencies
  31643. */
  31644. /**
  31645. * WordPress dependencies
  31646. */
  31647. /**
  31648. * Internal dependencies
  31649. */
  31650. /**
  31651. * Renders a placeholder. Normally used by blocks to render their empty state.
  31652. *
  31653. * @param {Object} props The component props.
  31654. * @param {WPIcon} props.icon An icon rendered before the label.
  31655. * @param {WPElement} props.children Children to be rendered.
  31656. * @param {string} props.label Title of the placeholder.
  31657. * @param {string} props.instructions Instructions of the placeholder.
  31658. * @param {string} props.className Class to set on the container div.
  31659. * @param {Object} props.notices A rendered notices list.
  31660. * @param {Object} props.preview Preview to be rendered in the placeholder.
  31661. * @param {boolean} props.isColumnLayout Whether a column layout should be used.
  31662. *
  31663. * @return {Object} The rendered placeholder.
  31664. */
  31665. function Placeholder({
  31666. icon,
  31667. children,
  31668. label,
  31669. instructions,
  31670. className,
  31671. notices,
  31672. preview,
  31673. isColumnLayout,
  31674. ...additionalProps
  31675. }) {
  31676. const [resizeListener, {
  31677. width
  31678. }] = Object(external_wp_compose_["useResizeObserver"])(); // Since `useResizeObserver` will report a width of `null` until after the
  31679. // first render, avoid applying any modifier classes until width is known.
  31680. let modifierClassNames;
  31681. if (typeof width === 'number') {
  31682. modifierClassNames = {
  31683. 'is-large': width >= 480,
  31684. 'is-medium': width >= 160 && width < 480,
  31685. 'is-small': width < 160
  31686. };
  31687. }
  31688. const classes = classnames_default()('components-placeholder', className, modifierClassNames);
  31689. const fieldsetClasses = classnames_default()('components-placeholder__fieldset', {
  31690. 'is-column-layout': isColumnLayout
  31691. });
  31692. return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, additionalProps, {
  31693. className: classes
  31694. }), resizeListener, notices, preview && Object(external_wp_element_["createElement"])("div", {
  31695. className: "components-placeholder__preview"
  31696. }, preview), Object(external_wp_element_["createElement"])("div", {
  31697. className: "components-placeholder__label"
  31698. }, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
  31699. icon: icon
  31700. }), label), !!instructions && Object(external_wp_element_["createElement"])("div", {
  31701. className: "components-placeholder__instructions"
  31702. }, instructions), Object(external_wp_element_["createElement"])("div", {
  31703. className: fieldsetClasses
  31704. }, children));
  31705. }
  31706. /* harmony default export */ var build_module_placeholder = (Placeholder);
  31707. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/terms.js
  31708. /**
  31709. * External dependencies
  31710. */
  31711. /**
  31712. * Returns terms in a tree form.
  31713. *
  31714. * @param {Array} flatTerms Array of terms in flat format.
  31715. *
  31716. * @return {Array} Array of terms in tree format.
  31717. */
  31718. function buildTermsTree(flatTerms) {
  31719. const flatTermsWithParentAndChildren = flatTerms.map(term => {
  31720. return {
  31721. children: [],
  31722. parent: null,
  31723. ...term
  31724. };
  31725. });
  31726. const termsByParent = Object(external_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent');
  31727. if (termsByParent.null && termsByParent.null.length) {
  31728. return flatTermsWithParentAndChildren;
  31729. }
  31730. const fillWithChildren = terms => {
  31731. return terms.map(term => {
  31732. const children = termsByParent[term.id];
  31733. return { ...term,
  31734. children: children && children.length ? fillWithChildren(children) : []
  31735. };
  31736. });
  31737. };
  31738. return fillWithChildren(termsByParent['0'] || []);
  31739. }
  31740. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-select/index.js
  31741. /**
  31742. * External dependencies
  31743. */
  31744. /**
  31745. * WordPress dependencies
  31746. */
  31747. /**
  31748. * Internal dependencies
  31749. */
  31750. function tree_select_getSelectOptions(tree, level = 0) {
  31751. return Object(external_lodash_["flatMap"])(tree, treeNode => [{
  31752. value: treeNode.id,
  31753. label: Object(external_lodash_["repeat"])('\u00A0', level * 3) + Object(external_lodash_["unescape"])(treeNode.name)
  31754. }, ...tree_select_getSelectOptions(treeNode.children || [], level + 1)]);
  31755. }
  31756. function TreeSelect({
  31757. label,
  31758. noOptionLabel,
  31759. onChange,
  31760. selectedId,
  31761. tree,
  31762. ...props
  31763. }) {
  31764. const options = Object(external_wp_element_["useMemo"])(() => {
  31765. return Object(external_lodash_["compact"])([noOptionLabel && {
  31766. value: '',
  31767. label: noOptionLabel
  31768. }, ...tree_select_getSelectOptions(tree)]);
  31769. }, [noOptionLabel, tree]);
  31770. return Object(external_wp_element_["createElement"])(select_control, Object(esm_extends["a" /* default */])({
  31771. label,
  31772. options,
  31773. onChange,
  31774. value: selectedId
  31775. }, props));
  31776. }
  31777. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/category-select.js
  31778. /**
  31779. * Internal dependencies
  31780. */
  31781. /**
  31782. * WordPress dependencies
  31783. */
  31784. function CategorySelect({
  31785. label,
  31786. noOptionLabel,
  31787. categoriesList,
  31788. selectedCategoryId,
  31789. onChange,
  31790. ...props
  31791. }) {
  31792. const termsTree = Object(external_wp_element_["useMemo"])(() => {
  31793. return buildTermsTree(categoriesList);
  31794. }, [categoriesList]);
  31795. return Object(external_wp_element_["createElement"])(TreeSelect, Object(esm_extends["a" /* default */])({
  31796. label,
  31797. noOptionLabel,
  31798. onChange,
  31799. tree: termsTree,
  31800. selectedId: selectedCategoryId
  31801. }, props));
  31802. }
  31803. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/author-select.js
  31804. /**
  31805. * Internal dependencies
  31806. */
  31807. function AuthorSelect({
  31808. label,
  31809. noOptionLabel,
  31810. authorList,
  31811. selectedAuthorId,
  31812. onChange
  31813. }) {
  31814. if (!authorList) return null;
  31815. const termsTree = buildTermsTree(authorList);
  31816. return Object(external_wp_element_["createElement"])(TreeSelect, {
  31817. label,
  31818. noOptionLabel,
  31819. onChange,
  31820. tree: termsTree,
  31821. selectedId: selectedAuthorId
  31822. });
  31823. }
  31824. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/index.js
  31825. /**
  31826. * WordPress dependencies
  31827. */
  31828. /**
  31829. * Internal dependencies
  31830. */
  31831. const DEFAULT_MIN_ITEMS = 1;
  31832. const DEFAULT_MAX_ITEMS = 100;
  31833. const MAX_CATEGORIES_SUGGESTIONS = 20;
  31834. function QueryControls({
  31835. authorList,
  31836. selectedAuthorId,
  31837. categoriesList,
  31838. selectedCategoryId,
  31839. categorySuggestions,
  31840. selectedCategories,
  31841. numberOfItems,
  31842. order,
  31843. orderBy,
  31844. maxItems = DEFAULT_MAX_ITEMS,
  31845. minItems = DEFAULT_MIN_ITEMS,
  31846. onCategoryChange,
  31847. onAuthorChange,
  31848. onNumberOfItemsChange,
  31849. onOrderChange,
  31850. onOrderByChange
  31851. }) {
  31852. return [onOrderChange && onOrderByChange && Object(external_wp_element_["createElement"])(select_control, {
  31853. key: "query-controls-order-select",
  31854. label: Object(external_wp_i18n_["__"])('Order by'),
  31855. value: `${orderBy}/${order}`,
  31856. options: [{
  31857. label: Object(external_wp_i18n_["__"])('Newest to oldest'),
  31858. value: 'date/desc'
  31859. }, {
  31860. label: Object(external_wp_i18n_["__"])('Oldest to newest'),
  31861. value: 'date/asc'
  31862. }, {
  31863. /* translators: label for ordering posts by title in ascending order */
  31864. label: Object(external_wp_i18n_["__"])('A → Z'),
  31865. value: 'title/asc'
  31866. }, {
  31867. /* translators: label for ordering posts by title in descending order */
  31868. label: Object(external_wp_i18n_["__"])('Z → A'),
  31869. value: 'title/desc'
  31870. }],
  31871. onChange: value => {
  31872. const [newOrderBy, newOrder] = value.split('/');
  31873. if (newOrder !== order) {
  31874. onOrderChange(newOrder);
  31875. }
  31876. if (newOrderBy !== orderBy) {
  31877. onOrderByChange(newOrderBy);
  31878. }
  31879. }
  31880. }), categoriesList && onCategoryChange && Object(external_wp_element_["createElement"])(CategorySelect, {
  31881. key: "query-controls-category-select",
  31882. categoriesList: categoriesList,
  31883. label: Object(external_wp_i18n_["__"])('Category'),
  31884. noOptionLabel: Object(external_wp_i18n_["__"])('All'),
  31885. selectedCategoryId: selectedCategoryId,
  31886. onChange: onCategoryChange
  31887. }), categorySuggestions && onCategoryChange && Object(external_wp_element_["createElement"])(form_token_field, {
  31888. key: "query-controls-categories-select",
  31889. label: Object(external_wp_i18n_["__"])('Categories'),
  31890. value: selectedCategories && selectedCategories.map(item => ({
  31891. id: item.id,
  31892. value: item.name || item.value
  31893. })),
  31894. suggestions: Object.keys(categorySuggestions),
  31895. onChange: onCategoryChange,
  31896. maxSuggestions: MAX_CATEGORIES_SUGGESTIONS
  31897. }), onAuthorChange && Object(external_wp_element_["createElement"])(AuthorSelect, {
  31898. key: "query-controls-author-select",
  31899. authorList: authorList,
  31900. label: Object(external_wp_i18n_["__"])('Author'),
  31901. noOptionLabel: Object(external_wp_i18n_["__"])('All'),
  31902. selectedAuthorId: selectedAuthorId,
  31903. onChange: onAuthorChange
  31904. }), onNumberOfItemsChange && Object(external_wp_element_["createElement"])(range_control, {
  31905. key: "query-controls-range-control",
  31906. label: Object(external_wp_i18n_["__"])('Number of items'),
  31907. value: numberOfItems,
  31908. onChange: onNumberOfItemsChange,
  31909. min: minItems,
  31910. max: maxItems,
  31911. required: true
  31912. })];
  31913. }
  31914. // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js
  31915. var warning = __webpack_require__("WnOg");
  31916. // CONCATENATED MODULE: ./node_modules/reakit/es/__keys-d251e56b.js
  31917. // Automatically generated
  31918. var RADIO_STATE_KEYS = ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "state", "setBaseId", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "setState"];
  31919. var RADIO_KEYS = [].concat(RADIO_STATE_KEYS, ["value", "checked", "unstable_checkOnFocus"]);
  31920. var RADIO_GROUP_KEYS = RADIO_STATE_KEYS;
  31921. // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/Radio.js
  31922. function getChecked(options) {
  31923. if (typeof options.checked !== "undefined") {
  31924. return options.checked;
  31925. }
  31926. return typeof options.value !== "undefined" && options.state === options.value;
  31927. }
  31928. function useInitialChecked(options) {
  31929. var _React$useState = Object(external_React_["useState"])(function () {
  31930. return getChecked(options);
  31931. }),
  31932. initialChecked = _React$useState[0];
  31933. var _React$useState2 = Object(external_React_["useState"])(options.currentId),
  31934. initialCurrentId = _React$useState2[0];
  31935. var id = options.id,
  31936. setCurrentId = options.setCurrentId;
  31937. Object(external_React_["useEffect"])(function () {
  31938. if (initialChecked && id && initialCurrentId !== id) {
  31939. setCurrentId === null || setCurrentId === void 0 ? void 0 : setCurrentId(id);
  31940. }
  31941. }, [initialChecked, id, setCurrentId, initialCurrentId]);
  31942. }
  31943. function fireChange(element, onChange) {
  31944. var event = Object(createEvent["a" /* createEvent */])(element, "change");
  31945. Object.defineProperties(event, {
  31946. type: {
  31947. value: "change"
  31948. },
  31949. target: {
  31950. value: element
  31951. },
  31952. currentTarget: {
  31953. value: element
  31954. }
  31955. });
  31956. onChange === null || onChange === void 0 ? void 0 : onChange(event);
  31957. }
  31958. var useRadio = Object(createHook["a" /* createHook */])({
  31959. name: "Radio",
  31960. compose: CompositeItem["b" /* useCompositeItem */],
  31961. keys: RADIO_KEYS,
  31962. useOptions: function useOptions(_ref, _ref2) {
  31963. var _options$value;
  31964. var value = _ref2.value,
  31965. checked = _ref2.checked;
  31966. var _ref$unstable_clickOn = _ref.unstable_clickOnEnter,
  31967. unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? false : _ref$unstable_clickOn,
  31968. _ref$unstable_checkOn = _ref.unstable_checkOnFocus,
  31969. unstable_checkOnFocus = _ref$unstable_checkOn === void 0 ? true : _ref$unstable_checkOn,
  31970. options = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["unstable_clickOnEnter", "unstable_checkOnFocus"]);
  31971. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  31972. checked: checked,
  31973. unstable_clickOnEnter: unstable_clickOnEnter,
  31974. unstable_checkOnFocus: unstable_checkOnFocus
  31975. }, options), {}, {
  31976. value: (_options$value = options.value) != null ? _options$value : value
  31977. });
  31978. },
  31979. useProps: function useProps(options, _ref3) {
  31980. var htmlRef = _ref3.ref,
  31981. htmlOnChange = _ref3.onChange,
  31982. htmlOnClick = _ref3.onClick,
  31983. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref3, ["ref", "onChange", "onClick"]);
  31984. var ref = Object(external_React_["useRef"])(null);
  31985. var _React$useState3 = Object(external_React_["useState"])(true),
  31986. isNativeRadio = _React$useState3[0],
  31987. setIsNativeRadio = _React$useState3[1];
  31988. var checked = getChecked(options);
  31989. var isCurrentItemRef = Object(useLiveRef["a" /* useLiveRef */])(options.currentId === options.id);
  31990. var onChangeRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnChange);
  31991. var onClickRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnClick);
  31992. useInitialChecked(options);
  31993. Object(external_React_["useEffect"])(function () {
  31994. var element = ref.current;
  31995. if (!element) {
  31996. false ? undefined : void 0;
  31997. return;
  31998. }
  31999. if (element.tagName !== "INPUT" || element.type !== "radio") {
  32000. setIsNativeRadio(false);
  32001. }
  32002. }, []);
  32003. var onChange = Object(external_React_["useCallback"])(function (event) {
  32004. var _onChangeRef$current, _options$setState;
  32005. (_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 ? void 0 : _onChangeRef$current.call(onChangeRef, event);
  32006. if (event.defaultPrevented) return;
  32007. if (options.disabled) return;
  32008. (_options$setState = options.setState) === null || _options$setState === void 0 ? void 0 : _options$setState.call(options, options.value);
  32009. }, [options.disabled, options.setState, options.value]);
  32010. var onClick = Object(external_React_["useCallback"])(function (event) {
  32011. var _onClickRef$current;
  32012. (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
  32013. if (event.defaultPrevented) return;
  32014. if (isNativeRadio) return;
  32015. fireChange(event.currentTarget, onChange);
  32016. }, [onChange, isNativeRadio]);
  32017. Object(external_React_["useEffect"])(function () {
  32018. var element = ref.current;
  32019. if (!element) return;
  32020. if (options.unstable_moves && isCurrentItemRef.current && options.unstable_checkOnFocus) {
  32021. fireChange(element, onChange);
  32022. }
  32023. }, [options.unstable_moves, options.unstable_checkOnFocus, onChange]);
  32024. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  32025. ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef),
  32026. role: !isNativeRadio ? "radio" : undefined,
  32027. type: isNativeRadio ? "radio" : undefined,
  32028. value: isNativeRadio ? options.value : undefined,
  32029. name: isNativeRadio ? options.baseId : undefined,
  32030. "aria-checked": checked,
  32031. checked: checked,
  32032. onChange: onChange,
  32033. onClick: onClick
  32034. }, htmlProps);
  32035. }
  32036. });
  32037. var Radio = Object(createComponent["a" /* createComponent */])({
  32038. as: "input",
  32039. memo: true,
  32040. useHook: useRadio
  32041. });
  32042. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-context/index.js
  32043. /**
  32044. * WordPress dependencies
  32045. */
  32046. const RadioContext = Object(external_wp_element_["createContext"])({
  32047. state: null,
  32048. setState: () => {}
  32049. });
  32050. /* harmony default export */ var radio_context = (RadioContext);
  32051. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio/index.js
  32052. /**
  32053. * External dependencies
  32054. */
  32055. /**
  32056. * WordPress dependencies
  32057. */
  32058. /**
  32059. * Internal dependencies
  32060. */
  32061. function radio_Radio({
  32062. children,
  32063. value,
  32064. ...props
  32065. }, ref) {
  32066. const radioContext = Object(external_wp_element_["useContext"])(radio_context);
  32067. const checked = radioContext.state === value;
  32068. return Object(external_wp_element_["createElement"])(Radio, Object(esm_extends["a" /* default */])({
  32069. ref: ref,
  32070. as: build_module_button["a" /* default */],
  32071. isPrimary: checked,
  32072. isSecondary: !checked,
  32073. value: value
  32074. }, radioContext, props), children || value);
  32075. }
  32076. /* harmony default export */ var build_module_radio = (Object(external_wp_element_["forwardRef"])(radio_Radio));
  32077. // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioState.js
  32078. function useRadioState(initialState) {
  32079. if (initialState === void 0) {
  32080. initialState = {};
  32081. }
  32082. var _useSealedState = useSealedState(initialState),
  32083. initialValue = _useSealedState.state,
  32084. _useSealedState$loop = _useSealedState.loop,
  32085. loop = _useSealedState$loop === void 0 ? true : _useSealedState$loop,
  32086. sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["state", "loop"]);
  32087. var _React$useState = Object(external_React_["useState"])(initialValue),
  32088. state = _React$useState[0],
  32089. setState = _React$useState[1];
  32090. var composite = useCompositeState(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, sealed), {}, {
  32091. loop: loop
  32092. }));
  32093. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, composite), {}, {
  32094. state: state,
  32095. setState: setState
  32096. });
  32097. }
  32098. // CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioGroup.js
  32099. var useRadioGroup = Object(createHook["a" /* createHook */])({
  32100. name: "RadioGroup",
  32101. compose: useComposite,
  32102. keys: RADIO_GROUP_KEYS,
  32103. useProps: function useProps(_, htmlProps) {
  32104. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  32105. role: "radiogroup"
  32106. }, htmlProps);
  32107. }
  32108. });
  32109. var RadioGroup = Object(createComponent["a" /* createComponent */])({
  32110. as: "div",
  32111. useHook: useRadioGroup,
  32112. useCreateElement: function useCreateElement$1(type, props, children) {
  32113. false ? undefined : void 0;
  32114. return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
  32115. }
  32116. });
  32117. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/index.js
  32118. /**
  32119. * External dependencies
  32120. */
  32121. /**
  32122. * WordPress dependencies
  32123. */
  32124. /**
  32125. * Internal dependencies
  32126. */
  32127. function radio_group_RadioGroup({
  32128. label,
  32129. checked,
  32130. defaultChecked,
  32131. disabled,
  32132. onChange,
  32133. ...props
  32134. }, ref) {
  32135. const radioState = useRadioState({
  32136. state: defaultChecked,
  32137. baseId: props.id
  32138. });
  32139. const radioContext = { ...radioState,
  32140. disabled,
  32141. // controlled or uncontrolled
  32142. state: checked !== null && checked !== void 0 ? checked : radioState.state,
  32143. setState: onChange !== null && onChange !== void 0 ? onChange : radioState.setState
  32144. };
  32145. return Object(external_wp_element_["createElement"])(radio_context.Provider, {
  32146. value: radioContext
  32147. }, Object(external_wp_element_["createElement"])(RadioGroup, Object(esm_extends["a" /* default */])({
  32148. ref: ref,
  32149. as: button_group,
  32150. "aria-label": label
  32151. }, radioState, props)));
  32152. }
  32153. /* harmony default export */ var radio_group = (Object(external_wp_element_["forwardRef"])(radio_group_RadioGroup));
  32154. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-control/index.js
  32155. /**
  32156. * External dependencies
  32157. */
  32158. /**
  32159. * WordPress dependencies
  32160. */
  32161. /**
  32162. * Internal dependencies
  32163. */
  32164. function RadioControl({
  32165. label,
  32166. className,
  32167. selected,
  32168. help,
  32169. onChange,
  32170. options = [],
  32171. ...props
  32172. }) {
  32173. const instanceId = Object(external_wp_compose_["useInstanceId"])(RadioControl);
  32174. const id = `inspector-radio-control-${instanceId}`;
  32175. const onChangeValue = event => onChange(event.target.value);
  32176. return !Object(external_lodash_["isEmpty"])(options) && Object(external_wp_element_["createElement"])(base_control, {
  32177. label: label,
  32178. id: id,
  32179. help: help,
  32180. className: classnames_default()(className, 'components-radio-control')
  32181. }, options.map((option, index) => Object(external_wp_element_["createElement"])("div", {
  32182. key: `${id}-${index}`,
  32183. className: "components-radio-control__option"
  32184. }, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
  32185. id: `${id}-${index}`,
  32186. className: "components-radio-control__input",
  32187. type: "radio",
  32188. name: id,
  32189. value: option.value,
  32190. onChange: onChangeValue,
  32191. checked: option.value === selected,
  32192. "aria-describedby": !!help ? `${id}__help` : undefined
  32193. }, props)), Object(external_wp_element_["createElement"])("label", {
  32194. htmlFor: `${id}-${index}`
  32195. }, option.label))));
  32196. }
  32197. // CONCATENATED MODULE: ./node_modules/re-resizable/lib/resizer.js
  32198. var resizer_extends = (undefined && undefined.__extends) || (function () {
  32199. var extendStatics = function (d, b) {
  32200. extendStatics = Object.setPrototypeOf ||
  32201. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32202. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32203. return extendStatics(d, b);
  32204. };
  32205. return function (d, b) {
  32206. extendStatics(d, b);
  32207. function __() { this.constructor = d; }
  32208. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32209. };
  32210. })();
  32211. var resizer_assign = (undefined && undefined.__assign) || function () {
  32212. resizer_assign = Object.assign || function(t) {
  32213. for (var s, i = 1, n = arguments.length; i < n; i++) {
  32214. s = arguments[i];
  32215. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  32216. t[p] = s[p];
  32217. }
  32218. return t;
  32219. };
  32220. return resizer_assign.apply(this, arguments);
  32221. };
  32222. var resizer_styles = {
  32223. top: {
  32224. width: '100%',
  32225. height: '10px',
  32226. top: '-5px',
  32227. left: '0px',
  32228. cursor: 'row-resize',
  32229. },
  32230. right: {
  32231. width: '10px',
  32232. height: '100%',
  32233. top: '0px',
  32234. right: '-5px',
  32235. cursor: 'col-resize',
  32236. },
  32237. bottom: {
  32238. width: '100%',
  32239. height: '10px',
  32240. bottom: '-5px',
  32241. left: '0px',
  32242. cursor: 'row-resize',
  32243. },
  32244. left: {
  32245. width: '10px',
  32246. height: '100%',
  32247. top: '0px',
  32248. left: '-5px',
  32249. cursor: 'col-resize',
  32250. },
  32251. topRight: {
  32252. width: '20px',
  32253. height: '20px',
  32254. position: 'absolute',
  32255. right: '-10px',
  32256. top: '-10px',
  32257. cursor: 'ne-resize',
  32258. },
  32259. bottomRight: {
  32260. width: '20px',
  32261. height: '20px',
  32262. position: 'absolute',
  32263. right: '-10px',
  32264. bottom: '-10px',
  32265. cursor: 'se-resize',
  32266. },
  32267. bottomLeft: {
  32268. width: '20px',
  32269. height: '20px',
  32270. position: 'absolute',
  32271. left: '-10px',
  32272. bottom: '-10px',
  32273. cursor: 'sw-resize',
  32274. },
  32275. topLeft: {
  32276. width: '20px',
  32277. height: '20px',
  32278. position: 'absolute',
  32279. left: '-10px',
  32280. top: '-10px',
  32281. cursor: 'nw-resize',
  32282. },
  32283. };
  32284. var resizer_Resizer = /** @class */ (function (_super) {
  32285. resizer_extends(Resizer, _super);
  32286. function Resizer() {
  32287. var _this = _super !== null && _super.apply(this, arguments) || this;
  32288. _this.onMouseDown = function (e) {
  32289. _this.props.onResizeStart(e, _this.props.direction);
  32290. };
  32291. _this.onTouchStart = function (e) {
  32292. _this.props.onResizeStart(e, _this.props.direction);
  32293. };
  32294. return _this;
  32295. }
  32296. Resizer.prototype.render = function () {
  32297. return (external_React_["createElement"]("div", { className: this.props.className || '', style: resizer_assign(resizer_assign({ position: 'absolute', userSelect: 'none' }, resizer_styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
  32298. };
  32299. return Resizer;
  32300. }(external_React_["PureComponent"]));
  32301. // EXTERNAL MODULE: ./node_modules/fast-memoize/src/index.js
  32302. var fast_memoize_src = __webpack_require__("75pU");
  32303. var src_default = /*#__PURE__*/__webpack_require__.n(fast_memoize_src);
  32304. // CONCATENATED MODULE: ./node_modules/re-resizable/lib/index.js
  32305. var lib_extends = (undefined && undefined.__extends) || (function () {
  32306. var extendStatics = function (d, b) {
  32307. extendStatics = Object.setPrototypeOf ||
  32308. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32309. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32310. return extendStatics(d, b);
  32311. };
  32312. return function (d, b) {
  32313. extendStatics(d, b);
  32314. function __() { this.constructor = d; }
  32315. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32316. };
  32317. })();
  32318. var lib_assign = (undefined && undefined.__assign) || function () {
  32319. lib_assign = Object.assign || function(t) {
  32320. for (var s, i = 1, n = arguments.length; i < n; i++) {
  32321. s = arguments[i];
  32322. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  32323. t[p] = s[p];
  32324. }
  32325. return t;
  32326. };
  32327. return lib_assign.apply(this, arguments);
  32328. };
  32329. var DEFAULT_SIZE = {
  32330. width: 'auto',
  32331. height: 'auto',
  32332. };
  32333. var clamp = src_default()(function (n, min, max) { return Math.max(Math.min(n, max), min); });
  32334. var snap = src_default()(function (n, size) { return Math.round(n / size) * size; });
  32335. var hasDirection = src_default()(function (dir, target) {
  32336. return new RegExp(dir, 'i').test(target);
  32337. });
  32338. // INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
  32339. var isTouchEvent = function (event) {
  32340. return Boolean(event.touches && event.touches.length);
  32341. };
  32342. var isMouseEvent = function (event) {
  32343. return Boolean((event.clientX || event.clientX === 0) &&
  32344. (event.clientY || event.clientY === 0));
  32345. };
  32346. var findClosestSnap = src_default()(function (n, snapArray, snapGap) {
  32347. if (snapGap === void 0) { snapGap = 0; }
  32348. var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
  32349. var gap = Math.abs(snapArray[closestGapIndex] - n);
  32350. return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
  32351. });
  32352. var endsWith = src_default()(function (str, searchStr) {
  32353. return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
  32354. });
  32355. var getStringSize = src_default()(function (n) {
  32356. n = n.toString();
  32357. if (n === 'auto') {
  32358. return n;
  32359. }
  32360. if (endsWith(n, 'px')) {
  32361. return n;
  32362. }
  32363. if (endsWith(n, '%')) {
  32364. return n;
  32365. }
  32366. if (endsWith(n, 'vh')) {
  32367. return n;
  32368. }
  32369. if (endsWith(n, 'vw')) {
  32370. return n;
  32371. }
  32372. if (endsWith(n, 'vmax')) {
  32373. return n;
  32374. }
  32375. if (endsWith(n, 'vmin')) {
  32376. return n;
  32377. }
  32378. return n + "px";
  32379. });
  32380. var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
  32381. if (size && typeof size === 'string') {
  32382. if (endsWith(size, 'px')) {
  32383. return Number(size.replace('px', ''));
  32384. }
  32385. if (endsWith(size, '%')) {
  32386. var ratio = Number(size.replace('%', '')) / 100;
  32387. return parentSize * ratio;
  32388. }
  32389. if (endsWith(size, 'vw')) {
  32390. var ratio = Number(size.replace('vw', '')) / 100;
  32391. return innerWidth * ratio;
  32392. }
  32393. if (endsWith(size, 'vh')) {
  32394. var ratio = Number(size.replace('vh', '')) / 100;
  32395. return innerHeight * ratio;
  32396. }
  32397. }
  32398. return size;
  32399. };
  32400. var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
  32401. maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
  32402. maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
  32403. minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
  32404. minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
  32405. return {
  32406. maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
  32407. maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
  32408. minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
  32409. minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
  32410. };
  32411. });
  32412. var definedProps = [
  32413. 'as',
  32414. 'style',
  32415. 'className',
  32416. 'grid',
  32417. 'snap',
  32418. 'bounds',
  32419. 'boundsByDirection',
  32420. 'size',
  32421. 'defaultSize',
  32422. 'minWidth',
  32423. 'minHeight',
  32424. 'maxWidth',
  32425. 'maxHeight',
  32426. 'lockAspectRatio',
  32427. 'lockAspectRatioExtraWidth',
  32428. 'lockAspectRatioExtraHeight',
  32429. 'enable',
  32430. 'handleStyles',
  32431. 'handleClasses',
  32432. 'handleWrapperStyle',
  32433. 'handleWrapperClass',
  32434. 'children',
  32435. 'onResizeStart',
  32436. 'onResize',
  32437. 'onResizeStop',
  32438. 'handleComponent',
  32439. 'scale',
  32440. 'resizeRatio',
  32441. 'snapGap',
  32442. ];
  32443. // HACK: This class is used to calculate % size.
  32444. var baseClassName = '__resizable_base__';
  32445. var lib_Resizable = /** @class */ (function (_super) {
  32446. lib_extends(Resizable, _super);
  32447. function Resizable(props) {
  32448. var _this = _super.call(this, props) || this;
  32449. _this.ratio = 1;
  32450. _this.resizable = null;
  32451. // For parent boundary
  32452. _this.parentLeft = 0;
  32453. _this.parentTop = 0;
  32454. // For boundary
  32455. _this.resizableLeft = 0;
  32456. _this.resizableRight = 0;
  32457. _this.resizableTop = 0;
  32458. _this.resizableBottom = 0;
  32459. // For target boundary
  32460. _this.targetLeft = 0;
  32461. _this.targetTop = 0;
  32462. _this.appendBase = function () {
  32463. if (!_this.resizable || !_this.window) {
  32464. return null;
  32465. }
  32466. var parent = _this.parentNode;
  32467. if (!parent) {
  32468. return null;
  32469. }
  32470. var element = _this.window.document.createElement('div');
  32471. element.style.width = '100%';
  32472. element.style.height = '100%';
  32473. element.style.position = 'absolute';
  32474. element.style.transform = 'scale(0, 0)';
  32475. element.style.left = '0';
  32476. element.style.flex = '0';
  32477. if (element.classList) {
  32478. element.classList.add(baseClassName);
  32479. }
  32480. else {
  32481. element.className += baseClassName;
  32482. }
  32483. parent.appendChild(element);
  32484. return element;
  32485. };
  32486. _this.removeBase = function (base) {
  32487. var parent = _this.parentNode;
  32488. if (!parent) {
  32489. return;
  32490. }
  32491. parent.removeChild(base);
  32492. };
  32493. _this.ref = function (c) {
  32494. if (c) {
  32495. _this.resizable = c;
  32496. }
  32497. };
  32498. _this.state = {
  32499. isResizing: false,
  32500. width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined'
  32501. ? 'auto'
  32502. : _this.propsSize && _this.propsSize.width,
  32503. height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined'
  32504. ? 'auto'
  32505. : _this.propsSize && _this.propsSize.height,
  32506. direction: 'right',
  32507. original: {
  32508. x: 0,
  32509. y: 0,
  32510. width: 0,
  32511. height: 0,
  32512. },
  32513. backgroundStyle: {
  32514. height: '100%',
  32515. width: '100%',
  32516. backgroundColor: 'rgba(0,0,0,0)',
  32517. cursor: 'auto',
  32518. opacity: 0,
  32519. position: 'fixed',
  32520. zIndex: 9999,
  32521. top: '0',
  32522. left: '0',
  32523. bottom: '0',
  32524. right: '0',
  32525. },
  32526. flexBasis: undefined,
  32527. };
  32528. _this.onResizeStart = _this.onResizeStart.bind(_this);
  32529. _this.onMouseMove = _this.onMouseMove.bind(_this);
  32530. _this.onMouseUp = _this.onMouseUp.bind(_this);
  32531. return _this;
  32532. }
  32533. Object.defineProperty(Resizable.prototype, "parentNode", {
  32534. get: function () {
  32535. if (!this.resizable) {
  32536. return null;
  32537. }
  32538. return this.resizable.parentNode;
  32539. },
  32540. enumerable: false,
  32541. configurable: true
  32542. });
  32543. Object.defineProperty(Resizable.prototype, "window", {
  32544. get: function () {
  32545. if (!this.resizable) {
  32546. return null;
  32547. }
  32548. if (!this.resizable.ownerDocument) {
  32549. return null;
  32550. }
  32551. return this.resizable.ownerDocument.defaultView;
  32552. },
  32553. enumerable: false,
  32554. configurable: true
  32555. });
  32556. Object.defineProperty(Resizable.prototype, "propsSize", {
  32557. get: function () {
  32558. return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
  32559. },
  32560. enumerable: false,
  32561. configurable: true
  32562. });
  32563. Object.defineProperty(Resizable.prototype, "size", {
  32564. get: function () {
  32565. var width = 0;
  32566. var height = 0;
  32567. if (this.resizable && this.window) {
  32568. var orgWidth = this.resizable.offsetWidth;
  32569. var orgHeight = this.resizable.offsetHeight;
  32570. // HACK: Set position `relative` to get parent size.
  32571. // This is because when re-resizable set `absolute`, I can not get base width correctly.
  32572. var orgPosition = this.resizable.style.position;
  32573. if (orgPosition !== 'relative') {
  32574. this.resizable.style.position = 'relative';
  32575. }
  32576. // INFO: Use original width or height if set auto.
  32577. width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
  32578. height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
  32579. // Restore original position
  32580. this.resizable.style.position = orgPosition;
  32581. }
  32582. return { width: width, height: height };
  32583. },
  32584. enumerable: false,
  32585. configurable: true
  32586. });
  32587. Object.defineProperty(Resizable.prototype, "sizeStyle", {
  32588. get: function () {
  32589. var _this = this;
  32590. var size = this.props.size;
  32591. var getSize = function (key) {
  32592. if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
  32593. return 'auto';
  32594. }
  32595. if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {
  32596. if (endsWith(_this.state[key].toString(), '%')) {
  32597. return _this.state[key].toString();
  32598. }
  32599. var parentSize = _this.getParentSize();
  32600. var value = Number(_this.state[key].toString().replace('px', ''));
  32601. var percent = (value / parentSize[key]) * 100;
  32602. return percent + "%";
  32603. }
  32604. return getStringSize(_this.state[key]);
  32605. };
  32606. var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
  32607. ? getStringSize(size.width)
  32608. : getSize('width');
  32609. var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
  32610. ? getStringSize(size.height)
  32611. : getSize('height');
  32612. return { width: width, height: height };
  32613. },
  32614. enumerable: false,
  32615. configurable: true
  32616. });
  32617. Resizable.prototype.getParentSize = function () {
  32618. if (!this.parentNode) {
  32619. if (!this.window) {
  32620. return { width: 0, height: 0 };
  32621. }
  32622. return { width: this.window.innerWidth, height: this.window.innerHeight };
  32623. }
  32624. var base = this.appendBase();
  32625. if (!base) {
  32626. return { width: 0, height: 0 };
  32627. }
  32628. // INFO: To calculate parent width with flex layout
  32629. var wrapChanged = false;
  32630. var wrap = this.parentNode.style.flexWrap;
  32631. if (wrap !== 'wrap') {
  32632. wrapChanged = true;
  32633. this.parentNode.style.flexWrap = 'wrap';
  32634. // HACK: Use relative to get parent padding size
  32635. }
  32636. base.style.position = 'relative';
  32637. base.style.minWidth = '100%';
  32638. var size = {
  32639. width: base.offsetWidth,
  32640. height: base.offsetHeight,
  32641. };
  32642. if (wrapChanged) {
  32643. this.parentNode.style.flexWrap = wrap;
  32644. }
  32645. this.removeBase(base);
  32646. return size;
  32647. };
  32648. Resizable.prototype.bindEvents = function () {
  32649. if (this.window) {
  32650. this.window.addEventListener('mouseup', this.onMouseUp);
  32651. this.window.addEventListener('mousemove', this.onMouseMove);
  32652. this.window.addEventListener('mouseleave', this.onMouseUp);
  32653. this.window.addEventListener('touchmove', this.onMouseMove, {
  32654. capture: true,
  32655. passive: false,
  32656. });
  32657. this.window.addEventListener('touchend', this.onMouseUp);
  32658. }
  32659. };
  32660. Resizable.prototype.unbindEvents = function () {
  32661. if (this.window) {
  32662. this.window.removeEventListener('mouseup', this.onMouseUp);
  32663. this.window.removeEventListener('mousemove', this.onMouseMove);
  32664. this.window.removeEventListener('mouseleave', this.onMouseUp);
  32665. this.window.removeEventListener('touchmove', this.onMouseMove, true);
  32666. this.window.removeEventListener('touchend', this.onMouseUp);
  32667. }
  32668. };
  32669. Resizable.prototype.componentDidMount = function () {
  32670. if (!this.resizable || !this.window) {
  32671. return;
  32672. }
  32673. var computedStyle = this.window.getComputedStyle(this.resizable);
  32674. this.setState({
  32675. width: this.state.width || this.size.width,
  32676. height: this.state.height || this.size.height,
  32677. flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
  32678. });
  32679. };
  32680. Resizable.prototype.componentWillUnmount = function () {
  32681. if (this.window) {
  32682. this.unbindEvents();
  32683. }
  32684. };
  32685. Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
  32686. var propsSize = this.propsSize && this.propsSize[kind];
  32687. return this.state[kind] === 'auto' &&
  32688. this.state.original[kind] === newSize &&
  32689. (typeof propsSize === 'undefined' || propsSize === 'auto')
  32690. ? 'auto'
  32691. : newSize;
  32692. };
  32693. Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
  32694. var boundsByDirection = this.props.boundsByDirection;
  32695. var direction = this.state.direction;
  32696. var widthByDirection = boundsByDirection && hasDirection('left', direction);
  32697. var heightByDirection = boundsByDirection && hasDirection('top', direction);
  32698. var boundWidth;
  32699. var boundHeight;
  32700. if (this.props.bounds === 'parent') {
  32701. var parent_1 = this.parentNode;
  32702. if (parent_1) {
  32703. boundWidth = widthByDirection
  32704. ? this.resizableRight - this.parentLeft
  32705. : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
  32706. boundHeight = heightByDirection
  32707. ? this.resizableBottom - this.parentTop
  32708. : parent_1.offsetHeight + (this.parentTop - this.resizableTop);
  32709. }
  32710. }
  32711. else if (this.props.bounds === 'window') {
  32712. if (this.window) {
  32713. boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
  32714. boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
  32715. }
  32716. }
  32717. else if (this.props.bounds) {
  32718. boundWidth = widthByDirection
  32719. ? this.resizableRight - this.targetLeft
  32720. : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
  32721. boundHeight = heightByDirection
  32722. ? this.resizableBottom - this.targetTop
  32723. : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
  32724. }
  32725. if (boundWidth && Number.isFinite(boundWidth)) {
  32726. maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
  32727. }
  32728. if (boundHeight && Number.isFinite(boundHeight)) {
  32729. maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
  32730. }
  32731. return { maxWidth: maxWidth, maxHeight: maxHeight };
  32732. };
  32733. Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
  32734. var scale = this.props.scale || 1;
  32735. var resizeRatio = this.props.resizeRatio || 1;
  32736. var _a = this.state, direction = _a.direction, original = _a.original;
  32737. var _b = this.props, lockAspectRatio = _b.lockAspectRatio, lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
  32738. var newWidth = original.width;
  32739. var newHeight = original.height;
  32740. var extraHeight = lockAspectRatioExtraHeight || 0;
  32741. var extraWidth = lockAspectRatioExtraWidth || 0;
  32742. if (hasDirection('right', direction)) {
  32743. newWidth = original.width + ((clientX - original.x) * resizeRatio) / scale;
  32744. if (lockAspectRatio) {
  32745. newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
  32746. }
  32747. }
  32748. if (hasDirection('left', direction)) {
  32749. newWidth = original.width - ((clientX - original.x) * resizeRatio) / scale;
  32750. if (lockAspectRatio) {
  32751. newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
  32752. }
  32753. }
  32754. if (hasDirection('bottom', direction)) {
  32755. newHeight = original.height + ((clientY - original.y) * resizeRatio) / scale;
  32756. if (lockAspectRatio) {
  32757. newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
  32758. }
  32759. }
  32760. if (hasDirection('top', direction)) {
  32761. newHeight = original.height - ((clientY - original.y) * resizeRatio) / scale;
  32762. if (lockAspectRatio) {
  32763. newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
  32764. }
  32765. }
  32766. return { newWidth: newWidth, newHeight: newHeight };
  32767. };
  32768. Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
  32769. var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
  32770. var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
  32771. var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
  32772. var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
  32773. var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
  32774. var extraHeight = lockAspectRatioExtraHeight || 0;
  32775. var extraWidth = lockAspectRatioExtraWidth || 0;
  32776. if (lockAspectRatio) {
  32777. var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
  32778. var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
  32779. var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
  32780. var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
  32781. var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
  32782. var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
  32783. var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
  32784. var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
  32785. newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);
  32786. newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);
  32787. }
  32788. else {
  32789. newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);
  32790. newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);
  32791. }
  32792. return { newWidth: newWidth, newHeight: newHeight };
  32793. };
  32794. Resizable.prototype.setBoundingClientRect = function () {
  32795. // For parent boundary
  32796. if (this.props.bounds === 'parent') {
  32797. var parent_2 = this.parentNode;
  32798. if (parent_2) {
  32799. var parentRect = parent_2.getBoundingClientRect();
  32800. this.parentLeft = parentRect.left;
  32801. this.parentTop = parentRect.top;
  32802. }
  32803. }
  32804. // For target(html element) boundary
  32805. if (this.props.bounds && typeof this.props.bounds !== 'string') {
  32806. var targetRect = this.props.bounds.getBoundingClientRect();
  32807. this.targetLeft = targetRect.left;
  32808. this.targetTop = targetRect.top;
  32809. }
  32810. // For boundary
  32811. if (this.resizable) {
  32812. var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;
  32813. this.resizableLeft = left;
  32814. this.resizableRight = right;
  32815. this.resizableTop = top_1;
  32816. this.resizableBottom = bottom;
  32817. }
  32818. };
  32819. Resizable.prototype.onResizeStart = function (event, direction) {
  32820. if (!this.resizable || !this.window) {
  32821. return;
  32822. }
  32823. var clientX = 0;
  32824. var clientY = 0;
  32825. if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
  32826. clientX = event.nativeEvent.clientX;
  32827. clientY = event.nativeEvent.clientY;
  32828. // When user click with right button the resize is stuck in resizing mode
  32829. // until users clicks again, dont continue if right click is used.
  32830. // HACK: MouseEvent does not have `which` from flow-bin v0.68.
  32831. if (event.nativeEvent.which === 3) {
  32832. return;
  32833. }
  32834. }
  32835. else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
  32836. clientX = event.nativeEvent.touches[0].clientX;
  32837. clientY = event.nativeEvent.touches[0].clientY;
  32838. }
  32839. if (this.props.onResizeStart) {
  32840. if (this.resizable) {
  32841. var startResize = this.props.onResizeStart(event, direction, this.resizable);
  32842. if (startResize === false) {
  32843. return;
  32844. }
  32845. }
  32846. }
  32847. // Fix #168
  32848. if (this.props.size) {
  32849. if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
  32850. this.setState({ height: this.props.size.height });
  32851. }
  32852. if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
  32853. this.setState({ width: this.props.size.width });
  32854. }
  32855. }
  32856. // For lockAspectRatio case
  32857. this.ratio =
  32858. typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
  32859. var flexBasis;
  32860. var computedStyle = this.window.getComputedStyle(this.resizable);
  32861. if (computedStyle.flexBasis !== 'auto') {
  32862. var parent_3 = this.parentNode;
  32863. if (parent_3) {
  32864. var dir = this.window.getComputedStyle(parent_3).flexDirection;
  32865. this.flexDir = dir.startsWith('row') ? 'row' : 'column';
  32866. flexBasis = computedStyle.flexBasis;
  32867. }
  32868. }
  32869. // For boundary
  32870. this.setBoundingClientRect();
  32871. this.bindEvents();
  32872. var state = {
  32873. original: {
  32874. x: clientX,
  32875. y: clientY,
  32876. width: this.size.width,
  32877. height: this.size.height,
  32878. },
  32879. isResizing: true,
  32880. backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
  32881. direction: direction,
  32882. flexBasis: flexBasis,
  32883. };
  32884. this.setState(state);
  32885. };
  32886. Resizable.prototype.onMouseMove = function (event) {
  32887. if (!this.state.isResizing || !this.resizable || !this.window) {
  32888. return;
  32889. }
  32890. if (this.window.TouchEvent && isTouchEvent(event)) {
  32891. try {
  32892. event.preventDefault();
  32893. event.stopPropagation();
  32894. }
  32895. catch (e) {
  32896. // Ignore on fail
  32897. }
  32898. }
  32899. var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
  32900. var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
  32901. var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
  32902. var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
  32903. var parentSize = this.getParentSize();
  32904. var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
  32905. maxWidth = max.maxWidth;
  32906. maxHeight = max.maxHeight;
  32907. minWidth = max.minWidth;
  32908. minHeight = max.minHeight;
  32909. // Calculate new size
  32910. var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
  32911. // Calculate max size from boundary settings
  32912. var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
  32913. // Calculate new size from aspect ratio
  32914. var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
  32915. newWidth = newSize.newWidth;
  32916. newHeight = newSize.newHeight;
  32917. if (this.props.grid) {
  32918. var newGridWidth = snap(newWidth, this.props.grid[0]);
  32919. var newGridHeight = snap(newHeight, this.props.grid[1]);
  32920. var gap = this.props.snapGap || 0;
  32921. newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
  32922. newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
  32923. }
  32924. if (this.props.snap && this.props.snap.x) {
  32925. newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
  32926. }
  32927. if (this.props.snap && this.props.snap.y) {
  32928. newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
  32929. }
  32930. var delta = {
  32931. width: newWidth - original.width,
  32932. height: newHeight - original.height,
  32933. };
  32934. if (width && typeof width === 'string') {
  32935. if (endsWith(width, '%')) {
  32936. var percent = (newWidth / parentSize.width) * 100;
  32937. newWidth = percent + "%";
  32938. }
  32939. else if (endsWith(width, 'vw')) {
  32940. var vw = (newWidth / this.window.innerWidth) * 100;
  32941. newWidth = vw + "vw";
  32942. }
  32943. else if (endsWith(width, 'vh')) {
  32944. var vh = (newWidth / this.window.innerHeight) * 100;
  32945. newWidth = vh + "vh";
  32946. }
  32947. }
  32948. if (height && typeof height === 'string') {
  32949. if (endsWith(height, '%')) {
  32950. var percent = (newHeight / parentSize.height) * 100;
  32951. newHeight = percent + "%";
  32952. }
  32953. else if (endsWith(height, 'vw')) {
  32954. var vw = (newHeight / this.window.innerWidth) * 100;
  32955. newHeight = vw + "vw";
  32956. }
  32957. else if (endsWith(height, 'vh')) {
  32958. var vh = (newHeight / this.window.innerHeight) * 100;
  32959. newHeight = vh + "vh";
  32960. }
  32961. }
  32962. var newState = {
  32963. width: this.createSizeForCssProperty(newWidth, 'width'),
  32964. height: this.createSizeForCssProperty(newHeight, 'height'),
  32965. };
  32966. if (this.flexDir === 'row') {
  32967. newState.flexBasis = newState.width;
  32968. }
  32969. else if (this.flexDir === 'column') {
  32970. newState.flexBasis = newState.height;
  32971. }
  32972. this.setState(newState);
  32973. if (this.props.onResize) {
  32974. this.props.onResize(event, direction, this.resizable, delta);
  32975. }
  32976. };
  32977. Resizable.prototype.onMouseUp = function (event) {
  32978. var _a = this.state, isResizing = _a.isResizing, direction = _a.direction, original = _a.original;
  32979. if (!isResizing || !this.resizable) {
  32980. return;
  32981. }
  32982. var delta = {
  32983. width: this.size.width - original.width,
  32984. height: this.size.height - original.height,
  32985. };
  32986. if (this.props.onResizeStop) {
  32987. this.props.onResizeStop(event, direction, this.resizable, delta);
  32988. }
  32989. if (this.props.size) {
  32990. this.setState(this.props.size);
  32991. }
  32992. this.unbindEvents();
  32993. this.setState({
  32994. isResizing: false,
  32995. backgroundStyle: lib_assign(lib_assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
  32996. });
  32997. };
  32998. Resizable.prototype.updateSize = function (size) {
  32999. this.setState({ width: size.width, height: size.height });
  33000. };
  33001. Resizable.prototype.renderResizer = function () {
  33002. var _this = this;
  33003. var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
  33004. if (!enable) {
  33005. return null;
  33006. }
  33007. var resizers = Object.keys(enable).map(function (dir) {
  33008. if (enable[dir] !== false) {
  33009. return (external_React_["createElement"](resizer_Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
  33010. }
  33011. return null;
  33012. });
  33013. // #93 Wrap the resize box in span (will not break 100% width/height)
  33014. return (external_React_["createElement"]("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
  33015. };
  33016. Resizable.prototype.render = function () {
  33017. var _this = this;
  33018. var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
  33019. if (definedProps.indexOf(key) !== -1) {
  33020. return acc;
  33021. }
  33022. acc[key] = _this.props[key];
  33023. return acc;
  33024. }, {});
  33025. var style = lib_assign(lib_assign(lib_assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
  33026. if (this.state.flexBasis) {
  33027. style.flexBasis = this.state.flexBasis;
  33028. }
  33029. var Wrapper = this.props.as || 'div';
  33030. return (external_React_["createElement"](Wrapper, lib_assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
  33031. this.state.isResizing && external_React_["createElement"]("div", { style: this.state.backgroundStyle }),
  33032. this.props.children,
  33033. this.renderResizer()));
  33034. };
  33035. Resizable.defaultProps = {
  33036. as: 'div',
  33037. onResizeStart: function () { },
  33038. onResize: function () { },
  33039. onResizeStop: function () { },
  33040. enable: {
  33041. top: true,
  33042. right: true,
  33043. bottom: true,
  33044. left: true,
  33045. topRight: true,
  33046. bottomRight: true,
  33047. bottomLeft: true,
  33048. topLeft: true,
  33049. },
  33050. style: {},
  33051. grid: [1, 1],
  33052. lockAspectRatio: false,
  33053. lockAspectRatioExtraWidth: 0,
  33054. lockAspectRatioExtraHeight: 0,
  33055. scale: 1,
  33056. resizeRatio: 1,
  33057. snapGap: 0,
  33058. };
  33059. return Resizable;
  33060. }(external_React_["PureComponent"]));
  33061. // EXTERNAL MODULE: ./node_modules/react-resize-aware/dist/index.js
  33062. var react_resize_aware_dist = __webpack_require__("SSiF");
  33063. var react_resize_aware_dist_default = /*#__PURE__*/__webpack_require__.n(react_resize_aware_dist);
  33064. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/utils.js
  33065. /**
  33066. * External dependencies
  33067. */
  33068. /**
  33069. * WordPress dependencies
  33070. */
  33071. const {
  33072. clearTimeout: utils_clearTimeout,
  33073. setTimeout: utils_setTimeout
  33074. } = typeof window !== 'undefined' ? window : {};
  33075. const POSITIONS = {
  33076. bottom: 'bottom',
  33077. corner: 'corner'
  33078. };
  33079. /**
  33080. * @typedef {Object} UseResizeLabelProps
  33081. *
  33082. * @property {undefined|string} label The label value.
  33083. * @property {Function} resizeListener Element to be rendered for resize listening events.
  33084. */
  33085. /**
  33086. * Custom hook that manages resize listener events. It also provides a label
  33087. * based on current resize width x height values.
  33088. *
  33089. * @param {Object} props
  33090. * @param {string} props.axis Only shows the label corresponding to the axis.
  33091. * @param {number} props.fadeTimeout Duration (ms) before deactivating the resize label.
  33092. * @param {boolean} props.onResize Callback when a resize occurs. Provides { width, height } callback.
  33093. * @param {string} props.position Adjusts label value.
  33094. * @param {boolean} props.showPx Whether to add `PX` to the label.
  33095. *
  33096. * @return {UseResizeLabelProps} Properties for hook.
  33097. */
  33098. function useResizeLabel({
  33099. axis,
  33100. fadeTimeout = 180,
  33101. onResize = external_lodash_["noop"],
  33102. position = POSITIONS.bottom,
  33103. showPx = false
  33104. }) {
  33105. /*
  33106. * The width/height values derive from this special useResizeAware hook.
  33107. * This custom hook uses injects an iFrame into the element, allowing it
  33108. * to tap into the onResize (window) callback events.
  33109. */
  33110. const [resizeListener, sizes] = react_resize_aware_dist_default()();
  33111. /*
  33112. * Indicates if the x/y axis is preferred.
  33113. * If set, we will avoid resetting the moveX and moveY values.
  33114. * This will allow for the preferred axis values to persist in the label.
  33115. */
  33116. const isAxisControlled = !!axis;
  33117. /*
  33118. * The moveX and moveY values are used to track whether the label should
  33119. * display width, height, or width x height.
  33120. */
  33121. const [moveX, setMoveX] = Object(external_wp_element_["useState"])(false);
  33122. const [moveY, setMoveY] = Object(external_wp_element_["useState"])(false);
  33123. /*
  33124. * Cached dimension values to check for width/height updates from the
  33125. * sizes property from useResizeAware()
  33126. */
  33127. const {
  33128. width,
  33129. height
  33130. } = sizes;
  33131. const heightRef = Object(external_wp_element_["useRef"])(height);
  33132. const widthRef = Object(external_wp_element_["useRef"])(width);
  33133. /*
  33134. * This timeout is used with setMoveX and setMoveY to determine of
  33135. * both width and height values have changed at (roughly) the same time.
  33136. */
  33137. const moveTimeoutRef = Object(external_wp_element_["useRef"])();
  33138. const unsetMoveXY = () => {
  33139. /*
  33140. * If axis is controlled, we will avoid resetting the moveX and moveY values.
  33141. * This will allow for the preferred axis values to persist in the label.
  33142. */
  33143. if (isAxisControlled) return;
  33144. setMoveX(false);
  33145. setMoveY(false);
  33146. };
  33147. const debounceUnsetMoveXY = () => {
  33148. if (moveTimeoutRef.current) {
  33149. utils_clearTimeout(moveTimeoutRef.current);
  33150. }
  33151. moveTimeoutRef.current = utils_setTimeout(unsetMoveXY, fadeTimeout);
  33152. };
  33153. Object(external_wp_element_["useEffect"])(() => {
  33154. /*
  33155. * On the initial render of useResizeAware, the height and width values are
  33156. * null. They are calculated then set using via an internal useEffect hook.
  33157. */
  33158. const isRendered = width !== null || height !== null;
  33159. if (!isRendered) return;
  33160. const didWidthChange = width !== widthRef.current;
  33161. const didHeightChange = height !== heightRef.current;
  33162. if (!didWidthChange && !didHeightChange) return;
  33163. /*
  33164. * After the initial render, the useResizeAware will set the first
  33165. * width and height values. We'll sync those values with our
  33166. * width and height refs. However, we shouldn't render our Tooltip
  33167. * label on this first cycle.
  33168. */
  33169. if (width && !widthRef.current && height && !heightRef.current) {
  33170. widthRef.current = width;
  33171. heightRef.current = height;
  33172. return;
  33173. }
  33174. /*
  33175. * After the first cycle, we can track width and height changes.
  33176. */
  33177. if (didWidthChange) {
  33178. setMoveX(true);
  33179. widthRef.current = width;
  33180. }
  33181. if (didHeightChange) {
  33182. setMoveY(true);
  33183. heightRef.current = height;
  33184. }
  33185. onResize({
  33186. width,
  33187. height
  33188. });
  33189. debounceUnsetMoveXY();
  33190. }, [width, height]);
  33191. const label = getSizeLabel({
  33192. axis,
  33193. height,
  33194. moveX,
  33195. moveY,
  33196. position,
  33197. showPx,
  33198. width
  33199. });
  33200. return {
  33201. label,
  33202. resizeListener
  33203. };
  33204. }
  33205. /**
  33206. * Gets the resize label based on width and height values (as well as recent changes).
  33207. *
  33208. * @param {Object} props
  33209. * @param {string} props.axis Only shows the label corresponding to the axis.
  33210. * @param {number} props.height Height value.
  33211. * @param {boolean} props.moveX Recent width (x axis) changes.
  33212. * @param {boolean} props.moveY Recent width (y axis) changes.
  33213. * @param {string} props.position Adjusts label value.
  33214. * @param {boolean} props.showPx Whether to add `PX` to the label.
  33215. * @param {number} props.width Width value.
  33216. *
  33217. * @return {undefined | string} The rendered label.
  33218. */
  33219. function getSizeLabel({
  33220. axis,
  33221. height,
  33222. moveX = false,
  33223. moveY = false,
  33224. position = POSITIONS.bottom,
  33225. showPx = false,
  33226. width
  33227. }) {
  33228. if (!moveX && !moveY) return null;
  33229. /*
  33230. * Corner position...
  33231. * We want the label to appear like width x height.
  33232. */
  33233. if (position === POSITIONS.corner) {
  33234. return `${width} x ${height}`;
  33235. }
  33236. /*
  33237. * Other POSITIONS...
  33238. * The label will combine both width x height values if both
  33239. * values have recently been changed.
  33240. *
  33241. * Otherwise, only width or height will be displayed.
  33242. * The `PX` unit will be added, if specified by the `showPx` prop.
  33243. */
  33244. const labelUnit = showPx ? ' px' : '';
  33245. if (axis) {
  33246. if (axis === 'x' && moveX) {
  33247. return `${width}${labelUnit}`;
  33248. }
  33249. if (axis === 'y' && moveY) {
  33250. return `${height}${labelUnit}`;
  33251. }
  33252. }
  33253. if (moveX && moveY) {
  33254. return `${width} x ${height}`;
  33255. }
  33256. if (moveX) {
  33257. return `${width}${labelUnit}`;
  33258. }
  33259. if (moveY) {
  33260. return `${height}${labelUnit}`;
  33261. }
  33262. return null;
  33263. }
  33264. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js
  33265. function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
  33266. /**
  33267. * Internal dependencies
  33268. */
  33269. const resize_tooltip_styles_Root = styled_base_browser_esm("div", {
  33270. target: "ekdag500",
  33271. label: "Root"
  33272. })( true ? {
  33273. name: "mt2ez5",
  33274. styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0;"
  33275. } : undefined);
  33276. const TooltipWrapper = styled_base_browser_esm("div", {
  33277. target: "ekdag501",
  33278. label: "TooltipWrapper"
  33279. })( true ? {
  33280. name: "1kllayo",
  33281. styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear;"
  33282. } : undefined);
  33283. const resize_tooltip_styles_Tooltip = styled_base_browser_esm("div", {
  33284. target: "ekdag502",
  33285. label: "Tooltip"
  33286. })("background:", COLORS.ui.border, ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + ( true ? "" : undefined)); // TODO: Resolve need to use &&& to increase specificity
  33287. // https://github.com/WordPress/gutenberg/issues/18483
  33288. const LabelText = /*#__PURE__*/styled_base_browser_esm(text_component, {
  33289. target: "ekdag503",
  33290. label: "LabelText"
  33291. })( true ? {
  33292. name: "1kboj1g",
  33293. styles: "&&&{color:white;display:block;font-size:13px;line-height:1.4;}"
  33294. } : undefined);
  33295. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js
  33296. /**
  33297. * WordPress dependencies
  33298. */
  33299. /**
  33300. * Internal dependencies
  33301. */
  33302. const CORNER_OFFSET = 4;
  33303. const CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;
  33304. function resize_tooltip_label_Label({
  33305. label,
  33306. position = POSITIONS.corner,
  33307. zIndex = 1000,
  33308. ...props
  33309. }, ref) {
  33310. const showLabel = !!label;
  33311. const isBottom = position === POSITIONS.bottom;
  33312. const isCorner = position === POSITIONS.corner;
  33313. if (!showLabel) return null;
  33314. let style = {
  33315. opacity: showLabel ? 1 : null,
  33316. zIndex
  33317. };
  33318. let labelStyle = {};
  33319. if (isBottom) {
  33320. style = { ...style,
  33321. position: 'absolute',
  33322. bottom: CURSOR_OFFSET_TOP * -1,
  33323. left: '50%',
  33324. transform: 'translate(-50%, 0)'
  33325. };
  33326. labelStyle = {
  33327. transform: `translate(0, 100%)`
  33328. };
  33329. }
  33330. if (isCorner) {
  33331. style = { ...style,
  33332. position: 'absolute',
  33333. top: CORNER_OFFSET,
  33334. right: Object(external_wp_i18n_["isRTL"])() ? null : CORNER_OFFSET,
  33335. left: Object(external_wp_i18n_["isRTL"])() ? CORNER_OFFSET : null
  33336. };
  33337. }
  33338. return Object(external_wp_element_["createElement"])(TooltipWrapper, Object(esm_extends["a" /* default */])({
  33339. "aria-hidden": "true",
  33340. className: "components-resizable-tooltip__tooltip-wrapper",
  33341. isActive: showLabel,
  33342. ref: ref,
  33343. style: style
  33344. }, props), Object(external_wp_element_["createElement"])(resize_tooltip_styles_Tooltip, {
  33345. className: "components-resizable-tooltip__tooltip",
  33346. style: labelStyle
  33347. }, Object(external_wp_element_["createElement"])(LabelText, {
  33348. as: "span"
  33349. }, label)));
  33350. }
  33351. const label_ForwardedComponent = Object(external_wp_element_["forwardRef"])(resize_tooltip_label_Label);
  33352. /* harmony default export */ var resize_tooltip_label = (label_ForwardedComponent);
  33353. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js
  33354. /**
  33355. * External dependencies
  33356. */
  33357. /**
  33358. * WordPress dependencies
  33359. */
  33360. /**
  33361. * Internal dependencies
  33362. */
  33363. function ResizeTooltip({
  33364. axis,
  33365. className,
  33366. fadeTimeout = 180,
  33367. isVisible = true,
  33368. labelRef,
  33369. onResize = external_lodash_["noop"],
  33370. position = POSITIONS.bottom,
  33371. showPx = true,
  33372. zIndex = 1000,
  33373. ...props
  33374. }, ref) {
  33375. const {
  33376. label,
  33377. resizeListener
  33378. } = useResizeLabel({
  33379. axis,
  33380. fadeTimeout,
  33381. onResize,
  33382. showPx,
  33383. position
  33384. });
  33385. if (!isVisible) return null;
  33386. const classes = classnames_default()('components-resize-tooltip', className);
  33387. return Object(external_wp_element_["createElement"])(resize_tooltip_styles_Root, Object(esm_extends["a" /* default */])({
  33388. "aria-hidden": "true",
  33389. className: classes,
  33390. ref: ref
  33391. }, props), resizeListener, Object(external_wp_element_["createElement"])(resize_tooltip_label, {
  33392. "aria-hidden": props['aria-hidden'],
  33393. fadeTimeout: fadeTimeout,
  33394. isVisible: isVisible,
  33395. label: label,
  33396. position: position,
  33397. ref: labelRef,
  33398. zIndex: zIndex
  33399. }));
  33400. }
  33401. const resize_tooltip_ForwardedComponent = Object(external_wp_element_["forwardRef"])(ResizeTooltip);
  33402. /* harmony default export */ var resize_tooltip = (resize_tooltip_ForwardedComponent);
  33403. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/index.js
  33404. /**
  33405. * WordPress dependencies
  33406. */
  33407. /**
  33408. * External dependencies
  33409. */
  33410. /**
  33411. * Internal dependencies
  33412. */
  33413. function ResizableBox({
  33414. className,
  33415. children,
  33416. showHandle = true,
  33417. __experimentalShowTooltip: showTooltip = false,
  33418. __experimentalTooltipProps: tooltipProps = {},
  33419. ...props
  33420. }, ref) {
  33421. // Removes the inline styles in the drag handles.
  33422. const handleStylesOverrides = {
  33423. width: null,
  33424. height: null,
  33425. top: null,
  33426. right: null,
  33427. bottom: null,
  33428. left: null
  33429. };
  33430. const handleClassName = 'components-resizable-box__handle';
  33431. const sideHandleClassName = 'components-resizable-box__side-handle';
  33432. const cornerHandleClassName = 'components-resizable-box__corner-handle';
  33433. return Object(external_wp_element_["createElement"])(lib_Resizable, Object(esm_extends["a" /* default */])({
  33434. className: classnames_default()('components-resizable-box__container', showHandle && 'has-show-handle', className),
  33435. handleClasses: {
  33436. top: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-top'),
  33437. right: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-right'),
  33438. bottom: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-bottom'),
  33439. left: classnames_default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-left'),
  33440. topLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-left'),
  33441. topRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-right'),
  33442. bottomRight: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-right'),
  33443. bottomLeft: classnames_default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-left')
  33444. },
  33445. handleStyles: {
  33446. top: handleStylesOverrides,
  33447. right: handleStylesOverrides,
  33448. bottom: handleStylesOverrides,
  33449. left: handleStylesOverrides,
  33450. topLeft: handleStylesOverrides,
  33451. topRight: handleStylesOverrides,
  33452. bottomRight: handleStylesOverrides,
  33453. bottomLeft: handleStylesOverrides
  33454. },
  33455. ref: ref
  33456. }, props), children, showTooltip && Object(external_wp_element_["createElement"])(resize_tooltip, tooltipProps));
  33457. }
  33458. /* harmony default export */ var resizable_box = (Object(external_wp_element_["forwardRef"])(ResizableBox));
  33459. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js
  33460. /**
  33461. * External dependencies
  33462. */
  33463. /**
  33464. * WordPress dependencies
  33465. */
  33466. function ResponsiveWrapper({
  33467. naturalWidth,
  33468. naturalHeight,
  33469. children,
  33470. isInline = false
  33471. }) {
  33472. const [containerResizeListener, {
  33473. width: containerWidth
  33474. }] = Object(external_wp_compose_["useResizeObserver"])();
  33475. if (external_wp_element_["Children"].count(children) !== 1) {
  33476. return null;
  33477. }
  33478. const imageStyle = {
  33479. paddingBottom: naturalWidth < containerWidth ? naturalHeight : naturalHeight / naturalWidth * 100 + '%'
  33480. };
  33481. const TagName = isInline ? 'span' : 'div';
  33482. return Object(external_wp_element_["createElement"])(TagName, {
  33483. className: "components-responsive-wrapper"
  33484. }, containerResizeListener, Object(external_wp_element_["createElement"])(TagName, {
  33485. style: imageStyle
  33486. }), Object(external_wp_element_["cloneElement"])(children, {
  33487. className: classnames_default()('components-responsive-wrapper__content', children.props.className)
  33488. }));
  33489. }
  33490. /* harmony default export */ var responsive_wrapper = (ResponsiveWrapper);
  33491. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/sandbox/index.js
  33492. /**
  33493. * WordPress dependencies
  33494. */
  33495. /**
  33496. * Internal dependencies
  33497. */
  33498. const observeAndResizeJS = `
  33499. ( function() {
  33500. var observer;
  33501. if ( ! window.MutationObserver || ! document.body || ! window.parent ) {
  33502. return;
  33503. }
  33504. function sendResize() {
  33505. var clientBoundingRect = document.body.getBoundingClientRect();
  33506. window.parent.postMessage( {
  33507. action: 'resize',
  33508. width: clientBoundingRect.width,
  33509. height: clientBoundingRect.height,
  33510. }, '*' );
  33511. }
  33512. observer = new MutationObserver( sendResize );
  33513. observer.observe( document.body, {
  33514. attributes: true,
  33515. attributeOldValue: false,
  33516. characterData: true,
  33517. characterDataOldValue: false,
  33518. childList: true,
  33519. subtree: true
  33520. } );
  33521. window.addEventListener( 'load', sendResize, true );
  33522. // Hack: Remove viewport unit styles, as these are relative
  33523. // the iframe root and interfere with our mechanism for
  33524. // determining the unconstrained page bounds.
  33525. function removeViewportStyles( ruleOrNode ) {
  33526. if( ruleOrNode.style ) {
  33527. [ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {
  33528. if ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {
  33529. ruleOrNode.style[ style ] = '';
  33530. }
  33531. } );
  33532. }
  33533. }
  33534. Array.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );
  33535. Array.prototype.forEach.call( document.styleSheets, function( stylesheet ) {
  33536. Array.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );
  33537. } );
  33538. document.body.style.position = 'absolute';
  33539. document.body.style.width = '100%';
  33540. document.body.setAttribute( 'data-resizable-iframe-connected', '' );
  33541. sendResize();
  33542. // Resize events can change the width of elements with 100% width, but we don't
  33543. // get an DOM mutations for that, so do the resize when the window is resized, too.
  33544. window.addEventListener( 'resize', sendResize, true );
  33545. } )();`;
  33546. const sandbox_style = `
  33547. body {
  33548. margin: 0;
  33549. }
  33550. html,
  33551. body,
  33552. body > div,
  33553. body > div iframe {
  33554. width: 100%;
  33555. }
  33556. html.wp-has-aspect-ratio,
  33557. body.wp-has-aspect-ratio,
  33558. body.wp-has-aspect-ratio > div,
  33559. body.wp-has-aspect-ratio > div iframe {
  33560. height: 100%;
  33561. overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */
  33562. }
  33563. body > div > * {
  33564. margin-top: 0 !important; /* Has to have !important to override inline styles. */
  33565. margin-bottom: 0 !important;
  33566. }
  33567. `;
  33568. function Sandbox({
  33569. html = '',
  33570. title = '',
  33571. type,
  33572. styles = [],
  33573. scripts = [],
  33574. onFocus
  33575. }) {
  33576. const ref = Object(external_wp_element_["useRef"])();
  33577. const [width, setWidth] = Object(external_wp_element_["useState"])(0);
  33578. const [height, setHeight] = Object(external_wp_element_["useState"])(0);
  33579. function isFrameAccessible() {
  33580. try {
  33581. return !!ref.current.contentDocument.body;
  33582. } catch (e) {
  33583. return false;
  33584. }
  33585. }
  33586. function trySandbox(forceRerender = false) {
  33587. if (!isFrameAccessible()) {
  33588. return;
  33589. }
  33590. const {
  33591. contentDocument,
  33592. ownerDocument
  33593. } = ref.current;
  33594. const {
  33595. body
  33596. } = contentDocument;
  33597. if (!forceRerender && null !== body.getAttribute('data-resizable-iframe-connected')) {
  33598. return;
  33599. } // put the html snippet into a html document, and then write it to the iframe's document
  33600. // we can use this in the future to inject custom styles or scripts.
  33601. // Scripts go into the body rather than the head, to support embedded content such as Instagram
  33602. // that expect the scripts to be part of the body.
  33603. const htmlDoc = Object(external_wp_element_["createElement"])("html", {
  33604. lang: ownerDocument.documentElement.lang,
  33605. className: type
  33606. }, Object(external_wp_element_["createElement"])("head", null, Object(external_wp_element_["createElement"])("title", null, title), Object(external_wp_element_["createElement"])("style", {
  33607. dangerouslySetInnerHTML: {
  33608. __html: sandbox_style
  33609. }
  33610. }), styles.map((rules, i) => Object(external_wp_element_["createElement"])("style", {
  33611. key: i,
  33612. dangerouslySetInnerHTML: {
  33613. __html: rules
  33614. }
  33615. }))), Object(external_wp_element_["createElement"])("body", {
  33616. "data-resizable-iframe-connected": "data-resizable-iframe-connected",
  33617. className: type
  33618. }, Object(external_wp_element_["createElement"])("div", {
  33619. dangerouslySetInnerHTML: {
  33620. __html: html
  33621. }
  33622. }), Object(external_wp_element_["createElement"])("script", {
  33623. type: "text/javascript",
  33624. dangerouslySetInnerHTML: {
  33625. __html: observeAndResizeJS
  33626. }
  33627. }), scripts.map(src => Object(external_wp_element_["createElement"])("script", {
  33628. key: src,
  33629. src: src
  33630. })))); // writing the document like this makes it act in the same way as if it was
  33631. // loaded over the network, so DOM creation and mutation, script execution, etc.
  33632. // all work as expected
  33633. contentDocument.open();
  33634. contentDocument.write('<!DOCTYPE html>' + Object(external_wp_element_["renderToString"])(htmlDoc));
  33635. contentDocument.close();
  33636. }
  33637. Object(external_wp_element_["useEffect"])(() => {
  33638. trySandbox();
  33639. function tryNoForceSandbox() {
  33640. trySandbox(false);
  33641. }
  33642. function checkMessageForResize(event) {
  33643. const iframe = ref.current; // Verify that the mounted element is the source of the message
  33644. if (!iframe || iframe.contentWindow !== event.source) {
  33645. return;
  33646. } // Attempt to parse the message data as JSON if passed as string
  33647. let data = event.data || {};
  33648. if ('string' === typeof data) {
  33649. try {
  33650. data = JSON.parse(data);
  33651. } catch (e) {}
  33652. } // Update the state only if the message is formatted as we expect,
  33653. // i.e. as an object with a 'resize' action.
  33654. if ('resize' !== data.action) {
  33655. return;
  33656. }
  33657. setWidth(data.width);
  33658. setHeight(data.height);
  33659. }
  33660. const {
  33661. ownerDocument
  33662. } = ref.current;
  33663. const {
  33664. defaultView
  33665. } = ownerDocument; // This used to be registered using <iframe onLoad={} />, but it made the iframe blank
  33666. // after reordering the containing block. See these two issues for more details:
  33667. // https://github.com/WordPress/gutenberg/issues/6146
  33668. // https://github.com/facebook/react/issues/18752
  33669. ref.current.addEventListener('load', tryNoForceSandbox, false);
  33670. defaultView.addEventListener('message', checkMessageForResize);
  33671. return () => {
  33672. ref.current.removeEventListener('load', tryNoForceSandbox, false);
  33673. defaultView.addEventListener('message', checkMessageForResize);
  33674. };
  33675. }, []);
  33676. Object(external_wp_element_["useEffect"])(() => {
  33677. trySandbox();
  33678. }, [title, type, styles, scripts]);
  33679. Object(external_wp_element_["useEffect"])(() => {
  33680. trySandbox(true);
  33681. }, [html]);
  33682. return Object(external_wp_element_["createElement"])(FocusableIframe, {
  33683. iframeRef: ref,
  33684. title: title,
  33685. className: "components-sandbox",
  33686. sandbox: "allow-scripts allow-same-origin allow-presentation",
  33687. onFocus: onFocus,
  33688. width: Math.ceil(width),
  33689. height: Math.ceil(height)
  33690. });
  33691. }
  33692. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js
  33693. var snackbar = __webpack_require__("iB/h");
  33694. // EXTERNAL MODULE: ./node_modules/react-spring/web.cjs.js
  33695. var web_cjs = __webpack_require__("ZO3Q");
  33696. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js
  33697. /**
  33698. * External dependencies
  33699. */
  33700. /**
  33701. * WordPress dependencies
  33702. */
  33703. /**
  33704. * Internal dependencies
  33705. */
  33706. /**
  33707. * Renders a list of notices.
  33708. *
  33709. * @param {Object} $0 Props passed to the component.
  33710. * @param {Array} $0.notices Array of notices to render.
  33711. * @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
  33712. * @param {Object} $0.className Name of the class used by the component.
  33713. * @param {Object} $0.children Array of children to be rendered inside the notice list.
  33714. * @return {Object} The rendered notices list.
  33715. */
  33716. function SnackbarList({
  33717. notices,
  33718. className,
  33719. children,
  33720. onRemove = external_lodash_["noop"]
  33721. }) {
  33722. const isReducedMotion = Object(external_wp_compose_["useReducedMotion"])();
  33723. const [refMap] = Object(external_wp_element_["useState"])(() => new WeakMap());
  33724. const transitions = Object(web_cjs["useTransition"])(notices, notice => notice.id, {
  33725. from: {
  33726. opacity: 0,
  33727. height: 0
  33728. },
  33729. enter: item => async (next) => await next({
  33730. opacity: 1,
  33731. height: refMap.get(item).offsetHeight
  33732. }),
  33733. leave: () => async next => {
  33734. await next({
  33735. opacity: 0
  33736. });
  33737. await next({
  33738. height: 0
  33739. });
  33740. },
  33741. immediate: isReducedMotion
  33742. });
  33743. className = classnames_default()('components-snackbar-list', className);
  33744. const removeNotice = notice => () => onRemove(notice.id);
  33745. return Object(external_wp_element_["createElement"])("div", {
  33746. className: className
  33747. }, children, transitions.map(({
  33748. item: notice,
  33749. key,
  33750. props: style
  33751. }) => Object(external_wp_element_["createElement"])(web_cjs["animated"].div, {
  33752. key: key,
  33753. style: style
  33754. }, Object(external_wp_element_["createElement"])("div", {
  33755. className: "components-snackbar-list__notice-container",
  33756. ref: ref => ref && refMap.set(notice, ref)
  33757. }, Object(external_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
  33758. onRemove: removeNotice(notice)
  33759. }), notice.content)))));
  33760. }
  33761. /* harmony default export */ var snackbar_list = (SnackbarList);
  33762. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/hook.js
  33763. /**
  33764. * Internal dependencies
  33765. */
  33766. // eslint-disable-next-line no-duplicate-imports
  33767. const isDefined = o => typeof o !== 'undefined' && o !== null;
  33768. function useSpacer(props) {
  33769. const {
  33770. className,
  33771. margin,
  33772. marginBottom = 2,
  33773. marginLeft,
  33774. marginRight,
  33775. marginTop,
  33776. marginX,
  33777. marginY,
  33778. padding,
  33779. paddingBottom,
  33780. paddingLeft,
  33781. paddingRight,
  33782. paddingTop,
  33783. paddingX,
  33784. paddingY,
  33785. ...otherProps
  33786. } = Object(use_context_system["a" /* useContextSystem */])(props, 'Spacer');
  33787. const classes = Object(emotion_esm["b" /* cx */])(isDefined(marginTop) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-top:", space_space(marginTop), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginBottom) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginBottom), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginLeft) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-left:", space_space(marginLeft), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginRight) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-right:", space_space(marginRight), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginX) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-left:", space_space(marginX), ";margin-right:", space_space(marginX), ";;label:classes;" + ( true ? "" : undefined)), isDefined(marginY) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin-bottom:", space_space(marginY), ";margin-top:", space_space(marginY), ";;label:classes;" + ( true ? "" : undefined)), isDefined(margin) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("margin:", space_space(margin), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingTop) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-top:", space_space(paddingTop), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingBottom) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-bottom:", space_space(paddingBottom), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingLeft) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-left:", space_space(paddingLeft), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingRight) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-right:", space_space(paddingRight), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingX) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-left:", space_space(paddingX), ";padding-right:", space_space(paddingX), ";;label:classes;" + ( true ? "" : undefined)), isDefined(paddingY) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding-bottom:", space_space(paddingY), ";padding-top:", space_space(paddingY), ";;label:classes;" + ( true ? "" : undefined)), isDefined(padding) && /*#__PURE__*/Object(emotion_esm["a" /* css */])("padding:", space_space(padding), ";;label:classes;" + ( true ? "" : undefined)), className);
  33788. return { ...otherProps,
  33789. className: classes
  33790. };
  33791. }
  33792. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spacer/component.js
  33793. /**
  33794. * Internal dependencies
  33795. */
  33796. /**
  33797. * `Spacer` is a primitive layout component that providers inner (`padding`) or outer (`margin`) space in-between components. It can also be used to adaptively provide space within an `HStack` or `VStack`.
  33798. *
  33799. * `Spacer` comes with a bunch of shorthand props to adjust `margin` and `padding`. The values of these props work as a multiplier to the library's grid system (base of `4px`).
  33800. *
  33801. * @example
  33802. * ```jsx
  33803. * import { Spacer } from `@wordpress/components`
  33804. *
  33805. * function Example() {
  33806. * return (
  33807. * <View>
  33808. * <Spacer>
  33809. * <Heading>WordPress.org</Heading>
  33810. * </Spacer>
  33811. * <Text>
  33812. * Code is Poetry
  33813. * </Text>
  33814. * </View>
  33815. * );
  33816. * }
  33817. * ```
  33818. */
  33819. const Spacer = create_component_createComponent({
  33820. as: 'div',
  33821. useHook: useSpacer,
  33822. name: 'Spacer'
  33823. });
  33824. /* harmony default export */ var spacer_component = (Spacer);
  33825. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/styles/spinner-styles.js
  33826. /**
  33827. * Internal dependencies
  33828. */
  33829. const spinAnimation = core_browser_esm_keyframes`
  33830. from {
  33831. transform: rotate(0deg);
  33832. }
  33833. to {
  33834. transform: rotate(360deg);
  33835. }
  33836. `;
  33837. const topLeft = `calc( ( ${config_values.spinnerSize} - ${config_values.spinnerSize} * ( 2 / 3 ) ) / 2 )`;
  33838. const StyledSpinner = styled_base_browser_esm("span", {
  33839. target: "e1s472tg0",
  33840. label: "StyledSpinner"
  33841. })("display:inline-block;background-color:", COLORS.gray[600], ";width:", config_values.spinnerSize, ";height:", config_values.spinnerSize, ";opacity:0.7;margin:5px 11px 0;border-radius:100%;position:relative;&::before{content:'';position:absolute;background-color:", COLORS.white, ";top:", topLeft, ";left:", topLeft, ";width:calc( ", config_values.spinnerSize, " / 4.5 );height:calc( ", config_values.spinnerSize, " / 4.5 );border-radius:100%;transform-origin:calc( ", config_values.spinnerSize, " / 3 ) calc( ", config_values.spinnerSize, " / 3 );animation:", spinAnimation, " 1s infinite linear;}" + ( true ? "" : undefined));
  33842. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/index.js
  33843. /**
  33844. * Internal dependencies
  33845. */
  33846. function Spinner() {
  33847. return Object(external_wp_element_["createElement"])(StyledSpinner, {
  33848. className: "components-spinner"
  33849. });
  33850. }
  33851. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tab-panel/index.js
  33852. /**
  33853. * External dependencies
  33854. */
  33855. /**
  33856. * WordPress dependencies
  33857. */
  33858. /**
  33859. * Internal dependencies
  33860. */
  33861. const TabButton = ({
  33862. tabId,
  33863. onClick,
  33864. children,
  33865. selected,
  33866. ...rest
  33867. }) => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  33868. role: "tab",
  33869. tabIndex: selected ? null : -1,
  33870. "aria-selected": selected,
  33871. id: tabId,
  33872. onClick: onClick
  33873. }, rest), children);
  33874. function TabPanel({
  33875. className,
  33876. children,
  33877. tabs,
  33878. initialTabName,
  33879. orientation = 'horizontal',
  33880. activeClass = 'is-active',
  33881. onSelect = external_lodash_["noop"]
  33882. }) {
  33883. var _selectedTab$name;
  33884. const instanceId = Object(external_wp_compose_["useInstanceId"])(TabPanel, 'tab-panel');
  33885. const [selected, setSelected] = Object(external_wp_element_["useState"])(null);
  33886. const handleClick = tabKey => {
  33887. setSelected(tabKey);
  33888. onSelect(tabKey);
  33889. };
  33890. const onNavigate = (childIndex, child) => {
  33891. child.click();
  33892. };
  33893. const selectedTab = Object(external_lodash_["find"])(tabs, {
  33894. name: selected
  33895. });
  33896. const selectedId = `${instanceId}-${(_selectedTab$name = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name) !== null && _selectedTab$name !== void 0 ? _selectedTab$name : 'none'}`;
  33897. Object(external_wp_element_["useEffect"])(() => {
  33898. const newSelectedTab = Object(external_lodash_["find"])(tabs, {
  33899. name: selected
  33900. });
  33901. if (!newSelectedTab) {
  33902. setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name : null));
  33903. }
  33904. }, [tabs]);
  33905. return Object(external_wp_element_["createElement"])("div", {
  33906. className: className
  33907. }, Object(external_wp_element_["createElement"])(navigable_container_menu, {
  33908. role: "tablist",
  33909. orientation: orientation,
  33910. onNavigate: onNavigate,
  33911. className: "components-tab-panel__tabs"
  33912. }, tabs.map(tab => Object(external_wp_element_["createElement"])(TabButton, {
  33913. className: classnames_default()('components-tab-panel__tabs-item', tab.className, {
  33914. [activeClass]: tab.name === selected
  33915. }),
  33916. tabId: `${instanceId}-${tab.name}`,
  33917. "aria-controls": `${instanceId}-${tab.name}-view`,
  33918. selected: tab.name === selected,
  33919. key: tab.name,
  33920. onClick: Object(external_lodash_["partial"])(handleClick, tab.name)
  33921. }, tab.title))), selectedTab && Object(external_wp_element_["createElement"])("div", {
  33922. key: selectedId,
  33923. "aria-labelledby": selectedId,
  33924. role: "tabpanel",
  33925. id: `${selectedId}-view`,
  33926. className: "components-tab-panel__tab-content"
  33927. }, children(selectedTab)));
  33928. }
  33929. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/input/base.js
  33930. /**
  33931. * External dependencies
  33932. */
  33933. /**
  33934. * Internal dependencies
  33935. */
  33936. const inputStyleNeutral = /*#__PURE__*/css_browser_esm("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:", config_values.radiusBlockUi, ";border:", config_values.borderWidth, " solid ", COLORS.ui.border, "};", reduceMotion('transition'), ";label:inputStyleNeutral;" + ( true ? "" : undefined));
  33937. const inputStyleFocus = /*#__PURE__*/css_browser_esm("border-color:var( --wp-admin-theme-color );box-shadow:0 0 0 calc( ", config_values.borderWidthFocus, " - ", config_values.borderWidth, " ) var( --wp-admin-theme-color );outline:2px solid transparent;;label:inputStyleFocus;" + ( true ? "" : undefined));
  33938. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/breakpoint-values.js
  33939. /* harmony default export */ var breakpoint_values = ({
  33940. huge: '1440px',
  33941. wide: '1280px',
  33942. 'x-large': '1080px',
  33943. large: '960px',
  33944. // admin sidebar auto folds
  33945. medium: '782px',
  33946. // adminbar goes big
  33947. small: '600px',
  33948. mobile: '480px',
  33949. 'zoomed-in': '280px'
  33950. });
  33951. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/breakpoint.js
  33952. /**
  33953. * Internal dependencies
  33954. */
  33955. /**
  33956. * @param {keyof breakpoints} point
  33957. * @return {string} Media query declaration.
  33958. */
  33959. const breakpoint = point => `@media (min-width: ${breakpoint_values[point]})`;
  33960. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/input/input-control.js
  33961. /**
  33962. * External dependencies
  33963. */
  33964. /**
  33965. * Internal dependencies
  33966. */
  33967. const inputControl = /*#__PURE__*/css_browser_esm("font-family:", font('default.fontFamily'), ";padding:6px 8px;", inputStyleNeutral, ";font-size:", font('mobileTextMinFontSize'), ";line-height:normal;", breakpoint('small'), "{font-size:", font('default.fontSize'), ";line-height:normal;}&:focus{", inputStyleFocus, "}&::-webkit-input-placeholder{color:", COLORS.darkGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", COLORS.darkGray.placeholder, ";}&:-ms-input-placeholder{color:", COLORS.darkGray.placeholder, ";}.is-dark-theme &{&::-webkit-input-placeholder{color:", COLORS.lightGray.placeholder, ";}&::-moz-placeholder{opacity:1;color:", COLORS.lightGray.placeholder, ";}&:-ms-input-placeholder{color:", COLORS.lightGray.placeholder, ";}};label:inputControl;" + ( true ? "" : undefined));
  33968. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/styles/textarea-control-styles.js
  33969. /**
  33970. * Internal dependencies
  33971. */
  33972. const StyledTextarea = styled_base_browser_esm("textarea", {
  33973. target: "ebk7yr50",
  33974. label: "StyledTextarea"
  33975. })("width:100%;", inputControl, true ? "" : undefined);
  33976. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/index.js
  33977. /**
  33978. * WordPress dependencies
  33979. */
  33980. /**
  33981. * Internal dependencies
  33982. */
  33983. function TextareaControl({
  33984. label,
  33985. hideLabelFromVision,
  33986. value,
  33987. help,
  33988. onChange,
  33989. rows = 4,
  33990. className,
  33991. ...props
  33992. }) {
  33993. const instanceId = Object(external_wp_compose_["useInstanceId"])(TextareaControl);
  33994. const id = `inspector-textarea-control-${instanceId}`;
  33995. const onChangeValue = event => onChange(event.target.value);
  33996. return Object(external_wp_element_["createElement"])(base_control, {
  33997. label: label,
  33998. hideLabelFromVision: hideLabelFromVision,
  33999. id: id,
  34000. help: help,
  34001. className: className
  34002. }, Object(external_wp_element_["createElement"])(StyledTextarea, Object(esm_extends["a" /* default */])({
  34003. className: "components-textarea-control__input",
  34004. id: id,
  34005. rows: rows,
  34006. onChange: onChangeValue,
  34007. "aria-describedby": !!help ? id + '__help' : undefined,
  34008. value: value
  34009. }, props)));
  34010. }
  34011. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-highlight/index.js
  34012. /**
  34013. * External dependencies
  34014. */
  34015. /**
  34016. * WordPress dependencies
  34017. */
  34018. const TextHighlight = ({
  34019. text = '',
  34020. highlight = ''
  34021. }) => {
  34022. const trimmedHighlightText = highlight.trim();
  34023. if (!trimmedHighlightText) {
  34024. return text;
  34025. }
  34026. const regex = new RegExp(`(${Object(external_lodash_["escapeRegExp"])(trimmedHighlightText)})`, 'gi');
  34027. return Object(external_wp_element_["createInterpolateElement"])(text.replace(regex, '<mark>$&</mark>'), {
  34028. mark: Object(external_wp_element_["createElement"])("mark", null)
  34029. });
  34030. };
  34031. /* harmony default export */ var text_highlight = (TextHighlight);
  34032. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tip/index.js
  34033. /**
  34034. * WordPress dependencies
  34035. */
  34036. /**
  34037. * @typedef Props
  34038. * @property {import('react').ReactNode} children Children to render in the tip.
  34039. */
  34040. /**
  34041. * @param {Props} props
  34042. * @return {JSX.Element} Element
  34043. */
  34044. function Tip(props) {
  34045. return Object(external_wp_element_["createElement"])("div", {
  34046. className: "components-tip"
  34047. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
  34048. width: "24",
  34049. height: "24",
  34050. viewBox: "0 0 24 24"
  34051. }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
  34052. d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"
  34053. })), Object(external_wp_element_["createElement"])("p", null, props.children));
  34054. }
  34055. /* harmony default export */ var tip = (Tip);
  34056. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-control/index.js
  34057. /**
  34058. * External dependencies
  34059. */
  34060. /**
  34061. * WordPress dependencies
  34062. */
  34063. /**
  34064. * Internal dependencies
  34065. */
  34066. function ToggleControl({
  34067. label,
  34068. checked,
  34069. help,
  34070. className,
  34071. onChange,
  34072. disabled
  34073. }) {
  34074. function onChangeToggle(event) {
  34075. onChange(event.target.checked);
  34076. }
  34077. const instanceId = Object(external_wp_compose_["useInstanceId"])(ToggleControl);
  34078. const id = `inspector-toggle-control-${instanceId}`;
  34079. let describedBy, helpLabel;
  34080. if (help) {
  34081. describedBy = id + '__help';
  34082. helpLabel = Object(external_lodash_["isFunction"])(help) ? help(checked) : help;
  34083. }
  34084. return Object(external_wp_element_["createElement"])(base_control, {
  34085. id: id,
  34086. help: helpLabel,
  34087. className: classnames_default()('components-toggle-control', className)
  34088. }, Object(external_wp_element_["createElement"])(form_toggle, {
  34089. id: id,
  34090. checked: checked,
  34091. onChange: onChangeToggle,
  34092. "aria-describedby": describedBy,
  34093. disabled: disabled
  34094. }), Object(external_wp_element_["createElement"])("label", {
  34095. htmlFor: id,
  34096. className: "components-toggle-control__label"
  34097. }, label));
  34098. }
  34099. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-item/index.js
  34100. var toolbar_item = __webpack_require__("aA0e");
  34101. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/toolbar-context/index.js
  34102. var toolbar_context = __webpack_require__("GK4x");
  34103. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/toolbar-button-container.js
  34104. const ToolbarButtonContainer = props => Object(external_wp_element_["createElement"])("div", {
  34105. className: props.className
  34106. }, props.children);
  34107. /* harmony default export */ var toolbar_button_container = (ToolbarButtonContainer);
  34108. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-button/index.js
  34109. /**
  34110. * External dependencies
  34111. */
  34112. /**
  34113. * WordPress dependencies
  34114. */
  34115. /**
  34116. * Internal dependencies
  34117. */
  34118. function ToolbarButton({
  34119. containerClassName,
  34120. className,
  34121. extraProps,
  34122. children,
  34123. title,
  34124. isActive,
  34125. isDisabled,
  34126. ...props
  34127. }, ref) {
  34128. const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]);
  34129. if (!accessibleToolbarState) {
  34130. return Object(external_wp_element_["createElement"])(toolbar_button_container, {
  34131. className: containerClassName
  34132. }, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  34133. ref: ref,
  34134. icon: props.icon,
  34135. label: title,
  34136. shortcut: props.shortcut,
  34137. "data-subscript": props.subscript,
  34138. onClick: event => {
  34139. event.stopPropagation();
  34140. if (props.onClick) {
  34141. props.onClick(event);
  34142. }
  34143. },
  34144. className: classnames_default()('components-toolbar__control', className),
  34145. isPressed: isActive,
  34146. disabled: isDisabled,
  34147. "data-toolbar-item": true
  34148. }, extraProps, props), children));
  34149. } // ToobarItem will pass all props to the render prop child, which will pass
  34150. // all props to Button. This means that ToolbarButton has the same API as
  34151. // Button.
  34152. return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], Object(esm_extends["a" /* default */])({
  34153. className: classnames_default()('components-toolbar-button', className)
  34154. }, extraProps, props, {
  34155. ref: ref
  34156. }), toolbarItemProps => Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
  34157. label: title,
  34158. isPressed: isActive,
  34159. disabled: isDisabled
  34160. }, toolbarItemProps), children));
  34161. }
  34162. /* harmony default export */ var toolbar_button = (Object(external_wp_element_["forwardRef"])(ToolbarButton));
  34163. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-container.js
  34164. const ToolbarGroupContainer = ({
  34165. className,
  34166. children,
  34167. ...props
  34168. }) => Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
  34169. className: className
  34170. }, props), children);
  34171. /* harmony default export */ var toolbar_group_container = (ToolbarGroupContainer);
  34172. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/toolbar-group-collapsed.js
  34173. /**
  34174. * WordPress dependencies
  34175. */
  34176. /**
  34177. * Internal dependencies
  34178. */
  34179. function ToolbarGroupCollapsed({
  34180. controls = [],
  34181. toggleProps,
  34182. ...props
  34183. }) {
  34184. // It'll contain state if `ToolbarGroup` is being used within
  34185. // `<Toolbar label="label" />`
  34186. const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]);
  34187. const renderDropdownMenu = internalToggleProps => Object(external_wp_element_["createElement"])(dropdown_menu, Object(esm_extends["a" /* default */])({
  34188. controls: controls,
  34189. toggleProps: { ...internalToggleProps,
  34190. 'data-toolbar-item': true
  34191. }
  34192. }, props));
  34193. if (accessibleToolbarState) {
  34194. return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], toggleProps, renderDropdownMenu);
  34195. }
  34196. return renderDropdownMenu(toggleProps);
  34197. }
  34198. /* harmony default export */ var toolbar_group_collapsed = (ToolbarGroupCollapsed);
  34199. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-group/index.js
  34200. /**
  34201. * External dependencies
  34202. */
  34203. /**
  34204. * WordPress dependencies
  34205. */
  34206. /**
  34207. * Internal dependencies
  34208. */
  34209. /**
  34210. * Renders a collapsible group of controls
  34211. *
  34212. * The `controls` prop accepts an array of sets. A set is an array of controls.
  34213. * Controls have the following shape:
  34214. *
  34215. * ```
  34216. * {
  34217. * icon: string,
  34218. * title: string,
  34219. * subscript: string,
  34220. * onClick: Function,
  34221. * isActive: boolean,
  34222. * isDisabled: boolean
  34223. * }
  34224. * ```
  34225. *
  34226. * For convenience it is also possible to pass only an array of controls. It is
  34227. * then assumed this is the only set.
  34228. *
  34229. * Either `controls` or `children` is required, otherwise this components
  34230. * renders nothing.
  34231. *
  34232. * @param {Object} props Component props.
  34233. * @param {Array} [props.controls] The controls to render in this toolbar.
  34234. * @param {WPElement} [props.children] Any other things to render inside the toolbar besides the controls.
  34235. * @param {string} [props.className] Class to set on the container div.
  34236. * @param {boolean} [props.isCollapsed] Turns ToolbarGroup into a dropdown menu.
  34237. * @param {string} [props.title] ARIA label for dropdown menu if is collapsed.
  34238. */
  34239. function ToolbarGroup({
  34240. controls = [],
  34241. children,
  34242. className,
  34243. isCollapsed,
  34244. title,
  34245. ...props
  34246. }) {
  34247. // It'll contain state if `ToolbarGroup` is being used within
  34248. // `<Toolbar label="label" />`
  34249. const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]);
  34250. if ((!controls || !controls.length) && !children) {
  34251. return null;
  34252. }
  34253. const finalClassName = classnames_default()( // Unfortunately, there's legacy code referencing to `.components-toolbar`
  34254. // So we can't get rid of it
  34255. accessibleToolbarState ? 'components-toolbar-group' : 'components-toolbar', className); // Normalize controls to nested array of objects (sets of controls)
  34256. let controlSets = controls;
  34257. if (!Array.isArray(controlSets[0])) {
  34258. controlSets = [controlSets];
  34259. }
  34260. if (isCollapsed) {
  34261. return Object(external_wp_element_["createElement"])(toolbar_group_collapsed, Object(esm_extends["a" /* default */])({
  34262. label: title,
  34263. controls: controlSets,
  34264. className: finalClassName,
  34265. children: children
  34266. }, props));
  34267. }
  34268. return Object(external_wp_element_["createElement"])(toolbar_group_container, Object(esm_extends["a" /* default */])({
  34269. className: finalClassName
  34270. }, props), Object(external_lodash_["flatMap"])(controlSets, (controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => Object(external_wp_element_["createElement"])(toolbar_button, Object(esm_extends["a" /* default */])({
  34271. key: [indexOfSet, indexOfControl].join(),
  34272. containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null
  34273. }, control)))), children);
  34274. }
  34275. /* harmony default export */ var toolbar_group = (ToolbarGroup);
  34276. // CONCATENATED MODULE: ./node_modules/reakit/es/Toolbar/ToolbarState.js
  34277. function useToolbarState(initialState) {
  34278. if (initialState === void 0) {
  34279. initialState = {};
  34280. }
  34281. var _useSealedState = useSealedState(initialState),
  34282. _useSealedState$orien = _useSealedState.orientation,
  34283. orientation = _useSealedState$orien === void 0 ? "horizontal" : _useSealedState$orien,
  34284. sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["orientation"]);
  34285. return useCompositeState(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  34286. orientation: orientation
  34287. }, sealed));
  34288. }
  34289. // EXTERNAL MODULE: ./node_modules/reakit/es/__keys-ae468c11.js
  34290. var _keys_ae468c11 = __webpack_require__("mjVI");
  34291. // CONCATENATED MODULE: ./node_modules/reakit/es/Toolbar/Toolbar.js
  34292. var useToolbar = Object(createHook["a" /* createHook */])({
  34293. name: "Toolbar",
  34294. compose: useComposite,
  34295. keys: _keys_ae468c11["a" /* T */],
  34296. useProps: function useProps(options, htmlProps) {
  34297. return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
  34298. role: "toolbar",
  34299. "aria-orientation": options.orientation
  34300. }, htmlProps);
  34301. }
  34302. });
  34303. var Toolbar = Object(createComponent["a" /* createComponent */])({
  34304. as: "div",
  34305. useHook: useToolbar,
  34306. useCreateElement: function useCreateElement$1(type, props, children) {
  34307. false ? undefined : void 0;
  34308. return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
  34309. }
  34310. });
  34311. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js
  34312. /**
  34313. * External dependencies
  34314. */
  34315. /**
  34316. * WordPress dependencies
  34317. */
  34318. /**
  34319. * Internal dependencies
  34320. */
  34321. function ToolbarContainer({
  34322. label,
  34323. ...props
  34324. }, ref) {
  34325. // https://reakit.io/docs/basic-concepts/#state-hooks
  34326. // Passing baseId for server side rendering (which includes snapshots)
  34327. // If an id prop is passed to Toolbar, toolbar items will use it as a base for their ids
  34328. const toolbarState = useToolbarState({
  34329. loop: true,
  34330. baseId: props.id,
  34331. rtl: Object(external_wp_i18n_["isRTL"])()
  34332. });
  34333. return (// This will provide state for `ToolbarButton`'s
  34334. Object(external_wp_element_["createElement"])(toolbar_context["a" /* default */].Provider, {
  34335. value: toolbarState
  34336. }, Object(external_wp_element_["createElement"])(Toolbar, Object(esm_extends["a" /* default */])({
  34337. ref: ref,
  34338. "aria-label": label
  34339. }, toolbarState, props)))
  34340. );
  34341. }
  34342. /* harmony default export */ var toolbar_container = (Object(external_wp_element_["forwardRef"])(ToolbarContainer));
  34343. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/index.js
  34344. /**
  34345. * External dependencies
  34346. */
  34347. /**
  34348. * WordPress dependencies
  34349. */
  34350. /**
  34351. * Internal dependencies
  34352. */
  34353. /**
  34354. * Renders a toolbar.
  34355. *
  34356. * To add controls, simply pass `ToolbarButton` components as children.
  34357. *
  34358. * @param {Object} props Component props.
  34359. * @param {string} [props.className] Class to set on the container div.
  34360. * @param {string} [props.label] ARIA label for toolbar container.
  34361. * @param {Object} ref React Element ref.
  34362. */
  34363. function toolbar_Toolbar({
  34364. className,
  34365. label,
  34366. ...props
  34367. }, ref) {
  34368. if (!label) {
  34369. external_wp_deprecated_default()('Using Toolbar without label prop', {
  34370. since: '5.6',
  34371. alternative: 'ToolbarGroup component',
  34372. link: 'https://developer.wordpress.org/block-editor/components/toolbar/'
  34373. });
  34374. return Object(external_wp_element_["createElement"])(toolbar_group, Object(esm_extends["a" /* default */])({}, props, {
  34375. className: className
  34376. }));
  34377. } // `ToolbarGroup` already uses components-toolbar for compatibility reasons
  34378. const finalClassName = classnames_default()('components-accessible-toolbar', className);
  34379. return Object(external_wp_element_["createElement"])(toolbar_container, Object(esm_extends["a" /* default */])({
  34380. className: finalClassName,
  34381. label: label,
  34382. ref: ref
  34383. }, props));
  34384. }
  34385. /* harmony default export */ var toolbar = (Object(external_wp_element_["forwardRef"])(toolbar_Toolbar));
  34386. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar-dropdown-menu/index.js
  34387. /**
  34388. * WordPress dependencies
  34389. */
  34390. /**
  34391. * Internal dependencies
  34392. */
  34393. function ToolbarDropdownMenu(props) {
  34394. const accessibleToolbarState = Object(external_wp_element_["useContext"])(toolbar_context["a" /* default */]);
  34395. if (!accessibleToolbarState) {
  34396. return Object(external_wp_element_["createElement"])(dropdown_menu, props);
  34397. } // ToobarItem will pass all props to the render prop child, which will pass
  34398. // all props to the toggle of DrpodownMenu. This means that ToolbarDropdownMenu has the same API as
  34399. // DrpodownMenu.
  34400. return Object(external_wp_element_["createElement"])(toolbar_item["a" /* default */], null, toolbarItemProps => Object(external_wp_element_["createElement"])(dropdown_menu, Object(esm_extends["a" /* default */])({}, props, {
  34401. toggleProps: props.toggleProps ? { ...props.toggleProps,
  34402. ...toolbarItemProps
  34403. } : toolbarItemProps
  34404. })));
  34405. }
  34406. /* harmony default export */ var toolbar_dropdown_menu = (ToolbarDropdownMenu);
  34407. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js
  34408. /**
  34409. * WordPress dependencies
  34410. */
  34411. const RovingTabIndexContext = Object(external_wp_element_["createContext"])();
  34412. const useRovingTabIndexContext = () => Object(external_wp_element_["useContext"])(RovingTabIndexContext);
  34413. const RovingTabIndexProvider = RovingTabIndexContext.Provider;
  34414. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index.js
  34415. /**
  34416. * WordPress dependencies
  34417. */
  34418. /**
  34419. * Internal dependencies
  34420. */
  34421. /**
  34422. * Provider for adding roving tab index behaviors to tree grid structures.
  34423. *
  34424. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md
  34425. *
  34426. * @param {Object} props Component props.
  34427. * @param {WPElement} props.children Children to be rendered
  34428. */
  34429. function RovingTabIndex({
  34430. children
  34431. }) {
  34432. const [lastFocusedElement, setLastFocusedElement] = Object(external_wp_element_["useState"])(); // Use `useMemo` to avoid creation of a new object for the providerValue
  34433. // on every render. Only create a new object when the `lastFocusedElement`
  34434. // value changes.
  34435. const providerValue = Object(external_wp_element_["useMemo"])(() => ({
  34436. lastFocusedElement,
  34437. setLastFocusedElement
  34438. }), [lastFocusedElement]);
  34439. return Object(external_wp_element_["createElement"])(RovingTabIndexProvider, {
  34440. value: providerValue
  34441. }, children);
  34442. }
  34443. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/index.js
  34444. /**
  34445. * External dependencies
  34446. */
  34447. /**
  34448. * WordPress dependencies
  34449. */
  34450. /**
  34451. * Internal dependencies
  34452. */
  34453. /**
  34454. * Return focusables in a row element, excluding those from other branches
  34455. * nested within the row.
  34456. *
  34457. * @param {Element} rowElement The DOM element representing the row.
  34458. *
  34459. * @return {?Array} The array of focusables in the row.
  34460. */
  34461. function getRowFocusables(rowElement) {
  34462. const focusablesInRow = external_wp_dom_["focus"].focusable.find(rowElement);
  34463. if (!focusablesInRow || !focusablesInRow.length) {
  34464. return;
  34465. }
  34466. return focusablesInRow.filter(focusable => {
  34467. return focusable.closest('[role="row"]') === rowElement;
  34468. });
  34469. }
  34470. /**
  34471. * Renders both a table and tbody element, used to create a tree hierarchy.
  34472. *
  34473. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md
  34474. * @param {Object} props Component props.
  34475. * @param {WPElement} props.children Children to be rendered.
  34476. * @param {Object} ref A ref to the underlying DOM table element.
  34477. */
  34478. function TreeGrid({
  34479. children,
  34480. ...props
  34481. }, ref) {
  34482. const onKeyDown = Object(external_wp_element_["useCallback"])(event => {
  34483. const {
  34484. keyCode,
  34485. metaKey,
  34486. ctrlKey,
  34487. altKey,
  34488. shiftKey
  34489. } = event;
  34490. const hasModifierKeyPressed = metaKey || ctrlKey || altKey || shiftKey;
  34491. if (hasModifierKeyPressed || !Object(external_lodash_["includes"])([external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) {
  34492. return;
  34493. } // The event will be handled, stop propagation.
  34494. event.stopPropagation();
  34495. const {
  34496. activeElement
  34497. } = document;
  34498. const {
  34499. currentTarget: treeGridElement
  34500. } = event;
  34501. if (!treeGridElement.contains(activeElement)) {
  34502. return;
  34503. } // Calculate the columnIndex of the active element.
  34504. const activeRow = activeElement.closest('[role="row"]');
  34505. const focusablesInRow = getRowFocusables(activeRow);
  34506. const currentColumnIndex = focusablesInRow.indexOf(activeElement);
  34507. if (Object(external_lodash_["includes"])([external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) {
  34508. // Calculate to the next element.
  34509. let nextIndex;
  34510. if (keyCode === external_wp_keycodes_["LEFT"]) {
  34511. nextIndex = Math.max(0, currentColumnIndex - 1);
  34512. } else {
  34513. nextIndex = Math.min(currentColumnIndex + 1, focusablesInRow.length - 1);
  34514. } // Focus is either at the left or right edge of the grid. Do nothing.
  34515. if (nextIndex === currentColumnIndex) {
  34516. // Prevent key use for anything else. For example, Voiceover
  34517. // will start reading text on continued use of left/right arrow
  34518. // keys.
  34519. event.preventDefault();
  34520. return;
  34521. } // Focus the next element.
  34522. focusablesInRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover
  34523. // doesn't try to handle key navigation.
  34524. event.preventDefault();
  34525. } else if (Object(external_lodash_["includes"])([external_wp_keycodes_["UP"], external_wp_keycodes_["DOWN"]], keyCode)) {
  34526. // Calculate the rowIndex of the next row.
  34527. const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
  34528. const currentRowIndex = rows.indexOf(activeRow);
  34529. let nextRowIndex;
  34530. if (keyCode === external_wp_keycodes_["UP"]) {
  34531. nextRowIndex = Math.max(0, currentRowIndex - 1);
  34532. } else {
  34533. nextRowIndex = Math.min(currentRowIndex + 1, rows.length - 1);
  34534. } // Focus is either at the top or bottom edge of the grid. Do nothing.
  34535. if (nextRowIndex === currentRowIndex) {
  34536. // Prevent key use for anything else. For example, Voiceover
  34537. // will start navigating horizontally when reaching the vertical
  34538. // bounds of a table.
  34539. event.preventDefault();
  34540. return;
  34541. } // Get the focusables in the next row.
  34542. const focusablesInNextRow = getRowFocusables(rows[nextRowIndex]); // If for some reason there are no focusables in the next row, do nothing.
  34543. if (!focusablesInNextRow || !focusablesInNextRow.length) {
  34544. // Prevent key use for anything else. For example, Voiceover
  34545. // will still focus text when using arrow keys, while this
  34546. // component should limit navigation to focusables.
  34547. event.preventDefault();
  34548. return;
  34549. } // Try to focus the element in the next row that's at a similar column to the activeElement.
  34550. const nextIndex = Math.min(currentColumnIndex, focusablesInNextRow.length - 1);
  34551. focusablesInNextRow[nextIndex].focus(); // Prevent key use for anything else. This ensures Voiceover
  34552. // doesn't try to handle key navigation.
  34553. event.preventDefault();
  34554. }
  34555. }, []);
  34556. /* Disable reason: A treegrid is implemented using a table element. */
  34557. /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
  34558. return Object(external_wp_element_["createElement"])(RovingTabIndex, null, Object(external_wp_element_["createElement"])("table", Object(esm_extends["a" /* default */])({}, props, {
  34559. role: "treegrid",
  34560. onKeyDown: onKeyDown,
  34561. ref: ref
  34562. }), Object(external_wp_element_["createElement"])("tbody", null, children)));
  34563. /* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */
  34564. }
  34565. /* harmony default export */ var tree_grid = (Object(external_wp_element_["forwardRef"])(TreeGrid));
  34566. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/row.js
  34567. /**
  34568. * WordPress dependencies
  34569. */
  34570. function TreeGridRow({
  34571. children,
  34572. level,
  34573. positionInSet,
  34574. setSize,
  34575. isExpanded,
  34576. ...props
  34577. }, ref) {
  34578. return (// Disable reason: Due to an error in the ARIA 1.1 specification, the
  34579. // aria-posinset and aria-setsize properties are not supported on row
  34580. // elements. This is being corrected in ARIA 1.2. Consequently, the
  34581. // linting rule fails when validating this markup.
  34582. //
  34583. // eslint-disable-next-line jsx-a11y/role-supports-aria-props
  34584. Object(external_wp_element_["createElement"])("tr", Object(esm_extends["a" /* default */])({}, props, {
  34585. ref: ref,
  34586. role: "row",
  34587. "aria-level": level,
  34588. "aria-posinset": positionInSet,
  34589. "aria-setsize": setSize,
  34590. "aria-expanded": isExpanded
  34591. }), children)
  34592. );
  34593. }
  34594. /* harmony default export */ var tree_grid_row = (Object(external_wp_element_["forwardRef"])(TreeGridRow));
  34595. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js
  34596. /**
  34597. * WordPress dependencies
  34598. */
  34599. /**
  34600. * Internal dependencies
  34601. */
  34602. /* harmony default export */ var roving_tab_index_item = (Object(external_wp_element_["forwardRef"])(function RovingTabIndexItem({
  34603. children,
  34604. as: Component,
  34605. ...props
  34606. }, forwardedRef) {
  34607. const localRef = Object(external_wp_element_["useRef"])();
  34608. const ref = forwardedRef || localRef;
  34609. const {
  34610. lastFocusedElement,
  34611. setLastFocusedElement
  34612. } = useRovingTabIndexContext();
  34613. let tabIndex;
  34614. if (lastFocusedElement) {
  34615. tabIndex = lastFocusedElement === ref.current ? 0 : -1;
  34616. }
  34617. const onFocus = event => setLastFocusedElement(event.target);
  34618. const allProps = {
  34619. ref,
  34620. tabIndex,
  34621. onFocus,
  34622. ...props
  34623. };
  34624. if (typeof children === 'function') {
  34625. return children(allProps);
  34626. }
  34627. return Object(external_wp_element_["createElement"])(Component, allProps, children);
  34628. }));
  34629. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/item.js
  34630. /**
  34631. * WordPress dependencies
  34632. */
  34633. /**
  34634. * Internal dependencies
  34635. */
  34636. /* harmony default export */ var tree_grid_item = (Object(external_wp_element_["forwardRef"])(function TreeGridItem({
  34637. children,
  34638. ...props
  34639. }, ref) {
  34640. return Object(external_wp_element_["createElement"])(roving_tab_index_item, Object(esm_extends["a" /* default */])({
  34641. ref: ref
  34642. }, props), children);
  34643. }));
  34644. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/cell.js
  34645. /**
  34646. * WordPress dependencies
  34647. */
  34648. /**
  34649. * Internal dependencies
  34650. */
  34651. /* harmony default export */ var tree_grid_cell = (Object(external_wp_element_["forwardRef"])(function TreeGridCell({
  34652. children,
  34653. withoutGridItem = false,
  34654. ...props
  34655. }, ref) {
  34656. return Object(external_wp_element_["createElement"])("td", Object(esm_extends["a" /* default */])({}, props, {
  34657. role: "gridcell"
  34658. }), withoutGridItem ? children : Object(external_wp_element_["createElement"])(tree_grid_item, {
  34659. ref: ref
  34660. }, children));
  34661. }));
  34662. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/component.js
  34663. /**
  34664. * Internal dependencies
  34665. */
  34666. /**
  34667. * `Truncate` is a typography primitive that trims text content.
  34668. * For almost all cases, it is recommended that `Text`, `Heading`, or
  34669. * `Subheading` is used to render text content. However,`Truncate` is
  34670. * available for custom implementations.
  34671. *
  34672. * @example
  34673. * ```jsx
  34674. * import { __experimentalTruncate as Truncate } from `@wordpress/components`;
  34675. *
  34676. * function Example() {
  34677. * return (
  34678. * <Truncate>
  34679. * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex
  34680. * neque, vulputate a diam et, luctus convallis lacus. Vestibulum ac
  34681. * mollis mi. Morbi id elementum massa.
  34682. * </Truncate>
  34683. * );
  34684. * }
  34685. * ```
  34686. */
  34687. const component_Truncate = create_component_createComponent({
  34688. as: 'span',
  34689. useHook: useTruncate,
  34690. name: 'Truncate'
  34691. });
  34692. /* harmony default export */ var truncate_component = (component_Truncate);
  34693. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/v-stack/hook.js
  34694. /**
  34695. * Internal dependencies
  34696. */
  34697. /**
  34698. *
  34699. * @param {import('../ui/context').ViewOwnProps<import('./types').Props, 'div'>} props
  34700. */
  34701. function useVStack(props) {
  34702. const {
  34703. expanded = false,
  34704. ...otherProps
  34705. } = Object(use_context_system["a" /* useContextSystem */])(props, 'VStack');
  34706. const hStackProps = useHStack({
  34707. direction: 'column',
  34708. expanded,
  34709. ...otherProps
  34710. });
  34711. return hStackProps;
  34712. }
  34713. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/v-stack/component.js
  34714. /**
  34715. * Internal dependencies
  34716. */
  34717. /**
  34718. * `VStack` (or Vertical Stack) is a layout component that arranges child elements in a vertical line.
  34719. *
  34720. * `VStack` can render anything inside.
  34721. *
  34722. * @example
  34723. * ```jsx
  34724. * import {
  34725. * __experimentalText as Text,
  34726. * __experimentalVStack as VStack,
  34727. * } from `@wordpress/components`;
  34728. *
  34729. * function Example() {
  34730. * return (
  34731. * <VStack>
  34732. * <Text>Code</Text>
  34733. * <Text>is</Text>
  34734. * <Text>Poetry</Text>
  34735. * </VStack>
  34736. * );
  34737. * }
  34738. * ```
  34739. */
  34740. const VStack = create_component_createComponent({
  34741. as: 'div',
  34742. useHook: useVStack,
  34743. name: 'VStack'
  34744. });
  34745. /* harmony default export */ var v_stack_component = (VStack);
  34746. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
  34747. /**
  34748. * WordPress dependencies
  34749. */
  34750. function stopPropagation(event) {
  34751. event.stopPropagation();
  34752. }
  34753. /* harmony default export */ var isolated_event_container = (Object(external_wp_element_["forwardRef"])(({
  34754. children,
  34755. ...props
  34756. }, ref) => {
  34757. external_wp_deprecated_default()('wp.components.IsolatedEventContainer', {
  34758. since: '5.7'
  34759. }); // Disable reason: this stops certain events from propagating outside of the component.
  34760. // - onMouseDown is disabled as this can cause interactions with other DOM elements
  34761. /* eslint-disable jsx-a11y/no-static-element-interactions */
  34762. return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({}, props, {
  34763. ref: ref,
  34764. onMouseDown: stopPropagation
  34765. }), children);
  34766. /* eslint-enable jsx-a11y/no-static-element-interactions */
  34767. }));
  34768. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 8 modules
  34769. var slot_fill = __webpack_require__("dSD1");
  34770. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
  34771. var use_slot = __webpack_require__("+WFq");
  34772. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/style-provider/index.js
  34773. /**
  34774. * External dependencies
  34775. */
  34776. const memoizedCreateCacheWithContainer = memize_default()(container => {
  34777. return Object(cache_browser_esm["a" /* default */])({
  34778. container
  34779. });
  34780. });
  34781. function StyleProvider({
  34782. children,
  34783. document
  34784. }) {
  34785. if (!document) {
  34786. return null;
  34787. }
  34788. const cache = memoizedCreateCacheWithContainer(document.head);
  34789. return Object(external_wp_element_["createElement"])(CacheProvider, {
  34790. value: cache
  34791. }, children);
  34792. }
  34793. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js
  34794. /**
  34795. * WordPress dependencies
  34796. */
  34797. const defaultShortcuts = {
  34798. previous: ['ctrl+shift+`', external_wp_keycodes_["rawShortcut"].access('p')],
  34799. next: ['ctrl+`', external_wp_keycodes_["rawShortcut"].access('n')]
  34800. };
  34801. function useNavigateRegions(ref, shortcuts = defaultShortcuts) {
  34802. const [isFocusingRegions, setIsFocusingRegions] = Object(external_wp_element_["useState"])(false);
  34803. function focusRegion(offset) {
  34804. const regions = Array.from(ref.current.querySelectorAll('[role="region"]'));
  34805. if (!regions.length) {
  34806. return;
  34807. }
  34808. let nextRegion = regions[0];
  34809. const selectedIndex = regions.indexOf(ref.current.ownerDocument.activeElement);
  34810. if (selectedIndex !== -1) {
  34811. let nextIndex = selectedIndex + offset;
  34812. nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;
  34813. nextIndex = nextIndex === regions.length ? 0 : nextIndex;
  34814. nextRegion = regions[nextIndex];
  34815. }
  34816. nextRegion.focus();
  34817. setIsFocusingRegions(true);
  34818. }
  34819. const focusPrevious = Object(external_wp_element_["useCallback"])(() => focusRegion(-1), []);
  34820. const focusNext = Object(external_wp_element_["useCallback"])(() => focusRegion(1), []);
  34821. Object(external_wp_compose_["useKeyboardShortcut"])(shortcuts.previous, focusPrevious, {
  34822. bindGlobal: true
  34823. });
  34824. Object(external_wp_compose_["useKeyboardShortcut"])(shortcuts.next, focusNext, {
  34825. bindGlobal: true
  34826. });
  34827. Object(external_wp_element_["useEffect"])(() => {
  34828. function onClick() {
  34829. setIsFocusingRegions(false);
  34830. }
  34831. ref.current.addEventListener('click', onClick);
  34832. return () => {
  34833. ref.current.removeEventListener('click', onClick);
  34834. };
  34835. }, [setIsFocusingRegions]);
  34836. if (!isFocusingRegions) {
  34837. return;
  34838. }
  34839. return 'is-focusing-regions';
  34840. }
  34841. /* harmony default export */ var navigate_regions = (Object(external_wp_compose_["createHigherOrderComponent"])(Component => ({
  34842. shortcuts,
  34843. ...props
  34844. }) => {
  34845. const ref = Object(external_wp_element_["useRef"])();
  34846. const className = useNavigateRegions(ref, shortcuts);
  34847. return Object(external_wp_element_["createElement"])("div", {
  34848. ref: ref,
  34849. className: className
  34850. }, Object(external_wp_element_["createElement"])(Component, props));
  34851. }, 'navigateRegions'));
  34852. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
  34853. /**
  34854. * WordPress dependencies
  34855. */
  34856. const withConstrainedTabbing = Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => function ComponentWithConstrainedTabbing(props) {
  34857. const ref = Object(external_wp_compose_["useConstrainedTabbing"])();
  34858. return Object(external_wp_element_["createElement"])("div", {
  34859. ref: ref,
  34860. tabIndex: "-1"
  34861. }, Object(external_wp_element_["createElement"])(WrappedComponent, props));
  34862. }, 'withConstrainedTabbing');
  34863. /* harmony default export */ var with_constrained_tabbing = (withConstrainedTabbing);
  34864. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js
  34865. /**
  34866. * External dependencies
  34867. */
  34868. /**
  34869. * WordPress dependencies
  34870. */
  34871. /* harmony default export */ var with_fallback_styles = (mapNodeToProps => Object(external_wp_compose_["createHigherOrderComponent"])(WrappedComponent => {
  34872. return class extends external_wp_element_["Component"] {
  34873. constructor() {
  34874. super(...arguments);
  34875. this.nodeRef = this.props.node;
  34876. this.state = {
  34877. fallbackStyles: undefined,
  34878. grabStylesCompleted: false
  34879. };
  34880. this.bindRef = this.bindRef.bind(this);
  34881. }
  34882. bindRef(node) {
  34883. if (!node) {
  34884. return;
  34885. }
  34886. this.nodeRef = node;
  34887. }
  34888. componentDidMount() {
  34889. this.grabFallbackStyles();
  34890. }
  34891. componentDidUpdate() {
  34892. this.grabFallbackStyles();
  34893. }
  34894. grabFallbackStyles() {
  34895. const {
  34896. grabStylesCompleted,
  34897. fallbackStyles
  34898. } = this.state;
  34899. if (this.nodeRef && !grabStylesCompleted) {
  34900. const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);
  34901. if (!Object(external_lodash_["isEqual"])(newFallbackStyles, fallbackStyles)) {
  34902. this.setState({
  34903. fallbackStyles: newFallbackStyles,
  34904. grabStylesCompleted: !!Object(external_lodash_["every"])(newFallbackStyles)
  34905. });
  34906. }
  34907. }
  34908. }
  34909. render() {
  34910. const wrappedComponent = Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, this.state.fallbackStyles));
  34911. return this.props.node ? wrappedComponent : Object(external_wp_element_["createElement"])("div", {
  34912. ref: this.bindRef
  34913. }, " ", wrappedComponent, " ");
  34914. }
  34915. };
  34916. }, 'withFallbackStyles'));
  34917. // EXTERNAL MODULE: external ["wp","hooks"]
  34918. var external_wp_hooks_ = __webpack_require__("g56x");
  34919. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js
  34920. /**
  34921. * External dependencies
  34922. */
  34923. /**
  34924. * WordPress dependencies
  34925. */
  34926. const ANIMATION_FRAME_PERIOD = 16;
  34927. /**
  34928. * Creates a higher-order component which adds filtering capability to the
  34929. * wrapped component. Filters get applied when the original component is about
  34930. * to be mounted. When a filter is added or removed that matches the hook name,
  34931. * the wrapped component re-renders.
  34932. *
  34933. * @param {string} hookName Hook name exposed to be used by filters.
  34934. *
  34935. * @return {Function} Higher-order component factory.
  34936. */
  34937. function withFilters(hookName) {
  34938. return Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => {
  34939. const namespace = 'core/with-filters/' + hookName;
  34940. /**
  34941. * The component definition with current filters applied. Each instance
  34942. * reuse this shared reference as an optimization to avoid excessive
  34943. * calls to `applyFilters` when many instances exist.
  34944. *
  34945. * @type {?Component}
  34946. */
  34947. let FilteredComponent;
  34948. /**
  34949. * Initializes the FilteredComponent variable once, if not already
  34950. * assigned. Subsequent calls are effectively a noop.
  34951. */
  34952. function ensureFilteredComponent() {
  34953. if (FilteredComponent === undefined) {
  34954. FilteredComponent = Object(external_wp_hooks_["applyFilters"])(hookName, OriginalComponent);
  34955. }
  34956. }
  34957. class FilteredComponentRenderer extends external_wp_element_["Component"] {
  34958. constructor() {
  34959. super(...arguments);
  34960. ensureFilteredComponent();
  34961. }
  34962. componentDidMount() {
  34963. FilteredComponentRenderer.instances.push(this); // If there were previously no mounted instances for components
  34964. // filtered on this hook, add the hook handler.
  34965. if (FilteredComponentRenderer.instances.length === 1) {
  34966. Object(external_wp_hooks_["addAction"])('hookRemoved', namespace, onHooksUpdated);
  34967. Object(external_wp_hooks_["addAction"])('hookAdded', namespace, onHooksUpdated);
  34968. }
  34969. }
  34970. componentWillUnmount() {
  34971. FilteredComponentRenderer.instances = Object(external_lodash_["without"])(FilteredComponentRenderer.instances, this); // If this was the last of the mounted components filtered on
  34972. // this hook, remove the hook handler.
  34973. if (FilteredComponentRenderer.instances.length === 0) {
  34974. Object(external_wp_hooks_["removeAction"])('hookRemoved', namespace);
  34975. Object(external_wp_hooks_["removeAction"])('hookAdded', namespace);
  34976. }
  34977. }
  34978. render() {
  34979. return Object(external_wp_element_["createElement"])(FilteredComponent, this.props);
  34980. }
  34981. }
  34982. FilteredComponentRenderer.instances = [];
  34983. /**
  34984. * Updates the FilteredComponent definition, forcing a render for each
  34985. * mounted instance. This occurs a maximum of once per animation frame.
  34986. */
  34987. const throttledForceUpdate = Object(external_lodash_["debounce"])(() => {
  34988. // Recreate the filtered component, only after delay so that it's
  34989. // computed once, even if many filters added.
  34990. FilteredComponent = Object(external_wp_hooks_["applyFilters"])(hookName, OriginalComponent); // Force each instance to render.
  34991. FilteredComponentRenderer.instances.forEach(instance => {
  34992. instance.forceUpdate();
  34993. });
  34994. }, ANIMATION_FRAME_PERIOD);
  34995. /**
  34996. * When a filter is added or removed for the matching hook name, each
  34997. * mounted instance should re-render with the new filters having been
  34998. * applied to the original component.
  34999. *
  35000. * @param {string} updatedHookName Name of the hook that was updated.
  35001. */
  35002. function onHooksUpdated(updatedHookName) {
  35003. if (updatedHookName === hookName) {
  35004. throttledForceUpdate();
  35005. }
  35006. }
  35007. return FilteredComponentRenderer;
  35008. }, 'withFilters');
  35009. }
  35010. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
  35011. /**
  35012. * WordPress dependencies
  35013. */
  35014. /**
  35015. * Returns true if the given object is component-like. An object is component-
  35016. * like if it is an instance of wp.element.Component, or is a function.
  35017. *
  35018. * @param {*} object Object to test.
  35019. *
  35020. * @return {boolean} Whether object is component-like.
  35021. */
  35022. function isComponentLike(object) {
  35023. return object instanceof external_wp_element_["Component"] || typeof object === 'function';
  35024. }
  35025. /**
  35026. * Higher Order Component used to be used to wrap disposable elements like
  35027. * sidebars, modals, dropdowns. When mounting the wrapped component, we track a
  35028. * reference to the current active element so we know where to restore focus
  35029. * when the component is unmounted.
  35030. *
  35031. * @param {(WPComponent|Object)} options The component to be enhanced with
  35032. * focus return behavior, or an object
  35033. * describing the component and the
  35034. * focus return characteristics.
  35035. *
  35036. * @return {Function} Higher Order Component with the focus restauration behaviour.
  35037. */
  35038. /* harmony default export */ var with_focus_return = (Object(external_wp_compose_["createHigherOrderComponent"])(options => {
  35039. const HoC = ({
  35040. onFocusReturn
  35041. } = {}) => WrappedComponent => {
  35042. const WithFocusReturn = props => {
  35043. const ref = Object(external_wp_compose_["useFocusReturn"])(onFocusReturn);
  35044. return Object(external_wp_element_["createElement"])("div", {
  35045. ref: ref
  35046. }, Object(external_wp_element_["createElement"])(WrappedComponent, props));
  35047. };
  35048. return WithFocusReturn;
  35049. };
  35050. if (isComponentLike(options)) {
  35051. const WrappedComponent = options;
  35052. return HoC()(WrappedComponent);
  35053. }
  35054. return HoC(options);
  35055. }, 'withFocusReturn'));
  35056. const with_focus_return_Provider = ({
  35057. children
  35058. }) => {
  35059. external_wp_deprecated_default()('wp.components.FocusReturnProvider component', {
  35060. since: '5.7',
  35061. hint: 'This provider is not used anymore. You can just remove it from your codebase'
  35062. });
  35063. return children;
  35064. };
  35065. // EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
  35066. var v4 = __webpack_require__("7Cbv");
  35067. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js
  35068. /**
  35069. * External dependencies
  35070. */
  35071. /**
  35072. * WordPress dependencies
  35073. */
  35074. /**
  35075. * Internal dependencies
  35076. */
  35077. /**
  35078. * Override the default edit UI to include notices if supported.
  35079. *
  35080. * @param {WPComponent} OriginalComponent Original component.
  35081. *
  35082. * @return {WPComponent} Wrapped component.
  35083. */
  35084. /* harmony default export */ var with_notices = (Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => {
  35085. function Component(props, ref) {
  35086. const [noticeList, setNoticeList] = Object(external_wp_element_["useState"])([]);
  35087. const noticeOperations = Object(external_wp_element_["useMemo"])(() => {
  35088. /**
  35089. * Function passed down as a prop that adds a new notice.
  35090. *
  35091. * @param {Object} notice Notice to add.
  35092. */
  35093. const createNotice = notice => {
  35094. const noticeToAdd = notice.id ? notice : { ...notice,
  35095. id: Object(v4["a" /* default */])()
  35096. };
  35097. setNoticeList(current => [...current, noticeToAdd]);
  35098. };
  35099. return {
  35100. createNotice,
  35101. /**
  35102. * Function passed as a prop that adds a new error notice.
  35103. *
  35104. * @param {string} msg Error message of the notice.
  35105. */
  35106. createErrorNotice: msg => {
  35107. createNotice({
  35108. status: 'error',
  35109. content: msg
  35110. });
  35111. },
  35112. /**
  35113. * Removes a notice by id.
  35114. *
  35115. * @param {string} id Id of the notice to remove.
  35116. */
  35117. removeNotice: id => {
  35118. setNoticeList(current => current.filter(notice => notice.id !== id));
  35119. },
  35120. /**
  35121. * Removes all notices
  35122. */
  35123. removeAllNotices: () => {
  35124. setNoticeList([]);
  35125. }
  35126. };
  35127. }, []);
  35128. const propsOut = { ...props,
  35129. noticeList,
  35130. noticeOperations,
  35131. noticeUI: noticeList.length > 0 && Object(external_wp_element_["createElement"])(list, {
  35132. className: "components-with-notices-ui",
  35133. notices: noticeList,
  35134. onRemove: noticeOperations.removeNotice
  35135. })
  35136. };
  35137. return isForwardRef ? Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, propsOut, {
  35138. ref: ref
  35139. })) : Object(external_wp_element_["createElement"])(OriginalComponent, propsOut);
  35140. }
  35141. let isForwardRef;
  35142. const {
  35143. render
  35144. } = OriginalComponent; // Returns a forwardRef if OriginalComponent appears to be a forwardRef
  35145. if (typeof render === 'function') {
  35146. isForwardRef = true;
  35147. return Object(external_wp_element_["forwardRef"])(Component);
  35148. }
  35149. return Component;
  35150. }));
  35151. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js
  35152. var with_next = __webpack_require__("9NHk");
  35153. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/component-system-provider.js
  35154. /**
  35155. * Internal dependencies
  35156. */
  35157. /**
  35158. * @param {Object} props
  35159. * @param {string[]} [props.__unstableNextInclude]
  35160. * @param {import('react').ReactNode} props.children
  35161. * @param {any} props.value
  35162. */
  35163. function ComponentSystemProvider({
  35164. __unstableNextInclude = [],
  35165. children,
  35166. value = {}
  35167. }) {
  35168. if (false) {}
  35169. return children;
  35170. }
  35171. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/index.js
  35172. // Primitives
  35173. // Components
  35174. // Higher-Order Components
  35175. // Component System
  35176. /***/ }),
  35177. /***/ "SIPS":
  35178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35179. "use strict";
  35180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRegisteredStyles; });
  35181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return insertStyles; });
  35182. var isBrowser = "object" !== 'undefined';
  35183. function getRegisteredStyles(registered, registeredStyles, classNames) {
  35184. var rawClassName = '';
  35185. classNames.split(' ').forEach(function (className) {
  35186. if (registered[className] !== undefined) {
  35187. registeredStyles.push(registered[className]);
  35188. } else {
  35189. rawClassName += className + " ";
  35190. }
  35191. });
  35192. return rawClassName;
  35193. }
  35194. var insertStyles = function insertStyles(cache, serialized, isStringTag) {
  35195. var className = cache.key + "-" + serialized.name;
  35196. if ( // we only need to add the styles to the registered cache if the
  35197. // class name could be used further down
  35198. // the tree but if it's a string tag, we know it won't
  35199. // so we don't have to add it to registered cache.
  35200. // this improves memory usage since we can avoid storing the whole style string
  35201. (isStringTag === false || // we need to always store it if we're in compat mode and
  35202. // in node since emotion-server relies on whether a style is in
  35203. // the registered cache to know whether a style is global or not
  35204. // also, note that this check will be dead code eliminated in the browser
  35205. isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
  35206. cache.registered[className] = serialized.styles;
  35207. }
  35208. if (cache.inserted[serialized.name] === undefined) {
  35209. var current = serialized;
  35210. do {
  35211. var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
  35212. current = current.next;
  35213. } while (current !== undefined);
  35214. }
  35215. };
  35216. /***/ }),
  35217. /***/ "SSiF":
  35218. /***/ (function(module, exports, __webpack_require__) {
  35219. var e=__webpack_require__("cDcd"),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
  35220. /***/ }),
  35221. /***/ "SegQ":
  35222. /***/ (function(module, exports, __webpack_require__) {
  35223. "use strict";
  35224. var callBound = __webpack_require__("6ZB3");
  35225. var hasToStringTag = __webpack_require__("B6Q+")();
  35226. var has;
  35227. var $exec;
  35228. var isRegexMarker;
  35229. var badStringifier;
  35230. if (hasToStringTag) {
  35231. has = callBound('Object.prototype.hasOwnProperty');
  35232. $exec = callBound('RegExp.prototype.exec');
  35233. isRegexMarker = {};
  35234. var throwRegexMarker = function () {
  35235. throw isRegexMarker;
  35236. };
  35237. badStringifier = {
  35238. toString: throwRegexMarker,
  35239. valueOf: throwRegexMarker
  35240. };
  35241. if (typeof Symbol.toPrimitive === 'symbol') {
  35242. badStringifier[Symbol.toPrimitive] = throwRegexMarker;
  35243. }
  35244. }
  35245. var $toString = callBound('Object.prototype.toString');
  35246. var gOPD = Object.getOwnPropertyDescriptor;
  35247. var regexClass = '[object RegExp]';
  35248. module.exports = hasToStringTag
  35249. // eslint-disable-next-line consistent-return
  35250. ? function isRegex(value) {
  35251. if (!value || typeof value !== 'object') {
  35252. return false;
  35253. }
  35254. var descriptor = gOPD(value, 'lastIndex');
  35255. var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
  35256. if (!hasLastIndexDataProperty) {
  35257. return false;
  35258. }
  35259. try {
  35260. $exec(value, badStringifier);
  35261. } catch (e) {
  35262. return e === isRegexMarker;
  35263. }
  35264. }
  35265. : function isRegex(value) {
  35266. // In older browsers, typeof regex incorrectly returns 'function'
  35267. if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
  35268. return false;
  35269. }
  35270. return $toString(value) === regexClass;
  35271. };
  35272. /***/ }),
  35273. /***/ "SksO":
  35274. /***/ (function(module, exports) {
  35275. function _setPrototypeOf(o, p) {
  35276. module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  35277. o.__proto__ = p;
  35278. return o;
  35279. };
  35280. module.exports["default"] = module.exports, module.exports.__esModule = true;
  35281. return _setPrototypeOf(o, p);
  35282. }
  35283. module.exports = _setPrototypeOf;
  35284. module.exports["default"] = module.exports, module.exports.__esModule = true;
  35285. /***/ }),
  35286. /***/ "SyVe":
  35287. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35288. "use strict";
  35289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; });
  35290. /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs");
  35291. // Thanks to Fluent UI for doing the [research on IE11 memery leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427)
  35292. var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window"
  35293. // hits a memory leak, whereas aliasing it and calling "typeof _window" does not.
  35294. // Caching the window value at the file scope lets us minimize the impact.
  35295. try {
  35296. _window = window;
  35297. } catch (e) {
  35298. /* no-op */
  35299. }
  35300. /**
  35301. * Returns `element.ownerDocument.defaultView || window`.
  35302. */
  35303. function getWindow(element) {
  35304. if (!element) {
  35305. return _window;
  35306. }
  35307. return Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).defaultView || _window;
  35308. }
  35309. /***/ }),
  35310. /***/ "TFuP":
  35311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35312. "use strict";
  35313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPOSITE_KEYS; });
  35314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return COMPOSITE_GROUP_KEYS; });
  35315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMPOSITE_ITEM_KEYS; });
  35316. /* unused harmony export c */
  35317. // Automatically generated
  35318. var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
  35319. var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS;
  35320. var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS;
  35321. var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS;
  35322. var COMPOSITE_ITEM_WIDGET_KEYS = COMPOSITE_ITEM_KEYS;
  35323. /***/ }),
  35324. /***/ "TG4+":
  35325. /***/ (function(module, exports, __webpack_require__) {
  35326. "use strict";
  35327. Object.defineProperty(exports, "__esModule", {
  35328. value: true
  35329. });
  35330. exports.withStylesPropTypes = exports.css = undefined;
  35331. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  35332. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  35333. exports.withStyles = withStyles;
  35334. var _object = __webpack_require__("Koq/");
  35335. var _object2 = _interopRequireDefault(_object);
  35336. var _react = __webpack_require__("cDcd");
  35337. var _react2 = _interopRequireDefault(_react);
  35338. var _propTypes = __webpack_require__("17x9");
  35339. var _propTypes2 = _interopRequireDefault(_propTypes);
  35340. var _hoistNonReactStatics = __webpack_require__("2mql");
  35341. var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
  35342. var _constants = __webpack_require__("QEu6");
  35343. var _brcast = __webpack_require__("sDMB");
  35344. var _brcast2 = _interopRequireDefault(_brcast);
  35345. var _ThemedStyleSheet = __webpack_require__("030x");
  35346. var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
  35347. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  35348. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35349. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  35350. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  35351. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */
  35352. // Add some named exports to assist in upgrading and for convenience
  35353. var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
  35354. var withStylesPropTypes = exports.withStylesPropTypes = {
  35355. styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
  35356. theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
  35357. css: _propTypes2['default'].func.isRequired
  35358. };
  35359. var EMPTY_STYLES = {};
  35360. var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {
  35361. return EMPTY_STYLES;
  35362. };
  35363. var START_MARK = 'react-with-styles.createStyles.start';
  35364. var END_MARK = 'react-with-styles.createStyles.end';
  35365. function baseClass(pureComponent) {
  35366. if (pureComponent) {
  35367. if (!_react2['default'].PureComponent) {
  35368. throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later');
  35369. }
  35370. return _react2['default'].PureComponent;
  35371. }
  35372. return _react2['default'].Component;
  35373. }
  35374. var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']);
  35375. var defaultDirection = _constants.DIRECTIONS.LTR;
  35376. function withStyles(styleFn) {
  35377. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  35378. _ref$stylesPropName = _ref.stylesPropName,
  35379. stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName,
  35380. _ref$themePropName = _ref.themePropName,
  35381. themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName,
  35382. _ref$cssPropName = _ref.cssPropName,
  35383. cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName,
  35384. _ref$flushBefore = _ref.flushBefore,
  35385. flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore,
  35386. _ref$pureComponent = _ref.pureComponent,
  35387. pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent;
  35388. var styleDefLTR = void 0;
  35389. var styleDefRTL = void 0;
  35390. var currentThemeLTR = void 0;
  35391. var currentThemeRTL = void 0;
  35392. var BaseClass = baseClass(pureComponent);
  35393. function getResolveMethod(direction) {
  35394. return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL;
  35395. }
  35396. function getCurrentTheme(direction) {
  35397. return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL;
  35398. }
  35399. function getStyleDef(direction, wrappedComponentName) {
  35400. var currentTheme = getCurrentTheme(direction);
  35401. var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL;
  35402. var registeredTheme = _ThemedStyleSheet2['default'].get();
  35403. // Return the existing styles if they've already been defined
  35404. // and if the theme used to create them corresponds to the theme
  35405. // registered with ThemedStyleSheet
  35406. if (styleDef && currentTheme === registeredTheme) {
  35407. return styleDef;
  35408. }
  35409. if (false) {}
  35410. var isRTL = direction === _constants.DIRECTIONS.RTL;
  35411. if (isRTL) {
  35412. styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN;
  35413. currentThemeRTL = registeredTheme;
  35414. styleDef = styleDefRTL;
  35415. } else {
  35416. styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN;
  35417. currentThemeLTR = registeredTheme;
  35418. styleDef = styleDefLTR;
  35419. }
  35420. if (false) { var measureName; }
  35421. return styleDef;
  35422. }
  35423. function getState(direction, wrappedComponentName) {
  35424. return {
  35425. resolveMethod: getResolveMethod(direction),
  35426. styleDef: getStyleDef(direction, wrappedComponentName)
  35427. };
  35428. }
  35429. return function () {
  35430. function withStylesHOC(WrappedComponent) {
  35431. var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
  35432. // NOTE: Use a class here so components are ref-able if need be:
  35433. // eslint-disable-next-line react/prefer-stateless-function
  35434. var WithStyles = function (_BaseClass) {
  35435. _inherits(WithStyles, _BaseClass);
  35436. function WithStyles(props, context) {
  35437. _classCallCheck(this, WithStyles);
  35438. var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context));
  35439. var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection;
  35440. _this.state = getState(direction, wrappedComponentName);
  35441. return _this;
  35442. }
  35443. _createClass(WithStyles, [{
  35444. key: 'componentDidMount',
  35445. value: function () {
  35446. function componentDidMount() {
  35447. var _this2 = this;
  35448. if (this.context[_constants.CHANNEL]) {
  35449. // subscribe to future direction changes
  35450. this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) {
  35451. _this2.setState(getState(direction, wrappedComponentName));
  35452. });
  35453. }
  35454. }
  35455. return componentDidMount;
  35456. }()
  35457. }, {
  35458. key: 'componentWillUnmount',
  35459. value: function () {
  35460. function componentWillUnmount() {
  35461. if (this.channelUnsubscribe) {
  35462. this.channelUnsubscribe();
  35463. }
  35464. }
  35465. return componentWillUnmount;
  35466. }()
  35467. }, {
  35468. key: 'render',
  35469. value: function () {
  35470. function render() {
  35471. var _ref2;
  35472. // As some components will depend on previous styles in
  35473. // the component tree, we provide the option of flushing the
  35474. // buffered styles (i.e. to a style tag) **before** the rendering
  35475. // cycle begins.
  35476. //
  35477. // The interfaces provide the optional "flush" method which
  35478. // is run in turn by ThemedStyleSheet.flush.
  35479. if (flushBefore) {
  35480. _ThemedStyleSheet2['default'].flush();
  35481. }
  35482. var _state = this.state,
  35483. resolveMethod = _state.resolveMethod,
  35484. styleDef = _state.styleDef;
  35485. return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2)));
  35486. }
  35487. return render;
  35488. }()
  35489. }]);
  35490. return WithStyles;
  35491. }(BaseClass);
  35492. WithStyles.WrappedComponent = WrappedComponent;
  35493. WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
  35494. WithStyles.contextTypes = contextTypes;
  35495. if (WrappedComponent.propTypes) {
  35496. WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes);
  35497. delete WithStyles.propTypes[stylesPropName];
  35498. delete WithStyles.propTypes[themePropName];
  35499. delete WithStyles.propTypes[cssPropName];
  35500. }
  35501. if (WrappedComponent.defaultProps) {
  35502. WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps);
  35503. }
  35504. return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
  35505. }
  35506. return withStylesHOC;
  35507. }();
  35508. }
  35509. /***/ }),
  35510. /***/ "TO8r":
  35511. /***/ (function(module, exports) {
  35512. /** Used to match a single whitespace character. */
  35513. var reWhitespace = /\s/;
  35514. /**
  35515. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  35516. * character of `string`.
  35517. *
  35518. * @private
  35519. * @param {string} string The string to inspect.
  35520. * @returns {number} Returns the index of the last non-whitespace character.
  35521. */
  35522. function trimmedEndIndex(string) {
  35523. var index = string.length;
  35524. while (index-- && reWhitespace.test(string.charAt(index))) {}
  35525. return index;
  35526. }
  35527. module.exports = trimmedEndIndex;
  35528. /***/ }),
  35529. /***/ "TOwV":
  35530. /***/ (function(module, exports, __webpack_require__) {
  35531. "use strict";
  35532. if (true) {
  35533. module.exports = __webpack_require__("qT12");
  35534. } else {}
  35535. /***/ }),
  35536. /***/ "TSYQ":
  35537. /***/ (function(module, exports, __webpack_require__) {
  35538. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  35539. Copyright (c) 2018 Jed Watson.
  35540. Licensed under the MIT License (MIT), see
  35541. http://jedwatson.github.io/classnames
  35542. */
  35543. /* global define */
  35544. (function () {
  35545. 'use strict';
  35546. var hasOwn = {}.hasOwnProperty;
  35547. function classNames() {
  35548. var classes = [];
  35549. for (var i = 0; i < arguments.length; i++) {
  35550. var arg = arguments[i];
  35551. if (!arg) continue;
  35552. var argType = typeof arg;
  35553. if (argType === 'string' || argType === 'number') {
  35554. classes.push(arg);
  35555. } else if (Array.isArray(arg)) {
  35556. if (arg.length) {
  35557. var inner = classNames.apply(null, arg);
  35558. if (inner) {
  35559. classes.push(inner);
  35560. }
  35561. }
  35562. } else if (argType === 'object') {
  35563. if (arg.toString === Object.prototype.toString) {
  35564. for (var key in arg) {
  35565. if (hasOwn.call(arg, key) && arg[key]) {
  35566. classes.push(key);
  35567. }
  35568. }
  35569. } else {
  35570. classes.push(arg.toString());
  35571. }
  35572. }
  35573. }
  35574. return classes.join(' ');
  35575. }
  35576. if ( true && module.exports) {
  35577. classNames.default = classNames;
  35578. module.exports = classNames;
  35579. } else if (true) {
  35580. // register as 'classnames', consistent with npm package name
  35581. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  35582. return classNames;
  35583. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  35584. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  35585. } else {}
  35586. }());
  35587. /***/ }),
  35588. /***/ "TUyu":
  35589. /***/ (function(module, exports, __webpack_require__) {
  35590. "use strict";
  35591. Object.defineProperty(exports, "__esModule", {
  35592. value: true
  35593. });
  35594. exports['default'] = registerCSSInterfaceWithDefaultTheme;
  35595. var _reactWithStylesInterfaceCss = __webpack_require__("lzPt");
  35596. var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss);
  35597. var _registerInterfaceWithDefaultTheme = __webpack_require__("WI5Z");
  35598. var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme);
  35599. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  35600. function registerCSSInterfaceWithDefaultTheme() {
  35601. (0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']);
  35602. }
  35603. /***/ }),
  35604. /***/ "Teho":
  35605. /***/ (function(module, exports, __webpack_require__) {
  35606. "use strict";
  35607. module.exports = function isPrimitive(value) {
  35608. return value === null || (typeof value !== 'function' && typeof value !== 'object');
  35609. };
  35610. /***/ }),
  35611. /***/ "Thzv":
  35612. /***/ (function(module, exports, __webpack_require__) {
  35613. "use strict";
  35614. Object.defineProperty(exports, "__esModule", {
  35615. value: true
  35616. });
  35617. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  35618. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  35619. var _object = __webpack_require__("Koq/");
  35620. var _object2 = _interopRequireDefault(_object);
  35621. var _react = __webpack_require__("cDcd");
  35622. var _react2 = _interopRequireDefault(_react);
  35623. var _propTypes = __webpack_require__("17x9");
  35624. var _propTypes2 = _interopRequireDefault(_propTypes);
  35625. var _reactAddonsShallowCompare = __webpack_require__("YZDV");
  35626. var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
  35627. var _reactMomentProptypes = __webpack_require__("XGBb");
  35628. var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
  35629. var _airbnbPropTypes = __webpack_require__("Hsqg");
  35630. var _reactWithStyles = __webpack_require__("TG4+");
  35631. var _moment = __webpack_require__("wy2R");
  35632. var _moment2 = _interopRequireDefault(_moment);
  35633. var _consolidatedEvents = __webpack_require__("1TsT");
  35634. var _defaultPhrases = __webpack_require__("vV+G");
  35635. var _getPhrasePropTypes = __webpack_require__("yc2e");
  35636. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  35637. var _CalendarMonth = __webpack_require__("mMiH");
  35638. var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth);
  35639. var _isTransitionEndSupported = __webpack_require__("dRQD");
  35640. var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported);
  35641. var _getTransformStyles = __webpack_require__("q86A");
  35642. var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles);
  35643. var _getCalendarMonthWidth = __webpack_require__("m2ax");
  35644. var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
  35645. var _toISOMonthString = __webpack_require__("jenk");
  35646. var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
  35647. var _isPrevMonth = __webpack_require__("Pq96");
  35648. var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth);
  35649. var _isNextMonth = __webpack_require__("6HWY");
  35650. var _isNextMonth2 = _interopRequireDefault(_isNextMonth);
  35651. var _ModifiersShape = __webpack_require__("J7JS");
  35652. var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
  35653. var _ScrollableOrientationShape = __webpack_require__("aE6U");
  35654. var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
  35655. var _DayOfWeekShape = __webpack_require__("2S2E");
  35656. var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
  35657. var _constants = __webpack_require__("Fv1B");
  35658. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  35659. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35660. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  35661. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  35662. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  35663. enableOutsideDays: _propTypes2['default'].bool,
  35664. firstVisibleMonthIndex: _propTypes2['default'].number,
  35665. horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
  35666. initialMonth: _reactMomentProptypes2['default'].momentObj,
  35667. isAnimating: _propTypes2['default'].bool,
  35668. numberOfMonths: _propTypes2['default'].number,
  35669. modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
  35670. orientation: _ScrollableOrientationShape2['default'],
  35671. onDayClick: _propTypes2['default'].func,
  35672. onDayMouseEnter: _propTypes2['default'].func,
  35673. onDayMouseLeave: _propTypes2['default'].func,
  35674. onMonthTransitionEnd: _propTypes2['default'].func,
  35675. onMonthChange: _propTypes2['default'].func,
  35676. onYearChange: _propTypes2['default'].func,
  35677. renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  35678. renderCalendarDay: _propTypes2['default'].func,
  35679. renderDayContents: _propTypes2['default'].func,
  35680. translationValue: _propTypes2['default'].number,
  35681. renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  35682. daySize: _airbnbPropTypes.nonNegativeInteger,
  35683. focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
  35684. isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
  35685. firstDayOfWeek: _DayOfWeekShape2['default'],
  35686. setMonthTitleHeight: _propTypes2['default'].func,
  35687. isRTL: _propTypes2['default'].bool,
  35688. transitionDuration: _airbnbPropTypes.nonNegativeInteger,
  35689. verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
  35690. // i18n
  35691. monthFormat: _propTypes2['default'].string,
  35692. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
  35693. dayAriaLabelFormat: _propTypes2['default'].string
  35694. }));
  35695. var defaultProps = {
  35696. enableOutsideDays: false,
  35697. firstVisibleMonthIndex: 0,
  35698. horizontalMonthPadding: 13,
  35699. initialMonth: (0, _moment2['default'])(),
  35700. isAnimating: false,
  35701. numberOfMonths: 1,
  35702. modifiers: {},
  35703. orientation: _constants.HORIZONTAL_ORIENTATION,
  35704. onDayClick: function () {
  35705. function onDayClick() {}
  35706. return onDayClick;
  35707. }(),
  35708. onDayMouseEnter: function () {
  35709. function onDayMouseEnter() {}
  35710. return onDayMouseEnter;
  35711. }(),
  35712. onDayMouseLeave: function () {
  35713. function onDayMouseLeave() {}
  35714. return onDayMouseLeave;
  35715. }(),
  35716. onMonthChange: function () {
  35717. function onMonthChange() {}
  35718. return onMonthChange;
  35719. }(),
  35720. onYearChange: function () {
  35721. function onYearChange() {}
  35722. return onYearChange;
  35723. }(),
  35724. onMonthTransitionEnd: function () {
  35725. function onMonthTransitionEnd() {}
  35726. return onMonthTransitionEnd;
  35727. }(),
  35728. renderMonthText: null,
  35729. renderCalendarDay: undefined,
  35730. renderDayContents: null,
  35731. translationValue: null,
  35732. renderMonthElement: null,
  35733. daySize: _constants.DAY_SIZE,
  35734. focusedDate: null,
  35735. isFocused: false,
  35736. firstDayOfWeek: null,
  35737. setMonthTitleHeight: null,
  35738. isRTL: false,
  35739. transitionDuration: 200,
  35740. verticalBorderSpacing: undefined,
  35741. // i18n
  35742. monthFormat: 'MMMM YYYY', // english locale
  35743. phrases: _defaultPhrases.CalendarDayPhrases,
  35744. dayAriaLabelFormat: undefined
  35745. };
  35746. function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) {
  35747. var month = initialMonth.clone();
  35748. if (!withoutTransitionMonths) month = month.subtract(1, 'month');
  35749. var months = [];
  35750. for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
  35751. months.push(month);
  35752. month = month.clone().add(1, 'month');
  35753. }
  35754. return months;
  35755. }
  35756. var CalendarMonthGrid = function (_React$Component) {
  35757. _inherits(CalendarMonthGrid, _React$Component);
  35758. function CalendarMonthGrid(props) {
  35759. _classCallCheck(this, CalendarMonthGrid);
  35760. var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props));
  35761. var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE;
  35762. _this.state = {
  35763. months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths)
  35764. };
  35765. _this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])();
  35766. _this.onTransitionEnd = _this.onTransitionEnd.bind(_this);
  35767. _this.setContainerRef = _this.setContainerRef.bind(_this);
  35768. _this.locale = _moment2['default'].locale();
  35769. _this.onMonthSelect = _this.onMonthSelect.bind(_this);
  35770. _this.onYearSelect = _this.onYearSelect.bind(_this);
  35771. return _this;
  35772. }
  35773. _createClass(CalendarMonthGrid, [{
  35774. key: 'componentDidMount',
  35775. value: function () {
  35776. function componentDidMount() {
  35777. this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd);
  35778. }
  35779. return componentDidMount;
  35780. }()
  35781. }, {
  35782. key: 'componentWillReceiveProps',
  35783. value: function () {
  35784. function componentWillReceiveProps(nextProps) {
  35785. var _this2 = this;
  35786. var initialMonth = nextProps.initialMonth,
  35787. numberOfMonths = nextProps.numberOfMonths,
  35788. orientation = nextProps.orientation;
  35789. var months = this.state.months;
  35790. var _props = this.props,
  35791. prevInitialMonth = _props.initialMonth,
  35792. prevNumberOfMonths = _props.numberOfMonths;
  35793. var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month');
  35794. var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths;
  35795. var newMonths = months;
  35796. if (hasMonthChanged && !hasNumberOfMonthsChanged) {
  35797. if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) {
  35798. newMonths = months.slice(1);
  35799. newMonths.push(months[months.length - 1].clone().add(1, 'month'));
  35800. } else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) {
  35801. newMonths = months.slice(0, months.length - 1);
  35802. newMonths.unshift(months[0].clone().subtract(1, 'month'));
  35803. } else {
  35804. var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  35805. newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths);
  35806. }
  35807. }
  35808. if (hasNumberOfMonthsChanged) {
  35809. var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  35810. newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths);
  35811. }
  35812. var momentLocale = _moment2['default'].locale();
  35813. if (this.locale !== momentLocale) {
  35814. this.locale = momentLocale;
  35815. newMonths = newMonths.map(function (m) {
  35816. return m.locale(_this2.locale);
  35817. });
  35818. }
  35819. this.setState({
  35820. months: newMonths
  35821. });
  35822. }
  35823. return componentWillReceiveProps;
  35824. }()
  35825. }, {
  35826. key: 'shouldComponentUpdate',
  35827. value: function () {
  35828. function shouldComponentUpdate(nextProps, nextState) {
  35829. return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
  35830. }
  35831. return shouldComponentUpdate;
  35832. }()
  35833. }, {
  35834. key: 'componentDidUpdate',
  35835. value: function () {
  35836. function componentDidUpdate() {
  35837. var _props2 = this.props,
  35838. isAnimating = _props2.isAnimating,
  35839. transitionDuration = _props2.transitionDuration,
  35840. onMonthTransitionEnd = _props2.onMonthTransitionEnd;
  35841. // For IE9, immediately call onMonthTransitionEnd instead of
  35842. // waiting for the animation to complete. Similarly, if transitionDuration
  35843. // is set to 0, also immediately invoke the onMonthTransitionEnd callback
  35844. if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) {
  35845. onMonthTransitionEnd();
  35846. }
  35847. }
  35848. return componentDidUpdate;
  35849. }()
  35850. }, {
  35851. key: 'componentWillUnmount',
  35852. value: function () {
  35853. function componentWillUnmount() {
  35854. if (this.removeEventListener) this.removeEventListener();
  35855. }
  35856. return componentWillUnmount;
  35857. }()
  35858. }, {
  35859. key: 'onTransitionEnd',
  35860. value: function () {
  35861. function onTransitionEnd() {
  35862. var onMonthTransitionEnd = this.props.onMonthTransitionEnd;
  35863. onMonthTransitionEnd();
  35864. }
  35865. return onTransitionEnd;
  35866. }()
  35867. }, {
  35868. key: 'onMonthSelect',
  35869. value: function () {
  35870. function onMonthSelect(currentMonth, newMonthVal) {
  35871. var newMonth = currentMonth.clone();
  35872. var _props3 = this.props,
  35873. onMonthChange = _props3.onMonthChange,
  35874. orientation = _props3.orientation;
  35875. var months = this.state.months;
  35876. var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  35877. var initialMonthSubtraction = months.indexOf(currentMonth);
  35878. if (!withoutTransitionMonths) {
  35879. initialMonthSubtraction -= 1;
  35880. }
  35881. newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months');
  35882. onMonthChange(newMonth);
  35883. }
  35884. return onMonthSelect;
  35885. }()
  35886. }, {
  35887. key: 'onYearSelect',
  35888. value: function () {
  35889. function onYearSelect(currentMonth, newYearVal) {
  35890. var newMonth = currentMonth.clone();
  35891. var _props4 = this.props,
  35892. onYearChange = _props4.onYearChange,
  35893. orientation = _props4.orientation;
  35894. var months = this.state.months;
  35895. var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  35896. var initialMonthSubtraction = months.indexOf(currentMonth);
  35897. if (!withoutTransitionMonths) {
  35898. initialMonthSubtraction -= 1;
  35899. }
  35900. newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months');
  35901. onYearChange(newMonth);
  35902. }
  35903. return onYearSelect;
  35904. }()
  35905. }, {
  35906. key: 'setContainerRef',
  35907. value: function () {
  35908. function setContainerRef(ref) {
  35909. this.container = ref;
  35910. }
  35911. return setContainerRef;
  35912. }()
  35913. }, {
  35914. key: 'render',
  35915. value: function () {
  35916. function render() {
  35917. var _this3 = this;
  35918. var _props5 = this.props,
  35919. enableOutsideDays = _props5.enableOutsideDays,
  35920. firstVisibleMonthIndex = _props5.firstVisibleMonthIndex,
  35921. horizontalMonthPadding = _props5.horizontalMonthPadding,
  35922. isAnimating = _props5.isAnimating,
  35923. modifiers = _props5.modifiers,
  35924. numberOfMonths = _props5.numberOfMonths,
  35925. monthFormat = _props5.monthFormat,
  35926. orientation = _props5.orientation,
  35927. translationValue = _props5.translationValue,
  35928. daySize = _props5.daySize,
  35929. onDayMouseEnter = _props5.onDayMouseEnter,
  35930. onDayMouseLeave = _props5.onDayMouseLeave,
  35931. onDayClick = _props5.onDayClick,
  35932. renderMonthText = _props5.renderMonthText,
  35933. renderCalendarDay = _props5.renderCalendarDay,
  35934. renderDayContents = _props5.renderDayContents,
  35935. renderMonthElement = _props5.renderMonthElement,
  35936. onMonthTransitionEnd = _props5.onMonthTransitionEnd,
  35937. firstDayOfWeek = _props5.firstDayOfWeek,
  35938. focusedDate = _props5.focusedDate,
  35939. isFocused = _props5.isFocused,
  35940. isRTL = _props5.isRTL,
  35941. styles = _props5.styles,
  35942. phrases = _props5.phrases,
  35943. dayAriaLabelFormat = _props5.dayAriaLabelFormat,
  35944. transitionDuration = _props5.transitionDuration,
  35945. verticalBorderSpacing = _props5.verticalBorderSpacing,
  35946. setMonthTitleHeight = _props5.setMonthTitleHeight;
  35947. var months = this.state.months;
  35948. var isVertical = orientation === _constants.VERTICAL_ORIENTATION;
  35949. var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
  35950. var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
  35951. var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding);
  35952. var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth;
  35953. var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX';
  35954. var transformValue = transformType + '(' + String(translationValue) + 'px)';
  35955. return _react2['default'].createElement(
  35956. 'div',
  35957. _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && {
  35958. transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out'
  35959. }, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), {
  35960. width: width
  35961. })), {
  35962. ref: this.setContainerRef,
  35963. onTransitionEnd: onMonthTransitionEnd
  35964. }),
  35965. months.map(function (month, i) {
  35966. var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths;
  35967. var hideForAnimation = i === 0 && !isVisible;
  35968. var showForAnimation = i === 0 && isAnimating && isVisible;
  35969. var monthString = (0, _toISOMonthString2['default'])(month);
  35970. return _react2['default'].createElement(
  35971. 'div',
  35972. _extends({
  35973. key: monthString
  35974. }, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && {
  35975. position: 'absolute',
  35976. left: -calendarMonthWidth
  35977. }, showForAnimation && !isVertical && isRTL && {
  35978. position: 'absolute',
  35979. right: 0
  35980. }, showForAnimation && isVertical && {
  35981. position: 'absolute',
  35982. top: -translationValue
  35983. }, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)),
  35984. _react2['default'].createElement(_CalendarMonth2['default'], {
  35985. month: month,
  35986. isVisible: isVisible,
  35987. enableOutsideDays: enableOutsideDays,
  35988. modifiers: modifiers[monthString],
  35989. monthFormat: monthFormat,
  35990. orientation: orientation,
  35991. onDayMouseEnter: onDayMouseEnter,
  35992. onDayMouseLeave: onDayMouseLeave,
  35993. onDayClick: onDayClick,
  35994. onMonthSelect: _this3.onMonthSelect,
  35995. onYearSelect: _this3.onYearSelect,
  35996. renderMonthText: renderMonthText,
  35997. renderCalendarDay: renderCalendarDay,
  35998. renderDayContents: renderDayContents,
  35999. renderMonthElement: renderMonthElement,
  36000. firstDayOfWeek: firstDayOfWeek,
  36001. daySize: daySize,
  36002. focusedDate: isVisible ? focusedDate : null,
  36003. isFocused: isFocused,
  36004. phrases: phrases,
  36005. setMonthTitleHeight: setMonthTitleHeight,
  36006. dayAriaLabelFormat: dayAriaLabelFormat,
  36007. verticalBorderSpacing: verticalBorderSpacing,
  36008. horizontalMonthPadding: horizontalMonthPadding
  36009. })
  36010. );
  36011. })
  36012. );
  36013. }
  36014. return render;
  36015. }()
  36016. }]);
  36017. return CalendarMonthGrid;
  36018. }(_react2['default'].Component);
  36019. CalendarMonthGrid.propTypes = propTypes;
  36020. CalendarMonthGrid.defaultProps = defaultProps;
  36021. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
  36022. var _ref$reactDates = _ref.reactDates,
  36023. color = _ref$reactDates.color,
  36024. noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable,
  36025. spacing = _ref$reactDates.spacing,
  36026. zIndex = _ref$reactDates.zIndex;
  36027. return {
  36028. CalendarMonthGrid: {
  36029. background: color.background,
  36030. textAlign: 'left',
  36031. zIndex: zIndex
  36032. },
  36033. CalendarMonthGrid__animating: {
  36034. zIndex: zIndex + 1
  36035. },
  36036. CalendarMonthGrid__horizontal: {
  36037. position: 'absolute',
  36038. left: spacing.dayPickerHorizontalPadding
  36039. },
  36040. CalendarMonthGrid__vertical: {
  36041. margin: '0 auto'
  36042. },
  36043. CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({
  36044. margin: '0 auto',
  36045. overflowY: 'scroll'
  36046. }, noScrollBarOnVerticalScrollable && {
  36047. '-webkitOverflowScrolling': 'touch',
  36048. '::-webkit-scrollbar': {
  36049. '-webkit-appearance': 'none',
  36050. display: 'none'
  36051. }
  36052. }),
  36053. CalendarMonthGrid_month__horizontal: {
  36054. display: 'inline-block',
  36055. verticalAlign: 'top',
  36056. minHeight: '100%'
  36057. },
  36058. CalendarMonthGrid_month__hideForAnimation: {
  36059. position: 'absolute',
  36060. zIndex: zIndex - 1,
  36061. opacity: 0,
  36062. pointerEvents: 'none'
  36063. },
  36064. CalendarMonthGrid_month__hidden: {
  36065. visibility: 'hidden'
  36066. }
  36067. };
  36068. })(CalendarMonthGrid);
  36069. /***/ }),
  36070. /***/ "TqVZ":
  36071. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36072. "use strict";
  36073. // EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js
  36074. var sheet_browser_esm = __webpack_require__("z9I/");
  36075. // CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js
  36076. function stylis_min (W) {
  36077. function M(d, c, e, h, a) {
  36078. for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
  36079. g = e.charCodeAt(l);
  36080. l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
  36081. if (0 === b + n + v + m) {
  36082. if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
  36083. switch (g) {
  36084. case 32:
  36085. case 9:
  36086. case 59:
  36087. case 13:
  36088. case 10:
  36089. break;
  36090. default:
  36091. f += e.charAt(l);
  36092. }
  36093. g = 59;
  36094. }
  36095. switch (g) {
  36096. case 123:
  36097. f = f.trim();
  36098. q = f.charCodeAt(0);
  36099. k = 1;
  36100. for (t = ++l; l < B;) {
  36101. switch (g = e.charCodeAt(l)) {
  36102. case 123:
  36103. k++;
  36104. break;
  36105. case 125:
  36106. k--;
  36107. break;
  36108. case 47:
  36109. switch (g = e.charCodeAt(l + 1)) {
  36110. case 42:
  36111. case 47:
  36112. a: {
  36113. for (u = l + 1; u < J; ++u) {
  36114. switch (e.charCodeAt(u)) {
  36115. case 47:
  36116. if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
  36117. l = u + 1;
  36118. break a;
  36119. }
  36120. break;
  36121. case 10:
  36122. if (47 === g) {
  36123. l = u + 1;
  36124. break a;
  36125. }
  36126. }
  36127. }
  36128. l = u;
  36129. }
  36130. }
  36131. break;
  36132. case 91:
  36133. g++;
  36134. case 40:
  36135. g++;
  36136. case 34:
  36137. case 39:
  36138. for (; l++ < J && e.charCodeAt(l) !== g;) {
  36139. }
  36140. }
  36141. if (0 === k) break;
  36142. l++;
  36143. }
  36144. k = e.substring(t, l);
  36145. 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
  36146. switch (q) {
  36147. case 64:
  36148. 0 < r && (f = f.replace(N, ''));
  36149. g = f.charCodeAt(1);
  36150. switch (g) {
  36151. case 100:
  36152. case 109:
  36153. case 115:
  36154. case 45:
  36155. r = c;
  36156. break;
  36157. default:
  36158. r = O;
  36159. }
  36160. k = M(c, r, k, g, a + 1);
  36161. t = k.length;
  36162. 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
  36163. if (0 < t) switch (g) {
  36164. case 115:
  36165. f = f.replace(da, ea);
  36166. case 100:
  36167. case 109:
  36168. case 45:
  36169. k = f + '{' + k + '}';
  36170. break;
  36171. case 107:
  36172. f = f.replace(fa, '$1 $2');
  36173. k = f + '{' + k + '}';
  36174. k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
  36175. break;
  36176. default:
  36177. k = f + k, 112 === h && (k = (p += k, ''));
  36178. } else k = '';
  36179. break;
  36180. default:
  36181. k = M(c, X(c, f, I), k, h, a + 1);
  36182. }
  36183. F += k;
  36184. k = I = r = u = q = 0;
  36185. f = '';
  36186. g = e.charCodeAt(++l);
  36187. break;
  36188. case 125:
  36189. case 59:
  36190. f = (0 < r ? f.replace(N, '') : f).trim();
  36191. if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
  36192. case 0:
  36193. break;
  36194. case 64:
  36195. if (105 === g || 99 === g) {
  36196. G += f + e.charAt(l);
  36197. break;
  36198. }
  36199. default:
  36200. 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
  36201. }
  36202. I = r = u = q = 0;
  36203. f = '';
  36204. g = e.charCodeAt(++l);
  36205. }
  36206. }
  36207. switch (g) {
  36208. case 13:
  36209. case 10:
  36210. 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
  36211. 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
  36212. z = 1;
  36213. D++;
  36214. break;
  36215. case 59:
  36216. case 125:
  36217. if (0 === b + n + v + m) {
  36218. z++;
  36219. break;
  36220. }
  36221. default:
  36222. z++;
  36223. y = e.charAt(l);
  36224. switch (g) {
  36225. case 9:
  36226. case 32:
  36227. if (0 === n + m + b) switch (x) {
  36228. case 44:
  36229. case 58:
  36230. case 9:
  36231. case 32:
  36232. y = '';
  36233. break;
  36234. default:
  36235. 32 !== g && (y = ' ');
  36236. }
  36237. break;
  36238. case 0:
  36239. y = '\\0';
  36240. break;
  36241. case 12:
  36242. y = '\\f';
  36243. break;
  36244. case 11:
  36245. y = '\\v';
  36246. break;
  36247. case 38:
  36248. 0 === n + b + m && (r = I = 1, y = '\f' + y);
  36249. break;
  36250. case 108:
  36251. if (0 === n + b + m + E && 0 < u) switch (l - u) {
  36252. case 2:
  36253. 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
  36254. case 8:
  36255. 111 === K && (E = K);
  36256. }
  36257. break;
  36258. case 58:
  36259. 0 === n + b + m && (u = l);
  36260. break;
  36261. case 44:
  36262. 0 === b + v + n + m && (r = 1, y += '\r');
  36263. break;
  36264. case 34:
  36265. case 39:
  36266. 0 === b && (n = n === g ? 0 : 0 === n ? g : n);
  36267. break;
  36268. case 91:
  36269. 0 === n + b + v && m++;
  36270. break;
  36271. case 93:
  36272. 0 === n + b + v && m--;
  36273. break;
  36274. case 41:
  36275. 0 === n + b + m && v--;
  36276. break;
  36277. case 40:
  36278. if (0 === n + b + m) {
  36279. if (0 === q) switch (2 * x + 3 * K) {
  36280. case 533:
  36281. break;
  36282. default:
  36283. q = 1;
  36284. }
  36285. v++;
  36286. }
  36287. break;
  36288. case 64:
  36289. 0 === b + v + n + m + u + k && (k = 1);
  36290. break;
  36291. case 42:
  36292. case 47:
  36293. if (!(0 < n + m + v)) switch (b) {
  36294. case 0:
  36295. switch (2 * g + 3 * e.charCodeAt(l + 1)) {
  36296. case 235:
  36297. b = 47;
  36298. break;
  36299. case 220:
  36300. t = l, b = 42;
  36301. }
  36302. break;
  36303. case 42:
  36304. 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
  36305. }
  36306. }
  36307. 0 === b && (f += y);
  36308. }
  36309. K = x;
  36310. x = g;
  36311. l++;
  36312. }
  36313. t = p.length;
  36314. if (0 < t) {
  36315. r = c;
  36316. if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
  36317. p = r.join(',') + '{' + p + '}';
  36318. if (0 !== w * E) {
  36319. 2 !== w || L(p, 2) || (E = 0);
  36320. switch (E) {
  36321. case 111:
  36322. p = p.replace(ha, ':-moz-$1') + p;
  36323. break;
  36324. case 112:
  36325. p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
  36326. }
  36327. E = 0;
  36328. }
  36329. }
  36330. return G + p + F;
  36331. }
  36332. function X(d, c, e) {
  36333. var h = c.trim().split(ia);
  36334. c = h;
  36335. var a = h.length,
  36336. m = d.length;
  36337. switch (m) {
  36338. case 0:
  36339. case 1:
  36340. var b = 0;
  36341. for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
  36342. c[b] = Z(d, c[b], e).trim();
  36343. }
  36344. break;
  36345. default:
  36346. var v = b = 0;
  36347. for (c = []; b < a; ++b) {
  36348. for (var n = 0; n < m; ++n) {
  36349. c[v++] = Z(d[n] + ' ', h[b], e).trim();
  36350. }
  36351. }
  36352. }
  36353. return c;
  36354. }
  36355. function Z(d, c, e) {
  36356. var h = c.charCodeAt(0);
  36357. 33 > h && (h = (c = c.trim()).charCodeAt(0));
  36358. switch (h) {
  36359. case 38:
  36360. return c.replace(F, '$1' + d.trim());
  36361. case 58:
  36362. return d.trim() + c.replace(F, '$1' + d.trim());
  36363. default:
  36364. if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
  36365. }
  36366. return d + c;
  36367. }
  36368. function P(d, c, e, h) {
  36369. var a = d + ';',
  36370. m = 2 * c + 3 * e + 4 * h;
  36371. if (944 === m) {
  36372. d = a.indexOf(':', 9) + 1;
  36373. var b = a.substring(d, a.length - 1).trim();
  36374. b = a.substring(0, d).trim() + b + ';';
  36375. return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
  36376. }
  36377. if (0 === w || 2 === w && !L(a, 1)) return a;
  36378. switch (m) {
  36379. case 1015:
  36380. return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
  36381. case 951:
  36382. return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
  36383. case 963:
  36384. return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
  36385. case 1009:
  36386. if (100 !== a.charCodeAt(4)) break;
  36387. case 969:
  36388. case 942:
  36389. return '-webkit-' + a + a;
  36390. case 978:
  36391. return '-webkit-' + a + '-moz-' + a + a;
  36392. case 1019:
  36393. case 983:
  36394. return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
  36395. case 883:
  36396. if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
  36397. if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
  36398. break;
  36399. case 932:
  36400. if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
  36401. case 103:
  36402. return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
  36403. case 115:
  36404. return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
  36405. case 98:
  36406. return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
  36407. }
  36408. return '-webkit-' + a + '-ms-' + a + a;
  36409. case 964:
  36410. return '-webkit-' + a + '-ms-flex-' + a + a;
  36411. case 1023:
  36412. if (99 !== a.charCodeAt(8)) break;
  36413. b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
  36414. return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
  36415. case 1005:
  36416. return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
  36417. case 1e3:
  36418. b = a.substring(13).trim();
  36419. c = b.indexOf('-') + 1;
  36420. switch (b.charCodeAt(0) + b.charCodeAt(c)) {
  36421. case 226:
  36422. b = a.replace(G, 'tb');
  36423. break;
  36424. case 232:
  36425. b = a.replace(G, 'tb-rl');
  36426. break;
  36427. case 220:
  36428. b = a.replace(G, 'lr');
  36429. break;
  36430. default:
  36431. return a;
  36432. }
  36433. return '-webkit-' + a + '-ms-' + b + a;
  36434. case 1017:
  36435. if (-1 === a.indexOf('sticky', 9)) break;
  36436. case 975:
  36437. c = (a = d).length - 10;
  36438. b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
  36439. switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
  36440. case 203:
  36441. if (111 > b.charCodeAt(8)) break;
  36442. case 115:
  36443. a = a.replace(b, '-webkit-' + b) + ';' + a;
  36444. break;
  36445. case 207:
  36446. case 102:
  36447. a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
  36448. }
  36449. return a + ';';
  36450. case 938:
  36451. if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
  36452. case 105:
  36453. return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
  36454. case 115:
  36455. return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
  36456. default:
  36457. return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
  36458. }
  36459. break;
  36460. case 973:
  36461. case 989:
  36462. if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
  36463. case 931:
  36464. case 953:
  36465. if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
  36466. break;
  36467. case 962:
  36468. if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
  36469. }
  36470. return a;
  36471. }
  36472. function L(d, c) {
  36473. var e = d.indexOf(1 === c ? ':' : '{'),
  36474. h = d.substring(0, 3 !== c ? e : 10);
  36475. e = d.substring(e + 1, d.length - 1);
  36476. return R(2 !== c ? h : h.replace(na, '$1'), e, c);
  36477. }
  36478. function ea(d, c) {
  36479. var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
  36480. return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
  36481. }
  36482. function H(d, c, e, h, a, m, b, v, n, q) {
  36483. for (var g = 0, x = c, w; g < A; ++g) {
  36484. switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
  36485. case void 0:
  36486. case !1:
  36487. case !0:
  36488. case null:
  36489. break;
  36490. default:
  36491. x = w;
  36492. }
  36493. }
  36494. if (x !== c) return x;
  36495. }
  36496. function T(d) {
  36497. switch (d) {
  36498. case void 0:
  36499. case null:
  36500. A = S.length = 0;
  36501. break;
  36502. default:
  36503. if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
  36504. T(d[c]);
  36505. } else Y = !!d | 0;
  36506. }
  36507. return T;
  36508. }
  36509. function U(d) {
  36510. d = d.prefix;
  36511. void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
  36512. return U;
  36513. }
  36514. function B(d, c) {
  36515. var e = d;
  36516. 33 > e.charCodeAt(0) && (e = e.trim());
  36517. V = e;
  36518. e = [V];
  36519. if (0 < A) {
  36520. var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
  36521. void 0 !== h && 'string' === typeof h && (c = h);
  36522. }
  36523. var a = M(O, e, c, 0, 0);
  36524. 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
  36525. V = '';
  36526. E = 0;
  36527. z = D = 1;
  36528. return a;
  36529. }
  36530. var ca = /^\0+/g,
  36531. N = /[\0\r\f]/g,
  36532. aa = /: */g,
  36533. ka = /zoo|gra/,
  36534. ma = /([,: ])(transform)/g,
  36535. ia = /,\r+?/g,
  36536. F = /([\t\r\n ])*\f?&/g,
  36537. fa = /@(k\w+)\s*(\S*)\s*/,
  36538. Q = /::(place)/g,
  36539. ha = /:(read-only)/g,
  36540. G = /[svh]\w+-[tblr]{2}/,
  36541. da = /\(\s*(.*)\s*\)/g,
  36542. oa = /([\s\S]*?);/g,
  36543. ba = /-self|flex-/g,
  36544. na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
  36545. la = /stretch|:\s*\w+\-(?:conte|avail)/,
  36546. ja = /([^-])(image-set\()/,
  36547. z = 1,
  36548. D = 1,
  36549. E = 0,
  36550. w = 1,
  36551. O = [],
  36552. S = [],
  36553. A = 0,
  36554. R = null,
  36555. Y = 0,
  36556. V = '';
  36557. B.use = T;
  36558. B.set = U;
  36559. void 0 !== W && U(W);
  36560. return B;
  36561. }
  36562. /* harmony default export */ var stylis_browser_esm = (stylis_min);
  36563. // CONCATENATED MODULE: ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js
  36564. var weakMemoize = function weakMemoize(func) {
  36565. // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
  36566. var cache = new WeakMap();
  36567. return function (arg) {
  36568. if (cache.has(arg)) {
  36569. // $FlowFixMe
  36570. return cache.get(arg);
  36571. }
  36572. var ret = func(arg);
  36573. cache.set(arg, ret);
  36574. return ret;
  36575. };
  36576. };
  36577. /* harmony default export */ var weak_memoize_browser_esm = (weakMemoize);
  36578. // CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js
  36579. // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
  36580. // inlined to avoid umd wrapper and peerDep warnings/installing stylis
  36581. // since we use stylis after closure compiler
  36582. var delimiter = '/*|*/';
  36583. var needle = delimiter + '}';
  36584. function toSheet(block) {
  36585. if (block) {
  36586. Sheet.current.insert(block + '}');
  36587. }
  36588. }
  36589. var Sheet = {
  36590. current: null
  36591. };
  36592. var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
  36593. switch (context) {
  36594. // property
  36595. case 1:
  36596. {
  36597. switch (content.charCodeAt(0)) {
  36598. case 64:
  36599. {
  36600. // @import
  36601. Sheet.current.insert(content + ';');
  36602. return '';
  36603. }
  36604. // charcode for l
  36605. case 108:
  36606. {
  36607. // charcode for b
  36608. // this ignores label
  36609. if (content.charCodeAt(2) === 98) {
  36610. return '';
  36611. }
  36612. }
  36613. }
  36614. break;
  36615. }
  36616. // selector
  36617. case 2:
  36618. {
  36619. if (ns === 0) return content + delimiter;
  36620. break;
  36621. }
  36622. // at-rule
  36623. case 3:
  36624. {
  36625. switch (ns) {
  36626. // @font-face, @page
  36627. case 102:
  36628. case 112:
  36629. {
  36630. Sheet.current.insert(selectors[0] + content);
  36631. return '';
  36632. }
  36633. default:
  36634. {
  36635. return content + (at === 0 ? delimiter : '');
  36636. }
  36637. }
  36638. }
  36639. case -2:
  36640. {
  36641. content.split(needle).forEach(toSheet);
  36642. }
  36643. }
  36644. };
  36645. var cache_browser_esm_createCache = function createCache(options) {
  36646. if (options === undefined) options = {};
  36647. var key = options.key || 'css';
  36648. var stylisOptions;
  36649. if (options.prefix !== undefined) {
  36650. stylisOptions = {
  36651. prefix: options.prefix
  36652. };
  36653. }
  36654. var stylis = new stylis_browser_esm(stylisOptions);
  36655. if (false) {}
  36656. var inserted = {}; // $FlowFixMe
  36657. var container;
  36658. {
  36659. container = options.container || document.head;
  36660. var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
  36661. Array.prototype.forEach.call(nodes, function (node) {
  36662. var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe
  36663. attrib.split(' ').forEach(function (id) {
  36664. inserted[id] = true;
  36665. });
  36666. if (node.parentNode !== container) {
  36667. container.appendChild(node);
  36668. }
  36669. });
  36670. }
  36671. var _insert;
  36672. {
  36673. stylis.use(options.stylisPlugins)(ruleSheet);
  36674. _insert = function insert(selector, serialized, sheet, shouldCache) {
  36675. var name = serialized.name;
  36676. Sheet.current = sheet;
  36677. if (false) { var map; }
  36678. stylis(selector, serialized.styles);
  36679. if (shouldCache) {
  36680. cache.inserted[name] = true;
  36681. }
  36682. };
  36683. }
  36684. if (false) { var commentEnd, commentStart; }
  36685. var cache = {
  36686. key: key,
  36687. sheet: new sheet_browser_esm["a" /* StyleSheet */]({
  36688. key: key,
  36689. container: container,
  36690. nonce: options.nonce,
  36691. speedy: options.speedy
  36692. }),
  36693. nonce: options.nonce,
  36694. inserted: inserted,
  36695. registered: {},
  36696. insert: _insert
  36697. };
  36698. return cache;
  36699. };
  36700. /* harmony default export */ var cache_browser_esm = __webpack_exports__["a"] = (cache_browser_esm_createCache);
  36701. /***/ }),
  36702. /***/ "Tqx9":
  36703. /***/ (function(module, exports) {
  36704. (function() { module.exports = window["wp"]["primitives"]; }());
  36705. /***/ }),
  36706. /***/ "UAm0":
  36707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36708. "use strict";
  36709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStyledClassNameFromKey; });
  36710. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("YLtl");
  36711. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
  36712. /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4eJC");
  36713. /* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_1__);
  36714. /**
  36715. * External dependencies
  36716. */
  36717. /**
  36718. * Generates the connected component CSS className based on the namespace.
  36719. *
  36720. * @param namespace The name of the connected component.
  36721. * @return The generated CSS className.
  36722. */
  36723. function getStyledClassName(namespace) {
  36724. const kebab = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(namespace);
  36725. return `components-${kebab}`;
  36726. }
  36727. const getStyledClassNameFromKey = memize__WEBPACK_IMPORTED_MODULE_1___default()(getStyledClassName);
  36728. /***/ }),
  36729. /***/ "UFhG":
  36730. /***/ (function(module, exports, __webpack_require__) {
  36731. "use strict";
  36732. // var modulo = require('./modulo');
  36733. var $floor = Math.floor;
  36734. // http://262.ecma-international.org/5.1/#sec-5.2
  36735. module.exports = function floor(x) {
  36736. // return x - modulo(x, 1);
  36737. return $floor(x);
  36738. };
  36739. /***/ }),
  36740. /***/ "UVaH":
  36741. /***/ (function(module, exports, __webpack_require__) {
  36742. "use strict";
  36743. /* WEBPACK VAR INJECTION */(function(global) {
  36744. var origSymbol = global.Symbol;
  36745. var hasSymbolSham = __webpack_require__("FpZJ");
  36746. module.exports = function hasNativeSymbols() {
  36747. if (typeof origSymbol !== 'function') { return false; }
  36748. if (typeof Symbol !== 'function') { return false; }
  36749. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  36750. if (typeof Symbol('bar') !== 'symbol') { return false; }
  36751. return hasSymbolSham();
  36752. };
  36753. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj")))
  36754. /***/ }),
  36755. /***/ "V1cy":
  36756. /***/ (function(module, exports, __webpack_require__) {
  36757. "use strict";
  36758. var ES5Type = __webpack_require__("60zJ");
  36759. // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
  36760. module.exports = function Type(x) {
  36761. if (typeof x === 'symbol') {
  36762. return 'Symbol';
  36763. }
  36764. if (typeof x === 'bigint') {
  36765. return 'BigInt';
  36766. }
  36767. return ES5Type(x);
  36768. };
  36769. /***/ }),
  36770. /***/ "VDVV":
  36771. /***/ (function(module, exports, __webpack_require__) {
  36772. Object.defineProperty(exports, "__esModule", {
  36773. value: true
  36774. });
  36775. var _arrayPrototype = __webpack_require__("/ZKw");
  36776. var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
  36777. var _globalCache = __webpack_require__("9pTB");
  36778. var _globalCache2 = _interopRequireDefault(_globalCache);
  36779. var _constants = __webpack_require__("kFtd");
  36780. var _getClassName = __webpack_require__("nLTY");
  36781. var _getClassName2 = _interopRequireDefault(_getClassName);
  36782. var _separateStyles2 = __webpack_require__("3HjQ");
  36783. var _separateStyles3 = _interopRequireDefault(_separateStyles2);
  36784. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  36785. /**
  36786. * Function required as part of the react-with-styles interface. Parses the styles provided by
  36787. * react-with-styles to produce class names based on the style name and optionally the namespace if
  36788. * available.
  36789. *
  36790. * stylesObject {Object} The styles object passed to withStyles.
  36791. *
  36792. * Return an object mapping style names to class names.
  36793. */
  36794. function create(stylesObject) {
  36795. var stylesToClasses = {};
  36796. var styleNames = Object.keys(stylesObject);
  36797. var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {};
  36798. var _sharedState$namespac = sharedState.namespace,
  36799. namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac;
  36800. styleNames.forEach(function (styleName) {
  36801. var className = (0, _getClassName2['default'])(namespace, styleName);
  36802. stylesToClasses[styleName] = className;
  36803. });
  36804. return stylesToClasses;
  36805. }
  36806. /**
  36807. * Process styles to be consumed by a component.
  36808. *
  36809. * stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects
  36810. * representing inline styles, or arrays thereof.
  36811. *
  36812. * Return an object with optional className and style properties to be spread on a component.
  36813. */
  36814. function resolve(stylesArray) {
  36815. var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity);
  36816. var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles),
  36817. classNames = _separateStyles.classNames,
  36818. hasInlineStyles = _separateStyles.hasInlineStyles,
  36819. inlineStyles = _separateStyles.inlineStyles;
  36820. var specificClassNames = classNames.map(function (name, index) {
  36821. return String(name) + ' ' + String(name) + '_' + String(index + 1);
  36822. });
  36823. var className = specificClassNames.join(' ');
  36824. var result = { className: className };
  36825. if (hasInlineStyles) result.style = inlineStyles;
  36826. return result;
  36827. }
  36828. exports['default'] = { create: create, resolve: resolve };
  36829. /***/ }),
  36830. /***/ "VF6F":
  36831. /***/ (function(module, exports, __webpack_require__) {
  36832. "use strict";
  36833. var GetIntrinsic = __webpack_require__("AM7I");
  36834. var callBind = __webpack_require__("PrET");
  36835. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  36836. module.exports = function callBoundIntrinsic(name, allowMissing) {
  36837. var intrinsic = GetIntrinsic(name, !!allowMissing);
  36838. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  36839. return callBind(intrinsic);
  36840. }
  36841. return intrinsic;
  36842. };
  36843. /***/ }),
  36844. /***/ "VbXa":
  36845. /***/ (function(module, exports, __webpack_require__) {
  36846. var setPrototypeOf = __webpack_require__("SksO");
  36847. function _inheritsLoose(subClass, superClass) {
  36848. subClass.prototype = Object.create(superClass.prototype);
  36849. subClass.prototype.constructor = subClass;
  36850. setPrototypeOf(subClass, superClass);
  36851. }
  36852. module.exports = _inheritsLoose;
  36853. module.exports["default"] = module.exports, module.exports.__esModule = true;
  36854. /***/ }),
  36855. /***/ "Vq1w":
  36856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36857. "use strict";
  36858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPortalEvent; });
  36859. /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("utzN");
  36860. /**
  36861. * Returns `true` if `event` has been fired within a React Portal element.
  36862. */
  36863. function isPortalEvent(event) {
  36864. return !Object(_contains_js__WEBPACK_IMPORTED_MODULE_0__[/* contains */ "a"])(event.currentTarget, event.target);
  36865. }
  36866. /***/ }),
  36867. /***/ "W/NR":
  36868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36869. "use strict";
  36870. // UNUSED EXPORTS: TOOLTIP_DELAY
  36871. // EXTERNAL MODULE: external ["wp","element"]
  36872. var external_wp_element_ = __webpack_require__("GRId");
  36873. // EXTERNAL MODULE: external "lodash"
  36874. var external_lodash_ = __webpack_require__("YLtl");
  36875. // EXTERNAL MODULE: external ["wp","compose"]
  36876. var external_wp_compose_ = __webpack_require__("K9lf");
  36877. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 1 modules
  36878. var popover = __webpack_require__("oXO/");
  36879. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js
  36880. var build_module_shortcut = __webpack_require__("Cw+6");
  36881. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js
  36882. var with_next = __webpack_require__("9NHk");
  36883. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/next.js
  36884. /**
  36885. * Internal dependencies
  36886. */
  36887. const Tooltip = false ? undefined : undefined;
  36888. const adapter = ({
  36889. text,
  36890. ...props
  36891. }) => ({ ...props,
  36892. content: text
  36893. });
  36894. function withNextComponent(Component) {
  36895. return Object(with_next["a" /* withNext */])(Component, Tooltip, 'WPComponentsTooltip', adapter);
  36896. }
  36897. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js
  36898. /**
  36899. * External dependencies
  36900. */
  36901. /**
  36902. * WordPress dependencies
  36903. */
  36904. /**
  36905. * Internal dependencies
  36906. */
  36907. /**
  36908. * Time over children to wait before showing tooltip
  36909. *
  36910. * @type {number}
  36911. */
  36912. const TOOLTIP_DELAY = 700;
  36913. const eventCatcher = Object(external_wp_element_["createElement"])("div", {
  36914. className: "event-catcher"
  36915. });
  36916. const getDisabledElement = ({
  36917. eventHandlers,
  36918. child,
  36919. childrenWithPopover
  36920. }) => Object(external_wp_element_["cloneElement"])(Object(external_wp_element_["createElement"])("span", {
  36921. className: "disabled-element-wrapper"
  36922. }, Object(external_wp_element_["cloneElement"])(eventCatcher, eventHandlers), Object(external_wp_element_["cloneElement"])(child, {
  36923. children: childrenWithPopover
  36924. }), ","), eventHandlers);
  36925. const getRegularElement = ({
  36926. child,
  36927. eventHandlers,
  36928. childrenWithPopover
  36929. }) => Object(external_wp_element_["cloneElement"])(child, { ...eventHandlers,
  36930. children: childrenWithPopover
  36931. });
  36932. const addPopoverToGrandchildren = ({
  36933. grandchildren,
  36934. isOver,
  36935. position,
  36936. text,
  36937. shortcut
  36938. }) => Object(external_wp_element_["concatChildren"])(grandchildren, isOver && Object(external_wp_element_["createElement"])(popover["a" /* default */], {
  36939. focusOnMount: false,
  36940. position: position,
  36941. className: "components-tooltip",
  36942. "aria-hidden": "true",
  36943. animate: false,
  36944. noArrow: true
  36945. }, text, Object(external_wp_element_["createElement"])(build_module_shortcut["a" /* default */], {
  36946. className: "components-tooltip__shortcut",
  36947. shortcut: shortcut
  36948. })));
  36949. const emitToChild = (children, eventName, event) => {
  36950. if (external_wp_element_["Children"].count(children) !== 1) {
  36951. return;
  36952. }
  36953. const child = external_wp_element_["Children"].only(children);
  36954. if (typeof child.props[eventName] === 'function') {
  36955. child.props[eventName](event);
  36956. }
  36957. };
  36958. function tooltip_Tooltip({
  36959. children,
  36960. position,
  36961. text,
  36962. shortcut
  36963. }) {
  36964. /**
  36965. * Whether a mouse is currently pressed, used in determining whether
  36966. * to handle a focus event as displaying the tooltip immediately.
  36967. *
  36968. * @type {boolean}
  36969. */
  36970. const [isMouseDown, setIsMouseDown] = Object(external_wp_element_["useState"])(false);
  36971. const [isOver, setIsOver] = Object(external_wp_element_["useState"])(false);
  36972. const delayedSetIsOver = Object(external_wp_compose_["useDebounce"])(setIsOver, TOOLTIP_DELAY);
  36973. const createMouseDown = event => {
  36974. // Preserve original child callback behavior
  36975. emitToChild(children, 'onMouseDown', event); // On mouse down, the next `mouseup` should revert the value of the
  36976. // instance property and remove its own event handler. The bind is
  36977. // made on the document since the `mouseup` might not occur within
  36978. // the bounds of the element.
  36979. document.addEventListener('mouseup', cancelIsMouseDown);
  36980. setIsMouseDown(true);
  36981. };
  36982. const createMouseUp = event => {
  36983. emitToChild(children, 'onMouseUp', event);
  36984. document.removeEventListener('mouseup', cancelIsMouseDown);
  36985. setIsMouseDown(false);
  36986. };
  36987. const createMouseEvent = type => {
  36988. if (type === 'mouseUp') return createMouseUp;
  36989. if (type === 'mouseDown') return createMouseDown;
  36990. };
  36991. /**
  36992. * Prebound `isInMouseDown` handler, created as a constant reference to
  36993. * assure ability to remove in component unmount.
  36994. *
  36995. * @type {Function}
  36996. */
  36997. const cancelIsMouseDown = createMouseEvent('mouseUp');
  36998. const createToggleIsOver = (eventName, isDelayed) => {
  36999. return event => {
  37000. // Preserve original child callback behavior
  37001. emitToChild(children, eventName, event); // Mouse events behave unreliably in React for disabled elements,
  37002. // firing on mouseenter but not mouseleave. Further, the default
  37003. // behavior for disabled elements in some browsers is to ignore
  37004. // mouse events. Don't bother trying to to handle them.
  37005. //
  37006. // See: https://github.com/facebook/react/issues/4251
  37007. if (event.currentTarget.disabled) {
  37008. return;
  37009. } // A focus event will occur as a result of a mouse click, but it
  37010. // should be disambiguated between interacting with the button and
  37011. // using an explicit focus shift as a cue to display the tooltip.
  37012. if ('focus' === event.type && isMouseDown) {
  37013. return;
  37014. } // Needed in case unsetting is over while delayed set pending, i.e.
  37015. // quickly blur/mouseleave before delayedSetIsOver is called
  37016. delayedSetIsOver.cancel();
  37017. const _isOver = Object(external_lodash_["includes"])(['focus', 'mouseenter'], event.type);
  37018. if (_isOver === isOver) {
  37019. return;
  37020. }
  37021. if (isDelayed) {
  37022. delayedSetIsOver(_isOver);
  37023. } else {
  37024. setIsOver(_isOver);
  37025. }
  37026. };
  37027. };
  37028. const clearOnUnmount = () => {
  37029. delayedSetIsOver.cancel();
  37030. document.removeEventListener('mouseup', cancelIsMouseDown);
  37031. };
  37032. Object(external_wp_element_["useEffect"])(() => clearOnUnmount, []);
  37033. if (external_wp_element_["Children"].count(children) !== 1) {
  37034. if (false) {}
  37035. return children;
  37036. }
  37037. const eventHandlers = {
  37038. onMouseEnter: createToggleIsOver('onMouseEnter', true),
  37039. onMouseLeave: createToggleIsOver('onMouseLeave'),
  37040. onClick: createToggleIsOver('onClick'),
  37041. onFocus: createToggleIsOver('onFocus'),
  37042. onBlur: createToggleIsOver('onBlur'),
  37043. onMouseDown: createMouseEvent('mouseDown')
  37044. };
  37045. const child = external_wp_element_["Children"].only(children);
  37046. const {
  37047. children: grandchildren,
  37048. disabled
  37049. } = child.props;
  37050. const getElementWithPopover = disabled ? getDisabledElement : getRegularElement;
  37051. const popoverData = {
  37052. isOver,
  37053. position,
  37054. text,
  37055. shortcut
  37056. };
  37057. const childrenWithPopover = addPopoverToGrandchildren({
  37058. grandchildren,
  37059. ...popoverData
  37060. });
  37061. return getElementWithPopover({
  37062. child,
  37063. eventHandlers,
  37064. childrenWithPopover
  37065. });
  37066. }
  37067. /* harmony default export */ var tooltip = __webpack_exports__["a"] = (withNextComponent(tooltip_Tooltip));
  37068. /***/ }),
  37069. /***/ "WFqU":
  37070. /***/ (function(module, exports, __webpack_require__) {
  37071. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  37072. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  37073. module.exports = freeGlobal;
  37074. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj")))
  37075. /***/ }),
  37076. /***/ "WI5Z":
  37077. /***/ (function(module, exports, __webpack_require__) {
  37078. "use strict";
  37079. Object.defineProperty(exports, "__esModule", {
  37080. value: true
  37081. });
  37082. exports['default'] = registerInterfaceWithDefaultTheme;
  37083. var _ThemedStyleSheet = __webpack_require__("030x");
  37084. var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
  37085. var _DefaultTheme = __webpack_require__("xOhs");
  37086. var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
  37087. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  37088. function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
  37089. _ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface);
  37090. _ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']);
  37091. }
  37092. /***/ }),
  37093. /***/ "WZeS":
  37094. /***/ (function(module, exports, __webpack_require__) {
  37095. "use strict";
  37096. var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
  37097. var isPrimitive = __webpack_require__("Teho");
  37098. var isCallable = __webpack_require__("IdCN");
  37099. var isDate = __webpack_require__("DmXP");
  37100. var isSymbol = __webpack_require__("/sVA");
  37101. var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
  37102. if (typeof O === 'undefined' || O === null) {
  37103. throw new TypeError('Cannot call method on ' + O);
  37104. }
  37105. if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {
  37106. throw new TypeError('hint must be "string" or "number"');
  37107. }
  37108. var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
  37109. var method, result, i;
  37110. for (i = 0; i < methodNames.length; ++i) {
  37111. method = O[methodNames[i]];
  37112. if (isCallable(method)) {
  37113. result = method.call(O);
  37114. if (isPrimitive(result)) {
  37115. return result;
  37116. }
  37117. }
  37118. }
  37119. throw new TypeError('No default value');
  37120. };
  37121. var GetMethod = function GetMethod(O, P) {
  37122. var func = O[P];
  37123. if (func !== null && typeof func !== 'undefined') {
  37124. if (!isCallable(func)) {
  37125. throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
  37126. }
  37127. return func;
  37128. }
  37129. return void 0;
  37130. };
  37131. // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
  37132. module.exports = function ToPrimitive(input) {
  37133. if (isPrimitive(input)) {
  37134. return input;
  37135. }
  37136. var hint = 'default';
  37137. if (arguments.length > 1) {
  37138. if (arguments[1] === String) {
  37139. hint = 'string';
  37140. } else if (arguments[1] === Number) {
  37141. hint = 'number';
  37142. }
  37143. }
  37144. var exoticToPrim;
  37145. if (hasSymbols) {
  37146. if (Symbol.toPrimitive) {
  37147. exoticToPrim = GetMethod(input, Symbol.toPrimitive);
  37148. } else if (isSymbol(input)) {
  37149. exoticToPrim = Symbol.prototype.valueOf;
  37150. }
  37151. }
  37152. if (typeof exoticToPrim !== 'undefined') {
  37153. var result = exoticToPrim.call(input, hint);
  37154. if (isPrimitive(result)) {
  37155. return result;
  37156. }
  37157. throw new TypeError('unable to convert exotic object to primitive');
  37158. }
  37159. if (hint === 'default' && (isDate(input) || isSymbol(input))) {
  37160. hint = 'string';
  37161. }
  37162. return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
  37163. };
  37164. /***/ }),
  37165. /***/ "WbBG":
  37166. /***/ (function(module, exports, __webpack_require__) {
  37167. "use strict";
  37168. /**
  37169. * Copyright (c) 2013-present, Facebook, Inc.
  37170. *
  37171. * This source code is licensed under the MIT license found in the
  37172. * LICENSE file in the root directory of this source tree.
  37173. */
  37174. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  37175. module.exports = ReactPropTypesSecret;
  37176. /***/ }),
  37177. /***/ "Wfh+":
  37178. /***/ (function(module, exports, __webpack_require__) {
  37179. "use strict";
  37180. var abs = __webpack_require__("nKkb");
  37181. var floor = __webpack_require__("UFhG");
  37182. var ToNumber = __webpack_require__("Pjai");
  37183. var $isNaN = __webpack_require__("HwJD");
  37184. var $isFinite = __webpack_require__("ald4");
  37185. var $sign = __webpack_require__("6I5v");
  37186. // http://262.ecma-international.org/5.1/#sec-9.4
  37187. module.exports = function ToInteger(value) {
  37188. var number = ToNumber(value);
  37189. if ($isNaN(number)) { return 0; }
  37190. if (number === 0 || !$isFinite(number)) { return number; }
  37191. return $sign(number) * floor(abs(number));
  37192. };
  37193. /***/ }),
  37194. /***/ "WmS1":
  37195. /***/ (function(module, exports, __webpack_require__) {
  37196. "use strict";
  37197. Object.defineProperty(exports, "__esModule", {
  37198. value: true
  37199. });
  37200. exports['default'] = toMomentObject;
  37201. var _moment = __webpack_require__("wy2R");
  37202. var _moment2 = _interopRequireDefault(_moment);
  37203. var _constants = __webpack_require__("Fv1B");
  37204. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  37205. function toMomentObject(dateString, customFormat) {
  37206. var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT];
  37207. var date = (0, _moment2['default'])(dateString, dateFormats, true);
  37208. return date.isValid() ? date.hour(12) : null;
  37209. }
  37210. /***/ }),
  37211. /***/ "WnOg":
  37212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37213. "use strict";
  37214. /* unused harmony export warning */
  37215. /**
  37216. * Logs `messages` to the console using `console.warn` based on a `condition`.
  37217. *
  37218. * @example
  37219. * import { warning } from "reakit-warning";
  37220. *
  37221. * warning(true, "a", "b"); // console.warn("a", "\n", "b")
  37222. * warning(false, "a", "b"); // does nothing
  37223. */
  37224. function warning(condition) {
  37225. if (false) { var warns, _len, messages, _key, _console; }
  37226. }
  37227. /***/ }),
  37228. /***/ "WvKp":
  37229. /***/ (function(module, exports, __webpack_require__) {
  37230. "use strict";
  37231. var GetIntrinsic = __webpack_require__("rZ7t");
  37232. var $TypeError = GetIntrinsic('%TypeError%');
  37233. var CreateDataProperty = __webpack_require__("DvWQ");
  37234. var IsPropertyKey = __webpack_require__("i10q");
  37235. var Type = __webpack_require__("V1cy");
  37236. // // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
  37237. module.exports = function CreateDataPropertyOrThrow(O, P, V) {
  37238. if (Type(O) !== 'Object') {
  37239. throw new $TypeError('Assertion failed: Type(O) is not Object');
  37240. }
  37241. if (!IsPropertyKey(P)) {
  37242. throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
  37243. }
  37244. var success = CreateDataProperty(O, P, V);
  37245. if (!success) {
  37246. throw new $TypeError('unable to create data property');
  37247. }
  37248. return success;
  37249. };
  37250. /***/ }),
  37251. /***/ "XGBb":
  37252. /***/ (function(module, exports, __webpack_require__) {
  37253. var moment = __webpack_require__("wy2R");
  37254. var momentValidationWrapper = __webpack_require__("c6aN");
  37255. var core = __webpack_require__("iNdV");
  37256. module.exports = {
  37257. momentObj : core.createMomentChecker(
  37258. 'object',
  37259. function(obj) {
  37260. return typeof obj === 'object';
  37261. },
  37262. function isValid(value) {
  37263. return momentValidationWrapper.isValidMoment(value);
  37264. },
  37265. 'Moment'
  37266. ),
  37267. momentString : core.createMomentChecker(
  37268. 'string',
  37269. function(str) {
  37270. return typeof str === 'string';
  37271. },
  37272. function isValid(value) {
  37273. return momentValidationWrapper.isValidMoment(moment(value));
  37274. },
  37275. 'Moment'
  37276. ),
  37277. momentDurationObj : core.createMomentChecker(
  37278. 'object',
  37279. function(obj) {
  37280. return typeof obj === 'object';
  37281. },
  37282. function isValid(value) {
  37283. return moment.isDuration(value);
  37284. },
  37285. 'Duration'
  37286. ),
  37287. };
  37288. /***/ }),
  37289. /***/ "XgzB":
  37290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37291. "use strict";
  37292. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  37293. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  37294. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  37295. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  37296. /**
  37297. * WordPress dependencies
  37298. */
  37299. const chevronUp = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  37300. viewBox: "0 0 24 24",
  37301. xmlns: "http://www.w3.org/2000/svg"
  37302. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  37303. d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"
  37304. }));
  37305. /* harmony default export */ __webpack_exports__["a"] = (chevronUp);
  37306. /***/ }),
  37307. /***/ "Xtko":
  37308. /***/ (function(module, exports, __webpack_require__) {
  37309. "use strict";
  37310. Object.defineProperty(exports, "__esModule", {
  37311. value: true
  37312. });
  37313. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  37314. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  37315. var _object = __webpack_require__("Koq/");
  37316. var _object2 = _interopRequireDefault(_object);
  37317. var _react = __webpack_require__("cDcd");
  37318. var _react2 = _interopRequireDefault(_react);
  37319. var _propTypes = __webpack_require__("17x9");
  37320. var _propTypes2 = _interopRequireDefault(_propTypes);
  37321. var _reactMomentProptypes = __webpack_require__("XGBb");
  37322. var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
  37323. var _airbnbPropTypes = __webpack_require__("Hsqg");
  37324. var _moment = __webpack_require__("wy2R");
  37325. var _moment2 = _interopRequireDefault(_moment);
  37326. var _object3 = __webpack_require__("4cSd");
  37327. var _object4 = _interopRequireDefault(_object3);
  37328. var _isTouchDevice = __webpack_require__("LTAC");
  37329. var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
  37330. var _defaultPhrases = __webpack_require__("vV+G");
  37331. var _getPhrasePropTypes = __webpack_require__("yc2e");
  37332. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  37333. var _isSameDay = __webpack_require__("pRvc");
  37334. var _isSameDay2 = _interopRequireDefault(_isSameDay);
  37335. var _isAfterDay = __webpack_require__("Nho6");
  37336. var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
  37337. var _getVisibleDays = __webpack_require__("u5Fq");
  37338. var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays);
  37339. var _isDayVisible = __webpack_require__("IgE5");
  37340. var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
  37341. var _toISODateString = __webpack_require__("pYxT");
  37342. var _toISODateString2 = _interopRequireDefault(_toISODateString);
  37343. var _toISOMonthString = __webpack_require__("jenk");
  37344. var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
  37345. var _ScrollableOrientationShape = __webpack_require__("aE6U");
  37346. var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
  37347. var _DayOfWeekShape = __webpack_require__("2S2E");
  37348. var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
  37349. var _CalendarInfoPositionShape = __webpack_require__("oR9Z");
  37350. var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
  37351. var _constants = __webpack_require__("Fv1B");
  37352. var _DayPicker = __webpack_require__("Nloh");
  37353. var _DayPicker2 = _interopRequireDefault(_DayPicker);
  37354. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  37355. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  37356. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37357. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  37358. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  37359. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
  37360. date: _reactMomentProptypes2['default'].momentObj,
  37361. onDateChange: _propTypes2['default'].func,
  37362. focused: _propTypes2['default'].bool,
  37363. onFocusChange: _propTypes2['default'].func,
  37364. onClose: _propTypes2['default'].func,
  37365. keepOpenOnDateSelect: _propTypes2['default'].bool,
  37366. isOutsideRange: _propTypes2['default'].func,
  37367. isDayBlocked: _propTypes2['default'].func,
  37368. isDayHighlighted: _propTypes2['default'].func,
  37369. // DayPicker props
  37370. renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  37371. renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  37372. enableOutsideDays: _propTypes2['default'].bool,
  37373. numberOfMonths: _propTypes2['default'].number,
  37374. orientation: _ScrollableOrientationShape2['default'],
  37375. withPortal: _propTypes2['default'].bool,
  37376. initialVisibleMonth: _propTypes2['default'].func,
  37377. firstDayOfWeek: _DayOfWeekShape2['default'],
  37378. hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
  37379. daySize: _airbnbPropTypes.nonNegativeInteger,
  37380. verticalHeight: _airbnbPropTypes.nonNegativeInteger,
  37381. noBorder: _propTypes2['default'].bool,
  37382. verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
  37383. transitionDuration: _airbnbPropTypes.nonNegativeInteger,
  37384. horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
  37385. navPrev: _propTypes2['default'].node,
  37386. navNext: _propTypes2['default'].node,
  37387. onPrevMonthClick: _propTypes2['default'].func,
  37388. onNextMonthClick: _propTypes2['default'].func,
  37389. onOutsideClick: _propTypes2['default'].func,
  37390. renderCalendarDay: _propTypes2['default'].func,
  37391. renderDayContents: _propTypes2['default'].func,
  37392. renderCalendarInfo: _propTypes2['default'].func,
  37393. calendarInfoPosition: _CalendarInfoPositionShape2['default'],
  37394. // accessibility
  37395. onBlur: _propTypes2['default'].func,
  37396. isFocused: _propTypes2['default'].bool,
  37397. showKeyboardShortcuts: _propTypes2['default'].bool,
  37398. // i18n
  37399. monthFormat: _propTypes2['default'].string,
  37400. weekDayFormat: _propTypes2['default'].string,
  37401. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
  37402. dayAriaLabelFormat: _propTypes2['default'].string,
  37403. isRTL: _propTypes2['default'].bool
  37404. });
  37405. var defaultProps = {
  37406. date: undefined, // TODO: use null
  37407. onDateChange: function () {
  37408. function onDateChange() {}
  37409. return onDateChange;
  37410. }(),
  37411. focused: false,
  37412. onFocusChange: function () {
  37413. function onFocusChange() {}
  37414. return onFocusChange;
  37415. }(),
  37416. onClose: function () {
  37417. function onClose() {}
  37418. return onClose;
  37419. }(),
  37420. keepOpenOnDateSelect: false,
  37421. isOutsideRange: function () {
  37422. function isOutsideRange() {}
  37423. return isOutsideRange;
  37424. }(),
  37425. isDayBlocked: function () {
  37426. function isDayBlocked() {}
  37427. return isDayBlocked;
  37428. }(),
  37429. isDayHighlighted: function () {
  37430. function isDayHighlighted() {}
  37431. return isDayHighlighted;
  37432. }(),
  37433. // DayPicker props
  37434. renderMonthText: null,
  37435. enableOutsideDays: false,
  37436. numberOfMonths: 1,
  37437. orientation: _constants.HORIZONTAL_ORIENTATION,
  37438. withPortal: false,
  37439. hideKeyboardShortcutsPanel: false,
  37440. initialVisibleMonth: null,
  37441. firstDayOfWeek: null,
  37442. daySize: _constants.DAY_SIZE,
  37443. verticalHeight: null,
  37444. noBorder: false,
  37445. verticalBorderSpacing: undefined,
  37446. transitionDuration: undefined,
  37447. horizontalMonthPadding: 13,
  37448. navPrev: null,
  37449. navNext: null,
  37450. onPrevMonthClick: function () {
  37451. function onPrevMonthClick() {}
  37452. return onPrevMonthClick;
  37453. }(),
  37454. onNextMonthClick: function () {
  37455. function onNextMonthClick() {}
  37456. return onNextMonthClick;
  37457. }(),
  37458. onOutsideClick: function () {
  37459. function onOutsideClick() {}
  37460. return onOutsideClick;
  37461. }(),
  37462. renderCalendarDay: undefined,
  37463. renderDayContents: null,
  37464. renderCalendarInfo: null,
  37465. renderMonthElement: null,
  37466. calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
  37467. // accessibility
  37468. onBlur: function () {
  37469. function onBlur() {}
  37470. return onBlur;
  37471. }(),
  37472. isFocused: false,
  37473. showKeyboardShortcuts: false,
  37474. // i18n
  37475. monthFormat: 'MMMM YYYY',
  37476. weekDayFormat: 'dd',
  37477. phrases: _defaultPhrases.DayPickerPhrases,
  37478. dayAriaLabelFormat: undefined,
  37479. isRTL: false
  37480. };
  37481. var DayPickerSingleDateController = function (_React$Component) {
  37482. _inherits(DayPickerSingleDateController, _React$Component);
  37483. function DayPickerSingleDateController(props) {
  37484. _classCallCheck(this, DayPickerSingleDateController);
  37485. var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props));
  37486. _this.isTouchDevice = false;
  37487. _this.today = (0, _moment2['default'])();
  37488. _this.modifiers = {
  37489. today: function () {
  37490. function today(day) {
  37491. return _this.isToday(day);
  37492. }
  37493. return today;
  37494. }(),
  37495. blocked: function () {
  37496. function blocked(day) {
  37497. return _this.isBlocked(day);
  37498. }
  37499. return blocked;
  37500. }(),
  37501. 'blocked-calendar': function () {
  37502. function blockedCalendar(day) {
  37503. return props.isDayBlocked(day);
  37504. }
  37505. return blockedCalendar;
  37506. }(),
  37507. 'blocked-out-of-range': function () {
  37508. function blockedOutOfRange(day) {
  37509. return props.isOutsideRange(day);
  37510. }
  37511. return blockedOutOfRange;
  37512. }(),
  37513. 'highlighted-calendar': function () {
  37514. function highlightedCalendar(day) {
  37515. return props.isDayHighlighted(day);
  37516. }
  37517. return highlightedCalendar;
  37518. }(),
  37519. valid: function () {
  37520. function valid(day) {
  37521. return !_this.isBlocked(day);
  37522. }
  37523. return valid;
  37524. }(),
  37525. hovered: function () {
  37526. function hovered(day) {
  37527. return _this.isHovered(day);
  37528. }
  37529. return hovered;
  37530. }(),
  37531. selected: function () {
  37532. function selected(day) {
  37533. return _this.isSelected(day);
  37534. }
  37535. return selected;
  37536. }(),
  37537. 'first-day-of-week': function () {
  37538. function firstDayOfWeek(day) {
  37539. return _this.isFirstDayOfWeek(day);
  37540. }
  37541. return firstDayOfWeek;
  37542. }(),
  37543. 'last-day-of-week': function () {
  37544. function lastDayOfWeek(day) {
  37545. return _this.isLastDayOfWeek(day);
  37546. }
  37547. return lastDayOfWeek;
  37548. }()
  37549. };
  37550. var _this$getStateForNewM = _this.getStateForNewMonth(props),
  37551. currentMonth = _this$getStateForNewM.currentMonth,
  37552. visibleDays = _this$getStateForNewM.visibleDays;
  37553. _this.state = {
  37554. hoverDate: null,
  37555. currentMonth: currentMonth,
  37556. visibleDays: visibleDays
  37557. };
  37558. _this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this);
  37559. _this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this);
  37560. _this.onDayClick = _this.onDayClick.bind(_this);
  37561. _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
  37562. _this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
  37563. _this.onMonthChange = _this.onMonthChange.bind(_this);
  37564. _this.onYearChange = _this.onYearChange.bind(_this);
  37565. _this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this);
  37566. return _this;
  37567. }
  37568. _createClass(DayPickerSingleDateController, [{
  37569. key: 'componentDidMount',
  37570. value: function () {
  37571. function componentDidMount() {
  37572. this.isTouchDevice = (0, _isTouchDevice2['default'])();
  37573. }
  37574. return componentDidMount;
  37575. }()
  37576. }, {
  37577. key: 'componentWillReceiveProps',
  37578. value: function () {
  37579. function componentWillReceiveProps(nextProps) {
  37580. var _this2 = this;
  37581. var date = nextProps.date,
  37582. focused = nextProps.focused,
  37583. isOutsideRange = nextProps.isOutsideRange,
  37584. isDayBlocked = nextProps.isDayBlocked,
  37585. isDayHighlighted = nextProps.isDayHighlighted,
  37586. initialVisibleMonth = nextProps.initialVisibleMonth,
  37587. numberOfMonths = nextProps.numberOfMonths,
  37588. enableOutsideDays = nextProps.enableOutsideDays;
  37589. var _props = this.props,
  37590. prevIsOutsideRange = _props.isOutsideRange,
  37591. prevIsDayBlocked = _props.isDayBlocked,
  37592. prevIsDayHighlighted = _props.isDayHighlighted,
  37593. prevNumberOfMonths = _props.numberOfMonths,
  37594. prevEnableOutsideDays = _props.enableOutsideDays,
  37595. prevInitialVisibleMonth = _props.initialVisibleMonth,
  37596. prevFocused = _props.focused,
  37597. prevDate = _props.date;
  37598. var visibleDays = this.state.visibleDays;
  37599. var recomputeOutsideRange = false;
  37600. var recomputeDayBlocked = false;
  37601. var recomputeDayHighlighted = false;
  37602. if (isOutsideRange !== prevIsOutsideRange) {
  37603. this.modifiers['blocked-out-of-range'] = function (day) {
  37604. return isOutsideRange(day);
  37605. };
  37606. recomputeOutsideRange = true;
  37607. }
  37608. if (isDayBlocked !== prevIsDayBlocked) {
  37609. this.modifiers['blocked-calendar'] = function (day) {
  37610. return isDayBlocked(day);
  37611. };
  37612. recomputeDayBlocked = true;
  37613. }
  37614. if (isDayHighlighted !== prevIsDayHighlighted) {
  37615. this.modifiers['highlighted-calendar'] = function (day) {
  37616. return isDayHighlighted(day);
  37617. };
  37618. recomputeDayHighlighted = true;
  37619. }
  37620. var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted;
  37621. if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) {
  37622. var newMonthState = this.getStateForNewMonth(nextProps);
  37623. var currentMonth = newMonthState.currentMonth;
  37624. visibleDays = newMonthState.visibleDays;
  37625. this.setState({
  37626. currentMonth: currentMonth,
  37627. visibleDays: visibleDays
  37628. });
  37629. }
  37630. var didDateChange = date !== prevDate;
  37631. var didFocusChange = focused !== prevFocused;
  37632. var modifiers = {};
  37633. if (didDateChange) {
  37634. modifiers = this.deleteModifier(modifiers, prevDate, 'selected');
  37635. modifiers = this.addModifier(modifiers, date, 'selected');
  37636. }
  37637. if (didFocusChange || recomputePropModifiers) {
  37638. (0, _object4['default'])(visibleDays).forEach(function (days) {
  37639. Object.keys(days).forEach(function (day) {
  37640. var momentObj = (0, _moment2['default'])(day);
  37641. if (_this2.isBlocked(momentObj)) {
  37642. modifiers = _this2.addModifier(modifiers, momentObj, 'blocked');
  37643. } else {
  37644. modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked');
  37645. }
  37646. if (didFocusChange || recomputeOutsideRange) {
  37647. if (isOutsideRange(momentObj)) {
  37648. modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range');
  37649. } else {
  37650. modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range');
  37651. }
  37652. }
  37653. if (didFocusChange || recomputeDayBlocked) {
  37654. if (isDayBlocked(momentObj)) {
  37655. modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar');
  37656. } else {
  37657. modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar');
  37658. }
  37659. }
  37660. if (didFocusChange || recomputeDayHighlighted) {
  37661. if (isDayHighlighted(momentObj)) {
  37662. modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar');
  37663. } else {
  37664. modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar');
  37665. }
  37666. }
  37667. });
  37668. });
  37669. }
  37670. var today = (0, _moment2['default'])();
  37671. if (!(0, _isSameDay2['default'])(this.today, today)) {
  37672. modifiers = this.deleteModifier(modifiers, this.today, 'today');
  37673. modifiers = this.addModifier(modifiers, today, 'today');
  37674. this.today = today;
  37675. }
  37676. if (Object.keys(modifiers).length > 0) {
  37677. this.setState({
  37678. visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
  37679. });
  37680. }
  37681. }
  37682. return componentWillReceiveProps;
  37683. }()
  37684. }, {
  37685. key: 'componentWillUpdate',
  37686. value: function () {
  37687. function componentWillUpdate() {
  37688. this.today = (0, _moment2['default'])();
  37689. }
  37690. return componentWillUpdate;
  37691. }()
  37692. }, {
  37693. key: 'onDayClick',
  37694. value: function () {
  37695. function onDayClick(day, e) {
  37696. if (e) e.preventDefault();
  37697. if (this.isBlocked(day)) return;
  37698. var _props2 = this.props,
  37699. onDateChange = _props2.onDateChange,
  37700. keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
  37701. onFocusChange = _props2.onFocusChange,
  37702. onClose = _props2.onClose;
  37703. onDateChange(day);
  37704. if (!keepOpenOnDateSelect) {
  37705. onFocusChange({ focused: false });
  37706. onClose({ date: day });
  37707. }
  37708. }
  37709. return onDayClick;
  37710. }()
  37711. }, {
  37712. key: 'onDayMouseEnter',
  37713. value: function () {
  37714. function onDayMouseEnter(day) {
  37715. if (this.isTouchDevice) return;
  37716. var _state = this.state,
  37717. hoverDate = _state.hoverDate,
  37718. visibleDays = _state.visibleDays;
  37719. var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
  37720. modifiers = this.addModifier(modifiers, day, 'hovered');
  37721. this.setState({
  37722. hoverDate: day,
  37723. visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
  37724. });
  37725. }
  37726. return onDayMouseEnter;
  37727. }()
  37728. }, {
  37729. key: 'onDayMouseLeave',
  37730. value: function () {
  37731. function onDayMouseLeave() {
  37732. var _state2 = this.state,
  37733. hoverDate = _state2.hoverDate,
  37734. visibleDays = _state2.visibleDays;
  37735. if (this.isTouchDevice || !hoverDate) return;
  37736. var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
  37737. this.setState({
  37738. hoverDate: null,
  37739. visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
  37740. });
  37741. }
  37742. return onDayMouseLeave;
  37743. }()
  37744. }, {
  37745. key: 'onPrevMonthClick',
  37746. value: function () {
  37747. function onPrevMonthClick() {
  37748. var _props3 = this.props,
  37749. onPrevMonthClick = _props3.onPrevMonthClick,
  37750. numberOfMonths = _props3.numberOfMonths,
  37751. enableOutsideDays = _props3.enableOutsideDays;
  37752. var _state3 = this.state,
  37753. currentMonth = _state3.currentMonth,
  37754. visibleDays = _state3.visibleDays;
  37755. var newVisibleDays = {};
  37756. Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) {
  37757. newVisibleDays[month] = visibleDays[month];
  37758. });
  37759. var prevMonth = currentMonth.clone().subtract(1, 'month');
  37760. var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays);
  37761. this.setState({
  37762. currentMonth: prevMonth,
  37763. visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays))
  37764. }, function () {
  37765. onPrevMonthClick(prevMonth.clone());
  37766. });
  37767. }
  37768. return onPrevMonthClick;
  37769. }()
  37770. }, {
  37771. key: 'onNextMonthClick',
  37772. value: function () {
  37773. function onNextMonthClick() {
  37774. var _props4 = this.props,
  37775. onNextMonthClick = _props4.onNextMonthClick,
  37776. numberOfMonths = _props4.numberOfMonths,
  37777. enableOutsideDays = _props4.enableOutsideDays;
  37778. var _state4 = this.state,
  37779. currentMonth = _state4.currentMonth,
  37780. visibleDays = _state4.visibleDays;
  37781. var newVisibleDays = {};
  37782. Object.keys(visibleDays).sort().slice(1).forEach(function (month) {
  37783. newVisibleDays[month] = visibleDays[month];
  37784. });
  37785. var nextMonth = currentMonth.clone().add(numberOfMonths, 'month');
  37786. var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays);
  37787. var newCurrentMonth = currentMonth.clone().add(1, 'month');
  37788. this.setState({
  37789. currentMonth: newCurrentMonth,
  37790. visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays))
  37791. }, function () {
  37792. onNextMonthClick(newCurrentMonth.clone());
  37793. });
  37794. }
  37795. return onNextMonthClick;
  37796. }()
  37797. }, {
  37798. key: 'onMonthChange',
  37799. value: function () {
  37800. function onMonthChange(newMonth) {
  37801. var _props5 = this.props,
  37802. numberOfMonths = _props5.numberOfMonths,
  37803. enableOutsideDays = _props5.enableOutsideDays,
  37804. orientation = _props5.orientation;
  37805. var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  37806. var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
  37807. this.setState({
  37808. currentMonth: newMonth.clone(),
  37809. visibleDays: this.getModifiers(newVisibleDays)
  37810. });
  37811. }
  37812. return onMonthChange;
  37813. }()
  37814. }, {
  37815. key: 'onYearChange',
  37816. value: function () {
  37817. function onYearChange(newMonth) {
  37818. var _props6 = this.props,
  37819. numberOfMonths = _props6.numberOfMonths,
  37820. enableOutsideDays = _props6.enableOutsideDays,
  37821. orientation = _props6.orientation;
  37822. var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
  37823. var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
  37824. this.setState({
  37825. currentMonth: newMonth.clone(),
  37826. visibleDays: this.getModifiers(newVisibleDays)
  37827. });
  37828. }
  37829. return onYearChange;
  37830. }()
  37831. }, {
  37832. key: 'getFirstFocusableDay',
  37833. value: function () {
  37834. function getFirstFocusableDay(newMonth) {
  37835. var _this3 = this;
  37836. var _props7 = this.props,
  37837. date = _props7.date,
  37838. numberOfMonths = _props7.numberOfMonths;
  37839. var focusedDate = newMonth.clone().startOf('month');
  37840. if (date) {
  37841. focusedDate = date.clone();
  37842. }
  37843. if (this.isBlocked(focusedDate)) {
  37844. var days = [];
  37845. var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month');
  37846. var currentDay = focusedDate.clone();
  37847. while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) {
  37848. currentDay = currentDay.clone().add(1, 'day');
  37849. days.push(currentDay);
  37850. }
  37851. var viableDays = days.filter(function (day) {
  37852. return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate);
  37853. });
  37854. if (viableDays.length > 0) {
  37855. var _viableDays = _slicedToArray(viableDays, 1);
  37856. focusedDate = _viableDays[0];
  37857. }
  37858. }
  37859. return focusedDate;
  37860. }
  37861. return getFirstFocusableDay;
  37862. }()
  37863. }, {
  37864. key: 'getModifiers',
  37865. value: function () {
  37866. function getModifiers(visibleDays) {
  37867. var _this4 = this;
  37868. var modifiers = {};
  37869. Object.keys(visibleDays).forEach(function (month) {
  37870. modifiers[month] = {};
  37871. visibleDays[month].forEach(function (day) {
  37872. modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day);
  37873. });
  37874. });
  37875. return modifiers;
  37876. }
  37877. return getModifiers;
  37878. }()
  37879. }, {
  37880. key: 'getModifiersForDay',
  37881. value: function () {
  37882. function getModifiersForDay(day) {
  37883. var _this5 = this;
  37884. return new Set(Object.keys(this.modifiers).filter(function (modifier) {
  37885. return _this5.modifiers[modifier](day);
  37886. }));
  37887. }
  37888. return getModifiersForDay;
  37889. }()
  37890. }, {
  37891. key: 'getStateForNewMonth',
  37892. value: function () {
  37893. function getStateForNewMonth(nextProps) {
  37894. var _this6 = this;
  37895. var initialVisibleMonth = nextProps.initialVisibleMonth,
  37896. date = nextProps.date,
  37897. numberOfMonths = nextProps.numberOfMonths,
  37898. enableOutsideDays = nextProps.enableOutsideDays;
  37899. var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () {
  37900. return date;
  37901. } : function () {
  37902. return _this6.today;
  37903. });
  37904. var currentMonth = initialVisibleMonthThunk();
  37905. var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays));
  37906. return { currentMonth: currentMonth, visibleDays: visibleDays };
  37907. }
  37908. return getStateForNewMonth;
  37909. }()
  37910. }, {
  37911. key: 'addModifier',
  37912. value: function () {
  37913. function addModifier(updatedDays, day, modifier) {
  37914. var _props8 = this.props,
  37915. numberOfVisibleMonths = _props8.numberOfMonths,
  37916. enableOutsideDays = _props8.enableOutsideDays,
  37917. orientation = _props8.orientation;
  37918. var _state5 = this.state,
  37919. firstVisibleMonth = _state5.currentMonth,
  37920. visibleDays = _state5.visibleDays;
  37921. var currentMonth = firstVisibleMonth;
  37922. var numberOfMonths = numberOfVisibleMonths;
  37923. if (orientation === _constants.VERTICAL_SCROLLABLE) {
  37924. numberOfMonths = Object.keys(visibleDays).length;
  37925. } else {
  37926. currentMonth = currentMonth.clone().subtract(1, 'month');
  37927. numberOfMonths += 2;
  37928. }
  37929. if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
  37930. return updatedDays;
  37931. }
  37932. var iso = (0, _toISODateString2['default'])(day);
  37933. var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays);
  37934. if (enableOutsideDays) {
  37935. var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
  37936. return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
  37937. });
  37938. updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) {
  37939. var month = updatedDays[monthIso] || visibleDays[monthIso];
  37940. var modifiers = new Set(month[iso]);
  37941. modifiers.add(modifier);
  37942. return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
  37943. }, updatedDaysAfterAddition);
  37944. } else {
  37945. var monthIso = (0, _toISOMonthString2['default'])(day);
  37946. var month = updatedDays[monthIso] || visibleDays[monthIso];
  37947. var modifiers = new Set(month[iso]);
  37948. modifiers.add(modifier);
  37949. updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
  37950. }
  37951. return updatedDaysAfterAddition;
  37952. }
  37953. return addModifier;
  37954. }()
  37955. }, {
  37956. key: 'deleteModifier',
  37957. value: function () {
  37958. function deleteModifier(updatedDays, day, modifier) {
  37959. var _props9 = this.props,
  37960. numberOfVisibleMonths = _props9.numberOfMonths,
  37961. enableOutsideDays = _props9.enableOutsideDays,
  37962. orientation = _props9.orientation;
  37963. var _state6 = this.state,
  37964. firstVisibleMonth = _state6.currentMonth,
  37965. visibleDays = _state6.visibleDays;
  37966. var currentMonth = firstVisibleMonth;
  37967. var numberOfMonths = numberOfVisibleMonths;
  37968. if (orientation === _constants.VERTICAL_SCROLLABLE) {
  37969. numberOfMonths = Object.keys(visibleDays).length;
  37970. } else {
  37971. currentMonth = currentMonth.clone().subtract(1, 'month');
  37972. numberOfMonths += 2;
  37973. }
  37974. if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
  37975. return updatedDays;
  37976. }
  37977. var iso = (0, _toISODateString2['default'])(day);
  37978. var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays);
  37979. if (enableOutsideDays) {
  37980. var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
  37981. return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
  37982. });
  37983. updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) {
  37984. var month = updatedDays[monthIso] || visibleDays[monthIso];
  37985. var modifiers = new Set(month[iso]);
  37986. modifiers['delete'](modifier);
  37987. return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
  37988. }, updatedDaysAfterDeletion);
  37989. } else {
  37990. var monthIso = (0, _toISOMonthString2['default'])(day);
  37991. var month = updatedDays[monthIso] || visibleDays[monthIso];
  37992. var modifiers = new Set(month[iso]);
  37993. modifiers['delete'](modifier);
  37994. updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
  37995. }
  37996. return updatedDaysAfterDeletion;
  37997. }
  37998. return deleteModifier;
  37999. }()
  38000. }, {
  38001. key: 'isBlocked',
  38002. value: function () {
  38003. function isBlocked(day) {
  38004. var _props10 = this.props,
  38005. isDayBlocked = _props10.isDayBlocked,
  38006. isOutsideRange = _props10.isOutsideRange;
  38007. return isDayBlocked(day) || isOutsideRange(day);
  38008. }
  38009. return isBlocked;
  38010. }()
  38011. }, {
  38012. key: 'isHovered',
  38013. value: function () {
  38014. function isHovered(day) {
  38015. var _ref = this.state || {},
  38016. hoverDate = _ref.hoverDate;
  38017. return (0, _isSameDay2['default'])(day, hoverDate);
  38018. }
  38019. return isHovered;
  38020. }()
  38021. }, {
  38022. key: 'isSelected',
  38023. value: function () {
  38024. function isSelected(day) {
  38025. var date = this.props.date;
  38026. return (0, _isSameDay2['default'])(day, date);
  38027. }
  38028. return isSelected;
  38029. }()
  38030. }, {
  38031. key: 'isToday',
  38032. value: function () {
  38033. function isToday(day) {
  38034. return (0, _isSameDay2['default'])(day, this.today);
  38035. }
  38036. return isToday;
  38037. }()
  38038. }, {
  38039. key: 'isFirstDayOfWeek',
  38040. value: function () {
  38041. function isFirstDayOfWeek(day) {
  38042. var firstDayOfWeek = this.props.firstDayOfWeek;
  38043. return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek());
  38044. }
  38045. return isFirstDayOfWeek;
  38046. }()
  38047. }, {
  38048. key: 'isLastDayOfWeek',
  38049. value: function () {
  38050. function isLastDayOfWeek(day) {
  38051. var firstDayOfWeek = this.props.firstDayOfWeek;
  38052. return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7;
  38053. }
  38054. return isLastDayOfWeek;
  38055. }()
  38056. }, {
  38057. key: 'render',
  38058. value: function () {
  38059. function render() {
  38060. var _props11 = this.props,
  38061. numberOfMonths = _props11.numberOfMonths,
  38062. orientation = _props11.orientation,
  38063. monthFormat = _props11.monthFormat,
  38064. renderMonthText = _props11.renderMonthText,
  38065. navPrev = _props11.navPrev,
  38066. navNext = _props11.navNext,
  38067. onOutsideClick = _props11.onOutsideClick,
  38068. withPortal = _props11.withPortal,
  38069. focused = _props11.focused,
  38070. enableOutsideDays = _props11.enableOutsideDays,
  38071. hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
  38072. daySize = _props11.daySize,
  38073. firstDayOfWeek = _props11.firstDayOfWeek,
  38074. renderCalendarDay = _props11.renderCalendarDay,
  38075. renderDayContents = _props11.renderDayContents,
  38076. renderCalendarInfo = _props11.renderCalendarInfo,
  38077. renderMonthElement = _props11.renderMonthElement,
  38078. calendarInfoPosition = _props11.calendarInfoPosition,
  38079. isFocused = _props11.isFocused,
  38080. isRTL = _props11.isRTL,
  38081. phrases = _props11.phrases,
  38082. dayAriaLabelFormat = _props11.dayAriaLabelFormat,
  38083. onBlur = _props11.onBlur,
  38084. showKeyboardShortcuts = _props11.showKeyboardShortcuts,
  38085. weekDayFormat = _props11.weekDayFormat,
  38086. verticalHeight = _props11.verticalHeight,
  38087. noBorder = _props11.noBorder,
  38088. transitionDuration = _props11.transitionDuration,
  38089. verticalBorderSpacing = _props11.verticalBorderSpacing,
  38090. horizontalMonthPadding = _props11.horizontalMonthPadding;
  38091. var _state7 = this.state,
  38092. currentMonth = _state7.currentMonth,
  38093. visibleDays = _state7.visibleDays;
  38094. return _react2['default'].createElement(_DayPicker2['default'], {
  38095. orientation: orientation,
  38096. enableOutsideDays: enableOutsideDays,
  38097. modifiers: visibleDays,
  38098. numberOfMonths: numberOfMonths,
  38099. onDayClick: this.onDayClick,
  38100. onDayMouseEnter: this.onDayMouseEnter,
  38101. onDayMouseLeave: this.onDayMouseLeave,
  38102. onPrevMonthClick: this.onPrevMonthClick,
  38103. onNextMonthClick: this.onNextMonthClick,
  38104. onMonthChange: this.onMonthChange,
  38105. onYearChange: this.onYearChange,
  38106. monthFormat: monthFormat,
  38107. withPortal: withPortal,
  38108. hidden: !focused,
  38109. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  38110. initialVisibleMonth: function () {
  38111. function initialVisibleMonth() {
  38112. return currentMonth;
  38113. }
  38114. return initialVisibleMonth;
  38115. }(),
  38116. firstDayOfWeek: firstDayOfWeek,
  38117. onOutsideClick: onOutsideClick,
  38118. navPrev: navPrev,
  38119. navNext: navNext,
  38120. renderMonthText: renderMonthText,
  38121. renderCalendarDay: renderCalendarDay,
  38122. renderDayContents: renderDayContents,
  38123. renderCalendarInfo: renderCalendarInfo,
  38124. renderMonthElement: renderMonthElement,
  38125. calendarInfoPosition: calendarInfoPosition,
  38126. isFocused: isFocused,
  38127. getFirstFocusableDay: this.getFirstFocusableDay,
  38128. onBlur: onBlur,
  38129. phrases: phrases,
  38130. daySize: daySize,
  38131. isRTL: isRTL,
  38132. showKeyboardShortcuts: showKeyboardShortcuts,
  38133. weekDayFormat: weekDayFormat,
  38134. dayAriaLabelFormat: dayAriaLabelFormat,
  38135. verticalHeight: verticalHeight,
  38136. noBorder: noBorder,
  38137. transitionDuration: transitionDuration,
  38138. verticalBorderSpacing: verticalBorderSpacing,
  38139. horizontalMonthPadding: horizontalMonthPadding
  38140. });
  38141. }
  38142. return render;
  38143. }()
  38144. }]);
  38145. return DayPickerSingleDateController;
  38146. }(_react2['default'].Component);
  38147. exports['default'] = DayPickerSingleDateController;
  38148. DayPickerSingleDateController.propTypes = propTypes;
  38149. DayPickerSingleDateController.defaultProps = defaultProps;
  38150. /***/ }),
  38151. /***/ "YLtl":
  38152. /***/ (function(module, exports) {
  38153. (function() { module.exports = window["lodash"]; }());
  38154. /***/ }),
  38155. /***/ "YZDV":
  38156. /***/ (function(module, exports, __webpack_require__) {
  38157. "use strict";
  38158. /**
  38159. * Copyright (c) 2013-present, Facebook, Inc.
  38160. *
  38161. * This source code is licensed under the MIT license found in the
  38162. * LICENSE file in the root directory of this source tree.
  38163. *
  38164. * @providesModule shallowCompare
  38165. */
  38166. var hasOwnProperty = Object.prototype.hasOwnProperty;
  38167. /**
  38168. * inlined Object.is polyfill to avoid requiring consumers ship their own
  38169. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  38170. */
  38171. function is(x, y) {
  38172. // SameValue algorithm
  38173. if (x === y) {
  38174. // Steps 1-5, 7-10
  38175. // Steps 6.b-6.e: +0 != -0
  38176. // Added the nonzero y check to make Flow happy, but it is redundant
  38177. return x !== 0 || y !== 0 || 1 / x === 1 / y;
  38178. } else {
  38179. // Step 6.a: NaN == NaN
  38180. return x !== x && y !== y;
  38181. }
  38182. }
  38183. /**
  38184. * Performs equality by iterating through keys on an object and returning false
  38185. * when any key has values which are not strictly equal between the arguments.
  38186. * Returns true when the values of all keys are strictly equal.
  38187. */
  38188. function shallowEqual(objA, objB) {
  38189. if (is(objA, objB)) {
  38190. return true;
  38191. }
  38192. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  38193. return false;
  38194. }
  38195. var keysA = Object.keys(objA);
  38196. var keysB = Object.keys(objB);
  38197. if (keysA.length !== keysB.length) {
  38198. return false;
  38199. }
  38200. // Test for A's keys different from B.
  38201. for (var i = 0; i < keysA.length; i++) {
  38202. if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
  38203. return false;
  38204. }
  38205. }
  38206. return true;
  38207. }
  38208. /**
  38209. * Does a shallow comparison for props and state.
  38210. * See ReactComponentWithPureRenderMixin
  38211. * See also https://facebook.github.io/react/docs/shallow-compare.html
  38212. */
  38213. function shallowCompare(instance, nextProps, nextState) {
  38214. return (
  38215. !shallowEqual(instance.props, nextProps) ||
  38216. !shallowEqual(instance.state, nextState)
  38217. );
  38218. }
  38219. module.exports = shallowCompare;
  38220. /***/ }),
  38221. /***/ "Z23Y":
  38222. /***/ (function(module, exports) {
  38223. (function() { module.exports = window["wp"]["warning"]; }());
  38224. /***/ }),
  38225. /***/ "ZO3Q":
  38226. /***/ (function(module, exports, __webpack_require__) {
  38227. "use strict";
  38228. Object.defineProperty(exports, '__esModule', { value: true });
  38229. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  38230. var _extends = _interopDefault(__webpack_require__("pVnL"));
  38231. var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__("8OQS"));
  38232. var React = __webpack_require__("cDcd");
  38233. var React__default = _interopDefault(React);
  38234. var _inheritsLoose = _interopDefault(__webpack_require__("VbXa"));
  38235. var _assertThisInitialized = _interopDefault(__webpack_require__("PJYZ"));
  38236. var is = {
  38237. arr: Array.isArray,
  38238. obj: function obj(a) {
  38239. return Object.prototype.toString.call(a) === '[object Object]';
  38240. },
  38241. fun: function fun(a) {
  38242. return typeof a === 'function';
  38243. },
  38244. str: function str(a) {
  38245. return typeof a === 'string';
  38246. },
  38247. num: function num(a) {
  38248. return typeof a === 'number';
  38249. },
  38250. und: function und(a) {
  38251. return a === void 0;
  38252. },
  38253. nul: function nul(a) {
  38254. return a === null;
  38255. },
  38256. set: function set(a) {
  38257. return a instanceof Set;
  38258. },
  38259. map: function map(a) {
  38260. return a instanceof Map;
  38261. },
  38262. equ: function equ(a, b) {
  38263. if (typeof a !== typeof b) return false;
  38264. if (is.str(a) || is.num(a)) return a === b;
  38265. if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
  38266. var i;
  38267. for (i in a) {
  38268. if (!(i in b)) return false;
  38269. }
  38270. for (i in b) {
  38271. if (a[i] !== b[i]) return false;
  38272. }
  38273. return is.und(i) ? a === b : true;
  38274. }
  38275. };
  38276. function merge(target, lowercase) {
  38277. if (lowercase === void 0) {
  38278. lowercase = true;
  38279. }
  38280. return function (object) {
  38281. return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) {
  38282. var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;
  38283. acc[key] = target(key);
  38284. return acc;
  38285. }, target);
  38286. };
  38287. }
  38288. function useForceUpdate() {
  38289. var _useState = React.useState(false),
  38290. f = _useState[1];
  38291. var forceUpdate = React.useCallback(function () {
  38292. return f(function (v) {
  38293. return !v;
  38294. });
  38295. }, []);
  38296. return forceUpdate;
  38297. }
  38298. function withDefault(value, defaultValue) {
  38299. return is.und(value) || is.nul(value) ? defaultValue : value;
  38300. }
  38301. function toArray(a) {
  38302. return !is.und(a) ? is.arr(a) ? a : [a] : [];
  38303. }
  38304. function callProp(obj) {
  38305. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  38306. args[_key - 1] = arguments[_key];
  38307. }
  38308. return is.fun(obj) ? obj.apply(void 0, args) : obj;
  38309. }
  38310. function getForwardProps(props) {
  38311. var to = props.to,
  38312. from = props.from,
  38313. config = props.config,
  38314. onStart = props.onStart,
  38315. onRest = props.onRest,
  38316. onFrame = props.onFrame,
  38317. children = props.children,
  38318. reset = props.reset,
  38319. reverse = props.reverse,
  38320. force = props.force,
  38321. immediate = props.immediate,
  38322. delay = props.delay,
  38323. attach = props.attach,
  38324. destroyed = props.destroyed,
  38325. interpolateTo = props.interpolateTo,
  38326. ref = props.ref,
  38327. lazy = props.lazy,
  38328. forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
  38329. return forward;
  38330. }
  38331. function interpolateTo(props) {
  38332. var forward = getForwardProps(props);
  38333. if (is.und(forward)) return _extends({
  38334. to: forward
  38335. }, props);
  38336. var rest = Object.keys(props).reduce(function (a, k) {
  38337. var _extends2;
  38338. return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2));
  38339. }, {});
  38340. return _extends({
  38341. to: forward
  38342. }, rest);
  38343. }
  38344. function handleRef(ref, forward) {
  38345. if (forward) {
  38346. // If it's a function, assume it's a ref callback
  38347. if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
  38348. forward.current = ref;
  38349. }
  38350. }
  38351. return ref;
  38352. }
  38353. var Animated =
  38354. /*#__PURE__*/
  38355. function () {
  38356. function Animated() {
  38357. this.payload = void 0;
  38358. this.children = [];
  38359. }
  38360. var _proto = Animated.prototype;
  38361. _proto.getAnimatedValue = function getAnimatedValue() {
  38362. return this.getValue();
  38363. };
  38364. _proto.getPayload = function getPayload() {
  38365. return this.payload || this;
  38366. };
  38367. _proto.attach = function attach() {};
  38368. _proto.detach = function detach() {};
  38369. _proto.getChildren = function getChildren() {
  38370. return this.children;
  38371. };
  38372. _proto.addChild = function addChild(child) {
  38373. if (this.children.length === 0) this.attach();
  38374. this.children.push(child);
  38375. };
  38376. _proto.removeChild = function removeChild(child) {
  38377. var index = this.children.indexOf(child);
  38378. this.children.splice(index, 1);
  38379. if (this.children.length === 0) this.detach();
  38380. };
  38381. return Animated;
  38382. }();
  38383. var AnimatedArray =
  38384. /*#__PURE__*/
  38385. function (_Animated) {
  38386. _inheritsLoose(AnimatedArray, _Animated);
  38387. function AnimatedArray() {
  38388. var _this;
  38389. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  38390. args[_key] = arguments[_key];
  38391. }
  38392. _this = _Animated.call.apply(_Animated, [this].concat(args)) || this;
  38393. _this.payload = [];
  38394. _this.attach = function () {
  38395. return _this.payload.forEach(function (p) {
  38396. return p instanceof Animated && p.addChild(_assertThisInitialized(_this));
  38397. });
  38398. };
  38399. _this.detach = function () {
  38400. return _this.payload.forEach(function (p) {
  38401. return p instanceof Animated && p.removeChild(_assertThisInitialized(_this));
  38402. });
  38403. };
  38404. return _this;
  38405. }
  38406. return AnimatedArray;
  38407. }(Animated);
  38408. var AnimatedObject =
  38409. /*#__PURE__*/
  38410. function (_Animated2) {
  38411. _inheritsLoose(AnimatedObject, _Animated2);
  38412. function AnimatedObject() {
  38413. var _this2;
  38414. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  38415. args[_key3] = arguments[_key3];
  38416. }
  38417. _this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this;
  38418. _this2.payload = {};
  38419. _this2.attach = function () {
  38420. return Object.values(_this2.payload).forEach(function (s) {
  38421. return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
  38422. });
  38423. };
  38424. _this2.detach = function () {
  38425. return Object.values(_this2.payload).forEach(function (s) {
  38426. return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2));
  38427. });
  38428. };
  38429. return _this2;
  38430. }
  38431. var _proto2 = AnimatedObject.prototype;
  38432. _proto2.getValue = function getValue(animated) {
  38433. if (animated === void 0) {
  38434. animated = false;
  38435. }
  38436. var payload = {};
  38437. for (var _key4 in this.payload) {
  38438. var value = this.payload[_key4];
  38439. if (animated && !(value instanceof Animated)) continue;
  38440. payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;
  38441. }
  38442. return payload;
  38443. };
  38444. _proto2.getAnimatedValue = function getAnimatedValue() {
  38445. return this.getValue(true);
  38446. };
  38447. return AnimatedObject;
  38448. }(Animated);
  38449. var applyAnimatedValues;
  38450. function injectApplyAnimatedValues(fn, transform) {
  38451. applyAnimatedValues = {
  38452. fn: fn,
  38453. transform: transform
  38454. };
  38455. }
  38456. var colorNames;
  38457. function injectColorNames(names) {
  38458. colorNames = names;
  38459. }
  38460. var requestFrame = function requestFrame(cb) {
  38461. return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
  38462. };
  38463. var cancelFrame = function cancelFrame(id) {
  38464. typeof window !== 'undefined' && window.cancelAnimationFrame(id);
  38465. };
  38466. function injectFrame(raf, caf) {
  38467. requestFrame = raf;
  38468. cancelFrame = caf;
  38469. }
  38470. var interpolation;
  38471. function injectStringInterpolator(fn) {
  38472. interpolation = fn;
  38473. }
  38474. var now = function now() {
  38475. return Date.now();
  38476. };
  38477. function injectNow(nowFn) {
  38478. now = nowFn;
  38479. }
  38480. var defaultElement;
  38481. function injectDefaultElement(el) {
  38482. defaultElement = el;
  38483. }
  38484. var animatedApi = function animatedApi(node) {
  38485. return node.current;
  38486. };
  38487. function injectAnimatedApi(fn) {
  38488. animatedApi = fn;
  38489. }
  38490. var createAnimatedStyle;
  38491. function injectCreateAnimatedStyle(factory) {
  38492. createAnimatedStyle = factory;
  38493. }
  38494. var manualFrameloop;
  38495. function injectManualFrameloop(callback) {
  38496. manualFrameloop = callback;
  38497. }
  38498. var Globals = /*#__PURE__*/Object.freeze({
  38499. get applyAnimatedValues () { return applyAnimatedValues; },
  38500. injectApplyAnimatedValues: injectApplyAnimatedValues,
  38501. get colorNames () { return colorNames; },
  38502. injectColorNames: injectColorNames,
  38503. get requestFrame () { return requestFrame; },
  38504. get cancelFrame () { return cancelFrame; },
  38505. injectFrame: injectFrame,
  38506. get interpolation () { return interpolation; },
  38507. injectStringInterpolator: injectStringInterpolator,
  38508. get now () { return now; },
  38509. injectNow: injectNow,
  38510. get defaultElement () { return defaultElement; },
  38511. injectDefaultElement: injectDefaultElement,
  38512. get animatedApi () { return animatedApi; },
  38513. injectAnimatedApi: injectAnimatedApi,
  38514. get createAnimatedStyle () { return createAnimatedStyle; },
  38515. injectCreateAnimatedStyle: injectCreateAnimatedStyle,
  38516. get manualFrameloop () { return manualFrameloop; },
  38517. injectManualFrameloop: injectManualFrameloop
  38518. });
  38519. /**
  38520. * Wraps the `style` property with `AnimatedStyle`.
  38521. */
  38522. var AnimatedProps =
  38523. /*#__PURE__*/
  38524. function (_AnimatedObject) {
  38525. _inheritsLoose(AnimatedProps, _AnimatedObject);
  38526. function AnimatedProps(props, callback) {
  38527. var _this;
  38528. _this = _AnimatedObject.call(this) || this;
  38529. _this.update = void 0;
  38530. _this.payload = !props.style ? props : _extends({}, props, {
  38531. style: createAnimatedStyle(props.style)
  38532. });
  38533. _this.update = callback;
  38534. _this.attach();
  38535. return _this;
  38536. }
  38537. return AnimatedProps;
  38538. }(AnimatedObject);
  38539. var isFunctionComponent = function isFunctionComponent(val) {
  38540. return is.fun(val) && !(val.prototype instanceof React__default.Component);
  38541. };
  38542. var createAnimatedComponent = function createAnimatedComponent(Component) {
  38543. var AnimatedComponent = React.forwardRef(function (props, ref) {
  38544. var forceUpdate = useForceUpdate();
  38545. var mounted = React.useRef(true);
  38546. var propsAnimated = React.useRef(null);
  38547. var node = React.useRef(null);
  38548. var attachProps = React.useCallback(function (props) {
  38549. var oldPropsAnimated = propsAnimated.current;
  38550. var callback = function callback() {
  38551. var didUpdate = false;
  38552. if (node.current) {
  38553. didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());
  38554. }
  38555. if (!node.current || didUpdate === false) {
  38556. // If no referenced node has been found, or the update target didn't have a
  38557. // native-responder, then forceUpdate the animation ...
  38558. forceUpdate();
  38559. }
  38560. };
  38561. propsAnimated.current = new AnimatedProps(props, callback);
  38562. oldPropsAnimated && oldPropsAnimated.detach();
  38563. }, []);
  38564. React.useEffect(function () {
  38565. return function () {
  38566. mounted.current = false;
  38567. propsAnimated.current && propsAnimated.current.detach();
  38568. };
  38569. }, []);
  38570. React.useImperativeHandle(ref, function () {
  38571. return animatedApi(node, mounted, forceUpdate);
  38572. });
  38573. attachProps(props);
  38574. var _getValue = propsAnimated.current.getValue(),
  38575. scrollTop = _getValue.scrollTop,
  38576. scrollLeft = _getValue.scrollLeft,
  38577. animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
  38578. // See: https://github.com/react-spring/react-spring/issues/569
  38579. var refFn = isFunctionComponent(Component) ? undefined : function (childRef) {
  38580. return node.current = handleRef(childRef, ref);
  38581. };
  38582. return React__default.createElement(Component, _extends({}, animatedProps, {
  38583. ref: refFn
  38584. }));
  38585. });
  38586. return AnimatedComponent;
  38587. };
  38588. var active = false;
  38589. var controllers = new Set();
  38590. var update = function update() {
  38591. if (!active) return false;
  38592. var time = now();
  38593. for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  38594. var _ref;
  38595. if (_isArray) {
  38596. if (_i >= _iterator.length) break;
  38597. _ref = _iterator[_i++];
  38598. } else {
  38599. _i = _iterator.next();
  38600. if (_i.done) break;
  38601. _ref = _i.value;
  38602. }
  38603. var controller = _ref;
  38604. var isActive = false;
  38605. for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) {
  38606. var config = controller.configs[configIdx];
  38607. var endOfAnimation = void 0,
  38608. lastTime = void 0;
  38609. for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {
  38610. var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
  38611. if (animation.done) continue;
  38612. var from = config.fromValues[valIdx];
  38613. var to = config.toValues[valIdx];
  38614. var position = animation.lastPosition;
  38615. var isAnimated = to instanceof Animated;
  38616. var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
  38617. if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
  38618. if (config.immediate) {
  38619. animation.setValue(to);
  38620. animation.done = true;
  38621. continue;
  38622. } // Break animation when string values are involved
  38623. if (typeof from === 'string' || typeof to === 'string') {
  38624. animation.setValue(to);
  38625. animation.done = true;
  38626. continue;
  38627. }
  38628. if (config.duration !== void 0) {
  38629. /** Duration easing */
  38630. position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);
  38631. endOfAnimation = time >= animation.startTime + config.duration;
  38632. } else if (config.decay) {
  38633. /** Decay easing */
  38634. position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));
  38635. endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;
  38636. if (endOfAnimation) to = position;
  38637. } else {
  38638. /** Spring easing */
  38639. lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;
  38640. velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.
  38641. if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/
  38642. var numSteps = Math.floor(time - lastTime);
  38643. for (var i = 0; i < numSteps; ++i) {
  38644. var force = -config.tension * (position - to);
  38645. var damping = -config.friction * velocity;
  38646. var acceleration = (force + damping) / config.mass;
  38647. velocity = velocity + acceleration * 1 / 1000;
  38648. position = position + velocity * 1 / 1000;
  38649. } // Conditions for stopping the spring animation
  38650. var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;
  38651. var isVelocity = Math.abs(velocity) <= config.precision;
  38652. var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;
  38653. endOfAnimation = isOvershooting || isVelocity && isDisplacement;
  38654. animation.lastVelocity = velocity;
  38655. animation.lastTime = time;
  38656. } // Trails aren't done until their parents conclude
  38657. if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;
  38658. if (endOfAnimation) {
  38659. // Ensure that we end up with a round value
  38660. if (animation.value !== to) position = to;
  38661. animation.done = true;
  38662. } else isActive = true;
  38663. animation.setValue(position);
  38664. animation.lastPosition = position;
  38665. } // Keep track of updated values only when necessary
  38666. if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue();
  38667. } // Update callbacks in the end of the frame
  38668. if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame
  38669. if (!isActive) {
  38670. controllers.delete(controller);
  38671. controller.stop(true);
  38672. }
  38673. } // Loop over as long as there are controllers ...
  38674. if (controllers.size) {
  38675. if (manualFrameloop) manualFrameloop();else requestFrame(update);
  38676. } else {
  38677. active = false;
  38678. }
  38679. return active;
  38680. };
  38681. var start = function start(controller) {
  38682. if (!controllers.has(controller)) controllers.add(controller);
  38683. if (!active) {
  38684. active = true;
  38685. if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);
  38686. }
  38687. };
  38688. var stop = function stop(controller) {
  38689. if (controllers.has(controller)) controllers.delete(controller);
  38690. };
  38691. function createInterpolator(range, output, extrapolate) {
  38692. if (typeof range === 'function') {
  38693. return range;
  38694. }
  38695. if (Array.isArray(range)) {
  38696. return createInterpolator({
  38697. range: range,
  38698. output: output,
  38699. extrapolate: extrapolate
  38700. });
  38701. }
  38702. if (interpolation && typeof range.output[0] === 'string') {
  38703. return interpolation(range);
  38704. }
  38705. var config = range;
  38706. var outputRange = config.output;
  38707. var inputRange = config.range || [0, 1];
  38708. var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
  38709. var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
  38710. var easing = config.easing || function (t) {
  38711. return t;
  38712. };
  38713. return function (input) {
  38714. var range = findRange(input, inputRange);
  38715. return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
  38716. };
  38717. }
  38718. function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
  38719. var result = map ? map(input) : input; // Extrapolate
  38720. if (result < inputMin) {
  38721. if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
  38722. }
  38723. if (result > inputMax) {
  38724. if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
  38725. }
  38726. if (outputMin === outputMax) return outputMin;
  38727. if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range
  38728. if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing
  38729. result = easing(result); // Output Range
  38730. if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
  38731. return result;
  38732. }
  38733. function findRange(input, inputRange) {
  38734. for (var i = 1; i < inputRange.length - 1; ++i) {
  38735. if (inputRange[i] >= input) break;
  38736. }
  38737. return i - 1;
  38738. }
  38739. var AnimatedInterpolation =
  38740. /*#__PURE__*/
  38741. function (_AnimatedArray) {
  38742. _inheritsLoose(AnimatedInterpolation, _AnimatedArray);
  38743. function AnimatedInterpolation(parents, range, output, extrapolate) {
  38744. var _this;
  38745. _this = _AnimatedArray.call(this) || this;
  38746. _this.calc = void 0;
  38747. _this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
  38748. _this.calc = createInterpolator(range, output, extrapolate);
  38749. return _this;
  38750. }
  38751. var _proto = AnimatedInterpolation.prototype;
  38752. _proto.getValue = function getValue() {
  38753. return this.calc.apply(this, this.payload.map(function (value) {
  38754. return value.getValue();
  38755. }));
  38756. };
  38757. _proto.updateConfig = function updateConfig(range, output, extrapolate) {
  38758. this.calc = createInterpolator(range, output, extrapolate);
  38759. };
  38760. _proto.interpolate = function interpolate(range, output, extrapolate) {
  38761. return new AnimatedInterpolation(this, range, output, extrapolate);
  38762. };
  38763. return AnimatedInterpolation;
  38764. }(AnimatedArray);
  38765. var interpolate$1 = function interpolate(parents, range, output) {
  38766. return parents && new AnimatedInterpolation(parents, range, output);
  38767. };
  38768. var config = {
  38769. default: {
  38770. tension: 170,
  38771. friction: 26
  38772. },
  38773. gentle: {
  38774. tension: 120,
  38775. friction: 14
  38776. },
  38777. wobbly: {
  38778. tension: 180,
  38779. friction: 12
  38780. },
  38781. stiff: {
  38782. tension: 210,
  38783. friction: 20
  38784. },
  38785. slow: {
  38786. tension: 280,
  38787. friction: 60
  38788. },
  38789. molasses: {
  38790. tension: 280,
  38791. friction: 120
  38792. }
  38793. };
  38794. /** API
  38795. * useChain(references, timeSteps, timeFrame)
  38796. */
  38797. function useChain(refs, timeSteps, timeFrame) {
  38798. if (timeFrame === void 0) {
  38799. timeFrame = 1000;
  38800. }
  38801. var previous = React.useRef();
  38802. React.useEffect(function () {
  38803. if (is.equ(refs, previous.current)) refs.forEach(function (_ref) {
  38804. var current = _ref.current;
  38805. return current && current.start();
  38806. });else if (timeSteps) {
  38807. refs.forEach(function (_ref2, index) {
  38808. var current = _ref2.current;
  38809. if (current) {
  38810. var ctrls = current.controllers;
  38811. if (ctrls.length) {
  38812. var t = timeFrame * timeSteps[index];
  38813. ctrls.forEach(function (ctrl) {
  38814. ctrl.queue = ctrl.queue.map(function (e) {
  38815. return _extends({}, e, {
  38816. delay: e.delay + t
  38817. });
  38818. });
  38819. ctrl.start();
  38820. });
  38821. }
  38822. }
  38823. });
  38824. } else refs.reduce(function (q, _ref3, rI) {
  38825. var current = _ref3.current;
  38826. return q = q.then(function () {
  38827. return current.start();
  38828. });
  38829. }, Promise.resolve());
  38830. previous.current = refs;
  38831. });
  38832. }
  38833. /**
  38834. * Animated works by building a directed acyclic graph of dependencies
  38835. * transparently when you render your Animated components.
  38836. *
  38837. * new Animated.Value(0)
  38838. * .interpolate() .interpolate() new Animated.Value(1)
  38839. * opacity translateY scale
  38840. * style transform
  38841. * View#234 style
  38842. * View#123
  38843. *
  38844. * A) Top Down phase
  38845. * When an AnimatedValue is updated, we recursively go down through this
  38846. * graph in order to find leaf nodes: the views that we flag as needing
  38847. * an update.
  38848. *
  38849. * B) Bottom Up phase
  38850. * When a view is flagged as needing an update, we recursively go back up
  38851. * in order to build the new value that it needs. The reason why we need
  38852. * this two-phases process is to deal with composite props such as
  38853. * transform which can receive values from multiple parents.
  38854. */
  38855. function addAnimatedStyles(node, styles) {
  38856. if ('update' in node) {
  38857. styles.add(node);
  38858. } else {
  38859. node.getChildren().forEach(function (child) {
  38860. return addAnimatedStyles(child, styles);
  38861. });
  38862. }
  38863. }
  38864. var AnimatedValue =
  38865. /*#__PURE__*/
  38866. function (_Animated) {
  38867. _inheritsLoose(AnimatedValue, _Animated);
  38868. function AnimatedValue(_value) {
  38869. var _this;
  38870. _this = _Animated.call(this) || this;
  38871. _this.animatedStyles = new Set();
  38872. _this.value = void 0;
  38873. _this.startPosition = void 0;
  38874. _this.lastPosition = void 0;
  38875. _this.lastVelocity = void 0;
  38876. _this.startTime = void 0;
  38877. _this.lastTime = void 0;
  38878. _this.done = false;
  38879. _this.setValue = function (value, flush) {
  38880. if (flush === void 0) {
  38881. flush = true;
  38882. }
  38883. _this.value = value;
  38884. if (flush) _this.flush();
  38885. };
  38886. _this.value = _value;
  38887. _this.startPosition = _value;
  38888. _this.lastPosition = _value;
  38889. return _this;
  38890. }
  38891. var _proto = AnimatedValue.prototype;
  38892. _proto.flush = function flush() {
  38893. if (this.animatedStyles.size === 0) {
  38894. addAnimatedStyles(this, this.animatedStyles);
  38895. }
  38896. this.animatedStyles.forEach(function (animatedStyle) {
  38897. return animatedStyle.update();
  38898. });
  38899. };
  38900. _proto.clearStyles = function clearStyles() {
  38901. this.animatedStyles.clear();
  38902. };
  38903. _proto.getValue = function getValue() {
  38904. return this.value;
  38905. };
  38906. _proto.interpolate = function interpolate(range, output, extrapolate) {
  38907. return new AnimatedInterpolation(this, range, output, extrapolate);
  38908. };
  38909. return AnimatedValue;
  38910. }(Animated);
  38911. var AnimatedValueArray =
  38912. /*#__PURE__*/
  38913. function (_AnimatedArray) {
  38914. _inheritsLoose(AnimatedValueArray, _AnimatedArray);
  38915. function AnimatedValueArray(values) {
  38916. var _this;
  38917. _this = _AnimatedArray.call(this) || this;
  38918. _this.payload = values.map(function (n) {
  38919. return new AnimatedValue(n);
  38920. });
  38921. return _this;
  38922. }
  38923. var _proto = AnimatedValueArray.prototype;
  38924. _proto.setValue = function setValue(value, flush) {
  38925. var _this2 = this;
  38926. if (flush === void 0) {
  38927. flush = true;
  38928. }
  38929. if (Array.isArray(value)) {
  38930. if (value.length === this.payload.length) {
  38931. value.forEach(function (v, i) {
  38932. return _this2.payload[i].setValue(v, flush);
  38933. });
  38934. }
  38935. } else {
  38936. this.payload.forEach(function (p) {
  38937. return p.setValue(value, flush);
  38938. });
  38939. }
  38940. };
  38941. _proto.getValue = function getValue() {
  38942. return this.payload.map(function (v) {
  38943. return v.getValue();
  38944. });
  38945. };
  38946. _proto.interpolate = function interpolate(range, output) {
  38947. return new AnimatedInterpolation(this, range, output);
  38948. };
  38949. return AnimatedValueArray;
  38950. }(AnimatedArray);
  38951. var G = 0;
  38952. var Controller =
  38953. /*#__PURE__*/
  38954. function () {
  38955. function Controller() {
  38956. var _this = this;
  38957. this.id = void 0;
  38958. this.idle = true;
  38959. this.hasChanged = false;
  38960. this.guid = 0;
  38961. this.local = 0;
  38962. this.props = {};
  38963. this.merged = {};
  38964. this.animations = {};
  38965. this.interpolations = {};
  38966. this.values = {};
  38967. this.configs = [];
  38968. this.listeners = [];
  38969. this.queue = [];
  38970. this.localQueue = void 0;
  38971. this.getValues = function () {
  38972. return _this.interpolations;
  38973. };
  38974. this.id = G++;
  38975. }
  38976. /** update(props)
  38977. * This function filters input props and creates an array of tasks which are executed in .start()
  38978. * Each task is allowed to carry a delay, which means it can execute asnychroneously */
  38979. var _proto = Controller.prototype;
  38980. _proto.update = function update$$1(args) {
  38981. //this._id = n + this.id
  38982. if (!args) return this; // Extract delay and the to-prop from props
  38983. var _ref = interpolateTo(args),
  38984. _ref$delay = _ref.delay,
  38985. delay = _ref$delay === void 0 ? 0 : _ref$delay,
  38986. to = _ref.to,
  38987. props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
  38988. if (is.arr(to) || is.fun(to)) {
  38989. // If config is either a function or an array queue it up as is
  38990. this.queue.push(_extends({}, props, {
  38991. delay: delay,
  38992. to: to
  38993. }));
  38994. } else if (to) {
  38995. // Otherwise go through each key since it could be delayed individually
  38996. var ops = {};
  38997. Object.entries(to).forEach(function (_ref2) {
  38998. var _to;
  38999. var k = _ref2[0],
  39000. v = _ref2[1];
  39001. // Fetch delay and create an entry, consisting of the to-props, the delay, and basic props
  39002. var entry = _extends({
  39003. to: (_to = {}, _to[k] = v, _to),
  39004. delay: callProp(delay, k)
  39005. }, props);
  39006. var previous = ops[entry.delay] && ops[entry.delay].to;
  39007. ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
  39008. to: _extends({}, previous, entry.to)
  39009. });
  39010. });
  39011. this.queue = Object.values(ops);
  39012. } // Sort queue, so that async calls go last
  39013. this.queue = this.queue.sort(function (a, b) {
  39014. return a.delay - b.delay;
  39015. }); // Diff the reduced props immediately (they'll contain the from-prop and some config)
  39016. this.diff(props);
  39017. return this;
  39018. }
  39019. /** start(onEnd)
  39020. * This function either executes a queue, if present, or starts the frameloop, which animates */
  39021. ;
  39022. _proto.start = function start$$1(onEnd) {
  39023. var _this2 = this;
  39024. // If a queue is present we must excecute it
  39025. if (this.queue.length) {
  39026. this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
  39027. if (this.localQueue) {
  39028. this.localQueue.forEach(function (_ref3) {
  39029. var _ref3$from = _ref3.from,
  39030. from = _ref3$from === void 0 ? {} : _ref3$from,
  39031. _ref3$to = _ref3.to,
  39032. to = _ref3$to === void 0 ? {} : _ref3$to;
  39033. if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
  39034. if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
  39035. });
  39036. } // The guid helps us tracking frames, a new queue over an old one means an override
  39037. // We discard async calls in that caseÍ
  39038. var local = this.local = ++this.guid;
  39039. var queue = this.localQueue = this.queue;
  39040. this.queue = []; // Go through each entry and execute it
  39041. queue.forEach(function (_ref4, index) {
  39042. var delay = _ref4.delay,
  39043. props = _objectWithoutPropertiesLoose(_ref4, ["delay"]);
  39044. var cb = function cb(finished) {
  39045. if (index === queue.length - 1 && local === _this2.guid && finished) {
  39046. _this2.idle = true;
  39047. if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
  39048. }
  39049. if (onEnd) onEnd();
  39050. }; // Entries can be delayed, ansyc or immediate
  39051. var async = is.arr(props.to) || is.fun(props.to);
  39052. if (delay) {
  39053. setTimeout(function () {
  39054. if (local === _this2.guid) {
  39055. if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
  39056. }
  39057. }, delay);
  39058. } else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
  39059. });
  39060. } // Otherwise we kick of the frameloop
  39061. else {
  39062. if (is.fun(onEnd)) this.listeners.push(onEnd);
  39063. if (this.props.onStart) this.props.onStart();
  39064. start(this);
  39065. }
  39066. return this;
  39067. };
  39068. _proto.stop = function stop$$1(finished) {
  39069. this.listeners.forEach(function (onEnd) {
  39070. return onEnd(finished);
  39071. });
  39072. this.listeners = [];
  39073. return this;
  39074. }
  39075. /** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
  39076. ;
  39077. _proto.pause = function pause(finished) {
  39078. this.stop(true);
  39079. if (finished) stop(this);
  39080. return this;
  39081. };
  39082. _proto.runAsync = function runAsync(_ref5, onEnd) {
  39083. var _this3 = this;
  39084. var delay = _ref5.delay,
  39085. props = _objectWithoutPropertiesLoose(_ref5, ["delay"]);
  39086. var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now
  39087. // If the view relies on certain values "from" has to be present
  39088. var queue = Promise.resolve(undefined);
  39089. if (is.arr(props.to)) {
  39090. var _loop = function _loop(i) {
  39091. var index = i;
  39092. var fresh = _extends({}, props, interpolateTo(props.to[index]));
  39093. if (is.arr(fresh.config)) fresh.config = fresh.config[index];
  39094. queue = queue.then(function () {
  39095. //this.stop()
  39096. if (local === _this3.guid) return new Promise(function (r) {
  39097. return _this3.diff(fresh).start(r);
  39098. });
  39099. });
  39100. };
  39101. for (var i = 0; i < props.to.length; i++) {
  39102. _loop(i);
  39103. }
  39104. } else if (is.fun(props.to)) {
  39105. var index = 0;
  39106. var last;
  39107. queue = queue.then(function () {
  39108. return props.to( // next(props)
  39109. function (p) {
  39110. var fresh = _extends({}, props, interpolateTo(p));
  39111. if (is.arr(fresh.config)) fresh.config = fresh.config[index];
  39112. index++; //this.stop()
  39113. if (local === _this3.guid) return last = new Promise(function (r) {
  39114. return _this3.diff(fresh).start(r);
  39115. });
  39116. return;
  39117. }, // cancel()
  39118. function (finished) {
  39119. if (finished === void 0) {
  39120. finished = true;
  39121. }
  39122. return _this3.stop(finished);
  39123. }).then(function () {
  39124. return last;
  39125. });
  39126. });
  39127. }
  39128. queue.then(onEnd);
  39129. };
  39130. _proto.diff = function diff(props) {
  39131. var _this4 = this;
  39132. this.props = _extends({}, this.props, props);
  39133. var _this$props = this.props,
  39134. _this$props$from = _this$props.from,
  39135. from = _this$props$from === void 0 ? {} : _this$props$from,
  39136. _this$props$to = _this$props.to,
  39137. to = _this$props$to === void 0 ? {} : _this$props$to,
  39138. _this$props$config = _this$props.config,
  39139. config = _this$props$config === void 0 ? {} : _this$props$config,
  39140. reverse = _this$props.reverse,
  39141. attach = _this$props.attach,
  39142. reset = _this$props.reset,
  39143. immediate = _this$props.immediate; // Reverse values when requested
  39144. if (reverse) {
  39145. var _ref6 = [to, from];
  39146. from = _ref6[0];
  39147. to = _ref6[1];
  39148. } // This will collect all props that were ever set, reset merged props when necessary
  39149. this.merged = _extends({}, from, this.merged, to);
  39150. this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
  39151. var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
  39152. this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) {
  39153. var name = _ref7[0],
  39154. value = _ref7[1];
  39155. // Issue cached entries, except on reset
  39156. var entry = acc[name] || {}; // Figure out what the value is supposed to be
  39157. var isNumber = is.num(value);
  39158. var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value];
  39159. var isArray = is.arr(value);
  39160. var isInterpolation = !isNumber && !isArray && !isString;
  39161. var fromValue = !is.und(from[name]) ? from[name] : value;
  39162. var toValue = isNumber || isArray ? value : isString ? value : 1;
  39163. var toConfig = callProp(config, name);
  39164. if (target) toValue = target.animations[name].parent;
  39165. var parent = entry.parent,
  39166. interpolation$$1 = entry.interpolation,
  39167. toValues = toArray(target ? toValue.getPayload() : toValue),
  39168. animatedValues;
  39169. var newValue = value;
  39170. if (isInterpolation) newValue = interpolation({
  39171. range: [0, 1],
  39172. output: [value, value]
  39173. })(1);
  39174. var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
  39175. var isFirst = is.und(parent);
  39176. var isActive = !isFirst && entry.animatedValues.some(function (v) {
  39177. return !v.done;
  39178. });
  39179. var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
  39180. var hasNewGoal = !is.equ(newValue, entry.previous);
  39181. var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
  39182. // and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
  39183. if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) {
  39184. var _extends2;
  39185. // Convert regular values into animated values, ALWAYS re-use if possible
  39186. if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) {
  39187. var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value);
  39188. prev = prev !== void 0 && !reset ? prev : fromValue;
  39189. if (entry.parent) {
  39190. parent = entry.parent;
  39191. parent.setValue(0, false);
  39192. } else parent = new AnimatedValue(0);
  39193. var range = {
  39194. output: [prev, value]
  39195. };
  39196. if (entry.interpolation) {
  39197. interpolation$$1 = entry.interpolation;
  39198. entry.interpolation.updateConfig(range);
  39199. } else interpolation$$1 = parent.interpolate(range);
  39200. }
  39201. toValues = toArray(target ? toValue.getPayload() : toValue);
  39202. animatedValues = toArray(parent.getPayload());
  39203. if (reset && !isInterpolation) parent.setValue(fromValue, false);
  39204. _this4.hasChanged = true; // Reset animated values
  39205. animatedValues.forEach(function (value) {
  39206. value.startPosition = value.value;
  39207. value.lastPosition = value.value;
  39208. value.lastVelocity = isActive ? value.lastVelocity : undefined;
  39209. value.lastTime = isActive ? value.lastTime : undefined;
  39210. value.startTime = now();
  39211. value.done = false;
  39212. value.animatedStyles.clear();
  39213. }); // Set immediate values
  39214. if (callProp(immediate, name)) {
  39215. parent.setValue(isInterpolation ? toValue : value, false);
  39216. }
  39217. return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, {
  39218. name: name,
  39219. parent: parent,
  39220. interpolation: interpolation$$1,
  39221. animatedValues: animatedValues,
  39222. toValues: toValues,
  39223. previous: newValue,
  39224. config: toConfig,
  39225. fromValues: toArray(parent.getValue()),
  39226. immediate: callProp(immediate, name),
  39227. initialVelocity: withDefault(toConfig.velocity, 0),
  39228. clamp: withDefault(toConfig.clamp, false),
  39229. precision: withDefault(toConfig.precision, 0.01),
  39230. tension: withDefault(toConfig.tension, 170),
  39231. friction: withDefault(toConfig.friction, 26),
  39232. mass: withDefault(toConfig.mass, 1),
  39233. duration: toConfig.duration,
  39234. easing: withDefault(toConfig.easing, function (t) {
  39235. return t;
  39236. }),
  39237. decay: toConfig.decay
  39238. }), _extends2));
  39239. } else {
  39240. if (!currentValueDiffersFromGoal) {
  39241. var _extends3;
  39242. // So ... the current target value (newValue) appears to be different from the previous value,
  39243. // which normally constitutes an update, but the actual value (currentValue) matches the target!
  39244. // In order to resolve this without causing an animation update we silently flag the animation as done,
  39245. // which it technically is. Interpolations also needs a config update with their target set to 1.
  39246. if (isInterpolation) {
  39247. parent.setValue(1, false);
  39248. interpolation$$1.updateConfig({
  39249. output: [newValue, newValue]
  39250. });
  39251. }
  39252. parent.done = true;
  39253. _this4.hasChanged = true;
  39254. return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
  39255. previous: newValue
  39256. }), _extends3));
  39257. }
  39258. return acc;
  39259. }
  39260. }, this.animations);
  39261. if (this.hasChanged) {
  39262. // Make animations available to frameloop
  39263. this.configs = Object.values(this.animations);
  39264. this.values = {};
  39265. this.interpolations = {};
  39266. for (var key in this.animations) {
  39267. this.interpolations[key] = this.animations[key].interpolation;
  39268. this.values[key] = this.animations[key].interpolation.getValue();
  39269. }
  39270. }
  39271. return this;
  39272. };
  39273. _proto.destroy = function destroy() {
  39274. this.stop();
  39275. this.props = {};
  39276. this.merged = {};
  39277. this.animations = {};
  39278. this.interpolations = {};
  39279. this.values = {};
  39280. this.configs = [];
  39281. this.local = 0;
  39282. };
  39283. return Controller;
  39284. }();
  39285. /** API
  39286. * const props = useSprings(number, [{ ... }, { ... }, ...])
  39287. * const [props, set] = useSprings(number, (i, controller) => ({ ... }))
  39288. */
  39289. var useSprings = function useSprings(length, props) {
  39290. var mounted = React.useRef(false);
  39291. var ctrl = React.useRef();
  39292. var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
  39293. var _useMemo = React.useMemo(function () {
  39294. // Remove old controllers
  39295. if (ctrl.current) {
  39296. ctrl.current.map(function (c) {
  39297. return c.destroy();
  39298. });
  39299. ctrl.current = undefined;
  39300. }
  39301. var ref;
  39302. return [new Array(length).fill().map(function (_, i) {
  39303. var ctrl = new Controller();
  39304. var newProps = isFn ? callProp(props, i, ctrl) : props[i];
  39305. if (i === 0) ref = newProps.ref;
  39306. ctrl.update(newProps);
  39307. if (!ref) ctrl.start();
  39308. return ctrl;
  39309. }), ref];
  39310. }, [length]),
  39311. controllers = _useMemo[0],
  39312. ref = _useMemo[1];
  39313. ctrl.current = controllers; // The hooks reference api gets defined here ...
  39314. var api = React.useImperativeHandle(ref, function () {
  39315. return {
  39316. start: function start() {
  39317. return Promise.all(ctrl.current.map(function (c) {
  39318. return new Promise(function (r) {
  39319. return c.start(r);
  39320. });
  39321. }));
  39322. },
  39323. stop: function stop(finished) {
  39324. return ctrl.current.forEach(function (c) {
  39325. return c.stop(finished);
  39326. });
  39327. },
  39328. get controllers() {
  39329. return ctrl.current;
  39330. }
  39331. };
  39332. }); // This function updates the controllers
  39333. var updateCtrl = React.useMemo(function () {
  39334. return function (updateProps) {
  39335. return ctrl.current.map(function (c, i) {
  39336. c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
  39337. if (!ref) c.start();
  39338. });
  39339. };
  39340. }, [length]); // Update controller if props aren't functional
  39341. React.useEffect(function () {
  39342. if (mounted.current) {
  39343. if (!isFn) updateCtrl(props);
  39344. } else if (!ref) ctrl.current.forEach(function (c) {
  39345. return c.start();
  39346. });
  39347. }); // Update mounted flag and destroy controller on unmount
  39348. React.useEffect(function () {
  39349. return mounted.current = true, function () {
  39350. return ctrl.current.forEach(function (c) {
  39351. return c.destroy();
  39352. });
  39353. };
  39354. }, []); // Return animated props, or, anim-props + the update-setter above
  39355. var propValues = ctrl.current.map(function (c) {
  39356. return c.getValues();
  39357. });
  39358. return isFn ? [propValues, updateCtrl, function (finished) {
  39359. return ctrl.current.forEach(function (c) {
  39360. return c.pause(finished);
  39361. });
  39362. }] : propValues;
  39363. };
  39364. /** API
  39365. * const props = useSpring({ ... })
  39366. * const [props, set] = useSpring(() => ({ ... }))
  39367. */
  39368. var useSpring = function useSpring(props) {
  39369. var isFn = is.fun(props);
  39370. var _useSprings = useSprings(1, isFn ? props : [props]),
  39371. result = _useSprings[0],
  39372. set = _useSprings[1],
  39373. pause = _useSprings[2];
  39374. return isFn ? [result[0], set, pause] : result;
  39375. };
  39376. /** API
  39377. * const trails = useTrail(number, { ... })
  39378. * const [trails, set] = useTrail(number, () => ({ ... }))
  39379. */
  39380. var useTrail = function useTrail(length, props) {
  39381. var mounted = React.useRef(false);
  39382. var isFn = is.fun(props);
  39383. var updateProps = callProp(props);
  39384. var instances = React.useRef();
  39385. var _useSprings = useSprings(length, function (i, ctrl) {
  39386. if (i === 0) instances.current = [];
  39387. instances.current.push(ctrl);
  39388. return _extends({}, updateProps, {
  39389. config: callProp(updateProps.config, i),
  39390. attach: i > 0 && function () {
  39391. return instances.current[i - 1];
  39392. }
  39393. });
  39394. }),
  39395. result = _useSprings[0],
  39396. set = _useSprings[1],
  39397. pause = _useSprings[2]; // Set up function to update controller
  39398. var updateCtrl = React.useMemo(function () {
  39399. return function (props) {
  39400. return set(function (i, ctrl) {
  39401. var last = props.reverse ? i === 0 : length - 1 === i;
  39402. var attachIdx = props.reverse ? i + 1 : i - 1;
  39403. var attachController = instances.current[attachIdx];
  39404. return _extends({}, props, {
  39405. config: callProp(props.config || updateProps.config, i),
  39406. attach: attachController && function () {
  39407. return attachController;
  39408. }
  39409. });
  39410. });
  39411. };
  39412. }, [length, updateProps.reverse]); // Update controller if props aren't functional
  39413. React.useEffect(function () {
  39414. return void (mounted.current && !isFn && updateCtrl(props));
  39415. }); // Update mounted flag and destroy controller on unmount
  39416. React.useEffect(function () {
  39417. return void (mounted.current = true);
  39418. }, []);
  39419. return isFn ? [result, updateCtrl, pause] : result;
  39420. };
  39421. /** API
  39422. * const transitions = useTransition(items, itemKeys, { ... })
  39423. * const [transitions, update] = useTransition(items, itemKeys, () => ({ ... }))
  39424. */
  39425. var guid = 0;
  39426. var ENTER = 'enter';
  39427. var LEAVE = 'leave';
  39428. var UPDATE = 'update';
  39429. var mapKeys = function mapKeys(items, keys) {
  39430. return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String);
  39431. };
  39432. var get = function get(props) {
  39433. var items = props.items,
  39434. _props$keys = props.keys,
  39435. keys = _props$keys === void 0 ? function (item) {
  39436. return item;
  39437. } : _props$keys,
  39438. rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
  39439. items = toArray(items !== void 0 ? items : null);
  39440. return _extends({
  39441. items: items,
  39442. keys: mapKeys(items, keys)
  39443. }, rest);
  39444. };
  39445. function useTransition(input, keyTransform, config) {
  39446. var props = _extends({
  39447. items: input,
  39448. keys: keyTransform || function (i) {
  39449. return i;
  39450. }
  39451. }, config);
  39452. var _get = get(props),
  39453. _get$lazy = _get.lazy,
  39454. lazy = _get$lazy === void 0 ? false : _get$lazy,
  39455. _get$unique = _get.unique,
  39456. _get$reset = _get.reset,
  39457. reset = _get$reset === void 0 ? false : _get$reset,
  39458. enter = _get.enter,
  39459. leave = _get.leave,
  39460. update = _get.update,
  39461. onDestroyed = _get.onDestroyed,
  39462. keys = _get.keys,
  39463. items = _get.items,
  39464. onFrame = _get.onFrame,
  39465. _onRest = _get.onRest,
  39466. onStart = _get.onStart,
  39467. ref = _get.ref,
  39468. extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
  39469. var forceUpdate = useForceUpdate();
  39470. var mounted = React.useRef(false);
  39471. var state = React.useRef({
  39472. mounted: false,
  39473. first: true,
  39474. deleted: [],
  39475. current: {},
  39476. transitions: [],
  39477. prevProps: {},
  39478. paused: !!props.ref,
  39479. instances: !mounted.current && new Map(),
  39480. forceUpdate: forceUpdate
  39481. });
  39482. React.useImperativeHandle(props.ref, function () {
  39483. return {
  39484. start: function start() {
  39485. return Promise.all(Array.from(state.current.instances).map(function (_ref) {
  39486. var c = _ref[1];
  39487. return new Promise(function (r) {
  39488. return c.start(r);
  39489. });
  39490. }));
  39491. },
  39492. stop: function stop(finished) {
  39493. return Array.from(state.current.instances).forEach(function (_ref2) {
  39494. var c = _ref2[1];
  39495. return c.stop(finished);
  39496. });
  39497. },
  39498. get controllers() {
  39499. return Array.from(state.current.instances).map(function (_ref3) {
  39500. var c = _ref3[1];
  39501. return c;
  39502. });
  39503. }
  39504. };
  39505. }); // Update state
  39506. state.current = diffItems(state.current, props);
  39507. if (state.current.changed) {
  39508. // Update state
  39509. state.current.transitions.forEach(function (transition) {
  39510. var slot = transition.slot,
  39511. from = transition.from,
  39512. to = transition.to,
  39513. config = transition.config,
  39514. trail = transition.trail,
  39515. key = transition.key,
  39516. item = transition.item;
  39517. if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
  39518. var ctrl = state.current.instances.get(key);
  39519. var newProps = _extends({}, extra, {
  39520. to: to,
  39521. from: from,
  39522. config: config,
  39523. ref: ref,
  39524. onRest: function onRest(values) {
  39525. if (state.current.mounted) {
  39526. if (transition.destroyed) {
  39527. // If no ref is given delete destroyed items immediately
  39528. if (!ref && !lazy) cleanUp(state, key);
  39529. if (onDestroyed) onDestroyed(item);
  39530. } // A transition comes to rest once all its springs conclude
  39531. var curInstances = Array.from(state.current.instances);
  39532. var active = curInstances.some(function (_ref4) {
  39533. var c = _ref4[1];
  39534. return !c.idle;
  39535. });
  39536. if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
  39537. if (_onRest) _onRest(item, slot, values);
  39538. }
  39539. },
  39540. onStart: onStart && function () {
  39541. return onStart(item, slot);
  39542. },
  39543. onFrame: onFrame && function (values) {
  39544. return onFrame(item, slot, values);
  39545. },
  39546. delay: trail,
  39547. reset: reset && slot === ENTER // Update controller
  39548. });
  39549. ctrl.update(newProps);
  39550. if (!state.current.paused) ctrl.start();
  39551. });
  39552. }
  39553. React.useEffect(function () {
  39554. state.current.mounted = mounted.current = true;
  39555. return function () {
  39556. state.current.mounted = mounted.current = false;
  39557. Array.from(state.current.instances).map(function (_ref5) {
  39558. var c = _ref5[1];
  39559. return c.destroy();
  39560. });
  39561. state.current.instances.clear();
  39562. };
  39563. }, []);
  39564. return state.current.transitions.map(function (_ref6) {
  39565. var item = _ref6.item,
  39566. slot = _ref6.slot,
  39567. key = _ref6.key;
  39568. return {
  39569. item: item,
  39570. key: key,
  39571. state: slot,
  39572. props: state.current.instances.get(key).getValues()
  39573. };
  39574. });
  39575. }
  39576. function cleanUp(state, filterKey) {
  39577. var deleted = state.current.deleted;
  39578. var _loop = function _loop() {
  39579. if (_isArray) {
  39580. if (_i >= _iterator.length) return "break";
  39581. _ref8 = _iterator[_i++];
  39582. } else {
  39583. _i = _iterator.next();
  39584. if (_i.done) return "break";
  39585. _ref8 = _i.value;
  39586. }
  39587. var _ref7 = _ref8;
  39588. var key = _ref7.key;
  39589. var filter = function filter(t) {
  39590. return t.key !== key;
  39591. };
  39592. if (is.und(filterKey) || filterKey === key) {
  39593. state.current.instances.delete(key);
  39594. state.current.transitions = state.current.transitions.filter(filter);
  39595. state.current.deleted = state.current.deleted.filter(filter);
  39596. }
  39597. };
  39598. for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  39599. var _ref8;
  39600. var _ret = _loop();
  39601. if (_ret === "break") break;
  39602. }
  39603. state.current.forceUpdate();
  39604. }
  39605. function diffItems(_ref9, props) {
  39606. var first = _ref9.first,
  39607. prevProps = _ref9.prevProps,
  39608. state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
  39609. var _get2 = get(props),
  39610. items = _get2.items,
  39611. keys = _get2.keys,
  39612. initial = _get2.initial,
  39613. from = _get2.from,
  39614. enter = _get2.enter,
  39615. leave = _get2.leave,
  39616. update = _get2.update,
  39617. _get2$trail = _get2.trail,
  39618. trail = _get2$trail === void 0 ? 0 : _get2$trail,
  39619. unique = _get2.unique,
  39620. config = _get2.config,
  39621. _get2$order = _get2.order,
  39622. order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
  39623. var _get3 = get(prevProps),
  39624. _keys = _get3.keys,
  39625. _items = _get3.items;
  39626. var current = _extends({}, state.current);
  39627. var deleted = [].concat(state.deleted); // Compare next keys with current keys
  39628. var currentKeys = Object.keys(current);
  39629. var currentSet = new Set(currentKeys);
  39630. var nextSet = new Set(keys);
  39631. var added = keys.filter(function (item) {
  39632. return !currentSet.has(item);
  39633. });
  39634. var removed = state.transitions.filter(function (item) {
  39635. return !item.destroyed && !nextSet.has(item.originalKey);
  39636. }).map(function (i) {
  39637. return i.originalKey;
  39638. });
  39639. var updated = keys.filter(function (item) {
  39640. return currentSet.has(item);
  39641. });
  39642. var delay = -trail;
  39643. while (order.length) {
  39644. var changeType = order.shift();
  39645. switch (changeType) {
  39646. case ENTER:
  39647. {
  39648. added.forEach(function (key, index) {
  39649. // In unique mode, remove fading out transitions if their key comes in again
  39650. if (unique && deleted.find(function (d) {
  39651. return d.originalKey === key;
  39652. })) deleted = deleted.filter(function (t) {
  39653. return t.originalKey !== key;
  39654. });
  39655. var keyIndex = keys.indexOf(key);
  39656. var item = items[keyIndex];
  39657. var slot = first && initial !== void 0 ? 'initial' : ENTER;
  39658. current[key] = {
  39659. slot: slot,
  39660. originalKey: key,
  39661. key: unique ? String(key) : guid++,
  39662. item: item,
  39663. trail: delay = delay + trail,
  39664. config: callProp(config, item, slot),
  39665. from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),
  39666. to: callProp(enter, item)
  39667. };
  39668. });
  39669. break;
  39670. }
  39671. case LEAVE:
  39672. {
  39673. removed.forEach(function (key) {
  39674. var keyIndex = _keys.indexOf(key);
  39675. var item = _items[keyIndex];
  39676. var slot = LEAVE;
  39677. deleted.unshift(_extends({}, current[key], {
  39678. slot: slot,
  39679. destroyed: true,
  39680. left: _keys[Math.max(0, keyIndex - 1)],
  39681. right: _keys[Math.min(_keys.length, keyIndex + 1)],
  39682. trail: delay = delay + trail,
  39683. config: callProp(config, item, slot),
  39684. to: callProp(leave, item)
  39685. }));
  39686. delete current[key];
  39687. });
  39688. break;
  39689. }
  39690. case UPDATE:
  39691. {
  39692. updated.forEach(function (key) {
  39693. var keyIndex = keys.indexOf(key);
  39694. var item = items[keyIndex];
  39695. var slot = UPDATE;
  39696. current[key] = _extends({}, current[key], {
  39697. item: item,
  39698. slot: slot,
  39699. trail: delay = delay + trail,
  39700. config: callProp(config, item, slot),
  39701. to: callProp(update, item)
  39702. });
  39703. });
  39704. break;
  39705. }
  39706. }
  39707. }
  39708. var out = keys.map(function (key) {
  39709. return current[key];
  39710. }); // This tries to restore order for deleted items by finding their last known siblings
  39711. // only using the left sibling to keep order placement consistent for all deleted items
  39712. deleted.forEach(function (_ref10) {
  39713. var left = _ref10.left,
  39714. right = _ref10.right,
  39715. item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
  39716. var pos; // Was it the element on the left, if yes, move there ...
  39717. if ((pos = out.findIndex(function (t) {
  39718. return t.originalKey === left;
  39719. })) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯
  39720. pos = Math.max(0, pos);
  39721. out = [].concat(out.slice(0, pos), [item], out.slice(pos));
  39722. });
  39723. return _extends({}, state, {
  39724. changed: added.length || removed.length || updated.length,
  39725. first: first && added.length === 0,
  39726. transitions: out,
  39727. current: current,
  39728. deleted: deleted,
  39729. prevProps: props
  39730. });
  39731. }
  39732. var AnimatedStyle =
  39733. /*#__PURE__*/
  39734. function (_AnimatedObject) {
  39735. _inheritsLoose(AnimatedStyle, _AnimatedObject);
  39736. function AnimatedStyle(style) {
  39737. var _this;
  39738. if (style === void 0) {
  39739. style = {};
  39740. }
  39741. _this = _AnimatedObject.call(this) || this;
  39742. if (style.transform && !(style.transform instanceof Animated)) {
  39743. style = applyAnimatedValues.transform(style);
  39744. }
  39745. _this.payload = style;
  39746. return _this;
  39747. }
  39748. return AnimatedStyle;
  39749. }(AnimatedObject);
  39750. // http://www.w3.org/TR/css3-color/#svg-color
  39751. var colors = {
  39752. transparent: 0x00000000,
  39753. aliceblue: 0xf0f8ffff,
  39754. antiquewhite: 0xfaebd7ff,
  39755. aqua: 0x00ffffff,
  39756. aquamarine: 0x7fffd4ff,
  39757. azure: 0xf0ffffff,
  39758. beige: 0xf5f5dcff,
  39759. bisque: 0xffe4c4ff,
  39760. black: 0x000000ff,
  39761. blanchedalmond: 0xffebcdff,
  39762. blue: 0x0000ffff,
  39763. blueviolet: 0x8a2be2ff,
  39764. brown: 0xa52a2aff,
  39765. burlywood: 0xdeb887ff,
  39766. burntsienna: 0xea7e5dff,
  39767. cadetblue: 0x5f9ea0ff,
  39768. chartreuse: 0x7fff00ff,
  39769. chocolate: 0xd2691eff,
  39770. coral: 0xff7f50ff,
  39771. cornflowerblue: 0x6495edff,
  39772. cornsilk: 0xfff8dcff,
  39773. crimson: 0xdc143cff,
  39774. cyan: 0x00ffffff,
  39775. darkblue: 0x00008bff,
  39776. darkcyan: 0x008b8bff,
  39777. darkgoldenrod: 0xb8860bff,
  39778. darkgray: 0xa9a9a9ff,
  39779. darkgreen: 0x006400ff,
  39780. darkgrey: 0xa9a9a9ff,
  39781. darkkhaki: 0xbdb76bff,
  39782. darkmagenta: 0x8b008bff,
  39783. darkolivegreen: 0x556b2fff,
  39784. darkorange: 0xff8c00ff,
  39785. darkorchid: 0x9932ccff,
  39786. darkred: 0x8b0000ff,
  39787. darksalmon: 0xe9967aff,
  39788. darkseagreen: 0x8fbc8fff,
  39789. darkslateblue: 0x483d8bff,
  39790. darkslategray: 0x2f4f4fff,
  39791. darkslategrey: 0x2f4f4fff,
  39792. darkturquoise: 0x00ced1ff,
  39793. darkviolet: 0x9400d3ff,
  39794. deeppink: 0xff1493ff,
  39795. deepskyblue: 0x00bfffff,
  39796. dimgray: 0x696969ff,
  39797. dimgrey: 0x696969ff,
  39798. dodgerblue: 0x1e90ffff,
  39799. firebrick: 0xb22222ff,
  39800. floralwhite: 0xfffaf0ff,
  39801. forestgreen: 0x228b22ff,
  39802. fuchsia: 0xff00ffff,
  39803. gainsboro: 0xdcdcdcff,
  39804. ghostwhite: 0xf8f8ffff,
  39805. gold: 0xffd700ff,
  39806. goldenrod: 0xdaa520ff,
  39807. gray: 0x808080ff,
  39808. green: 0x008000ff,
  39809. greenyellow: 0xadff2fff,
  39810. grey: 0x808080ff,
  39811. honeydew: 0xf0fff0ff,
  39812. hotpink: 0xff69b4ff,
  39813. indianred: 0xcd5c5cff,
  39814. indigo: 0x4b0082ff,
  39815. ivory: 0xfffff0ff,
  39816. khaki: 0xf0e68cff,
  39817. lavender: 0xe6e6faff,
  39818. lavenderblush: 0xfff0f5ff,
  39819. lawngreen: 0x7cfc00ff,
  39820. lemonchiffon: 0xfffacdff,
  39821. lightblue: 0xadd8e6ff,
  39822. lightcoral: 0xf08080ff,
  39823. lightcyan: 0xe0ffffff,
  39824. lightgoldenrodyellow: 0xfafad2ff,
  39825. lightgray: 0xd3d3d3ff,
  39826. lightgreen: 0x90ee90ff,
  39827. lightgrey: 0xd3d3d3ff,
  39828. lightpink: 0xffb6c1ff,
  39829. lightsalmon: 0xffa07aff,
  39830. lightseagreen: 0x20b2aaff,
  39831. lightskyblue: 0x87cefaff,
  39832. lightslategray: 0x778899ff,
  39833. lightslategrey: 0x778899ff,
  39834. lightsteelblue: 0xb0c4deff,
  39835. lightyellow: 0xffffe0ff,
  39836. lime: 0x00ff00ff,
  39837. limegreen: 0x32cd32ff,
  39838. linen: 0xfaf0e6ff,
  39839. magenta: 0xff00ffff,
  39840. maroon: 0x800000ff,
  39841. mediumaquamarine: 0x66cdaaff,
  39842. mediumblue: 0x0000cdff,
  39843. mediumorchid: 0xba55d3ff,
  39844. mediumpurple: 0x9370dbff,
  39845. mediumseagreen: 0x3cb371ff,
  39846. mediumslateblue: 0x7b68eeff,
  39847. mediumspringgreen: 0x00fa9aff,
  39848. mediumturquoise: 0x48d1ccff,
  39849. mediumvioletred: 0xc71585ff,
  39850. midnightblue: 0x191970ff,
  39851. mintcream: 0xf5fffaff,
  39852. mistyrose: 0xffe4e1ff,
  39853. moccasin: 0xffe4b5ff,
  39854. navajowhite: 0xffdeadff,
  39855. navy: 0x000080ff,
  39856. oldlace: 0xfdf5e6ff,
  39857. olive: 0x808000ff,
  39858. olivedrab: 0x6b8e23ff,
  39859. orange: 0xffa500ff,
  39860. orangered: 0xff4500ff,
  39861. orchid: 0xda70d6ff,
  39862. palegoldenrod: 0xeee8aaff,
  39863. palegreen: 0x98fb98ff,
  39864. paleturquoise: 0xafeeeeff,
  39865. palevioletred: 0xdb7093ff,
  39866. papayawhip: 0xffefd5ff,
  39867. peachpuff: 0xffdab9ff,
  39868. peru: 0xcd853fff,
  39869. pink: 0xffc0cbff,
  39870. plum: 0xdda0ddff,
  39871. powderblue: 0xb0e0e6ff,
  39872. purple: 0x800080ff,
  39873. rebeccapurple: 0x663399ff,
  39874. red: 0xff0000ff,
  39875. rosybrown: 0xbc8f8fff,
  39876. royalblue: 0x4169e1ff,
  39877. saddlebrown: 0x8b4513ff,
  39878. salmon: 0xfa8072ff,
  39879. sandybrown: 0xf4a460ff,
  39880. seagreen: 0x2e8b57ff,
  39881. seashell: 0xfff5eeff,
  39882. sienna: 0xa0522dff,
  39883. silver: 0xc0c0c0ff,
  39884. skyblue: 0x87ceebff,
  39885. slateblue: 0x6a5acdff,
  39886. slategray: 0x708090ff,
  39887. slategrey: 0x708090ff,
  39888. snow: 0xfffafaff,
  39889. springgreen: 0x00ff7fff,
  39890. steelblue: 0x4682b4ff,
  39891. tan: 0xd2b48cff,
  39892. teal: 0x008080ff,
  39893. thistle: 0xd8bfd8ff,
  39894. tomato: 0xff6347ff,
  39895. turquoise: 0x40e0d0ff,
  39896. violet: 0xee82eeff,
  39897. wheat: 0xf5deb3ff,
  39898. white: 0xffffffff,
  39899. whitesmoke: 0xf5f5f5ff,
  39900. yellow: 0xffff00ff,
  39901. yellowgreen: 0x9acd32ff
  39902. };
  39903. // const INTEGER = '[-+]?\\d+';
  39904. var NUMBER = '[-+]?\\d*\\.?\\d+';
  39905. var PERCENTAGE = NUMBER + '%';
  39906. function call() {
  39907. for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
  39908. parts[_key] = arguments[_key];
  39909. }
  39910. return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
  39911. }
  39912. var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
  39913. var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
  39914. var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
  39915. var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
  39916. var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
  39917. var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
  39918. var hex6 = /^#([0-9a-fA-F]{6})$/;
  39919. var hex8 = /^#([0-9a-fA-F]{8})$/;
  39920. /*
  39921. https://github.com/react-community/normalize-css-color
  39922. BSD 3-Clause License
  39923. Copyright (c) 2016, React Community
  39924. All rights reserved.
  39925. Redistribution and use in source and binary forms, with or without
  39926. modification, are permitted provided that the following conditions are met:
  39927. * Redistributions of source code must retain the above copyright notice, this
  39928. list of conditions and the following disclaimer.
  39929. * Redistributions in binary form must reproduce the above copyright notice,
  39930. this list of conditions and the following disclaimer in the documentation
  39931. and/or other materials provided with the distribution.
  39932. * Neither the name of the copyright holder nor the names of its
  39933. contributors may be used to endorse or promote products derived from
  39934. this software without specific prior written permission.
  39935. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  39936. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  39937. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39938. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  39939. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  39940. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  39941. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39942. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  39943. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39944. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39945. */
  39946. function normalizeColor(color) {
  39947. var match;
  39948. if (typeof color === 'number') {
  39949. return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
  39950. } // Ordered based on occurrences on Facebook codebase
  39951. if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
  39952. if (colors.hasOwnProperty(color)) return colors[color];
  39953. if (match = rgb.exec(color)) {
  39954. return (parse255(match[1]) << 24 | // r
  39955. parse255(match[2]) << 16 | // g
  39956. parse255(match[3]) << 8 | // b
  39957. 0x000000ff) >>> // a
  39958. 0;
  39959. }
  39960. if (match = rgba.exec(color)) {
  39961. return (parse255(match[1]) << 24 | // r
  39962. parse255(match[2]) << 16 | // g
  39963. parse255(match[3]) << 8 | // b
  39964. parse1(match[4])) >>> // a
  39965. 0;
  39966. }
  39967. if (match = hex3.exec(color)) {
  39968. return parseInt(match[1] + match[1] + // r
  39969. match[2] + match[2] + // g
  39970. match[3] + match[3] + // b
  39971. 'ff', // a
  39972. 16) >>> 0;
  39973. } // https://drafts.csswg.org/css-color-4/#hex-notation
  39974. if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
  39975. if (match = hex4.exec(color)) {
  39976. return parseInt(match[1] + match[1] + // r
  39977. match[2] + match[2] + // g
  39978. match[3] + match[3] + // b
  39979. match[4] + match[4], // a
  39980. 16) >>> 0;
  39981. }
  39982. if (match = hsl.exec(color)) {
  39983. return (hslToRgb(parse360(match[1]), // h
  39984. parsePercentage(match[2]), // s
  39985. parsePercentage(match[3]) // l
  39986. ) | 0x000000ff) >>> // a
  39987. 0;
  39988. }
  39989. if (match = hsla.exec(color)) {
  39990. return (hslToRgb(parse360(match[1]), // h
  39991. parsePercentage(match[2]), // s
  39992. parsePercentage(match[3]) // l
  39993. ) | parse1(match[4])) >>> // a
  39994. 0;
  39995. }
  39996. return null;
  39997. }
  39998. function hue2rgb(p, q, t) {
  39999. if (t < 0) t += 1;
  40000. if (t > 1) t -= 1;
  40001. if (t < 1 / 6) return p + (q - p) * 6 * t;
  40002. if (t < 1 / 2) return q;
  40003. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  40004. return p;
  40005. }
  40006. function hslToRgb(h, s, l) {
  40007. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  40008. var p = 2 * l - q;
  40009. var r = hue2rgb(p, q, h + 1 / 3);
  40010. var g = hue2rgb(p, q, h);
  40011. var b = hue2rgb(p, q, h - 1 / 3);
  40012. return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
  40013. }
  40014. function parse255(str) {
  40015. var int = parseInt(str, 10);
  40016. if (int < 0) return 0;
  40017. if (int > 255) return 255;
  40018. return int;
  40019. }
  40020. function parse360(str) {
  40021. var int = parseFloat(str);
  40022. return (int % 360 + 360) % 360 / 360;
  40023. }
  40024. function parse1(str) {
  40025. var num = parseFloat(str);
  40026. if (num < 0) return 0;
  40027. if (num > 1) return 255;
  40028. return Math.round(num * 255);
  40029. }
  40030. function parsePercentage(str) {
  40031. // parseFloat conveniently ignores the final %
  40032. var int = parseFloat(str);
  40033. if (int < 0) return 0;
  40034. if (int > 100) return 1;
  40035. return int / 100;
  40036. }
  40037. function colorToRgba(input) {
  40038. var int32Color = normalizeColor(input);
  40039. if (int32Color === null) return input;
  40040. int32Color = int32Color || 0;
  40041. var r = (int32Color & 0xff000000) >>> 24;
  40042. var g = (int32Color & 0x00ff0000) >>> 16;
  40043. var b = (int32Color & 0x0000ff00) >>> 8;
  40044. var a = (int32Color & 0x000000ff) / 255;
  40045. return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
  40046. } // Problem: https://github.com/animatedjs/animated/pull/102
  40047. // Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
  40048. var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla
  40049. // Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e
  40050. var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.)
  40051. var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g');
  40052. /**
  40053. * Supports string shapes by extracting numbers so new values can be computed,
  40054. * and recombines those values into new strings of the same shape. Supports
  40055. * things like:
  40056. *
  40057. * rgba(123, 42, 99, 0.36) // colors
  40058. * -45deg // values with units
  40059. * 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
  40060. */
  40061. var createStringInterpolator = function createStringInterpolator(config) {
  40062. // Replace colors with rgba
  40063. var outputRange = config.output.map(function (rangeValue) {
  40064. return rangeValue.replace(colorRegex, colorToRgba);
  40065. }).map(function (rangeValue) {
  40066. return rangeValue.replace(colorNamesRegex, colorToRgba);
  40067. });
  40068. var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {
  40069. return [];
  40070. });
  40071. outputRange.forEach(function (value) {
  40072. value.match(stringShapeRegex).forEach(function (number, i) {
  40073. return outputRanges[i].push(+number);
  40074. });
  40075. });
  40076. var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
  40077. return createInterpolator(_extends({}, config, {
  40078. output: outputRanges[i]
  40079. }));
  40080. });
  40081. return function (input) {
  40082. var i = 0;
  40083. return outputRange[0] // 'rgba(0, 100, 200, 0)'
  40084. // ->
  40085. // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
  40086. .replace(stringShapeRegex, function () {
  40087. return interpolations[i++](input);
  40088. }) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
  40089. // round the opacity (4th column).
  40090. .replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
  40091. return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
  40092. });
  40093. };
  40094. };
  40095. var isUnitlessNumber = {
  40096. animationIterationCount: true,
  40097. borderImageOutset: true,
  40098. borderImageSlice: true,
  40099. borderImageWidth: true,
  40100. boxFlex: true,
  40101. boxFlexGroup: true,
  40102. boxOrdinalGroup: true,
  40103. columnCount: true,
  40104. columns: true,
  40105. flex: true,
  40106. flexGrow: true,
  40107. flexPositive: true,
  40108. flexShrink: true,
  40109. flexNegative: true,
  40110. flexOrder: true,
  40111. gridRow: true,
  40112. gridRowEnd: true,
  40113. gridRowSpan: true,
  40114. gridRowStart: true,
  40115. gridColumn: true,
  40116. gridColumnEnd: true,
  40117. gridColumnSpan: true,
  40118. gridColumnStart: true,
  40119. fontWeight: true,
  40120. lineClamp: true,
  40121. lineHeight: true,
  40122. opacity: true,
  40123. order: true,
  40124. orphans: true,
  40125. tabSize: true,
  40126. widows: true,
  40127. zIndex: true,
  40128. zoom: true,
  40129. // SVG-related properties
  40130. fillOpacity: true,
  40131. floodOpacity: true,
  40132. stopOpacity: true,
  40133. strokeDasharray: true,
  40134. strokeDashoffset: true,
  40135. strokeMiterlimit: true,
  40136. strokeOpacity: true,
  40137. strokeWidth: true
  40138. };
  40139. var prefixKey = function prefixKey(prefix, key) {
  40140. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  40141. };
  40142. var prefixes = ['Webkit', 'Ms', 'Moz', 'O'];
  40143. isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) {
  40144. prefixes.forEach(function (prefix) {
  40145. return acc[prefixKey(prefix, prop)] = acc[prop];
  40146. });
  40147. return acc;
  40148. }, isUnitlessNumber);
  40149. function dangerousStyleValue(name, value, isCustomProperty) {
  40150. if (value == null || typeof value === 'boolean' || value === '') return '';
  40151. if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  40152. return ('' + value).trim();
  40153. }
  40154. var attributeCache = {};
  40155. injectCreateAnimatedStyle(function (style) {
  40156. return new AnimatedStyle(style);
  40157. });
  40158. injectDefaultElement('div');
  40159. injectStringInterpolator(createStringInterpolator);
  40160. injectColorNames(colors);
  40161. injectApplyAnimatedValues(function (instance, props) {
  40162. if (instance.nodeType && instance.setAttribute !== undefined) {
  40163. var style = props.style,
  40164. children = props.children,
  40165. scrollTop = props.scrollTop,
  40166. scrollLeft = props.scrollLeft,
  40167. attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
  40168. var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
  40169. if (scrollTop !== void 0) instance.scrollTop = scrollTop;
  40170. if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
  40171. if (children !== void 0) instance.textContent = children; // Set styles ...
  40172. for (var styleName in style) {
  40173. if (!style.hasOwnProperty(styleName)) continue;
  40174. var isCustomProperty = styleName.indexOf('--') === 0;
  40175. var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
  40176. if (styleName === 'float') styleName = 'cssFloat';
  40177. if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
  40178. } // Set attributes ...
  40179. for (var name in attributes) {
  40180. // Attributes are written in dash case
  40181. var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) {
  40182. return '-' + n.toLowerCase();
  40183. }));
  40184. if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
  40185. }
  40186. return;
  40187. } else return false;
  40188. }, function (style) {
  40189. return style;
  40190. });
  40191. var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
  40192. 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
  40193. // Extend animated with all the available THREE elements
  40194. var apply = merge(createAnimatedComponent, false);
  40195. var extendedAnimated = apply(domElements);
  40196. exports.apply = apply;
  40197. exports.config = config;
  40198. exports.update = update;
  40199. exports.animated = extendedAnimated;
  40200. exports.a = extendedAnimated;
  40201. exports.interpolate = interpolate$1;
  40202. exports.Globals = Globals;
  40203. exports.useSpring = useSpring;
  40204. exports.useTrail = useTrail;
  40205. exports.useTransition = useTransition;
  40206. exports.useChain = useChain;
  40207. exports.useSprings = useSprings;
  40208. /***/ }),
  40209. /***/ "ZbWB":
  40210. /***/ (function(module, exports, __webpack_require__) {
  40211. "use strict";
  40212. var GetIntrinsic = __webpack_require__("rZ7t");
  40213. var $test = GetIntrinsic('RegExp.prototype.test');
  40214. var callBind = __webpack_require__("hZ2/");
  40215. module.exports = function regexTester(regex) {
  40216. return callBind($test, regex);
  40217. };
  40218. /***/ }),
  40219. /***/ "Zss7":
  40220. /***/ (function(module, exports, __webpack_require__) {
  40221. var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2
  40222. // https://github.com/bgrins/TinyColor
  40223. // Brian Grinstead, MIT License
  40224. (function(Math) {
  40225. var trimLeft = /^\s+/,
  40226. trimRight = /\s+$/,
  40227. tinyCounter = 0,
  40228. mathRound = Math.round,
  40229. mathMin = Math.min,
  40230. mathMax = Math.max,
  40231. mathRandom = Math.random;
  40232. function tinycolor (color, opts) {
  40233. color = (color) ? color : '';
  40234. opts = opts || { };
  40235. // If input is already a tinycolor, return itself
  40236. if (color instanceof tinycolor) {
  40237. return color;
  40238. }
  40239. // If we are called as a function, call using new instead
  40240. if (!(this instanceof tinycolor)) {
  40241. return new tinycolor(color, opts);
  40242. }
  40243. var rgb = inputToRGB(color);
  40244. this._originalInput = color,
  40245. this._r = rgb.r,
  40246. this._g = rgb.g,
  40247. this._b = rgb.b,
  40248. this._a = rgb.a,
  40249. this._roundA = mathRound(100*this._a) / 100,
  40250. this._format = opts.format || rgb.format;
  40251. this._gradientType = opts.gradientType;
  40252. // Don't let the range of [0,255] come back in [0,1].
  40253. // Potentially lose a little bit of precision here, but will fix issues where
  40254. // .5 gets interpreted as half of the total, instead of half of 1
  40255. // If it was supposed to be 128, this was already taken care of by `inputToRgb`
  40256. if (this._r < 1) { this._r = mathRound(this._r); }
  40257. if (this._g < 1) { this._g = mathRound(this._g); }
  40258. if (this._b < 1) { this._b = mathRound(this._b); }
  40259. this._ok = rgb.ok;
  40260. this._tc_id = tinyCounter++;
  40261. }
  40262. tinycolor.prototype = {
  40263. isDark: function() {
  40264. return this.getBrightness() < 128;
  40265. },
  40266. isLight: function() {
  40267. return !this.isDark();
  40268. },
  40269. isValid: function() {
  40270. return this._ok;
  40271. },
  40272. getOriginalInput: function() {
  40273. return this._originalInput;
  40274. },
  40275. getFormat: function() {
  40276. return this._format;
  40277. },
  40278. getAlpha: function() {
  40279. return this._a;
  40280. },
  40281. getBrightness: function() {
  40282. //http://www.w3.org/TR/AERT#color-contrast
  40283. var rgb = this.toRgb();
  40284. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
  40285. },
  40286. getLuminance: function() {
  40287. //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
  40288. var rgb = this.toRgb();
  40289. var RsRGB, GsRGB, BsRGB, R, G, B;
  40290. RsRGB = rgb.r/255;
  40291. GsRGB = rgb.g/255;
  40292. BsRGB = rgb.b/255;
  40293. if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
  40294. if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
  40295. if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
  40296. return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
  40297. },
  40298. setAlpha: function(value) {
  40299. this._a = boundAlpha(value);
  40300. this._roundA = mathRound(100*this._a) / 100;
  40301. return this;
  40302. },
  40303. toHsv: function() {
  40304. var hsv = rgbToHsv(this._r, this._g, this._b);
  40305. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
  40306. },
  40307. toHsvString: function() {
  40308. var hsv = rgbToHsv(this._r, this._g, this._b);
  40309. var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
  40310. return (this._a == 1) ?
  40311. "hsv(" + h + ", " + s + "%, " + v + "%)" :
  40312. "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
  40313. },
  40314. toHsl: function() {
  40315. var hsl = rgbToHsl(this._r, this._g, this._b);
  40316. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
  40317. },
  40318. toHslString: function() {
  40319. var hsl = rgbToHsl(this._r, this._g, this._b);
  40320. var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
  40321. return (this._a == 1) ?
  40322. "hsl(" + h + ", " + s + "%, " + l + "%)" :
  40323. "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
  40324. },
  40325. toHex: function(allow3Char) {
  40326. return rgbToHex(this._r, this._g, this._b, allow3Char);
  40327. },
  40328. toHexString: function(allow3Char) {
  40329. return '#' + this.toHex(allow3Char);
  40330. },
  40331. toHex8: function(allow4Char) {
  40332. return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
  40333. },
  40334. toHex8String: function(allow4Char) {
  40335. return '#' + this.toHex8(allow4Char);
  40336. },
  40337. toRgb: function() {
  40338. return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
  40339. },
  40340. toRgbString: function() {
  40341. return (this._a == 1) ?
  40342. "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
  40343. "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
  40344. },
  40345. toPercentageRgb: function() {
  40346. return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
  40347. },
  40348. toPercentageRgbString: function() {
  40349. return (this._a == 1) ?
  40350. "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
  40351. "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
  40352. },
  40353. toName: function() {
  40354. if (this._a === 0) {
  40355. return "transparent";
  40356. }
  40357. if (this._a < 1) {
  40358. return false;
  40359. }
  40360. return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
  40361. },
  40362. toFilter: function(secondColor) {
  40363. var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
  40364. var secondHex8String = hex8String;
  40365. var gradientType = this._gradientType ? "GradientType = 1, " : "";
  40366. if (secondColor) {
  40367. var s = tinycolor(secondColor);
  40368. secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
  40369. }
  40370. return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
  40371. },
  40372. toString: function(format) {
  40373. var formatSet = !!format;
  40374. format = format || this._format;
  40375. var formattedString = false;
  40376. var hasAlpha = this._a < 1 && this._a >= 0;
  40377. var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
  40378. if (needsAlphaFormat) {
  40379. // Special case for "transparent", all other non-alpha formats
  40380. // will return rgba when there is transparency.
  40381. if (format === "name" && this._a === 0) {
  40382. return this.toName();
  40383. }
  40384. return this.toRgbString();
  40385. }
  40386. if (format === "rgb") {
  40387. formattedString = this.toRgbString();
  40388. }
  40389. if (format === "prgb") {
  40390. formattedString = this.toPercentageRgbString();
  40391. }
  40392. if (format === "hex" || format === "hex6") {
  40393. formattedString = this.toHexString();
  40394. }
  40395. if (format === "hex3") {
  40396. formattedString = this.toHexString(true);
  40397. }
  40398. if (format === "hex4") {
  40399. formattedString = this.toHex8String(true);
  40400. }
  40401. if (format === "hex8") {
  40402. formattedString = this.toHex8String();
  40403. }
  40404. if (format === "name") {
  40405. formattedString = this.toName();
  40406. }
  40407. if (format === "hsl") {
  40408. formattedString = this.toHslString();
  40409. }
  40410. if (format === "hsv") {
  40411. formattedString = this.toHsvString();
  40412. }
  40413. return formattedString || this.toHexString();
  40414. },
  40415. clone: function() {
  40416. return tinycolor(this.toString());
  40417. },
  40418. _applyModification: function(fn, args) {
  40419. var color = fn.apply(null, [this].concat([].slice.call(args)));
  40420. this._r = color._r;
  40421. this._g = color._g;
  40422. this._b = color._b;
  40423. this.setAlpha(color._a);
  40424. return this;
  40425. },
  40426. lighten: function() {
  40427. return this._applyModification(lighten, arguments);
  40428. },
  40429. brighten: function() {
  40430. return this._applyModification(brighten, arguments);
  40431. },
  40432. darken: function() {
  40433. return this._applyModification(darken, arguments);
  40434. },
  40435. desaturate: function() {
  40436. return this._applyModification(desaturate, arguments);
  40437. },
  40438. saturate: function() {
  40439. return this._applyModification(saturate, arguments);
  40440. },
  40441. greyscale: function() {
  40442. return this._applyModification(greyscale, arguments);
  40443. },
  40444. spin: function() {
  40445. return this._applyModification(spin, arguments);
  40446. },
  40447. _applyCombination: function(fn, args) {
  40448. return fn.apply(null, [this].concat([].slice.call(args)));
  40449. },
  40450. analogous: function() {
  40451. return this._applyCombination(analogous, arguments);
  40452. },
  40453. complement: function() {
  40454. return this._applyCombination(complement, arguments);
  40455. },
  40456. monochromatic: function() {
  40457. return this._applyCombination(monochromatic, arguments);
  40458. },
  40459. splitcomplement: function() {
  40460. return this._applyCombination(splitcomplement, arguments);
  40461. },
  40462. triad: function() {
  40463. return this._applyCombination(triad, arguments);
  40464. },
  40465. tetrad: function() {
  40466. return this._applyCombination(tetrad, arguments);
  40467. }
  40468. };
  40469. // If input is an object, force 1 into "1.0" to handle ratios properly
  40470. // String input requires "1.0" as input, so 1 will be treated as 1
  40471. tinycolor.fromRatio = function(color, opts) {
  40472. if (typeof color == "object") {
  40473. var newColor = {};
  40474. for (var i in color) {
  40475. if (color.hasOwnProperty(i)) {
  40476. if (i === "a") {
  40477. newColor[i] = color[i];
  40478. }
  40479. else {
  40480. newColor[i] = convertToPercentage(color[i]);
  40481. }
  40482. }
  40483. }
  40484. color = newColor;
  40485. }
  40486. return tinycolor(color, opts);
  40487. };
  40488. // Given a string or object, convert that input to RGB
  40489. // Possible string inputs:
  40490. //
  40491. // "red"
  40492. // "#f00" or "f00"
  40493. // "#ff0000" or "ff0000"
  40494. // "#ff000000" or "ff000000"
  40495. // "rgb 255 0 0" or "rgb (255, 0, 0)"
  40496. // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
  40497. // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
  40498. // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
  40499. // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
  40500. // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
  40501. // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
  40502. //
  40503. function inputToRGB(color) {
  40504. var rgb = { r: 0, g: 0, b: 0 };
  40505. var a = 1;
  40506. var s = null;
  40507. var v = null;
  40508. var l = null;
  40509. var ok = false;
  40510. var format = false;
  40511. if (typeof color == "string") {
  40512. color = stringInputToObject(color);
  40513. }
  40514. if (typeof color == "object") {
  40515. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  40516. rgb = rgbToRgb(color.r, color.g, color.b);
  40517. ok = true;
  40518. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  40519. }
  40520. else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  40521. s = convertToPercentage(color.s);
  40522. v = convertToPercentage(color.v);
  40523. rgb = hsvToRgb(color.h, s, v);
  40524. ok = true;
  40525. format = "hsv";
  40526. }
  40527. else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  40528. s = convertToPercentage(color.s);
  40529. l = convertToPercentage(color.l);
  40530. rgb = hslToRgb(color.h, s, l);
  40531. ok = true;
  40532. format = "hsl";
  40533. }
  40534. if (color.hasOwnProperty("a")) {
  40535. a = color.a;
  40536. }
  40537. }
  40538. a = boundAlpha(a);
  40539. return {
  40540. ok: ok,
  40541. format: color.format || format,
  40542. r: mathMin(255, mathMax(rgb.r, 0)),
  40543. g: mathMin(255, mathMax(rgb.g, 0)),
  40544. b: mathMin(255, mathMax(rgb.b, 0)),
  40545. a: a
  40546. };
  40547. }
  40548. // Conversion Functions
  40549. // --------------------
  40550. // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
  40551. // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
  40552. // `rgbToRgb`
  40553. // Handle bounds / percentage checking to conform to CSS color spec
  40554. // <http://www.w3.org/TR/css3-color/>
  40555. // *Assumes:* r, g, b in [0, 255] or [0, 1]
  40556. // *Returns:* { r, g, b } in [0, 255]
  40557. function rgbToRgb(r, g, b){
  40558. return {
  40559. r: bound01(r, 255) * 255,
  40560. g: bound01(g, 255) * 255,
  40561. b: bound01(b, 255) * 255
  40562. };
  40563. }
  40564. // `rgbToHsl`
  40565. // Converts an RGB color value to HSL.
  40566. // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
  40567. // *Returns:* { h, s, l } in [0,1]
  40568. function rgbToHsl(r, g, b) {
  40569. r = bound01(r, 255);
  40570. g = bound01(g, 255);
  40571. b = bound01(b, 255);
  40572. var max = mathMax(r, g, b), min = mathMin(r, g, b);
  40573. var h, s, l = (max + min) / 2;
  40574. if(max == min) {
  40575. h = s = 0; // achromatic
  40576. }
  40577. else {
  40578. var d = max - min;
  40579. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  40580. switch(max) {
  40581. case r: h = (g - b) / d + (g < b ? 6 : 0); break;
  40582. case g: h = (b - r) / d + 2; break;
  40583. case b: h = (r - g) / d + 4; break;
  40584. }
  40585. h /= 6;
  40586. }
  40587. return { h: h, s: s, l: l };
  40588. }
  40589. // `hslToRgb`
  40590. // Converts an HSL color value to RGB.
  40591. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
  40592. // *Returns:* { r, g, b } in the set [0, 255]
  40593. function hslToRgb(h, s, l) {
  40594. var r, g, b;
  40595. h = bound01(h, 360);
  40596. s = bound01(s, 100);
  40597. l = bound01(l, 100);
  40598. function hue2rgb(p, q, t) {
  40599. if(t < 0) t += 1;
  40600. if(t > 1) t -= 1;
  40601. if(t < 1/6) return p + (q - p) * 6 * t;
  40602. if(t < 1/2) return q;
  40603. if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
  40604. return p;
  40605. }
  40606. if(s === 0) {
  40607. r = g = b = l; // achromatic
  40608. }
  40609. else {
  40610. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  40611. var p = 2 * l - q;
  40612. r = hue2rgb(p, q, h + 1/3);
  40613. g = hue2rgb(p, q, h);
  40614. b = hue2rgb(p, q, h - 1/3);
  40615. }
  40616. return { r: r * 255, g: g * 255, b: b * 255 };
  40617. }
  40618. // `rgbToHsv`
  40619. // Converts an RGB color value to HSV
  40620. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  40621. // *Returns:* { h, s, v } in [0,1]
  40622. function rgbToHsv(r, g, b) {
  40623. r = bound01(r, 255);
  40624. g = bound01(g, 255);
  40625. b = bound01(b, 255);
  40626. var max = mathMax(r, g, b), min = mathMin(r, g, b);
  40627. var h, s, v = max;
  40628. var d = max - min;
  40629. s = max === 0 ? 0 : d / max;
  40630. if(max == min) {
  40631. h = 0; // achromatic
  40632. }
  40633. else {
  40634. switch(max) {
  40635. case r: h = (g - b) / d + (g < b ? 6 : 0); break;
  40636. case g: h = (b - r) / d + 2; break;
  40637. case b: h = (r - g) / d + 4; break;
  40638. }
  40639. h /= 6;
  40640. }
  40641. return { h: h, s: s, v: v };
  40642. }
  40643. // `hsvToRgb`
  40644. // Converts an HSV color value to RGB.
  40645. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  40646. // *Returns:* { r, g, b } in the set [0, 255]
  40647. function hsvToRgb(h, s, v) {
  40648. h = bound01(h, 360) * 6;
  40649. s = bound01(s, 100);
  40650. v = bound01(v, 100);
  40651. var i = Math.floor(h),
  40652. f = h - i,
  40653. p = v * (1 - s),
  40654. q = v * (1 - f * s),
  40655. t = v * (1 - (1 - f) * s),
  40656. mod = i % 6,
  40657. r = [v, q, p, p, t, v][mod],
  40658. g = [t, v, v, q, p, p][mod],
  40659. b = [p, p, t, v, v, q][mod];
  40660. return { r: r * 255, g: g * 255, b: b * 255 };
  40661. }
  40662. // `rgbToHex`
  40663. // Converts an RGB color to hex
  40664. // Assumes r, g, and b are contained in the set [0, 255]
  40665. // Returns a 3 or 6 character hex
  40666. function rgbToHex(r, g, b, allow3Char) {
  40667. var hex = [
  40668. pad2(mathRound(r).toString(16)),
  40669. pad2(mathRound(g).toString(16)),
  40670. pad2(mathRound(b).toString(16))
  40671. ];
  40672. // Return a 3 character hex if possible
  40673. if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
  40674. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  40675. }
  40676. return hex.join("");
  40677. }
  40678. // `rgbaToHex`
  40679. // Converts an RGBA color plus alpha transparency to hex
  40680. // Assumes r, g, b are contained in the set [0, 255] and
  40681. // a in [0, 1]. Returns a 4 or 8 character rgba hex
  40682. function rgbaToHex(r, g, b, a, allow4Char) {
  40683. var hex = [
  40684. pad2(mathRound(r).toString(16)),
  40685. pad2(mathRound(g).toString(16)),
  40686. pad2(mathRound(b).toString(16)),
  40687. pad2(convertDecimalToHex(a))
  40688. ];
  40689. // Return a 4 character hex if possible
  40690. if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
  40691. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  40692. }
  40693. return hex.join("");
  40694. }
  40695. // `rgbaToArgbHex`
  40696. // Converts an RGBA color to an ARGB Hex8 string
  40697. // Rarely used, but required for "toFilter()"
  40698. function rgbaToArgbHex(r, g, b, a) {
  40699. var hex = [
  40700. pad2(convertDecimalToHex(a)),
  40701. pad2(mathRound(r).toString(16)),
  40702. pad2(mathRound(g).toString(16)),
  40703. pad2(mathRound(b).toString(16))
  40704. ];
  40705. return hex.join("");
  40706. }
  40707. // `equals`
  40708. // Can be called with any tinycolor input
  40709. tinycolor.equals = function (color1, color2) {
  40710. if (!color1 || !color2) { return false; }
  40711. return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
  40712. };
  40713. tinycolor.random = function() {
  40714. return tinycolor.fromRatio({
  40715. r: mathRandom(),
  40716. g: mathRandom(),
  40717. b: mathRandom()
  40718. });
  40719. };
  40720. // Modification Functions
  40721. // ----------------------
  40722. // Thanks to less.js for some of the basics here
  40723. // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
  40724. function desaturate(color, amount) {
  40725. amount = (amount === 0) ? 0 : (amount || 10);
  40726. var hsl = tinycolor(color).toHsl();
  40727. hsl.s -= amount / 100;
  40728. hsl.s = clamp01(hsl.s);
  40729. return tinycolor(hsl);
  40730. }
  40731. function saturate(color, amount) {
  40732. amount = (amount === 0) ? 0 : (amount || 10);
  40733. var hsl = tinycolor(color).toHsl();
  40734. hsl.s += amount / 100;
  40735. hsl.s = clamp01(hsl.s);
  40736. return tinycolor(hsl);
  40737. }
  40738. function greyscale(color) {
  40739. return tinycolor(color).desaturate(100);
  40740. }
  40741. function lighten (color, amount) {
  40742. amount = (amount === 0) ? 0 : (amount || 10);
  40743. var hsl = tinycolor(color).toHsl();
  40744. hsl.l += amount / 100;
  40745. hsl.l = clamp01(hsl.l);
  40746. return tinycolor(hsl);
  40747. }
  40748. function brighten(color, amount) {
  40749. amount = (amount === 0) ? 0 : (amount || 10);
  40750. var rgb = tinycolor(color).toRgb();
  40751. rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
  40752. rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
  40753. rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
  40754. return tinycolor(rgb);
  40755. }
  40756. function darken (color, amount) {
  40757. amount = (amount === 0) ? 0 : (amount || 10);
  40758. var hsl = tinycolor(color).toHsl();
  40759. hsl.l -= amount / 100;
  40760. hsl.l = clamp01(hsl.l);
  40761. return tinycolor(hsl);
  40762. }
  40763. // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
  40764. // Values outside of this range will be wrapped into this range.
  40765. function spin(color, amount) {
  40766. var hsl = tinycolor(color).toHsl();
  40767. var hue = (hsl.h + amount) % 360;
  40768. hsl.h = hue < 0 ? 360 + hue : hue;
  40769. return tinycolor(hsl);
  40770. }
  40771. // Combination Functions
  40772. // ---------------------
  40773. // Thanks to jQuery xColor for some of the ideas behind these
  40774. // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
  40775. function complement(color) {
  40776. var hsl = tinycolor(color).toHsl();
  40777. hsl.h = (hsl.h + 180) % 360;
  40778. return tinycolor(hsl);
  40779. }
  40780. function triad(color) {
  40781. var hsl = tinycolor(color).toHsl();
  40782. var h = hsl.h;
  40783. return [
  40784. tinycolor(color),
  40785. tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
  40786. tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
  40787. ];
  40788. }
  40789. function tetrad(color) {
  40790. var hsl = tinycolor(color).toHsl();
  40791. var h = hsl.h;
  40792. return [
  40793. tinycolor(color),
  40794. tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
  40795. tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
  40796. tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
  40797. ];
  40798. }
  40799. function splitcomplement(color) {
  40800. var hsl = tinycolor(color).toHsl();
  40801. var h = hsl.h;
  40802. return [
  40803. tinycolor(color),
  40804. tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
  40805. tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
  40806. ];
  40807. }
  40808. function analogous(color, results, slices) {
  40809. results = results || 6;
  40810. slices = slices || 30;
  40811. var hsl = tinycolor(color).toHsl();
  40812. var part = 360 / slices;
  40813. var ret = [tinycolor(color)];
  40814. for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
  40815. hsl.h = (hsl.h + part) % 360;
  40816. ret.push(tinycolor(hsl));
  40817. }
  40818. return ret;
  40819. }
  40820. function monochromatic(color, results) {
  40821. results = results || 6;
  40822. var hsv = tinycolor(color).toHsv();
  40823. var h = hsv.h, s = hsv.s, v = hsv.v;
  40824. var ret = [];
  40825. var modification = 1 / results;
  40826. while (results--) {
  40827. ret.push(tinycolor({ h: h, s: s, v: v}));
  40828. v = (v + modification) % 1;
  40829. }
  40830. return ret;
  40831. }
  40832. // Utility Functions
  40833. // ---------------------
  40834. tinycolor.mix = function(color1, color2, amount) {
  40835. amount = (amount === 0) ? 0 : (amount || 50);
  40836. var rgb1 = tinycolor(color1).toRgb();
  40837. var rgb2 = tinycolor(color2).toRgb();
  40838. var p = amount / 100;
  40839. var rgba = {
  40840. r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
  40841. g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
  40842. b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
  40843. a: ((rgb2.a - rgb1.a) * p) + rgb1.a
  40844. };
  40845. return tinycolor(rgba);
  40846. };
  40847. // Readability Functions
  40848. // ---------------------
  40849. // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
  40850. // `contrast`
  40851. // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
  40852. tinycolor.readability = function(color1, color2) {
  40853. var c1 = tinycolor(color1);
  40854. var c2 = tinycolor(color2);
  40855. return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
  40856. };
  40857. // `isReadable`
  40858. // Ensure that foreground and background color combinations meet WCAG2 guidelines.
  40859. // The third argument is an optional Object.
  40860. // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
  40861. // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
  40862. // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
  40863. // *Example*
  40864. // tinycolor.isReadable("#000", "#111") => false
  40865. // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
  40866. tinycolor.isReadable = function(color1, color2, wcag2) {
  40867. var readability = tinycolor.readability(color1, color2);
  40868. var wcag2Parms, out;
  40869. out = false;
  40870. wcag2Parms = validateWCAG2Parms(wcag2);
  40871. switch (wcag2Parms.level + wcag2Parms.size) {
  40872. case "AAsmall":
  40873. case "AAAlarge":
  40874. out = readability >= 4.5;
  40875. break;
  40876. case "AAlarge":
  40877. out = readability >= 3;
  40878. break;
  40879. case "AAAsmall":
  40880. out = readability >= 7;
  40881. break;
  40882. }
  40883. return out;
  40884. };
  40885. // `mostReadable`
  40886. // Given a base color and a list of possible foreground or background
  40887. // colors for that base, returns the most readable color.
  40888. // Optionally returns Black or White if the most readable color is unreadable.
  40889. // *Example*
  40890. // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
  40891. // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
  40892. // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
  40893. // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
  40894. tinycolor.mostReadable = function(baseColor, colorList, args) {
  40895. var bestColor = null;
  40896. var bestScore = 0;
  40897. var readability;
  40898. var includeFallbackColors, level, size ;
  40899. args = args || {};
  40900. includeFallbackColors = args.includeFallbackColors ;
  40901. level = args.level;
  40902. size = args.size;
  40903. for (var i= 0; i < colorList.length ; i++) {
  40904. readability = tinycolor.readability(baseColor, colorList[i]);
  40905. if (readability > bestScore) {
  40906. bestScore = readability;
  40907. bestColor = tinycolor(colorList[i]);
  40908. }
  40909. }
  40910. if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
  40911. return bestColor;
  40912. }
  40913. else {
  40914. args.includeFallbackColors=false;
  40915. return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
  40916. }
  40917. };
  40918. // Big List of Colors
  40919. // ------------------
  40920. // <http://www.w3.org/TR/css3-color/#svg-color>
  40921. var names = tinycolor.names = {
  40922. aliceblue: "f0f8ff",
  40923. antiquewhite: "faebd7",
  40924. aqua: "0ff",
  40925. aquamarine: "7fffd4",
  40926. azure: "f0ffff",
  40927. beige: "f5f5dc",
  40928. bisque: "ffe4c4",
  40929. black: "000",
  40930. blanchedalmond: "ffebcd",
  40931. blue: "00f",
  40932. blueviolet: "8a2be2",
  40933. brown: "a52a2a",
  40934. burlywood: "deb887",
  40935. burntsienna: "ea7e5d",
  40936. cadetblue: "5f9ea0",
  40937. chartreuse: "7fff00",
  40938. chocolate: "d2691e",
  40939. coral: "ff7f50",
  40940. cornflowerblue: "6495ed",
  40941. cornsilk: "fff8dc",
  40942. crimson: "dc143c",
  40943. cyan: "0ff",
  40944. darkblue: "00008b",
  40945. darkcyan: "008b8b",
  40946. darkgoldenrod: "b8860b",
  40947. darkgray: "a9a9a9",
  40948. darkgreen: "006400",
  40949. darkgrey: "a9a9a9",
  40950. darkkhaki: "bdb76b",
  40951. darkmagenta: "8b008b",
  40952. darkolivegreen: "556b2f",
  40953. darkorange: "ff8c00",
  40954. darkorchid: "9932cc",
  40955. darkred: "8b0000",
  40956. darksalmon: "e9967a",
  40957. darkseagreen: "8fbc8f",
  40958. darkslateblue: "483d8b",
  40959. darkslategray: "2f4f4f",
  40960. darkslategrey: "2f4f4f",
  40961. darkturquoise: "00ced1",
  40962. darkviolet: "9400d3",
  40963. deeppink: "ff1493",
  40964. deepskyblue: "00bfff",
  40965. dimgray: "696969",
  40966. dimgrey: "696969",
  40967. dodgerblue: "1e90ff",
  40968. firebrick: "b22222",
  40969. floralwhite: "fffaf0",
  40970. forestgreen: "228b22",
  40971. fuchsia: "f0f",
  40972. gainsboro: "dcdcdc",
  40973. ghostwhite: "f8f8ff",
  40974. gold: "ffd700",
  40975. goldenrod: "daa520",
  40976. gray: "808080",
  40977. green: "008000",
  40978. greenyellow: "adff2f",
  40979. grey: "808080",
  40980. honeydew: "f0fff0",
  40981. hotpink: "ff69b4",
  40982. indianred: "cd5c5c",
  40983. indigo: "4b0082",
  40984. ivory: "fffff0",
  40985. khaki: "f0e68c",
  40986. lavender: "e6e6fa",
  40987. lavenderblush: "fff0f5",
  40988. lawngreen: "7cfc00",
  40989. lemonchiffon: "fffacd",
  40990. lightblue: "add8e6",
  40991. lightcoral: "f08080",
  40992. lightcyan: "e0ffff",
  40993. lightgoldenrodyellow: "fafad2",
  40994. lightgray: "d3d3d3",
  40995. lightgreen: "90ee90",
  40996. lightgrey: "d3d3d3",
  40997. lightpink: "ffb6c1",
  40998. lightsalmon: "ffa07a",
  40999. lightseagreen: "20b2aa",
  41000. lightskyblue: "87cefa",
  41001. lightslategray: "789",
  41002. lightslategrey: "789",
  41003. lightsteelblue: "b0c4de",
  41004. lightyellow: "ffffe0",
  41005. lime: "0f0",
  41006. limegreen: "32cd32",
  41007. linen: "faf0e6",
  41008. magenta: "f0f",
  41009. maroon: "800000",
  41010. mediumaquamarine: "66cdaa",
  41011. mediumblue: "0000cd",
  41012. mediumorchid: "ba55d3",
  41013. mediumpurple: "9370db",
  41014. mediumseagreen: "3cb371",
  41015. mediumslateblue: "7b68ee",
  41016. mediumspringgreen: "00fa9a",
  41017. mediumturquoise: "48d1cc",
  41018. mediumvioletred: "c71585",
  41019. midnightblue: "191970",
  41020. mintcream: "f5fffa",
  41021. mistyrose: "ffe4e1",
  41022. moccasin: "ffe4b5",
  41023. navajowhite: "ffdead",
  41024. navy: "000080",
  41025. oldlace: "fdf5e6",
  41026. olive: "808000",
  41027. olivedrab: "6b8e23",
  41028. orange: "ffa500",
  41029. orangered: "ff4500",
  41030. orchid: "da70d6",
  41031. palegoldenrod: "eee8aa",
  41032. palegreen: "98fb98",
  41033. paleturquoise: "afeeee",
  41034. palevioletred: "db7093",
  41035. papayawhip: "ffefd5",
  41036. peachpuff: "ffdab9",
  41037. peru: "cd853f",
  41038. pink: "ffc0cb",
  41039. plum: "dda0dd",
  41040. powderblue: "b0e0e6",
  41041. purple: "800080",
  41042. rebeccapurple: "663399",
  41043. red: "f00",
  41044. rosybrown: "bc8f8f",
  41045. royalblue: "4169e1",
  41046. saddlebrown: "8b4513",
  41047. salmon: "fa8072",
  41048. sandybrown: "f4a460",
  41049. seagreen: "2e8b57",
  41050. seashell: "fff5ee",
  41051. sienna: "a0522d",
  41052. silver: "c0c0c0",
  41053. skyblue: "87ceeb",
  41054. slateblue: "6a5acd",
  41055. slategray: "708090",
  41056. slategrey: "708090",
  41057. snow: "fffafa",
  41058. springgreen: "00ff7f",
  41059. steelblue: "4682b4",
  41060. tan: "d2b48c",
  41061. teal: "008080",
  41062. thistle: "d8bfd8",
  41063. tomato: "ff6347",
  41064. turquoise: "40e0d0",
  41065. violet: "ee82ee",
  41066. wheat: "f5deb3",
  41067. white: "fff",
  41068. whitesmoke: "f5f5f5",
  41069. yellow: "ff0",
  41070. yellowgreen: "9acd32"
  41071. };
  41072. // Make it easy to access colors via `hexNames[hex]`
  41073. var hexNames = tinycolor.hexNames = flip(names);
  41074. // Utilities
  41075. // ---------
  41076. // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
  41077. function flip(o) {
  41078. var flipped = { };
  41079. for (var i in o) {
  41080. if (o.hasOwnProperty(i)) {
  41081. flipped[o[i]] = i;
  41082. }
  41083. }
  41084. return flipped;
  41085. }
  41086. // Return a valid alpha value [0,1] with all invalid values being set to 1
  41087. function boundAlpha(a) {
  41088. a = parseFloat(a);
  41089. if (isNaN(a) || a < 0 || a > 1) {
  41090. a = 1;
  41091. }
  41092. return a;
  41093. }
  41094. // Take input from [0, n] and return it as [0, 1]
  41095. function bound01(n, max) {
  41096. if (isOnePointZero(n)) { n = "100%"; }
  41097. var processPercent = isPercentage(n);
  41098. n = mathMin(max, mathMax(0, parseFloat(n)));
  41099. // Automatically convert percentage into number
  41100. if (processPercent) {
  41101. n = parseInt(n * max, 10) / 100;
  41102. }
  41103. // Handle floating point rounding errors
  41104. if ((Math.abs(n - max) < 0.000001)) {
  41105. return 1;
  41106. }
  41107. // Convert into [0, 1] range if it isn't already
  41108. return (n % max) / parseFloat(max);
  41109. }
  41110. // Force a number between 0 and 1
  41111. function clamp01(val) {
  41112. return mathMin(1, mathMax(0, val));
  41113. }
  41114. // Parse a base-16 hex value into a base-10 integer
  41115. function parseIntFromHex(val) {
  41116. return parseInt(val, 16);
  41117. }
  41118. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  41119. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  41120. function isOnePointZero(n) {
  41121. return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
  41122. }
  41123. // Check to see if string passed in is a percentage
  41124. function isPercentage(n) {
  41125. return typeof n === "string" && n.indexOf('%') != -1;
  41126. }
  41127. // Force a hex value to have 2 characters
  41128. function pad2(c) {
  41129. return c.length == 1 ? '0' + c : '' + c;
  41130. }
  41131. // Replace a decimal with it's percentage value
  41132. function convertToPercentage(n) {
  41133. if (n <= 1) {
  41134. n = (n * 100) + "%";
  41135. }
  41136. return n;
  41137. }
  41138. // Converts a decimal to a hex value
  41139. function convertDecimalToHex(d) {
  41140. return Math.round(parseFloat(d) * 255).toString(16);
  41141. }
  41142. // Converts a hex value to a decimal
  41143. function convertHexToDecimal(h) {
  41144. return (parseIntFromHex(h) / 255);
  41145. }
  41146. var matchers = (function() {
  41147. // <http://www.w3.org/TR/css3-values/#integers>
  41148. var CSS_INTEGER = "[-\\+]?\\d+%?";
  41149. // <http://www.w3.org/TR/css3-values/#number-value>
  41150. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  41151. // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
  41152. var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
  41153. // Actual matching.
  41154. // Parentheses and commas are optional, but not required.
  41155. // Whitespace can take the place of commas or opening paren
  41156. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  41157. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  41158. return {
  41159. CSS_UNIT: new RegExp(CSS_UNIT),
  41160. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  41161. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  41162. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  41163. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  41164. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  41165. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  41166. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  41167. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  41168. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  41169. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  41170. };
  41171. })();
  41172. // `isValidCSSUnit`
  41173. // Take in a single string / number and check to see if it looks like a CSS unit
  41174. // (see `matchers` above for definition).
  41175. function isValidCSSUnit(color) {
  41176. return !!matchers.CSS_UNIT.exec(color);
  41177. }
  41178. // `stringInputToObject`
  41179. // Permissive string parsing. Take in a number of formats, and output an object
  41180. // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
  41181. function stringInputToObject(color) {
  41182. color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
  41183. var named = false;
  41184. if (names[color]) {
  41185. color = names[color];
  41186. named = true;
  41187. }
  41188. else if (color == 'transparent') {
  41189. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  41190. }
  41191. // Try to match string input using regular expressions.
  41192. // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
  41193. // Just return an object and let the conversion functions handle that.
  41194. // This way the result will be the same whether the tinycolor is initialized with string or object.
  41195. var match;
  41196. if ((match = matchers.rgb.exec(color))) {
  41197. return { r: match[1], g: match[2], b: match[3] };
  41198. }
  41199. if ((match = matchers.rgba.exec(color))) {
  41200. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  41201. }
  41202. if ((match = matchers.hsl.exec(color))) {
  41203. return { h: match[1], s: match[2], l: match[3] };
  41204. }
  41205. if ((match = matchers.hsla.exec(color))) {
  41206. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  41207. }
  41208. if ((match = matchers.hsv.exec(color))) {
  41209. return { h: match[1], s: match[2], v: match[3] };
  41210. }
  41211. if ((match = matchers.hsva.exec(color))) {
  41212. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  41213. }
  41214. if ((match = matchers.hex8.exec(color))) {
  41215. return {
  41216. r: parseIntFromHex(match[1]),
  41217. g: parseIntFromHex(match[2]),
  41218. b: parseIntFromHex(match[3]),
  41219. a: convertHexToDecimal(match[4]),
  41220. format: named ? "name" : "hex8"
  41221. };
  41222. }
  41223. if ((match = matchers.hex6.exec(color))) {
  41224. return {
  41225. r: parseIntFromHex(match[1]),
  41226. g: parseIntFromHex(match[2]),
  41227. b: parseIntFromHex(match[3]),
  41228. format: named ? "name" : "hex"
  41229. };
  41230. }
  41231. if ((match = matchers.hex4.exec(color))) {
  41232. return {
  41233. r: parseIntFromHex(match[1] + '' + match[1]),
  41234. g: parseIntFromHex(match[2] + '' + match[2]),
  41235. b: parseIntFromHex(match[3] + '' + match[3]),
  41236. a: convertHexToDecimal(match[4] + '' + match[4]),
  41237. format: named ? "name" : "hex8"
  41238. };
  41239. }
  41240. if ((match = matchers.hex3.exec(color))) {
  41241. return {
  41242. r: parseIntFromHex(match[1] + '' + match[1]),
  41243. g: parseIntFromHex(match[2] + '' + match[2]),
  41244. b: parseIntFromHex(match[3] + '' + match[3]),
  41245. format: named ? "name" : "hex"
  41246. };
  41247. }
  41248. return false;
  41249. }
  41250. function validateWCAG2Parms(parms) {
  41251. // return valid WCAG2 parms for isReadable.
  41252. // If input parms are invalid, return {"level":"AA", "size":"small"}
  41253. var level, size;
  41254. parms = parms || {"level":"AA", "size":"small"};
  41255. level = (parms.level || "AA").toUpperCase();
  41256. size = (parms.size || "small").toLowerCase();
  41257. if (level !== "AA" && level !== "AAA") {
  41258. level = "AA";
  41259. }
  41260. if (size !== "small" && size !== "large") {
  41261. size = "small";
  41262. }
  41263. return {"level":level, "size":size};
  41264. }
  41265. // Node: Export function
  41266. if ( true && module.exports) {
  41267. module.exports = tinycolor;
  41268. }
  41269. // AMD/requirejs: Define the module
  41270. else if (true) {
  41271. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),
  41272. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  41273. }
  41274. // Browser: Expose to window
  41275. else {}
  41276. })(Math);
  41277. /***/ }),
  41278. /***/ "aA0e":
  41279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41280. "use strict";
  41281. /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14");
  41282. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  41283. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  41284. /* harmony import */ var reakit_Toolbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("zTEx");
  41285. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Z23Y");
  41286. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_3__);
  41287. /* harmony import */ var _toolbar_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("GK4x");
  41288. /**
  41289. * External dependencies
  41290. */
  41291. /**
  41292. * WordPress dependencies
  41293. */
  41294. /**
  41295. * Internal dependencies
  41296. */
  41297. function ToolbarItem({
  41298. children,
  41299. as: Component,
  41300. ...props
  41301. }, ref) {
  41302. const accessibleToolbarState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_toolbar_context__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]);
  41303. if (typeof children !== 'function' && !Component) {
  41304. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_3___default()('`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' + 'See https://developer.wordpress.org/block-editor/components/toolbar-item/') : void 0;
  41305. return null;
  41306. }
  41307. const allProps = { ...props,
  41308. ref,
  41309. 'data-toolbar-item': true
  41310. };
  41311. if (!accessibleToolbarState) {
  41312. if (Component) {
  41313. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Component, allProps, children);
  41314. }
  41315. return children(allProps);
  41316. }
  41317. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(reakit_Toolbar__WEBPACK_IMPORTED_MODULE_2__[/* ToolbarItem */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, accessibleToolbarState, allProps, {
  41318. as: Component
  41319. }), children);
  41320. }
  41321. /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(ToolbarItem));
  41322. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  41323. /***/ }),
  41324. /***/ "aE6U":
  41325. /***/ (function(module, exports, __webpack_require__) {
  41326. "use strict";
  41327. Object.defineProperty(exports, "__esModule", {
  41328. value: true
  41329. });
  41330. var _propTypes = __webpack_require__("17x9");
  41331. var _propTypes2 = _interopRequireDefault(_propTypes);
  41332. var _constants = __webpack_require__("Fv1B");
  41333. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  41334. exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
  41335. /***/ }),
  41336. /***/ "aI7X":
  41337. /***/ (function(module, exports, __webpack_require__) {
  41338. "use strict";
  41339. /* eslint no-invalid-this: 1 */
  41340. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  41341. var slice = Array.prototype.slice;
  41342. var toStr = Object.prototype.toString;
  41343. var funcType = '[object Function]';
  41344. module.exports = function bind(that) {
  41345. var target = this;
  41346. if (typeof target !== 'function' || toStr.call(target) !== funcType) {
  41347. throw new TypeError(ERROR_MESSAGE + target);
  41348. }
  41349. var args = slice.call(arguments, 1);
  41350. var bound;
  41351. var binder = function () {
  41352. if (this instanceof bound) {
  41353. var result = target.apply(
  41354. this,
  41355. args.concat(slice.call(arguments))
  41356. );
  41357. if (Object(result) === result) {
  41358. return result;
  41359. }
  41360. return this;
  41361. } else {
  41362. return target.apply(
  41363. that,
  41364. args.concat(slice.call(arguments))
  41365. );
  41366. }
  41367. };
  41368. var boundLength = Math.max(0, target.length - args.length);
  41369. var boundArgs = [];
  41370. for (var i = 0; i < boundLength; i++) {
  41371. boundArgs.push('$' + i);
  41372. }
  41373. bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  41374. if (target.prototype) {
  41375. var Empty = function Empty() {};
  41376. Empty.prototype = target.prototype;
  41377. bound.prototype = new Empty();
  41378. Empty.prototype = null;
  41379. }
  41380. return bound;
  41381. };
  41382. /***/ }),
  41383. /***/ "aU41":
  41384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41385. "use strict";
  41386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useForkRef; });
  41387. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  41388. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  41389. // https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js
  41390. function setRef(ref, value) {
  41391. if (value === void 0) {
  41392. value = null;
  41393. }
  41394. if (!ref) return;
  41395. if (typeof ref === "function") {
  41396. ref(value);
  41397. } else {
  41398. ref.current = value;
  41399. }
  41400. }
  41401. /**
  41402. * Merges up to two React Refs into a single memoized function React Ref so you
  41403. * can pass it to an element.
  41404. *
  41405. * @example
  41406. * import React from "react";
  41407. * import { useForkRef } from "reakit-utils";
  41408. *
  41409. * const Component = React.forwardRef((props, ref) => {
  41410. * const internalRef = React.useRef();
  41411. * return <div {...props} ref={useForkRef(internalRef, ref)} />;
  41412. * });
  41413. */
  41414. function useForkRef(refA, refB) {
  41415. return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
  41416. if (refA == null && refB == null) {
  41417. return null;
  41418. }
  41419. return function (value) {
  41420. setRef(refA, value);
  41421. setRef(refB, value);
  41422. };
  41423. }, [refA, refB]);
  41424. }
  41425. /***/ }),
  41426. /***/ "aUaa":
  41427. /***/ (function(module, exports, __webpack_require__) {
  41428. "use strict";
  41429. var GetIntrinsic = __webpack_require__("v7lB");
  41430. var $TypeError = GetIntrinsic('%TypeError%');
  41431. // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
  41432. module.exports = function CheckObjectCoercible(value, optMessage) {
  41433. if (value == null) {
  41434. throw new $TypeError(optMessage || ('Cannot call method on ' + value));
  41435. }
  41436. return value;
  41437. };
  41438. /***/ }),
  41439. /***/ "aenO":
  41440. /***/ (function(module, exports, __webpack_require__) {
  41441. "use strict";
  41442. var GetIntrinsic = __webpack_require__("rZ7t");
  41443. var $TypeError = GetIntrinsic('%TypeError%');
  41444. var IsPropertyKey = __webpack_require__("i10q");
  41445. var Type = __webpack_require__("V1cy");
  41446. // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
  41447. module.exports = function HasProperty(O, P) {
  41448. if (Type(O) !== 'Object') {
  41449. throw new $TypeError('Assertion failed: `O` must be an Object');
  41450. }
  41451. if (!IsPropertyKey(P)) {
  41452. throw new $TypeError('Assertion failed: `P` must be a Property Key');
  41453. }
  41454. return P in O;
  41455. };
  41456. /***/ }),
  41457. /***/ "agUq":
  41458. /***/ (function(module, exports, __webpack_require__) {
  41459. "use strict";
  41460. // http://262.ecma-international.org/5.1/#sec-9.11
  41461. module.exports = __webpack_require__("Asd8");
  41462. /***/ }),
  41463. /***/ "ald4":
  41464. /***/ (function(module, exports, __webpack_require__) {
  41465. "use strict";
  41466. var $isNaN = Number.isNaN || function (a) { return a !== a; };
  41467. module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };
  41468. /***/ }),
  41469. /***/ "bWcr":
  41470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41471. "use strict";
  41472. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  41473. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  41474. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  41475. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  41476. /**
  41477. * WordPress dependencies
  41478. */
  41479. const closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  41480. xmlns: "http://www.w3.org/2000/svg",
  41481. viewBox: "0 0 24 24"
  41482. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  41483. d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
  41484. }));
  41485. /* harmony default export */ __webpack_exports__["a"] = (closeSmall);
  41486. /***/ }),
  41487. /***/ "c6aN":
  41488. /***/ (function(module, exports, __webpack_require__) {
  41489. var moment = __webpack_require__("wy2R");
  41490. function isValidMoment(testMoment) {
  41491. if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) {
  41492. return false;
  41493. }
  41494. /* istanbul ignore else */
  41495. if (typeof testMoment.isValid === 'function') {
  41496. // moment 1.7.0+
  41497. return testMoment.isValid();
  41498. }
  41499. /* istanbul ignore next */
  41500. return !isNaN(testMoment);
  41501. }
  41502. module.exports = {
  41503. isValidMoment : isValidMoment,
  41504. };
  41505. /***/ }),
  41506. /***/ "cD2C":
  41507. /***/ (function(module, exports, __webpack_require__) {
  41508. "use strict";
  41509. if (true) {
  41510. module.exports = __webpack_require__("5aBA");
  41511. } else {}
  41512. /***/ }),
  41513. /***/ "cDcd":
  41514. /***/ (function(module, exports) {
  41515. (function() { module.exports = window["React"]; }());
  41516. /***/ }),
  41517. /***/ "cGtP":
  41518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41519. "use strict";
  41520. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  41521. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  41522. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  41523. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  41524. /**
  41525. * WordPress dependencies
  41526. */
  41527. const search = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  41528. xmlns: "http://www.w3.org/2000/svg",
  41529. viewBox: "0 0 24 24"
  41530. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  41531. d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"
  41532. }));
  41533. /* harmony default export */ __webpack_exports__["a"] = (search);
  41534. /***/ }),
  41535. /***/ "dRQD":
  41536. /***/ (function(module, exports, __webpack_require__) {
  41537. "use strict";
  41538. Object.defineProperty(exports, "__esModule", {
  41539. value: true
  41540. });
  41541. exports['default'] = isTransitionEndSupported;
  41542. function isTransitionEndSupported() {
  41543. return !!(typeof window !== 'undefined' && 'TransitionEvent' in window);
  41544. }
  41545. /***/ }),
  41546. /***/ "dSD1":
  41547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41548. "use strict";
  41549. // EXPORTS
  41550. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; });
  41551. __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ slot_fill_Slot; });
  41552. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ Provider; });
  41553. __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createSlotFill; });
  41554. // UNUSED EXPORTS: useSlot
  41555. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  41556. var esm_extends = __webpack_require__("wx14");
  41557. // EXTERNAL MODULE: external ["wp","element"]
  41558. var external_wp_element_ = __webpack_require__("GRId");
  41559. // EXTERNAL MODULE: external "lodash"
  41560. var external_lodash_ = __webpack_require__("YLtl");
  41561. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js
  41562. /**
  41563. * WordPress dependencies
  41564. */
  41565. const SlotFillContext = Object(external_wp_element_["createContext"])({
  41566. registerSlot: () => {},
  41567. unregisterSlot: () => {},
  41568. registerFill: () => {},
  41569. unregisterFill: () => {},
  41570. getSlot: () => {},
  41571. getFills: () => {},
  41572. subscribe: () => {}
  41573. });
  41574. /* harmony default export */ var context = (SlotFillContext);
  41575. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js
  41576. /**
  41577. * WordPress dependencies
  41578. */
  41579. /**
  41580. * Internal dependencies
  41581. */
  41582. /**
  41583. * React hook returning the active slot given a name.
  41584. *
  41585. * @param {string} name Slot name.
  41586. * @return {Object} Slot object.
  41587. */
  41588. const useSlot = name => {
  41589. const {
  41590. getSlot,
  41591. subscribe
  41592. } = Object(external_wp_element_["useContext"])(context);
  41593. const [slot, setSlot] = Object(external_wp_element_["useState"])(getSlot(name));
  41594. Object(external_wp_element_["useEffect"])(() => {
  41595. setSlot(getSlot(name));
  41596. const unsubscribe = subscribe(() => {
  41597. setSlot(getSlot(name));
  41598. });
  41599. return unsubscribe;
  41600. }, [name]);
  41601. return slot;
  41602. };
  41603. /* harmony default export */ var use_slot = (useSlot);
  41604. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
  41605. /**
  41606. * External dependencies
  41607. */
  41608. /**
  41609. * WordPress dependencies
  41610. */
  41611. /**
  41612. * Internal dependencies
  41613. */
  41614. function fill_FillComponent({
  41615. name,
  41616. children,
  41617. registerFill,
  41618. unregisterFill
  41619. }) {
  41620. const slot = use_slot(name);
  41621. const ref = Object(external_wp_element_["useRef"])({
  41622. name,
  41623. children
  41624. });
  41625. Object(external_wp_element_["useLayoutEffect"])(() => {
  41626. registerFill(name, ref.current);
  41627. return () => unregisterFill(name, ref.current);
  41628. }, []);
  41629. Object(external_wp_element_["useLayoutEffect"])(() => {
  41630. ref.current.children = children;
  41631. if (slot) {
  41632. slot.forceUpdate();
  41633. }
  41634. }, [children]);
  41635. Object(external_wp_element_["useLayoutEffect"])(() => {
  41636. if (name === ref.current.name) {
  41637. // ignore initial effect
  41638. return;
  41639. }
  41640. unregisterFill(ref.current.name, ref.current);
  41641. ref.current.name = name;
  41642. registerFill(name, ref.current);
  41643. }, [name]);
  41644. if (!slot || !slot.node) {
  41645. return null;
  41646. } // If a function is passed as a child, provide it with the fillProps.
  41647. if (Object(external_lodash_["isFunction"])(children)) {
  41648. children = children(slot.props.fillProps);
  41649. }
  41650. return Object(external_wp_element_["createPortal"])(children, slot.node);
  41651. }
  41652. const Fill = props => Object(external_wp_element_["createElement"])(context.Consumer, null, ({
  41653. registerFill,
  41654. unregisterFill
  41655. }) => Object(external_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, {
  41656. registerFill: registerFill,
  41657. unregisterFill: unregisterFill
  41658. })));
  41659. /* harmony default export */ var slot_fill_fill = (Fill);
  41660. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js
  41661. /**
  41662. * External dependencies
  41663. */
  41664. /**
  41665. * WordPress dependencies
  41666. */
  41667. /**
  41668. * Internal dependencies
  41669. */
  41670. class slot_SlotComponent extends external_wp_element_["Component"] {
  41671. constructor() {
  41672. super(...arguments);
  41673. this.isUnmounted = false;
  41674. this.bindNode = this.bindNode.bind(this);
  41675. }
  41676. componentDidMount() {
  41677. const {
  41678. registerSlot
  41679. } = this.props;
  41680. registerSlot(this.props.name, this);
  41681. }
  41682. componentWillUnmount() {
  41683. const {
  41684. unregisterSlot
  41685. } = this.props;
  41686. this.isUnmounted = true;
  41687. unregisterSlot(this.props.name, this);
  41688. }
  41689. componentDidUpdate(prevProps) {
  41690. const {
  41691. name,
  41692. unregisterSlot,
  41693. registerSlot
  41694. } = this.props;
  41695. if (prevProps.name !== name) {
  41696. unregisterSlot(prevProps.name);
  41697. registerSlot(name, this);
  41698. }
  41699. }
  41700. bindNode(node) {
  41701. this.node = node;
  41702. }
  41703. forceUpdate() {
  41704. if (this.isUnmounted) {
  41705. return;
  41706. }
  41707. super.forceUpdate();
  41708. }
  41709. render() {
  41710. const {
  41711. children,
  41712. name,
  41713. fillProps = {},
  41714. getFills
  41715. } = this.props;
  41716. const fills = Object(external_lodash_["map"])(getFills(name, this), fill => {
  41717. const fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children;
  41718. return external_wp_element_["Children"].map(fillChildren, (child, childIndex) => {
  41719. if (!child || Object(external_lodash_["isString"])(child)) {
  41720. return child;
  41721. }
  41722. const childKey = child.key || childIndex;
  41723. return Object(external_wp_element_["cloneElement"])(child, {
  41724. key: childKey
  41725. });
  41726. });
  41727. }).filter( // In some cases fills are rendered only when some conditions apply.
  41728. // This ensures that we only use non-empty fills when rendering, i.e.,
  41729. // it allows us to render wrappers only when the fills are actually present.
  41730. Object(external_lodash_["negate"])(external_wp_element_["isEmptyElement"]));
  41731. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills);
  41732. }
  41733. }
  41734. const Slot = props => Object(external_wp_element_["createElement"])(context.Consumer, null, ({
  41735. registerSlot,
  41736. unregisterSlot,
  41737. getFills
  41738. }) => Object(external_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, {
  41739. registerSlot: registerSlot,
  41740. unregisterSlot: unregisterSlot,
  41741. getFills: getFills
  41742. })));
  41743. /* harmony default export */ var slot_fill_slot = (Slot);
  41744. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
  41745. var bubbles_virtually_use_slot = __webpack_require__("+WFq");
  41746. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
  41747. /**
  41748. * WordPress dependencies
  41749. */
  41750. /**
  41751. * Internal dependencies
  41752. */
  41753. function useForceUpdate() {
  41754. const [, setState] = Object(external_wp_element_["useState"])({});
  41755. const mounted = Object(external_wp_element_["useRef"])(true);
  41756. Object(external_wp_element_["useEffect"])(() => {
  41757. return () => {
  41758. mounted.current = false;
  41759. };
  41760. }, []);
  41761. return () => {
  41762. if (mounted.current) {
  41763. setState({});
  41764. }
  41765. };
  41766. }
  41767. function fill_Fill({
  41768. name,
  41769. children
  41770. }) {
  41771. const slot = Object(bubbles_virtually_use_slot["a" /* default */])(name);
  41772. const ref = Object(external_wp_element_["useRef"])({
  41773. rerender: useForceUpdate()
  41774. });
  41775. Object(external_wp_element_["useEffect"])(() => {
  41776. // We register fills so we can keep track of their existance.
  41777. // Some Slot implementations need to know if there're already fills
  41778. // registered so they can choose to render themselves or not.
  41779. slot.registerFill(ref);
  41780. return () => {
  41781. slot.unregisterFill(ref);
  41782. };
  41783. }, [slot.registerFill, slot.unregisterFill]);
  41784. if (!slot.ref || !slot.ref.current) {
  41785. return null;
  41786. }
  41787. if (typeof children === 'function') {
  41788. children = children(slot.fillProps);
  41789. }
  41790. return Object(external_wp_element_["createPortal"])(children, slot.ref.current);
  41791. }
  41792. // EXTERNAL MODULE: external ["wp","compose"]
  41793. var external_wp_compose_ = __webpack_require__("K9lf");
  41794. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
  41795. var slot_fill_context = __webpack_require__("JYkG");
  41796. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
  41797. /**
  41798. * WordPress dependencies
  41799. */
  41800. /**
  41801. * Internal dependencies
  41802. */
  41803. function slot_Slot({
  41804. name,
  41805. fillProps = {},
  41806. as: Component = 'div',
  41807. ...props
  41808. }, forwardedRef) {
  41809. const registry = Object(external_wp_element_["useContext"])(slot_fill_context["a" /* default */]);
  41810. const ref = Object(external_wp_element_["useRef"])();
  41811. Object(external_wp_element_["useLayoutEffect"])(() => {
  41812. registry.registerSlot(name, ref, fillProps);
  41813. return () => {
  41814. registry.unregisterSlot(name, ref);
  41815. }; // We are not including fillProps in the deps because we don't want to
  41816. // unregister and register the slot whenever fillProps change, which would
  41817. // cause the fill to be re-mounted. We are only considering the initial value
  41818. // of fillProps.
  41819. }, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we
  41820. // useLayoutEffect
  41821. Object(external_wp_element_["useLayoutEffect"])(() => {
  41822. registry.updateSlot(name, fillProps);
  41823. });
  41824. return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
  41825. ref: Object(external_wp_compose_["useMergeRefs"])([forwardedRef, ref])
  41826. }, props));
  41827. }
  41828. /* harmony default export */ var bubbles_virtually_slot = (Object(external_wp_element_["forwardRef"])(slot_Slot));
  41829. // EXTERNAL MODULE: external ["wp","isShallowEqual"]
  41830. var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
  41831. var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
  41832. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
  41833. /**
  41834. * WordPress dependencies
  41835. */
  41836. /**
  41837. * Internal dependencies
  41838. */
  41839. function useSlotRegistry() {
  41840. const [slots, setSlots] = Object(external_wp_element_["useState"])({});
  41841. const [fills, setFills] = Object(external_wp_element_["useState"])({});
  41842. const registerSlot = Object(external_wp_element_["useCallback"])((name, ref, fillProps) => {
  41843. setSlots(prevSlots => {
  41844. const slot = prevSlots[name] || {};
  41845. return { ...prevSlots,
  41846. [name]: { ...slot,
  41847. ref: ref || slot.ref,
  41848. fillProps: fillProps || slot.fillProps || {}
  41849. }
  41850. };
  41851. });
  41852. }, []);
  41853. const unregisterSlot = Object(external_wp_element_["useCallback"])((name, ref) => {
  41854. setSlots(prevSlots => {
  41855. const {
  41856. [name]: slot,
  41857. ...nextSlots
  41858. } = prevSlots; // Make sure we're not unregistering a slot registered by another element
  41859. // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
  41860. if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) {
  41861. return nextSlots;
  41862. }
  41863. return prevSlots;
  41864. });
  41865. }, []);
  41866. const updateSlot = Object(external_wp_element_["useCallback"])((name, fillProps) => {
  41867. const slot = slots[name];
  41868. if (!slot) {
  41869. return;
  41870. }
  41871. if (!external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) {
  41872. slot.fillProps = fillProps;
  41873. const slotFills = fills[name];
  41874. if (slotFills) {
  41875. // Force update fills
  41876. slotFills.map(fill => fill.current.rerender());
  41877. }
  41878. }
  41879. }, [slots, fills]);
  41880. const registerFill = Object(external_wp_element_["useCallback"])((name, ref) => {
  41881. setFills(prevFills => ({ ...prevFills,
  41882. [name]: [...(prevFills[name] || []), ref]
  41883. }));
  41884. }, []);
  41885. const unregisterFill = Object(external_wp_element_["useCallback"])((name, ref) => {
  41886. setFills(prevFills => {
  41887. if (prevFills[name]) {
  41888. return { ...prevFills,
  41889. [name]: prevFills[name].filter(fillRef => fillRef !== ref)
  41890. };
  41891. }
  41892. return prevFills;
  41893. });
  41894. }, []); // Memoizing the return value so it can be directly passed to Provider value
  41895. const registry = Object(external_wp_element_["useMemo"])(() => ({
  41896. slots,
  41897. fills,
  41898. registerSlot,
  41899. updateSlot,
  41900. unregisterSlot,
  41901. registerFill,
  41902. unregisterFill
  41903. }), [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]);
  41904. return registry;
  41905. }
  41906. function slot_fill_provider_SlotFillProvider({
  41907. children
  41908. }) {
  41909. const registry = useSlotRegistry();
  41910. return Object(external_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, {
  41911. value: registry
  41912. }, children);
  41913. }
  41914. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js
  41915. /**
  41916. * External dependencies
  41917. */
  41918. /**
  41919. * WordPress dependencies
  41920. */
  41921. /**
  41922. * Internal dependencies
  41923. */
  41924. class provider_SlotFillProvider extends external_wp_element_["Component"] {
  41925. constructor() {
  41926. super(...arguments);
  41927. this.registerSlot = this.registerSlot.bind(this);
  41928. this.registerFill = this.registerFill.bind(this);
  41929. this.unregisterSlot = this.unregisterSlot.bind(this);
  41930. this.unregisterFill = this.unregisterFill.bind(this);
  41931. this.getSlot = this.getSlot.bind(this);
  41932. this.getFills = this.getFills.bind(this);
  41933. this.hasFills = this.hasFills.bind(this);
  41934. this.subscribe = this.subscribe.bind(this);
  41935. this.slots = {};
  41936. this.fills = {};
  41937. this.listeners = [];
  41938. this.contextValue = {
  41939. registerSlot: this.registerSlot,
  41940. unregisterSlot: this.unregisterSlot,
  41941. registerFill: this.registerFill,
  41942. unregisterFill: this.unregisterFill,
  41943. getSlot: this.getSlot,
  41944. getFills: this.getFills,
  41945. hasFills: this.hasFills,
  41946. subscribe: this.subscribe
  41947. };
  41948. }
  41949. registerSlot(name, slot) {
  41950. const previousSlot = this.slots[name];
  41951. this.slots[name] = slot;
  41952. this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot
  41953. // But before the registerSlot call, we need to rerender the slot
  41954. this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the
  41955. // same name exists, force its update _after_ the new slot has been
  41956. // assigned into the instance, such that its own rendering of children
  41957. // will be empty (the new Slot will subsume all fills for this name).
  41958. if (previousSlot) {
  41959. previousSlot.forceUpdate();
  41960. }
  41961. }
  41962. registerFill(name, instance) {
  41963. this.fills[name] = [...(this.fills[name] || []), instance];
  41964. this.forceUpdateSlot(name);
  41965. }
  41966. unregisterSlot(name, instance) {
  41967. // If a previous instance of a Slot by this name unmounts, do nothing,
  41968. // as the slot and its fills should only be removed for the current
  41969. // known instance.
  41970. if (this.slots[name] !== instance) {
  41971. return;
  41972. }
  41973. delete this.slots[name];
  41974. this.triggerListeners();
  41975. }
  41976. unregisterFill(name, instance) {
  41977. this.fills[name] = Object(external_lodash_["without"])(this.fills[name], instance);
  41978. this.forceUpdateSlot(name);
  41979. }
  41980. getSlot(name) {
  41981. return this.slots[name];
  41982. }
  41983. getFills(name, slotInstance) {
  41984. // Fills should only be returned for the current instance of the slot
  41985. // in which they occupy.
  41986. if (this.slots[name] !== slotInstance) {
  41987. return [];
  41988. }
  41989. return this.fills[name];
  41990. }
  41991. hasFills(name) {
  41992. return this.fills[name] && !!this.fills[name].length;
  41993. }
  41994. forceUpdateSlot(name) {
  41995. const slot = this.getSlot(name);
  41996. if (slot) {
  41997. slot.forceUpdate();
  41998. }
  41999. }
  42000. triggerListeners() {
  42001. this.listeners.forEach(listener => listener());
  42002. }
  42003. subscribe(listener) {
  42004. this.listeners.push(listener);
  42005. return () => {
  42006. this.listeners = Object(external_lodash_["without"])(this.listeners, listener);
  42007. };
  42008. }
  42009. render() {
  42010. return Object(external_wp_element_["createElement"])(context.Provider, {
  42011. value: this.contextValue
  42012. }, this.props.children);
  42013. }
  42014. }
  42015. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js
  42016. /**
  42017. * WordPress dependencies
  42018. */
  42019. /**
  42020. * Internal dependencies
  42021. */
  42022. function slot_fill_Fill(props) {
  42023. // We're adding both Fills here so they can register themselves before
  42024. // their respective slot has been registered. Only the Fill that has a slot
  42025. // will render. The other one will return null.
  42026. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(slot_fill_fill, props), Object(external_wp_element_["createElement"])(fill_Fill, props));
  42027. }
  42028. const slot_fill_Slot = Object(external_wp_element_["forwardRef"])(({
  42029. bubblesVirtually,
  42030. ...props
  42031. }, ref) => {
  42032. if (bubblesVirtually) {
  42033. return Object(external_wp_element_["createElement"])(bubbles_virtually_slot, Object(esm_extends["a" /* default */])({}, props, {
  42034. ref: ref
  42035. }));
  42036. }
  42037. return Object(external_wp_element_["createElement"])(slot_fill_slot, props);
  42038. });
  42039. function Provider({
  42040. children,
  42041. ...props
  42042. }) {
  42043. return Object(external_wp_element_["createElement"])(provider_SlotFillProvider, props, Object(external_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, children));
  42044. }
  42045. function createSlotFill(name) {
  42046. const FillComponent = props => Object(external_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({
  42047. name: name
  42048. }, props));
  42049. FillComponent.displayName = name + 'Fill';
  42050. const SlotComponent = props => Object(external_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({
  42051. name: name
  42052. }, props));
  42053. SlotComponent.displayName = name + 'Slot';
  42054. SlotComponent.__unstableName = name;
  42055. return {
  42056. Fill: FillComponent,
  42057. Slot: SlotComponent
  42058. };
  42059. }
  42060. /***/ }),
  42061. /***/ "ddK1":
  42062. /***/ (function(module, exports, __webpack_require__) {
  42063. "use strict";
  42064. var ES5ToInteger = __webpack_require__("Wfh+");
  42065. var ToNumber = __webpack_require__("xCFm");
  42066. // https://262.ecma-international.org/11.0/#sec-tointeger
  42067. module.exports = function ToInteger(value) {
  42068. var number = ToNumber(value);
  42069. if (number !== 0) {
  42070. number = ES5ToInteger(number);
  42071. }
  42072. return number === 0 ? 0 : number;
  42073. };
  42074. /***/ }),
  42075. /***/ "eBsn":
  42076. /***/ (function(module, exports, __webpack_require__) {
  42077. "use strict";
  42078. var has = __webpack_require__("oNNP");
  42079. var GetIntrinsic = __webpack_require__("rZ7t");
  42080. var $TypeError = GetIntrinsic('%TypeError%');
  42081. var Type = __webpack_require__("V1cy");
  42082. var ToBoolean = __webpack_require__("kvlw");
  42083. var IsCallable = __webpack_require__("agUq");
  42084. // https://262.ecma-international.org/5.1/#sec-8.10.5
  42085. module.exports = function ToPropertyDescriptor(Obj) {
  42086. if (Type(Obj) !== 'Object') {
  42087. throw new $TypeError('ToPropertyDescriptor requires an object');
  42088. }
  42089. var desc = {};
  42090. if (has(Obj, 'enumerable')) {
  42091. desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
  42092. }
  42093. if (has(Obj, 'configurable')) {
  42094. desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
  42095. }
  42096. if (has(Obj, 'value')) {
  42097. desc['[[Value]]'] = Obj.value;
  42098. }
  42099. if (has(Obj, 'writable')) {
  42100. desc['[[Writable]]'] = ToBoolean(Obj.writable);
  42101. }
  42102. if (has(Obj, 'get')) {
  42103. var getter = Obj.get;
  42104. if (typeof getter !== 'undefined' && !IsCallable(getter)) {
  42105. throw new $TypeError('getter must be a function');
  42106. }
  42107. desc['[[Get]]'] = getter;
  42108. }
  42109. if (has(Obj, 'set')) {
  42110. var setter = Obj.set;
  42111. if (typeof setter !== 'undefined' && !IsCallable(setter)) {
  42112. throw new $TypeError('setter must be a function');
  42113. }
  42114. desc['[[Set]]'] = setter;
  42115. }
  42116. if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
  42117. throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
  42118. }
  42119. return desc;
  42120. };
  42121. /***/ }),
  42122. /***/ "eJkf":
  42123. /***/ (function(module, exports, __webpack_require__) {
  42124. "use strict";
  42125. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  42126. module.exports = function hasSymbols() {
  42127. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  42128. if (typeof Symbol.iterator === 'symbol') { return true; }
  42129. var obj = {};
  42130. var sym = Symbol('test');
  42131. var symObj = Object(sym);
  42132. if (typeof sym === 'string') { return false; }
  42133. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  42134. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  42135. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  42136. // if (sym instanceof Symbol) { return false; }
  42137. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  42138. // if (!(symObj instanceof Symbol)) { return false; }
  42139. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  42140. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  42141. var symVal = 42;
  42142. obj[sym] = symVal;
  42143. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
  42144. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  42145. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  42146. var syms = Object.getOwnPropertySymbols(obj);
  42147. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  42148. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  42149. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  42150. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  42151. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  42152. }
  42153. return true;
  42154. };
  42155. /***/ }),
  42156. /***/ "eNtd":
  42157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42158. "use strict";
  42159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useLiveRef; });
  42160. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  42161. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42162. /* harmony import */ var _useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("AXvK");
  42163. /**
  42164. * A `React.Ref` that keeps track of the passed `value`.
  42165. */
  42166. function useLiveRef(value) {
  42167. var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
  42168. Object(_useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__[/* useIsomorphicEffect */ "a"])(function () {
  42169. ref.current = value;
  42170. });
  42171. return ref;
  42172. }
  42173. /***/ }),
  42174. /***/ "eOFJ":
  42175. /***/ (function(module, exports, __webpack_require__) {
  42176. "use strict";
  42177. var GetIntrinsic = __webpack_require__("rZ7t");
  42178. var $TypeError = GetIntrinsic('%TypeError%');
  42179. var isPropertyDescriptor = __webpack_require__("Qmvf");
  42180. var DefineOwnProperty = __webpack_require__("wTIp");
  42181. var FromPropertyDescriptor = __webpack_require__("zYbv");
  42182. var IsAccessorDescriptor = __webpack_require__("z3X9");
  42183. var IsDataDescriptor = __webpack_require__("CGNl");
  42184. var IsPropertyKey = __webpack_require__("i10q");
  42185. var SameValue = __webpack_require__("HI8u");
  42186. var ToPropertyDescriptor = __webpack_require__("eBsn");
  42187. var Type = __webpack_require__("V1cy");
  42188. // https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
  42189. module.exports = function DefinePropertyOrThrow(O, P, desc) {
  42190. if (Type(O) !== 'Object') {
  42191. throw new $TypeError('Assertion failed: Type(O) is not Object');
  42192. }
  42193. if (!IsPropertyKey(P)) {
  42194. throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
  42195. }
  42196. var Desc = isPropertyDescriptor({
  42197. Type: Type,
  42198. IsDataDescriptor: IsDataDescriptor,
  42199. IsAccessorDescriptor: IsAccessorDescriptor
  42200. }, desc) ? desc : ToPropertyDescriptor(desc);
  42201. if (!isPropertyDescriptor({
  42202. Type: Type,
  42203. IsDataDescriptor: IsDataDescriptor,
  42204. IsAccessorDescriptor: IsAccessorDescriptor
  42205. }, Desc)) {
  42206. throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');
  42207. }
  42208. return DefineOwnProperty(
  42209. IsDataDescriptor,
  42210. SameValue,
  42211. FromPropertyDescriptor,
  42212. O,
  42213. P,
  42214. Desc
  42215. );
  42216. };
  42217. /***/ }),
  42218. /***/ "eUCI":
  42219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42220. "use strict";
  42221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SystemContext; });
  42222. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
  42223. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42224. var SystemContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])({});
  42225. /***/ }),
  42226. /***/ "fW1L":
  42227. /***/ (function(module, exports, __webpack_require__) {
  42228. "use strict";
  42229. var GetIntrinsic = __webpack_require__("rZ7t");
  42230. var callBound = __webpack_require__("EXo9");
  42231. var $TypeError = GetIntrinsic('%TypeError%');
  42232. var IsArray = __webpack_require__("9cOx");
  42233. var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%');
  42234. // https://ecma-international.org/ecma-262/6.0/#sec-call
  42235. module.exports = function Call(F, V) {
  42236. var argumentsList = arguments.length > 2 ? arguments[2] : [];
  42237. if (!IsArray(argumentsList)) {
  42238. throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
  42239. }
  42240. return $apply(F, V, argumentsList);
  42241. };
  42242. /***/ }),
  42243. /***/ "g56x":
  42244. /***/ (function(module, exports) {
  42245. (function() { module.exports = window["wp"]["hooks"]; }());
  42246. /***/ }),
  42247. /***/ "gZI3":
  42248. /***/ (function(module, exports, __webpack_require__) {
  42249. "use strict";
  42250. Object.defineProperty(exports, "__esModule", {
  42251. value: true
  42252. });
  42253. var _react = __webpack_require__("cDcd");
  42254. var _react2 = _interopRequireDefault(_react);
  42255. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  42256. var RightArrow = function () {
  42257. function RightArrow(props) {
  42258. return _react2['default'].createElement(
  42259. 'svg',
  42260. props,
  42261. _react2['default'].createElement('path', {
  42262. d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z'
  42263. })
  42264. );
  42265. }
  42266. return RightArrow;
  42267. }();
  42268. RightArrow.defaultProps = {
  42269. viewBox: '0 0 1000 1000'
  42270. };
  42271. exports['default'] = RightArrow;
  42272. /***/ }),
  42273. /***/ "gdqT":
  42274. /***/ (function(module, exports) {
  42275. (function() { module.exports = window["wp"]["a11y"]; }());
  42276. /***/ }),
  42277. /***/ "h6xH":
  42278. /***/ (function(module, exports, __webpack_require__) {
  42279. "use strict";
  42280. Object.defineProperty(exports, "__esModule", {
  42281. value: true
  42282. });
  42283. exports['default'] = isBeforeDay;
  42284. var _moment = __webpack_require__("wy2R");
  42285. var _moment2 = _interopRequireDefault(_moment);
  42286. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  42287. function isBeforeDay(a, b) {
  42288. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  42289. var aYear = a.year();
  42290. var aMonth = a.month();
  42291. var bYear = b.year();
  42292. var bMonth = b.month();
  42293. var isSameYear = aYear === bYear;
  42294. var isSameMonth = aMonth === bMonth;
  42295. if (isSameYear && isSameMonth) return a.date() < b.date();
  42296. if (isSameYear) return aMonth < bMonth;
  42297. return aYear < bYear;
  42298. }
  42299. /***/ }),
  42300. /***/ "hE48":
  42301. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42302. "use strict";
  42303. // EXPORTS
  42304. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createComponent; });
  42305. // EXTERNAL MODULE: external "React"
  42306. var external_React_ = __webpack_require__("cDcd");
  42307. // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js
  42308. var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__("RDTF");
  42309. // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js
  42310. var useCreateElement = __webpack_require__("IVEb");
  42311. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js
  42312. var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("I/A+");
  42313. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js
  42314. var isObject = __webpack_require__("Ptb8");
  42315. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js
  42316. /**
  42317. * Checks whether `arg` is a plain object or not.
  42318. *
  42319. * @returns {boolean}
  42320. */
  42321. function isPlainObject(arg) {
  42322. var _proto$constructor;
  42323. if (!Object(isObject["a" /* isObject */])(arg)) return false;
  42324. var proto = Object.getPrototypeOf(arg);
  42325. if (proto == null) return true;
  42326. return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString();
  42327. }
  42328. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js
  42329. /**
  42330. * Splits an object (`props`) into a tuple where the first item is an object
  42331. * with the passed `keys`, and the second item is an object with these keys
  42332. * omitted.
  42333. *
  42334. * @deprecated will be removed in version 2
  42335. *
  42336. * @example
  42337. * import { splitProps } from "reakit-utils";
  42338. *
  42339. * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }]
  42340. */
  42341. function __deprecatedSplitProps(props, keys) {
  42342. var propsKeys = Object.keys(props);
  42343. var picked = {};
  42344. var omitted = {};
  42345. for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) {
  42346. var key = _propsKeys[_i];
  42347. if (keys.indexOf(key) >= 0) {
  42348. picked[key] = props[key];
  42349. } else {
  42350. omitted[key] = props[key];
  42351. }
  42352. }
  42353. return [picked, omitted];
  42354. }
  42355. /**
  42356. * Splits an object (`props`) into a tuple where the first item
  42357. * is the `state` property, and the second item is the rest of the properties.
  42358. *
  42359. * It is also backward compatible with version 1. If `keys` are passed then
  42360. * splits an object (`props`) into a tuple where the first item is an object
  42361. * with the passed `keys`, and the second item is an object with these keys
  42362. * omitted.
  42363. *
  42364. * @example
  42365. * import { splitProps } from "reakit-utils";
  42366. *
  42367. * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }]
  42368. *
  42369. * @example
  42370. * import { splitProps } from "reakit-utils";
  42371. *
  42372. * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }]
  42373. */
  42374. function splitProps(props, keys) {
  42375. if (keys === void 0) {
  42376. keys = [];
  42377. }
  42378. if (!isPlainObject(props.state)) {
  42379. return __deprecatedSplitProps(props, keys);
  42380. }
  42381. var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])),
  42382. picked = _deprecatedSplitProp[0],
  42383. omitted = _deprecatedSplitProp[1];
  42384. var state = picked.state,
  42385. restPicked = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(picked, ["state"]);
  42386. return [Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), restPicked), omitted];
  42387. }
  42388. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js
  42389. var shallowEqual = __webpack_require__("uqqE");
  42390. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js
  42391. /**
  42392. * This higher order functions take `propsAreEqual` function and
  42393. * returns a new function which normalizes the props.
  42394. *
  42395. * Normalizing in our case is making sure the `propsAreEqual` works with
  42396. * both version 1 (object spreading) and version 2 (state object) state passing.
  42397. *
  42398. * To achieve this, the returned function in case of a state object
  42399. * will spread the state object in both `prev` and `next props.
  42400. *
  42401. * Other case it just returns the function as is which makes sure
  42402. * that we are still backward compatible
  42403. */
  42404. function normalizePropsAreEqual(propsAreEqual) {
  42405. if (propsAreEqual.name === "normalizePropsAreEqualInner") {
  42406. return propsAreEqual;
  42407. }
  42408. return function normalizePropsAreEqualInner(prev, next) {
  42409. if (!isPlainObject(prev.state) || !isPlainObject(next.state)) {
  42410. return propsAreEqual(prev, next);
  42411. }
  42412. return propsAreEqual(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, prev.state), prev), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, next.state), next));
  42413. };
  42414. }
  42415. // CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js
  42416. function forwardRef(component) {
  42417. return /*#__PURE__*/Object(external_React_["forwardRef"])(component);
  42418. }
  42419. function memo(component, propsAreEqual) {
  42420. return /*#__PURE__*/Object(external_React_["memo"])(component, propsAreEqual);
  42421. }
  42422. /**
  42423. * Creates a React component.
  42424. *
  42425. * @example
  42426. * import { createComponent } from "reakit-system";
  42427. *
  42428. * const A = createComponent({ as: "a" });
  42429. *
  42430. * @param options
  42431. */
  42432. function createComponent(_ref) {
  42433. var type = _ref.as,
  42434. useHook = _ref.useHook,
  42435. shouldMemo = _ref.memo,
  42436. _ref$propsAreEqual = _ref.propsAreEqual,
  42437. propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual,
  42438. _ref$keys = _ref.keys,
  42439. keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys,
  42440. _ref$useCreateElement = _ref.useCreateElement,
  42441. useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement["a" /* useCreateElement */] : _ref$useCreateElement;
  42442. var Comp = function Comp(_ref2, ref) {
  42443. var _ref2$as = _ref2.as,
  42444. as = _ref2$as === void 0 ? type : _ref2$as,
  42445. props = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_ref2, ["as"]);
  42446. if (useHook) {
  42447. var _as$render;
  42448. var _splitProps = splitProps(props, keys),
  42449. _options = _splitProps[0],
  42450. htmlProps = _splitProps[1];
  42451. var _useHook = useHook(_options, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({
  42452. ref: ref
  42453. }, htmlProps)),
  42454. wrapElement = _useHook.wrapElement,
  42455. elementProps = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_useHook, ["wrapElement"]); // @ts-ignore
  42456. var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys;
  42457. var asOptions = asKeys && splitProps(props, asKeys)[0];
  42458. var allProps = asOptions ? Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, elementProps), asOptions) : elementProps;
  42459. var _element = useCreateElement$1(as, allProps);
  42460. if (wrapElement) {
  42461. return wrapElement(_element);
  42462. }
  42463. return _element;
  42464. }
  42465. return useCreateElement$1(as, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({
  42466. ref: ref
  42467. }, props));
  42468. };
  42469. if (false) {}
  42470. Comp = forwardRef(Comp);
  42471. if (shouldMemo) {
  42472. Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual));
  42473. }
  42474. Comp.__keys = keys;
  42475. Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual["a" /* shallowEqual */]);
  42476. return Comp;
  42477. }
  42478. /***/ }),
  42479. /***/ "hZ2/":
  42480. /***/ (function(module, exports, __webpack_require__) {
  42481. "use strict";
  42482. var bind = __webpack_require__("D3zA");
  42483. var GetIntrinsic = __webpack_require__("rZ7t");
  42484. var $apply = GetIntrinsic('%Function.prototype.apply%');
  42485. var $call = GetIntrinsic('%Function.prototype.call%');
  42486. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  42487. var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
  42488. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  42489. var $max = GetIntrinsic('%Math.max%');
  42490. if ($defineProperty) {
  42491. try {
  42492. $defineProperty({}, 'a', { value: 1 });
  42493. } catch (e) {
  42494. // IE 8 has a broken defineProperty
  42495. $defineProperty = null;
  42496. }
  42497. }
  42498. module.exports = function callBind(originalFunction) {
  42499. var func = $reflectApply(bind, $call, arguments);
  42500. if ($gOPD && $defineProperty) {
  42501. var desc = $gOPD(func, 'length');
  42502. if (desc.configurable) {
  42503. // original length, plus the receiver, minus any additional arguments (after the receiver)
  42504. $defineProperty(
  42505. func,
  42506. 'length',
  42507. { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
  42508. );
  42509. }
  42510. }
  42511. return func;
  42512. };
  42513. var applyBind = function applyBind() {
  42514. return $reflectApply(bind, $apply, arguments);
  42515. };
  42516. if ($defineProperty) {
  42517. $defineProperty(module.exports, 'apply', { value: applyBind });
  42518. } else {
  42519. module.exports.apply = applyBind;
  42520. }
  42521. /***/ }),
  42522. /***/ "i10q":
  42523. /***/ (function(module, exports, __webpack_require__) {
  42524. "use strict";
  42525. // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
  42526. module.exports = function IsPropertyKey(argument) {
  42527. return typeof argument === 'string' || typeof argument === 'symbol';
  42528. };
  42529. /***/ }),
  42530. /***/ "iB/h":
  42531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42532. "use strict";
  42533. /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  42534. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  42535. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl");
  42536. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  42537. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ");
  42538. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  42539. /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("gdqT");
  42540. /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__);
  42541. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj");
  42542. /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
  42543. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y");
  42544. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__);
  42545. /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("kA6J");
  42546. /**
  42547. * External dependencies
  42548. */
  42549. /**
  42550. * WordPress dependencies
  42551. */
  42552. /**
  42553. * Internal dependencies
  42554. */
  42555. const NOTICE_TIMEOUT = 10000;
  42556. /** @typedef {import('@wordpress/element').WPElement} WPElement */
  42557. /**
  42558. * Custom hook which announces the message with the given politeness, if a
  42559. * valid message is provided.
  42560. *
  42561. * @param {string|WPElement} [message] Message to announce.
  42562. * @param {'polite'|'assertive'} politeness Politeness to announce.
  42563. */
  42564. function useSpokenMessage(message, politeness) {
  42565. const spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
  42566. Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
  42567. if (spokenMessage) {
  42568. Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(spokenMessage, politeness);
  42569. }
  42570. }, [spokenMessage, politeness]);
  42571. }
  42572. function Snackbar({
  42573. className,
  42574. children,
  42575. spokenMessage = children,
  42576. politeness = 'polite',
  42577. actions = [],
  42578. onRemove = lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
  42579. icon = null,
  42580. explicitDismiss = false,
  42581. // onDismiss is a callback executed when the snackbar is dismissed.
  42582. // It is distinct from onRemove, which _looks_ like a callback but is
  42583. // actually the function to call to remove the snackbar from the UI.
  42584. onDismiss = lodash__WEBPACK_IMPORTED_MODULE_1__["noop"]
  42585. }, ref) {
  42586. onDismiss = onDismiss || lodash__WEBPACK_IMPORTED_MODULE_1__["noop"];
  42587. function dismissMe(event) {
  42588. if (event && event.preventDefault) {
  42589. event.preventDefault();
  42590. }
  42591. onDismiss();
  42592. onRemove();
  42593. }
  42594. function onActionClick(event, onClick) {
  42595. event.stopPropagation();
  42596. onRemove();
  42597. if (onClick) {
  42598. onClick(event);
  42599. }
  42600. }
  42601. useSpokenMessage(spokenMessage, politeness); // Only set up the timeout dismiss if we're not explicitly dismissing.
  42602. Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
  42603. const timeoutHandle = setTimeout(() => {
  42604. if (!explicitDismiss) {
  42605. onDismiss();
  42606. onRemove();
  42607. }
  42608. }, NOTICE_TIMEOUT);
  42609. return () => clearTimeout(timeoutHandle);
  42610. }, [onDismiss, onRemove]);
  42611. const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar', {
  42612. 'components-snackbar-explicit-dismiss': !!explicitDismiss
  42613. });
  42614. if (actions && actions.length > 1) {
  42615. // we need to inform developers that snackbar only accepts 1 action
  42616. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
  42617. actions = [actions[0]];
  42618. }
  42619. const snackbarContentClassnames = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-snackbar__content', {
  42620. 'components-snackbar__content-with-icon': !!icon
  42621. });
  42622. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
  42623. ref: ref,
  42624. className: classes,
  42625. onClick: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
  42626. tabIndex: "0",
  42627. role: !explicitDismiss ? 'button' : '',
  42628. onKeyPress: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
  42629. "aria-label": !explicitDismiss ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') : ''
  42630. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
  42631. className: snackbarContentClassnames
  42632. }, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
  42633. className: "components-snackbar__icon"
  42634. }, icon), children, actions.map(({
  42635. label,
  42636. onClick,
  42637. url
  42638. }, index) => {
  42639. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
  42640. key: index,
  42641. href: url,
  42642. isTertiary: true,
  42643. onClick: event => onActionClick(event, onClick),
  42644. className: "components-snackbar__action"
  42645. }, label);
  42646. }), explicitDismiss && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
  42647. role: "button",
  42648. "aria-label": "Dismiss this notice",
  42649. tabIndex: "0",
  42650. className: "components-snackbar__dismiss-button",
  42651. onClick: dismissMe,
  42652. onKeyPress: dismissMe
  42653. }, "\u2715")));
  42654. }
  42655. /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
  42656. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  42657. /***/ }),
  42658. /***/ "iClF":
  42659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42660. "use strict";
  42661. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  42662. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  42663. /**
  42664. * WordPress dependencies
  42665. */
  42666. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  42667. /**
  42668. * Return an SVG icon.
  42669. *
  42670. * @param {IconProps} props icon is the SVG component to render
  42671. * size is a number specifiying the icon size in pixels
  42672. * Other props will be passed to wrapped SVG component
  42673. *
  42674. * @return {JSX.Element} Icon component
  42675. */
  42676. function Icon({
  42677. icon,
  42678. size = 24,
  42679. ...props
  42680. }) {
  42681. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
  42682. width: size,
  42683. height: size,
  42684. ...props
  42685. });
  42686. }
  42687. /* harmony default export */ __webpack_exports__["a"] = (Icon);
  42688. /***/ }),
  42689. /***/ "iNdV":
  42690. /***/ (function(module, exports) {
  42691. var messages = {
  42692. invalidPredicate: '`predicate` must be a function',
  42693. invalidPropValidator: '`propValidator` must be a function',
  42694. requiredCore: 'is marked as required',
  42695. invalidTypeCore: 'Invalid input type',
  42696. predicateFailureCore: 'Failed to succeed with predicate',
  42697. anonymousMessage: '<<anonymous>>',
  42698. baseInvalidMessage: 'Invalid ',
  42699. };
  42700. function constructPropValidatorVariations(propValidator) {
  42701. if (typeof propValidator !== 'function') {
  42702. throw new Error(messages.invalidPropValidator);
  42703. }
  42704. var requiredPropValidator = propValidator.bind(null, false, null);
  42705. requiredPropValidator.isRequired = propValidator.bind(null, true, null);
  42706. requiredPropValidator.withPredicate = function predicateApplication(predicate) {
  42707. if (typeof predicate !== 'function') {
  42708. throw new Error(messages.invalidPredicate);
  42709. }
  42710. var basePropValidator = propValidator.bind(null, false, predicate);
  42711. basePropValidator.isRequired = propValidator.bind(null, true, predicate);
  42712. return basePropValidator;
  42713. };
  42714. return requiredPropValidator;
  42715. }
  42716. function createInvalidRequiredErrorMessage(propName, componentName, value) {
  42717. return new Error(
  42718. 'The prop `' + propName + '` ' + messages.requiredCore +
  42719. ' in `' + componentName + '`, but its value is `' + value + '`.'
  42720. );
  42721. }
  42722. var independentGuardianValue = -1;
  42723. function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
  42724. var isPropValueUndefined = typeof propValue === 'undefined';
  42725. var isPropValueNull = propValue === null;
  42726. if (isRequired) {
  42727. if (isPropValueUndefined) {
  42728. return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
  42729. } else if (isPropValueNull) {
  42730. return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
  42731. }
  42732. }
  42733. if (isPropValueUndefined || isPropValueNull) {
  42734. return null;
  42735. }
  42736. return independentGuardianValue;
  42737. }
  42738. function createMomentChecker(type, typeValidator, validator, momentType) {
  42739. function propValidator(
  42740. isRequired, // Bound parameter to indicate with the propType is required
  42741. predicate, // Bound parameter to allow user to add dynamic validation
  42742. props,
  42743. propName,
  42744. componentName,
  42745. location,
  42746. propFullName
  42747. ) {
  42748. var propValue = props[ propName ];
  42749. var propType = typeof propValue;
  42750. componentName = componentName || messages.anonymousMessage;
  42751. propFullName = propFullName || propName;
  42752. var preValidationRequireCheckValue = preValidationRequireCheck(
  42753. isRequired, componentName, propFullName, propValue
  42754. );
  42755. if (preValidationRequireCheckValue !== independentGuardianValue) {
  42756. return preValidationRequireCheckValue;
  42757. }
  42758. if (typeValidator && !typeValidator(propValue)) {
  42759. return new Error(
  42760. messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' +
  42761. 'supplied to `' + componentName + '`, expected `' + type + '`.'
  42762. );
  42763. }
  42764. if (!validator(propValue)) {
  42765. return new Error(
  42766. messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
  42767. 'supplied to `' + componentName + '`, expected `' + momentType + '`.'
  42768. );
  42769. }
  42770. if (predicate && !predicate(propValue)) {
  42771. var predicateName = predicate.name || messages.anonymousMessage;
  42772. return new Error(
  42773. messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
  42774. 'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' +
  42775. predicateName + '`.'
  42776. );
  42777. }
  42778. return null;
  42779. }
  42780. return constructPropValidatorVariations(propValidator);
  42781. }
  42782. module.exports = {
  42783. constructPropValidatorVariations: constructPropValidatorVariations,
  42784. createMomentChecker: createMomentChecker,
  42785. messages: messages,
  42786. };
  42787. /***/ }),
  42788. /***/ "iYXd":
  42789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42790. "use strict";
  42791. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; });
  42792. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrentId; });
  42793. function findFirstEnabledItem(items, excludeId) {
  42794. if (excludeId) {
  42795. return items.find(function (item) {
  42796. return !item.disabled && item.id !== excludeId;
  42797. });
  42798. }
  42799. return items.find(function (item) {
  42800. return !item.disabled;
  42801. });
  42802. }
  42803. function getCurrentId(options, passedId) {
  42804. var _findFirstEnabledItem;
  42805. if (passedId || passedId === null) {
  42806. return passedId;
  42807. }
  42808. if (options.currentId || options.currentId === null) {
  42809. return options.currentId;
  42810. }
  42811. return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id;
  42812. }
  42813. /***/ }),
  42814. /***/ "ib7Q":
  42815. /***/ (function(module, exports, __webpack_require__) {
  42816. "use strict";
  42817. var getPolyfill = __webpack_require__("xoj2");
  42818. var define = __webpack_require__("82c2");
  42819. module.exports = function shimValues() {
  42820. var polyfill = getPolyfill();
  42821. define(Object, { values: polyfill }, {
  42822. values: function testValues() {
  42823. return Object.values !== polyfill;
  42824. }
  42825. });
  42826. return polyfill;
  42827. };
  42828. /***/ }),
  42829. /***/ "ixyq":
  42830. /***/ (function(module, exports, __webpack_require__) {
  42831. "use strict";
  42832. Object.defineProperty(exports, "__esModule", {
  42833. value: true
  42834. });
  42835. exports['default'] = calculateDimension;
  42836. function calculateDimension(el, axis) {
  42837. var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  42838. var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  42839. if (!el) {
  42840. return 0;
  42841. }
  42842. var axisStart = axis === 'width' ? 'Left' : 'Top';
  42843. var axisEnd = axis === 'width' ? 'Right' : 'Bottom';
  42844. // Only read styles if we need to
  42845. var style = !borderBox || withMargin ? window.getComputedStyle(el) : null;
  42846. // Offset includes border and padding
  42847. var offsetWidth = el.offsetWidth,
  42848. offsetHeight = el.offsetHeight;
  42849. var size = axis === 'width' ? offsetWidth : offsetHeight;
  42850. // Get the inner size
  42851. if (!borderBox) {
  42852. size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']);
  42853. }
  42854. // Apply margin
  42855. if (withMargin) {
  42856. size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]);
  42857. }
  42858. return size;
  42859. }
  42860. /***/ }),
  42861. /***/ "iz0l":
  42862. /***/ (function(module, exports, __webpack_require__) {
  42863. "use strict";
  42864. var GetIntrinsic = __webpack_require__("rZ7t");
  42865. var $TypeError = GetIntrinsic('%TypeError%');
  42866. var MAX_SAFE_INTEGER = __webpack_require__("yyeE");
  42867. var Call = __webpack_require__("fW1L");
  42868. var CreateDataPropertyOrThrow = __webpack_require__("WvKp");
  42869. var Get = __webpack_require__("3aeR");
  42870. var HasProperty = __webpack_require__("aenO");
  42871. var IsArray = __webpack_require__("9cOx");
  42872. var LengthOfArrayLike = __webpack_require__("y9oe");
  42873. var ToString = __webpack_require__("Hx/O");
  42874. // https://262.ecma-international.org/11.0/#sec-flattenintoarray
  42875. // eslint-disable-next-line max-params
  42876. module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) {
  42877. var mapperFunction;
  42878. if (arguments.length > 5) {
  42879. mapperFunction = arguments[5];
  42880. }
  42881. var targetIndex = start;
  42882. var sourceIndex = 0;
  42883. while (sourceIndex < sourceLen) {
  42884. var P = ToString(sourceIndex);
  42885. var exists = HasProperty(source, P);
  42886. if (exists === true) {
  42887. var element = Get(source, P);
  42888. if (typeof mapperFunction !== 'undefined') {
  42889. if (arguments.length <= 6) {
  42890. throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
  42891. }
  42892. element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
  42893. }
  42894. var shouldFlatten = false;
  42895. if (depth > 0) {
  42896. shouldFlatten = IsArray(element);
  42897. }
  42898. if (shouldFlatten) {
  42899. var elementLen = LengthOfArrayLike(element);
  42900. targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
  42901. } else {
  42902. if (targetIndex >= MAX_SAFE_INTEGER) {
  42903. throw new $TypeError('index too large');
  42904. }
  42905. CreateDataPropertyOrThrow(target, ToString(targetIndex), element);
  42906. targetIndex += 1;
  42907. }
  42908. }
  42909. sourceIndex += 1;
  42910. }
  42911. return targetIndex;
  42912. };
  42913. /***/ }),
  42914. /***/ "jB5C":
  42915. /***/ (function(module, exports, __webpack_require__) {
  42916. "use strict";
  42917. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  42918. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  42919. var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
  42920. function getClientPosition(elem) {
  42921. var box = undefined;
  42922. var x = undefined;
  42923. var y = undefined;
  42924. var doc = elem.ownerDocument;
  42925. var body = doc.body;
  42926. var docElem = doc && doc.documentElement;
  42927. // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
  42928. box = elem.getBoundingClientRect();
  42929. // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
  42930. // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
  42931. // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
  42932. x = box.left;
  42933. y = box.top;
  42934. // In IE, most of the time, 2 extra pixels are added to the top and left
  42935. // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
  42936. // IE6 standards mode, this border can be overridden by setting the
  42937. // document element's border to zero -- thus, we cannot rely on the
  42938. // offset always being 2 pixels.
  42939. // In quirks mode, the offset can be determined by querying the body's
  42940. // clientLeft/clientTop, but in standards mode, it is found by querying
  42941. // the document element's clientLeft/clientTop. Since we already called
  42942. // getClientBoundingRect we have already forced a reflow, so it is not
  42943. // too expensive just to query them all.
  42944. // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
  42945. // 窗口边框标准是设 documentElement ,quirks 时设置 body
  42946. // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
  42947. // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
  42948. // 标准 ie 下 docElem.clientTop 就是 border-top
  42949. // ie7 html 即窗口边框改变不了。永远为 2
  42950. // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
  42951. x -= docElem.clientLeft || body.clientLeft || 0;
  42952. y -= docElem.clientTop || body.clientTop || 0;
  42953. return {
  42954. left: x,
  42955. top: y
  42956. };
  42957. }
  42958. function getScroll(w, top) {
  42959. var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
  42960. var method = 'scroll' + (top ? 'Top' : 'Left');
  42961. if (typeof ret !== 'number') {
  42962. var d = w.document;
  42963. // ie6,7,8 standard mode
  42964. ret = d.documentElement[method];
  42965. if (typeof ret !== 'number') {
  42966. // quirks mode
  42967. ret = d.body[method];
  42968. }
  42969. }
  42970. return ret;
  42971. }
  42972. function getScrollLeft(w) {
  42973. return getScroll(w);
  42974. }
  42975. function getScrollTop(w) {
  42976. return getScroll(w, true);
  42977. }
  42978. function getOffset(el) {
  42979. var pos = getClientPosition(el);
  42980. var doc = el.ownerDocument;
  42981. var w = doc.defaultView || doc.parentWindow;
  42982. pos.left += getScrollLeft(w);
  42983. pos.top += getScrollTop(w);
  42984. return pos;
  42985. }
  42986. function _getComputedStyle(elem, name, computedStyle_) {
  42987. var val = '';
  42988. var d = elem.ownerDocument;
  42989. var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
  42990. // https://github.com/kissyteam/kissy/issues/61
  42991. if (computedStyle) {
  42992. val = computedStyle.getPropertyValue(name) || computedStyle[name];
  42993. }
  42994. return val;
  42995. }
  42996. var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
  42997. var RE_POS = /^(top|right|bottom|left)$/;
  42998. var CURRENT_STYLE = 'currentStyle';
  42999. var RUNTIME_STYLE = 'runtimeStyle';
  43000. var LEFT = 'left';
  43001. var PX = 'px';
  43002. function _getComputedStyleIE(elem, name) {
  43003. // currentStyle maybe null
  43004. // http://msdn.microsoft.com/en-us/library/ms535231.aspx
  43005. var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
  43006. // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
  43007. // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
  43008. // 在 ie 下不对,需要直接用 offset 方式
  43009. // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
  43010. // From the awesome hack by Dean Edwards
  43011. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  43012. // If we're not dealing with a regular pixel number
  43013. // but a number that has a weird ending, we need to convert it to pixels
  43014. // exclude left right for relativity
  43015. if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
  43016. // Remember the original values
  43017. var style = elem.style;
  43018. var left = style[LEFT];
  43019. var rsLeft = elem[RUNTIME_STYLE][LEFT];
  43020. // prevent flashing of content
  43021. elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
  43022. // Put in the new values to get a computed value out
  43023. style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
  43024. ret = style.pixelLeft + PX;
  43025. // Revert the changed values
  43026. style[LEFT] = left;
  43027. elem[RUNTIME_STYLE][LEFT] = rsLeft;
  43028. }
  43029. return ret === '' ? 'auto' : ret;
  43030. }
  43031. var getComputedStyleX = undefined;
  43032. if (typeof window !== 'undefined') {
  43033. getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
  43034. }
  43035. function each(arr, fn) {
  43036. for (var i = 0; i < arr.length; i++) {
  43037. fn(arr[i]);
  43038. }
  43039. }
  43040. function isBorderBoxFn(elem) {
  43041. return getComputedStyleX(elem, 'boxSizing') === 'border-box';
  43042. }
  43043. var BOX_MODELS = ['margin', 'border', 'padding'];
  43044. var CONTENT_INDEX = -1;
  43045. var PADDING_INDEX = 2;
  43046. var BORDER_INDEX = 1;
  43047. var MARGIN_INDEX = 0;
  43048. function swap(elem, options, callback) {
  43049. var old = {};
  43050. var style = elem.style;
  43051. var name = undefined;
  43052. // Remember the old values, and insert the new ones
  43053. for (name in options) {
  43054. if (options.hasOwnProperty(name)) {
  43055. old[name] = style[name];
  43056. style[name] = options[name];
  43057. }
  43058. }
  43059. callback.call(elem);
  43060. // Revert the old values
  43061. for (name in options) {
  43062. if (options.hasOwnProperty(name)) {
  43063. style[name] = old[name];
  43064. }
  43065. }
  43066. }
  43067. function getPBMWidth(elem, props, which) {
  43068. var value = 0;
  43069. var prop = undefined;
  43070. var j = undefined;
  43071. var i = undefined;
  43072. for (j = 0; j < props.length; j++) {
  43073. prop = props[j];
  43074. if (prop) {
  43075. for (i = 0; i < which.length; i++) {
  43076. var cssProp = undefined;
  43077. if (prop === 'border') {
  43078. cssProp = prop + which[i] + 'Width';
  43079. } else {
  43080. cssProp = prop + which[i];
  43081. }
  43082. value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
  43083. }
  43084. }
  43085. }
  43086. return value;
  43087. }
  43088. /**
  43089. * A crude way of determining if an object is a window
  43090. * @member util
  43091. */
  43092. function isWindow(obj) {
  43093. // must use == for ie8
  43094. /* eslint eqeqeq:0 */
  43095. return obj != null && obj == obj.window;
  43096. }
  43097. var domUtils = {};
  43098. each(['Width', 'Height'], function (name) {
  43099. domUtils['doc' + name] = function (refWin) {
  43100. var d = refWin.document;
  43101. return Math.max(
  43102. // firefox chrome documentElement.scrollHeight< body.scrollHeight
  43103. // ie standard mode : documentElement.scrollHeight> body.scrollHeight
  43104. d.documentElement['scroll' + name],
  43105. // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
  43106. d.body['scroll' + name], domUtils['viewport' + name](d));
  43107. };
  43108. domUtils['viewport' + name] = function (win) {
  43109. // pc browser includes scrollbar in window.innerWidth
  43110. var prop = 'client' + name;
  43111. var doc = win.document;
  43112. var body = doc.body;
  43113. var documentElement = doc.documentElement;
  43114. var documentElementProp = documentElement[prop];
  43115. // 标准模式取 documentElement
  43116. // backcompat 取 body
  43117. return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
  43118. };
  43119. });
  43120. /*
  43121. 得到元素的大小信息
  43122. @param elem
  43123. @param name
  43124. @param {String} [extra] 'padding' : (css width) + padding
  43125. 'border' : (css width) + padding + border
  43126. 'margin' : (css width) + padding + border + margin
  43127. */
  43128. function getWH(elem, name, extra) {
  43129. if (isWindow(elem)) {
  43130. return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
  43131. } else if (elem.nodeType === 9) {
  43132. return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
  43133. }
  43134. var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
  43135. var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
  43136. var computedStyle = getComputedStyleX(elem);
  43137. var isBorderBox = isBorderBoxFn(elem, computedStyle);
  43138. var cssBoxValue = 0;
  43139. if (borderBoxValue == null || borderBoxValue <= 0) {
  43140. borderBoxValue = undefined;
  43141. // Fall back to computed then un computed css if necessary
  43142. cssBoxValue = getComputedStyleX(elem, name);
  43143. if (cssBoxValue == null || Number(cssBoxValue) < 0) {
  43144. cssBoxValue = elem.style[name] || 0;
  43145. }
  43146. // Normalize '', auto, and prepare for extra
  43147. cssBoxValue = parseFloat(cssBoxValue) || 0;
  43148. }
  43149. if (extra === undefined) {
  43150. extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
  43151. }
  43152. var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
  43153. var val = borderBoxValue || cssBoxValue;
  43154. if (extra === CONTENT_INDEX) {
  43155. if (borderBoxValueOrIsBorderBox) {
  43156. return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
  43157. }
  43158. return cssBoxValue;
  43159. }
  43160. if (borderBoxValueOrIsBorderBox) {
  43161. var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
  43162. return val + (extra === BORDER_INDEX ? 0 : padding);
  43163. }
  43164. return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
  43165. }
  43166. var cssShow = {
  43167. position: 'absolute',
  43168. visibility: 'hidden',
  43169. display: 'block'
  43170. };
  43171. // fix #119 : https://github.com/kissyteam/kissy/issues/119
  43172. function getWHIgnoreDisplay(elem) {
  43173. var val = undefined;
  43174. var args = arguments;
  43175. // in case elem is window
  43176. // elem.offsetWidth === undefined
  43177. if (elem.offsetWidth !== 0) {
  43178. val = getWH.apply(undefined, args);
  43179. } else {
  43180. swap(elem, cssShow, function () {
  43181. val = getWH.apply(undefined, args);
  43182. });
  43183. }
  43184. return val;
  43185. }
  43186. function css(el, name, v) {
  43187. var value = v;
  43188. if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
  43189. for (var i in name) {
  43190. if (name.hasOwnProperty(i)) {
  43191. css(el, i, name[i]);
  43192. }
  43193. }
  43194. return undefined;
  43195. }
  43196. if (typeof value !== 'undefined') {
  43197. if (typeof value === 'number') {
  43198. value += 'px';
  43199. }
  43200. el.style[name] = value;
  43201. return undefined;
  43202. }
  43203. return getComputedStyleX(el, name);
  43204. }
  43205. each(['width', 'height'], function (name) {
  43206. var first = name.charAt(0).toUpperCase() + name.slice(1);
  43207. domUtils['outer' + first] = function (el, includeMargin) {
  43208. return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
  43209. };
  43210. var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
  43211. domUtils[name] = function (elem, val) {
  43212. if (val !== undefined) {
  43213. if (elem) {
  43214. var computedStyle = getComputedStyleX(elem);
  43215. var isBorderBox = isBorderBoxFn(elem);
  43216. if (isBorderBox) {
  43217. val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
  43218. }
  43219. return css(elem, name, val);
  43220. }
  43221. return undefined;
  43222. }
  43223. return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
  43224. };
  43225. });
  43226. // 设置 elem 相对 elem.ownerDocument 的坐标
  43227. function setOffset(elem, offset) {
  43228. // set position first, in-case top/left are set even on static elem
  43229. if (css(elem, 'position') === 'static') {
  43230. elem.style.position = 'relative';
  43231. }
  43232. var old = getOffset(elem);
  43233. var ret = {};
  43234. var current = undefined;
  43235. var key = undefined;
  43236. for (key in offset) {
  43237. if (offset.hasOwnProperty(key)) {
  43238. current = parseFloat(css(elem, key)) || 0;
  43239. ret[key] = current + offset[key] - old[key];
  43240. }
  43241. }
  43242. css(elem, ret);
  43243. }
  43244. module.exports = _extends({
  43245. getWindow: function getWindow(node) {
  43246. var doc = node.ownerDocument || node;
  43247. return doc.defaultView || doc.parentWindow;
  43248. },
  43249. offset: function offset(el, value) {
  43250. if (typeof value !== 'undefined') {
  43251. setOffset(el, value);
  43252. } else {
  43253. return getOffset(el);
  43254. }
  43255. },
  43256. isWindow: isWindow,
  43257. each: each,
  43258. css: css,
  43259. clone: function clone(obj) {
  43260. var ret = {};
  43261. for (var i in obj) {
  43262. if (obj.hasOwnProperty(i)) {
  43263. ret[i] = obj[i];
  43264. }
  43265. }
  43266. var overflow = obj.overflow;
  43267. if (overflow) {
  43268. for (var i in obj) {
  43269. if (obj.hasOwnProperty(i)) {
  43270. ret.overflow[i] = obj.overflow[i];
  43271. }
  43272. }
  43273. }
  43274. return ret;
  43275. },
  43276. scrollLeft: function scrollLeft(w, v) {
  43277. if (isWindow(w)) {
  43278. if (v === undefined) {
  43279. return getScrollLeft(w);
  43280. }
  43281. window.scrollTo(v, getScrollTop(w));
  43282. } else {
  43283. if (v === undefined) {
  43284. return w.scrollLeft;
  43285. }
  43286. w.scrollLeft = v;
  43287. }
  43288. },
  43289. scrollTop: function scrollTop(w, v) {
  43290. if (isWindow(w)) {
  43291. if (v === undefined) {
  43292. return getScrollTop(w);
  43293. }
  43294. window.scrollTo(getScrollLeft(w), v);
  43295. } else {
  43296. if (v === undefined) {
  43297. return w.scrollTop;
  43298. }
  43299. w.scrollTop = v;
  43300. }
  43301. },
  43302. viewportWidth: 0,
  43303. viewportHeight: 0
  43304. }, domUtils);
  43305. /***/ }),
  43306. /***/ "jXQH":
  43307. /***/ (function(module, exports, __webpack_require__) {
  43308. var trimmedEndIndex = __webpack_require__("TO8r");
  43309. /** Used to match leading whitespace. */
  43310. var reTrimStart = /^\s+/;
  43311. /**
  43312. * The base implementation of `_.trim`.
  43313. *
  43314. * @private
  43315. * @param {string} string The string to trim.
  43316. * @returns {string} Returns the trimmed string.
  43317. */
  43318. function baseTrim(string) {
  43319. return string
  43320. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  43321. : string;
  43322. }
  43323. module.exports = baseTrim;
  43324. /***/ }),
  43325. /***/ "jenk":
  43326. /***/ (function(module, exports, __webpack_require__) {
  43327. "use strict";
  43328. Object.defineProperty(exports, "__esModule", {
  43329. value: true
  43330. });
  43331. exports['default'] = toISOMonthString;
  43332. var _moment = __webpack_require__("wy2R");
  43333. var _moment2 = _interopRequireDefault(_moment);
  43334. var _toMomentObject = __webpack_require__("WmS1");
  43335. var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
  43336. var _constants = __webpack_require__("Fv1B");
  43337. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  43338. function toISOMonthString(date, currentFormat) {
  43339. var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
  43340. if (!dateObj) return null;
  43341. return dateObj.format(_constants.ISO_MONTH_FORMAT);
  43342. }
  43343. /***/ }),
  43344. /***/ "k2cL":
  43345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43346. "use strict";
  43347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isSelfTarget; });
  43348. /**
  43349. * Returns `true` if `event.target` and `event.currentTarget` are the same.
  43350. */
  43351. function isSelfTarget(event) {
  43352. return event.target === event.currentTarget;
  43353. }
  43354. /***/ }),
  43355. /***/ "k8OV":
  43356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43357. "use strict";
  43358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollLock; });
  43359. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  43360. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  43361. /**
  43362. * WordPress dependencies
  43363. */
  43364. /*
  43365. * Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
  43366. * Save scroll top so we can restore it after locking scroll.
  43367. *
  43368. * NOTE: It would be cleaner and possibly safer to find a localized solution such
  43369. * as preventing default on certain touchmove events.
  43370. */
  43371. let previousScrollTop = 0;
  43372. /**
  43373. * @param {boolean} locked
  43374. */
  43375. function setLocked(locked) {
  43376. const scrollingElement = document.scrollingElement || document.body;
  43377. if (locked) {
  43378. previousScrollTop = scrollingElement.scrollTop;
  43379. }
  43380. const methodName = locked ? 'add' : 'remove';
  43381. scrollingElement.classList[methodName]('lockscroll'); // Adding the class to the document element seems to be necessary in iOS.
  43382. document.documentElement.classList[methodName]('lockscroll');
  43383. if (!locked) {
  43384. scrollingElement.scrollTop = previousScrollTop;
  43385. }
  43386. }
  43387. let lockCounter = 0;
  43388. /**
  43389. * A component that will lock scrolling when it is mounted and unlock scrolling when it is unmounted.
  43390. *
  43391. * @return {null} Render nothing.
  43392. */
  43393. function ScrollLock() {
  43394. Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
  43395. if (lockCounter === 0) {
  43396. setLocked(true);
  43397. }
  43398. ++lockCounter;
  43399. return () => {
  43400. if (lockCounter === 1) {
  43401. setLocked(false);
  43402. }
  43403. --lockCounter;
  43404. };
  43405. }, []);
  43406. return null;
  43407. }
  43408. /***/ }),
  43409. /***/ "kA6J":
  43410. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43411. "use strict";
  43412. /* unused harmony export Button */
  43413. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14");
  43414. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  43415. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  43416. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ");
  43417. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  43418. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("YLtl");
  43419. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  43420. /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("NMb1");
  43421. /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__);
  43422. /* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("W/NR");
  43423. /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("9VDH");
  43424. /* harmony import */ var _visually_hidden__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("ldlY");
  43425. /**
  43426. * External dependencies
  43427. */
  43428. /**
  43429. * WordPress dependencies
  43430. */
  43431. /**
  43432. * Internal dependencies
  43433. */
  43434. const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];
  43435. function Button(props, ref) {
  43436. const {
  43437. href,
  43438. target,
  43439. isPrimary,
  43440. isSmall,
  43441. isTertiary,
  43442. isPressed,
  43443. isBusy,
  43444. isDefault,
  43445. isSecondary,
  43446. isLink,
  43447. isDestructive,
  43448. className,
  43449. disabled,
  43450. icon,
  43451. iconPosition = 'left',
  43452. iconSize,
  43453. showTooltip,
  43454. tooltipPosition,
  43455. shortcut,
  43456. label,
  43457. children,
  43458. text,
  43459. __experimentalIsFocusable: isFocusable,
  43460. describedBy,
  43461. ...additionalProps
  43462. } = props;
  43463. if (isDefault) {
  43464. _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default()('Button isDefault prop', {
  43465. since: '5.4',
  43466. alternative: 'isSecondary'
  43467. });
  43468. }
  43469. const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-button', className, {
  43470. 'is-secondary': isDefault || isSecondary,
  43471. 'is-primary': isPrimary,
  43472. 'is-small': isSmall,
  43473. 'is-tertiary': isTertiary,
  43474. 'is-pressed': isPressed,
  43475. 'is-busy': isBusy,
  43476. 'is-link': isLink,
  43477. 'is-destructive': isDestructive,
  43478. 'has-text': !!icon && !!children,
  43479. 'has-icon': !!icon
  43480. });
  43481. const trulyDisabled = disabled && !isFocusable;
  43482. const Tag = href !== undefined && !trulyDisabled ? 'a' : 'button';
  43483. const tagProps = Tag === 'a' ? {
  43484. href,
  43485. target
  43486. } : {
  43487. type: 'button',
  43488. disabled: trulyDisabled,
  43489. 'aria-pressed': isPressed
  43490. };
  43491. if (disabled && isFocusable) {
  43492. // In this case, the button will be disabled, but still focusable and
  43493. // perceivable by screen reader users.
  43494. tagProps['aria-disabled'] = true;
  43495. for (const disabledEvent of disabledEventsOnDisabledButton) {
  43496. additionalProps[disabledEvent] = event => {
  43497. event.stopPropagation();
  43498. event.preventDefault();
  43499. };
  43500. }
  43501. } // Should show the tooltip if...
  43502. const shouldShowTooltip = !trulyDisabled && ( // an explicit tooltip is passed or...
  43503. showTooltip && label || // there's a shortcut or...
  43504. shortcut || // there's a label and...
  43505. !!label && ( // the children are empty and...
  43506. !children || Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled.
  43507. false !== showTooltip);
  43508. const descriptionId = describedBy ? Object(lodash__WEBPACK_IMPORTED_MODULE_3__["uniqueId"])() : null;
  43509. const describedById = additionalProps['aria-describedby'] || descriptionId;
  43510. const element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, tagProps, additionalProps, {
  43511. className: classes,
  43512. "aria-label": additionalProps['aria-label'] || label,
  43513. "aria-describedby": describedById,
  43514. ref: ref
  43515. }), icon && iconPosition === 'left' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
  43516. icon: icon,
  43517. size: iconSize
  43518. }), text && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, text), icon && iconPosition === 'right' && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
  43519. icon: icon,
  43520. size: iconSize
  43521. }), children);
  43522. if (!shouldShowTooltip) {
  43523. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, element, describedBy && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_visually_hidden__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", {
  43524. id: descriptionId
  43525. }, describedBy)));
  43526. }
  43527. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
  43528. text: describedBy ? describedBy : label,
  43529. shortcut: shortcut,
  43530. position: tooltipPosition
  43531. }, element), describedBy && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_visually_hidden__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", {
  43532. id: descriptionId
  43533. }, describedBy)));
  43534. }
  43535. /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Button));
  43536. /***/ }),
  43537. /***/ "kDDq":
  43538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43539. "use strict";
  43540. // EXPORTS
  43541. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ emotion_esm_css; });
  43542. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ emotion_esm_cx; });
  43543. // UNUSED EXPORTS: cache, flush, getRegisteredStyles, hydrate, injectGlobal, keyframes, merge, sheet
  43544. // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js + 2 modules
  43545. var cache_browser_esm = __webpack_require__("TqVZ");
  43546. // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules
  43547. var serialize_browser_esm = __webpack_require__("MiSq");
  43548. // EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js
  43549. var utils_browser_esm = __webpack_require__("SIPS");
  43550. // CONCATENATED MODULE: ./node_modules/create-emotion/dist/create-emotion.browser.esm.js
  43551. function insertWithoutScoping(cache, serialized) {
  43552. if (cache.inserted[serialized.name] === undefined) {
  43553. return cache.insert('', serialized, cache.sheet, true);
  43554. }
  43555. }
  43556. function merge(registered, css, className) {
  43557. var registeredStyles = [];
  43558. var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className);
  43559. if (registeredStyles.length < 2) {
  43560. return className;
  43561. }
  43562. return rawClassName + css(registeredStyles);
  43563. }
  43564. var create_emotion_browser_esm_createEmotion = function createEmotion(options) {
  43565. var cache = Object(cache_browser_esm["a" /* default */])(options); // $FlowFixMe
  43566. cache.sheet.speedy = function (value) {
  43567. if (false) {}
  43568. this.isSpeedy = value;
  43569. };
  43570. cache.compat = true;
  43571. var css = function css() {
  43572. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  43573. args[_key] = arguments[_key];
  43574. }
  43575. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered, undefined);
  43576. Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, false);
  43577. return cache.key + "-" + serialized.name;
  43578. };
  43579. var keyframes = function keyframes() {
  43580. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  43581. args[_key2] = arguments[_key2];
  43582. }
  43583. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered);
  43584. var animation = "animation-" + serialized.name;
  43585. insertWithoutScoping(cache, {
  43586. name: serialized.name,
  43587. styles: "@keyframes " + animation + "{" + serialized.styles + "}"
  43588. });
  43589. return animation;
  43590. };
  43591. var injectGlobal = function injectGlobal() {
  43592. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  43593. args[_key3] = arguments[_key3];
  43594. }
  43595. var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, cache.registered);
  43596. insertWithoutScoping(cache, serialized);
  43597. };
  43598. var cx = function cx() {
  43599. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  43600. args[_key4] = arguments[_key4];
  43601. }
  43602. return merge(cache.registered, css, classnames(args));
  43603. };
  43604. return {
  43605. css: css,
  43606. cx: cx,
  43607. injectGlobal: injectGlobal,
  43608. keyframes: keyframes,
  43609. hydrate: function hydrate(ids) {
  43610. ids.forEach(function (key) {
  43611. cache.inserted[key] = true;
  43612. });
  43613. },
  43614. flush: function flush() {
  43615. cache.registered = {};
  43616. cache.inserted = {};
  43617. cache.sheet.flush();
  43618. },
  43619. // $FlowFixMe
  43620. sheet: cache.sheet,
  43621. cache: cache,
  43622. getRegisteredStyles: utils_browser_esm["a" /* getRegisteredStyles */].bind(null, cache.registered),
  43623. merge: merge.bind(null, cache.registered, css)
  43624. };
  43625. };
  43626. var classnames = function classnames(args) {
  43627. var cls = '';
  43628. for (var i = 0; i < args.length; i++) {
  43629. var arg = args[i];
  43630. if (arg == null) continue;
  43631. var toAdd = void 0;
  43632. switch (typeof arg) {
  43633. case 'boolean':
  43634. break;
  43635. case 'object':
  43636. {
  43637. if (Array.isArray(arg)) {
  43638. toAdd = classnames(arg);
  43639. } else {
  43640. toAdd = '';
  43641. for (var k in arg) {
  43642. if (arg[k] && k) {
  43643. toAdd && (toAdd += ' ');
  43644. toAdd += k;
  43645. }
  43646. }
  43647. }
  43648. break;
  43649. }
  43650. default:
  43651. {
  43652. toAdd = arg;
  43653. }
  43654. }
  43655. if (toAdd) {
  43656. cls && (cls += ' ');
  43657. cls += toAdd;
  43658. }
  43659. }
  43660. return cls;
  43661. };
  43662. /* harmony default export */ var create_emotion_browser_esm = (create_emotion_browser_esm_createEmotion);
  43663. // CONCATENATED MODULE: ./node_modules/emotion/dist/emotion.esm.js
  43664. var _createEmotion = create_emotion_browser_esm(),
  43665. flush = _createEmotion.flush,
  43666. hydrate = _createEmotion.hydrate,
  43667. emotion_esm_cx = _createEmotion.cx,
  43668. emotion_esm_merge = _createEmotion.merge,
  43669. getRegisteredStyles = _createEmotion.getRegisteredStyles,
  43670. emotion_esm_injectGlobal = _createEmotion.injectGlobal,
  43671. emotion_esm_keyframes = _createEmotion.keyframes,
  43672. emotion_esm_css = _createEmotion.css,
  43673. sheet = _createEmotion.sheet,
  43674. emotion_esm_cache = _createEmotion.cache;
  43675. /***/ }),
  43676. /***/ "kFtd":
  43677. /***/ (function(module, exports) {
  43678. Object.defineProperty(exports, "__esModule", {
  43679. value: true
  43680. });
  43681. var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS';
  43682. var MAX_SPECIFICITY = 20;
  43683. exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY;
  43684. exports.MAX_SPECIFICITY = MAX_SPECIFICITY;
  43685. /***/ }),
  43686. /***/ "kTC8":
  43687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43688. "use strict";
  43689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CompositeItem; });
  43690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useCompositeItem; });
  43691. /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
  43692. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
  43693. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
  43694. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
  43695. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  43696. /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aU41");
  43697. /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KA1K");
  43698. /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eNtd");
  43699. /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("k2cL");
  43700. /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("PcHe");
  43701. /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("Vq1w");
  43702. /* harmony import */ var _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("JLmN");
  43703. /* harmony import */ var reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("ouKs");
  43704. /* harmony import */ var _getCurrentId_5aa9849e_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("iYXd");
  43705. /* harmony import */ var _keys_6742f591_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("TFuP");
  43706. /* harmony import */ var _userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("Mih7");
  43707. /* harmony import */ var reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("4po3");
  43708. /* harmony import */ var reakit_utils_ensureFocus__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("AClM");
  43709. /* harmony import */ var _Id_Id_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("ym77");
  43710. /* harmony import */ var _setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("0HL0");
  43711. function getWidget(itemElement) {
  43712. return itemElement.querySelector("[data-composite-item-widget]");
  43713. }
  43714. function useItem(options) {
  43715. return Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
  43716. var _options$items;
  43717. return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) {
  43718. return options.id && item.id === options.id;
  43719. });
  43720. }, [options.items, options.id]);
  43721. }
  43722. function targetIsAnotherItem(event, items) {
  43723. if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return false;
  43724. for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(items), _step; !(_step = _iterator()).done;) {
  43725. var item = _step.value;
  43726. if (item.ref.current === event.target) {
  43727. return true;
  43728. }
  43729. }
  43730. return false;
  43731. }
  43732. var useCompositeItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
  43733. name: "CompositeItem",
  43734. compose: [_Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"], _Id_Id_js__WEBPACK_IMPORTED_MODULE_17__[/* unstable_useId */ "a"]],
  43735. keys: _keys_6742f591_js__WEBPACK_IMPORTED_MODULE_13__[/* b */ "c"],
  43736. propsAreEqual: function propsAreEqual(prev, next) {
  43737. if (!next.id || prev.id !== next.id) {
  43738. return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"].unstable_propsAreEqual(prev, next);
  43739. }
  43740. var prevCurrentId = prev.currentId,
  43741. prevMoves = prev.unstable_moves,
  43742. prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["currentId", "unstable_moves"]);
  43743. var nextCurrentId = next.currentId,
  43744. nextMoves = next.unstable_moves,
  43745. nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["currentId", "unstable_moves"]);
  43746. if (nextCurrentId !== prevCurrentId) {
  43747. if (next.id === nextCurrentId || next.id === prevCurrentId) {
  43748. return false;
  43749. }
  43750. } else if (prevMoves !== nextMoves) {
  43751. return false;
  43752. }
  43753. return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_10__[/* useClickable */ "a"].unstable_propsAreEqual(prevProps, nextProps);
  43754. },
  43755. useOptions: function useOptions(options) {
  43756. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, {
  43757. id: options.id,
  43758. currentId: Object(_getCurrentId_5aa9849e_js__WEBPACK_IMPORTED_MODULE_12__[/* g */ "b"])(options),
  43759. unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace
  43760. });
  43761. },
  43762. useProps: function useProps(options, _ref) {
  43763. var _options$items2;
  43764. var htmlRef = _ref.ref,
  43765. _ref$tabIndex = _ref.tabIndex,
  43766. htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
  43767. htmlOnMouseDown = _ref.onMouseDown,
  43768. htmlOnFocus = _ref.onFocus,
  43769. htmlOnBlurCapture = _ref.onBlurCapture,
  43770. htmlOnKeyDown = _ref.onKeyDown,
  43771. htmlOnClick = _ref.onClick,
  43772. htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["ref", "tabIndex", "onMouseDown", "onFocus", "onBlurCapture", "onKeyDown", "onClick"]);
  43773. var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
  43774. var id = options.id;
  43775. var trulyDisabled = options.disabled && !options.focusable;
  43776. var isCurrentItem = options.currentId === id;
  43777. var isCurrentItemRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(isCurrentItem);
  43778. var hasFocusedComposite = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(false);
  43779. var item = useItem(options);
  43780. var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnMouseDown);
  43781. var onFocusRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnFocus);
  43782. var onBlurCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnBlurCapture);
  43783. var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown);
  43784. var onClickRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnClick);
  43785. var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a
  43786. // standalone component, without state props.
  43787. !((_options$items2 = options.items) !== null && _options$items2 !== void 0 && _options$items2.length);
  43788. Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
  43789. var _options$registerItem;
  43790. if (!id) return undefined;
  43791. (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, {
  43792. id: id,
  43793. ref: ref,
  43794. disabled: !!trulyDisabled
  43795. });
  43796. return function () {
  43797. var _options$unregisterIt;
  43798. (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id);
  43799. };
  43800. }, [id, trulyDisabled, options.registerItem, options.unregisterItem]);
  43801. Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
  43802. var element = ref.current;
  43803. if (!element) {
  43804. false ? undefined : void 0;
  43805. return;
  43806. } // `moves` will be incremented whenever next, previous, up, down, first,
  43807. // last or move have been called. This means that the composite item will
  43808. // be focused whenever some of these functions are called. We're using
  43809. // isCurrentItemRef instead of isCurrentItem because we don't want to
  43810. // focus the item if isCurrentItem changes (and options.moves doesn't).
  43811. if (options.unstable_moves && isCurrentItemRef.current) {
  43812. Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* u */ "c"])(element);
  43813. }
  43814. }, [options.unstable_moves]);
  43815. var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  43816. var _onMouseDownRef$curre;
  43817. (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event);
  43818. Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* s */ "b"])(event.currentTarget, true);
  43819. }, []);
  43820. var onFocus = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  43821. var _onFocusRef$current, _options$setCurrentId;
  43822. var shouldFocusComposite = Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* h */ "a"])(event.currentTarget);
  43823. Object(_userFocus_e16425e3_js__WEBPACK_IMPORTED_MODULE_14__[/* s */ "b"])(event.currentTarget, false);
  43824. (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event);
  43825. if (event.defaultPrevented) return;
  43826. if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__[/* isPortalEvent */ "a"])(event)) return;
  43827. if (!id) return;
  43828. if (targetIsAnotherItem(event, options.items)) return;
  43829. (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the
  43830. // composite container receives focus, not the composite item.
  43831. // But we don't want to do this if the target is another focusable
  43832. // element inside the composite item, such as CompositeItemWidget.
  43833. if (shouldFocusComposite && options.unstable_virtual && options.baseId && Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) {
  43834. var target = event.target;
  43835. var composite = Object(reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_11__[/* getDocument */ "a"])(target).getElementById(options.baseId);
  43836. if (composite) {
  43837. hasFocusedComposite.current = true;
  43838. Object(reakit_utils_ensureFocus__WEBPACK_IMPORTED_MODULE_16__[/* ensureFocus */ "a"])(composite);
  43839. }
  43840. }
  43841. }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]);
  43842. var onBlurCapture = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  43843. var _onBlurCaptureRef$cur;
  43844. (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event);
  43845. if (event.defaultPrevented) return;
  43846. if (options.unstable_virtual && hasFocusedComposite.current) {
  43847. // When hasFocusedComposite is true, composite has been focused right
  43848. // after focusing this item. This is an intermediate blur event, so
  43849. // we ignore it.
  43850. hasFocusedComposite.current = false;
  43851. event.preventDefault();
  43852. event.stopPropagation();
  43853. }
  43854. }, [options.unstable_virtual]);
  43855. var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  43856. var _onKeyDownRef$current;
  43857. if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return;
  43858. var isVertical = options.orientation !== "horizontal";
  43859. var isHorizontal = options.orientation !== "vertical";
  43860. var isGrid = !!(item !== null && item !== void 0 && item.groupId);
  43861. var keyMap = {
  43862. ArrowUp: (isGrid || isVertical) && options.up,
  43863. ArrowRight: (isGrid || isHorizontal) && options.next,
  43864. ArrowDown: (isGrid || isVertical) && options.down,
  43865. ArrowLeft: (isGrid || isHorizontal) && options.previous,
  43866. Home: function Home() {
  43867. if (!isGrid || event.ctrlKey) {
  43868. var _options$first;
  43869. (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options);
  43870. } else {
  43871. var _options$previous;
  43872. (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true);
  43873. }
  43874. },
  43875. End: function End() {
  43876. if (!isGrid || event.ctrlKey) {
  43877. var _options$last;
  43878. (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options);
  43879. } else {
  43880. var _options$next;
  43881. (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true);
  43882. }
  43883. },
  43884. PageUp: function PageUp() {
  43885. if (isGrid) {
  43886. var _options$up;
  43887. (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true);
  43888. } else {
  43889. var _options$first2;
  43890. (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options);
  43891. }
  43892. },
  43893. PageDown: function PageDown() {
  43894. if (isGrid) {
  43895. var _options$down;
  43896. (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true);
  43897. } else {
  43898. var _options$last2;
  43899. (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options);
  43900. }
  43901. }
  43902. };
  43903. var action = keyMap[event.key];
  43904. if (action) {
  43905. event.preventDefault();
  43906. action();
  43907. return;
  43908. }
  43909. (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
  43910. if (event.defaultPrevented) return;
  43911. if (event.key.length === 1 && event.key !== " ") {
  43912. var widget = getWidget(event.currentTarget);
  43913. if (widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__[/* isTextField */ "a"])(widget)) {
  43914. widget.focus();
  43915. Object(_setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__[/* s */ "a"])(widget, "");
  43916. }
  43917. } else if (event.key === "Delete" || event.key === "Backspace") {
  43918. var _widget = getWidget(event.currentTarget);
  43919. if (_widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_15__[/* isTextField */ "a"])(_widget)) {
  43920. event.preventDefault();
  43921. Object(_setTextFieldValue_0a221f4e_js__WEBPACK_IMPORTED_MODULE_18__[/* s */ "a"])(_widget, "");
  43922. }
  43923. }
  43924. }, [options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]);
  43925. var onClick = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  43926. var _onClickRef$current;
  43927. (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
  43928. if (event.defaultPrevented) return;
  43929. var element = event.currentTarget;
  43930. var widget = getWidget(element);
  43931. if (widget && !Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__[/* hasFocusWithin */ "a"])(widget)) {
  43932. // If there's a widget inside the composite item, we make sure it's
  43933. // focused when pressing enter, space or clicking on the composite item.
  43934. widget.focus();
  43935. }
  43936. }, []);
  43937. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  43938. ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef),
  43939. id: id,
  43940. tabIndex: shouldTabIndex ? htmlTabIndex : -1,
  43941. "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined,
  43942. onMouseDown: onMouseDown,
  43943. onFocus: onFocus,
  43944. onBlurCapture: onBlurCapture,
  43945. onKeyDown: onKeyDown,
  43946. onClick: onClick
  43947. }, htmlProps);
  43948. }
  43949. });
  43950. var CompositeItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
  43951. as: "button",
  43952. memo: true,
  43953. useHook: useCompositeItem
  43954. });
  43955. /***/ }),
  43956. /***/ "kgBv":
  43957. /***/ (function(module, exports, __webpack_require__) {
  43958. "use strict";
  43959. var GetIntrinsic = __webpack_require__("rZ7t");
  43960. var $gOPD = __webpack_require__("knm9");
  43961. var $TypeError = GetIntrinsic('%TypeError%');
  43962. var callBound = __webpack_require__("EXo9");
  43963. var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  43964. var has = __webpack_require__("oNNP");
  43965. var IsArray = __webpack_require__("9cOx");
  43966. var IsPropertyKey = __webpack_require__("i10q");
  43967. var IsRegExp = __webpack_require__("yy3d");
  43968. var ToPropertyDescriptor = __webpack_require__("eBsn");
  43969. var Type = __webpack_require__("V1cy");
  43970. // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
  43971. module.exports = function OrdinaryGetOwnProperty(O, P) {
  43972. if (Type(O) !== 'Object') {
  43973. throw new $TypeError('Assertion failed: O must be an Object');
  43974. }
  43975. if (!IsPropertyKey(P)) {
  43976. throw new $TypeError('Assertion failed: P must be a Property Key');
  43977. }
  43978. if (!has(O, P)) {
  43979. return void 0;
  43980. }
  43981. if (!$gOPD) {
  43982. // ES3 / IE 8 fallback
  43983. var arrayLength = IsArray(O) && P === 'length';
  43984. var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
  43985. return {
  43986. '[[Configurable]]': !(arrayLength || regexLastIndex),
  43987. '[[Enumerable]]': $isEnumerable(O, P),
  43988. '[[Value]]': O[P],
  43989. '[[Writable]]': true
  43990. };
  43991. }
  43992. return ToPropertyDescriptor($gOPD(O, P));
  43993. };
  43994. /***/ }),
  43995. /***/ "khzz":
  43996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43997. "use strict";
  43998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createEvent; });
  43999. /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs");
  44000. /**
  44001. * Creates an `Event` in a way that also works on IE 11.
  44002. *
  44003. * @example
  44004. * import { createEvent } from "reakit-utils";
  44005. *
  44006. * const el = document.getElementById("id");
  44007. * el.dispatchEvent(createEvent(el, "blur", { bubbles: false }));
  44008. */
  44009. function createEvent(element, type, eventInit) {
  44010. if (typeof Event === "function") {
  44011. return new Event(type, eventInit);
  44012. } // IE 11 doesn't support Event constructors
  44013. var event = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).createEvent("Event");
  44014. event.initEvent(type, eventInit === null || eventInit === void 0 ? void 0 : eventInit.bubbles, eventInit === null || eventInit === void 0 ? void 0 : eventInit.cancelable);
  44015. return event;
  44016. }
  44017. /***/ }),
  44018. /***/ "knm9":
  44019. /***/ (function(module, exports, __webpack_require__) {
  44020. "use strict";
  44021. var GetIntrinsic = __webpack_require__("rZ7t");
  44022. var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
  44023. if ($gOPD) {
  44024. try {
  44025. $gOPD([], 'length');
  44026. } catch (e) {
  44027. // IE 8 has a broken gOPD
  44028. $gOPD = null;
  44029. }
  44030. }
  44031. module.exports = $gOPD;
  44032. /***/ }),
  44033. /***/ "kqkJ":
  44034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44035. "use strict";
  44036. // EXPORTS
  44037. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ isFocusable; });
  44038. // UNUSED EXPORTS: getAllFocusableIn, getAllTabbableIn, getClosestFocusable, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isTabbable
  44039. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js
  44040. /**
  44041. * Ponyfill for `Element.prototype.matches`
  44042. *
  44043. * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
  44044. */
  44045. function matches(element, selectors) {
  44046. if ("matches" in element) {
  44047. return element.matches(selectors);
  44048. }
  44049. if ("msMatchesSelector" in element) {
  44050. return element.msMatchesSelector(selectors);
  44051. }
  44052. return element.webkitMatchesSelector(selectors);
  44053. }
  44054. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/closest.js
  44055. /**
  44056. * Ponyfill for `Element.prototype.closest`
  44057. *
  44058. * @example
  44059. * import { closest } from "reakit-utils";
  44060. *
  44061. * closest(document.getElementById("id"), "div");
  44062. * // same as
  44063. * document.getElementById("id").closest("div");
  44064. */
  44065. function closest(element, selectors) {
  44066. if ("closest" in element) return element.closest(selectors);
  44067. do {
  44068. if (matches(element, selectors)) return element;
  44069. element = element.parentElement || element.parentNode;
  44070. } while (element !== null && element.nodeType === 1);
  44071. return null;
  44072. }
  44073. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
  44074. var getActiveElement = __webpack_require__("Nym8");
  44075. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js
  44076. /** @module tabbable */
  44077. var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), " + "textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], " + "iframe, object, embed, area[href], audio[controls], video[controls], " + "[contenteditable]:not([contenteditable='false'])";
  44078. function isVisible(element) {
  44079. var htmlElement = element;
  44080. return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
  44081. }
  44082. function hasNegativeTabIndex(element) {
  44083. var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
  44084. return tabIndex < 0;
  44085. }
  44086. /**
  44087. * Checks whether `element` is focusable or not.
  44088. *
  44089. * @memberof tabbable
  44090. *
  44091. * @example
  44092. * import { isFocusable } from "reakit-utils";
  44093. *
  44094. * isFocusable(document.querySelector("input")); // true
  44095. * isFocusable(document.querySelector("input[tabindex='-1']")); // true
  44096. * isFocusable(document.querySelector("input[hidden]")); // false
  44097. * isFocusable(document.querySelector("input:disabled")); // false
  44098. */
  44099. function isFocusable(element) {
  44100. return matches(element, selector) && isVisible(element);
  44101. }
  44102. /**
  44103. * Checks whether `element` is tabbable or not.
  44104. *
  44105. * @memberof tabbable
  44106. *
  44107. * @example
  44108. * import { isTabbable } from "reakit-utils";
  44109. *
  44110. * isTabbable(document.querySelector("input")); // true
  44111. * isTabbable(document.querySelector("input[tabindex='-1']")); // false
  44112. * isTabbable(document.querySelector("input[hidden]")); // false
  44113. * isTabbable(document.querySelector("input:disabled")); // false
  44114. */
  44115. function isTabbable(element) {
  44116. return isFocusable(element) && !hasNegativeTabIndex(element);
  44117. }
  44118. /**
  44119. * Returns all the focusable elements in `container`.
  44120. *
  44121. * @memberof tabbable
  44122. *
  44123. * @param {Element} container
  44124. *
  44125. * @returns {Element[]}
  44126. */
  44127. function getAllFocusableIn(container) {
  44128. var allFocusable = Array.from(container.querySelectorAll(selector));
  44129. allFocusable.unshift(container);
  44130. return allFocusable.filter(isFocusable);
  44131. }
  44132. /**
  44133. * Returns the first focusable element in `container`.
  44134. *
  44135. * @memberof tabbable
  44136. *
  44137. * @param {Element} container
  44138. *
  44139. * @returns {Element|null}
  44140. */
  44141. function getFirstFocusableIn(container) {
  44142. var _getAllFocusableIn = getAllFocusableIn(container),
  44143. first = _getAllFocusableIn[0];
  44144. return first || null;
  44145. }
  44146. /**
  44147. * Returns all the tabbable elements in `container`, including the container
  44148. * itself.
  44149. *
  44150. * @memberof tabbable
  44151. *
  44152. * @param {Element} container
  44153. * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones.
  44154. *
  44155. * @returns {Element[]}
  44156. */
  44157. function getAllTabbableIn(container, fallbackToFocusable) {
  44158. var allFocusable = Array.from(container.querySelectorAll(selector));
  44159. var allTabbable = allFocusable.filter(isTabbable);
  44160. if (isTabbable(container)) {
  44161. allTabbable.unshift(container);
  44162. }
  44163. if (!allTabbable.length && fallbackToFocusable) {
  44164. return allFocusable;
  44165. }
  44166. return allTabbable;
  44167. }
  44168. /**
  44169. * Returns the first tabbable element in `container`, including the container
  44170. * itself if it's tabbable.
  44171. *
  44172. * @memberof tabbable
  44173. *
  44174. * @param {Element} container
  44175. * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones.
  44176. *
  44177. * @returns {Element|null}
  44178. */
  44179. function getFirstTabbableIn(container, fallbackToFocusable) {
  44180. var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable),
  44181. first = _getAllTabbableIn[0];
  44182. return first || null;
  44183. }
  44184. /**
  44185. * Returns the last tabbable element in `container`, including the container
  44186. * itself if it's tabbable.
  44187. *
  44188. * @memberof tabbable
  44189. *
  44190. * @param {Element} container
  44191. * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones.
  44192. *
  44193. * @returns {Element|null}
  44194. */
  44195. function getLastTabbableIn(container, fallbackToFocusable) {
  44196. var allTabbable = getAllTabbableIn(container, fallbackToFocusable);
  44197. return allTabbable[allTabbable.length - 1] || null;
  44198. }
  44199. /**
  44200. * Returns the next tabbable element in `container`.
  44201. *
  44202. * @memberof tabbable
  44203. *
  44204. * @param {Element} container
  44205. * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones.
  44206. *
  44207. * @returns {Element|null}
  44208. */
  44209. function getNextTabbableIn(container, fallbackToFocusable) {
  44210. var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container);
  44211. var allFocusable = getAllFocusableIn(container);
  44212. var index = allFocusable.indexOf(activeElement);
  44213. var slice = allFocusable.slice(index + 1);
  44214. return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);
  44215. }
  44216. /**
  44217. * Returns the previous tabbable element in `container`.
  44218. *
  44219. * @memberof tabbable
  44220. *
  44221. * @param {Element} container
  44222. * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones.
  44223. *
  44224. * @returns {Element|null}
  44225. */
  44226. function getPreviousTabbableIn(container, fallbackToFocusable) {
  44227. var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container);
  44228. var allFocusable = getAllFocusableIn(container).reverse();
  44229. var index = allFocusable.indexOf(activeElement);
  44230. var slice = allFocusable.slice(index + 1);
  44231. return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);
  44232. }
  44233. /**
  44234. * Returns the closest focusable element.
  44235. *
  44236. * @memberof tabbable
  44237. *
  44238. * @param {Element} container
  44239. *
  44240. * @returns {Element|null}
  44241. */
  44242. function getClosestFocusable(element) {
  44243. while (element && !isFocusable(element)) {
  44244. element = closest(element, selector);
  44245. }
  44246. return element;
  44247. }
  44248. /***/ }),
  44249. /***/ "kuGu":
  44250. /***/ (function(module, exports, __webpack_require__) {
  44251. "use strict";
  44252. var GetIntrinsic = __webpack_require__("Jt44");
  44253. var $construct = GetIntrinsic('%Reflect.construct%', true);
  44254. var DefinePropertyOrThrow = __webpack_require__("eOFJ");
  44255. try {
  44256. DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });
  44257. } catch (e) {
  44258. // Accessor properties aren't supported
  44259. DefinePropertyOrThrow = null;
  44260. }
  44261. // https://ecma-international.org/ecma-262/6.0/#sec-isconstructor
  44262. if (DefinePropertyOrThrow && $construct) {
  44263. var isConstructorMarker = {};
  44264. var badArrayLike = {};
  44265. DefinePropertyOrThrow(badArrayLike, 'length', {
  44266. '[[Get]]': function () {
  44267. throw isConstructorMarker;
  44268. },
  44269. '[[Enumerable]]': true
  44270. });
  44271. module.exports = function IsConstructor(argument) {
  44272. try {
  44273. // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:
  44274. $construct(argument, badArrayLike);
  44275. } catch (err) {
  44276. return err === isConstructorMarker;
  44277. }
  44278. };
  44279. } else {
  44280. module.exports = function IsConstructor(argument) {
  44281. // unfortunately there's no way to truly check this without try/catch `new argument` in old environments
  44282. return typeof argument === 'function' && !!argument.prototype;
  44283. };
  44284. }
  44285. /***/ }),
  44286. /***/ "kvlw":
  44287. /***/ (function(module, exports, __webpack_require__) {
  44288. "use strict";
  44289. // http://262.ecma-international.org/5.1/#sec-9.2
  44290. module.exports = function ToBoolean(value) { return !!value; };
  44291. /***/ }),
  44292. /***/ "l3Sj":
  44293. /***/ (function(module, exports) {
  44294. (function() { module.exports = window["wp"]["i18n"]; }());
  44295. /***/ }),
  44296. /***/ "lSNA":
  44297. /***/ (function(module, exports) {
  44298. function _defineProperty(obj, key, value) {
  44299. if (key in obj) {
  44300. Object.defineProperty(obj, key, {
  44301. value: value,
  44302. enumerable: true,
  44303. configurable: true,
  44304. writable: true
  44305. });
  44306. } else {
  44307. obj[key] = value;
  44308. }
  44309. return obj;
  44310. }
  44311. module.exports = _defineProperty;
  44312. module.exports["default"] = module.exports, module.exports.__esModule = true;
  44313. /***/ }),
  44314. /***/ "laOf":
  44315. /***/ (function(module, exports, __webpack_require__) {
  44316. "use strict";
  44317. var GetIntrinsic = __webpack_require__("rZ7t");
  44318. var $TypeError = GetIntrinsic('%TypeError%');
  44319. // http://262.ecma-international.org/5.1/#sec-9.10
  44320. module.exports = function CheckObjectCoercible(value, optMessage) {
  44321. if (value == null) {
  44322. throw new $TypeError(optMessage || ('Cannot call method on ' + value));
  44323. }
  44324. return value;
  44325. };
  44326. /***/ }),
  44327. /***/ "ldlY":
  44328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44329. "use strict";
  44330. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  44331. var classnames = __webpack_require__("TSYQ");
  44332. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  44333. // EXTERNAL MODULE: external ["wp","element"]
  44334. var external_wp_element_ = __webpack_require__("GRId");
  44335. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/utils.js
  44336. /**
  44337. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T
  44338. * @typedef OwnProps
  44339. * @property {T} [as='div'] Component to render
  44340. * @property {import('react').ReactNode | ((props: import('react').ComponentProps<T>) => JSX.Element) } [children] Children or render props function
  44341. */
  44342. /**
  44343. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T
  44344. * @typedef {OwnProps<T> & import('react').ComponentProps<T>} Props
  44345. */
  44346. /**
  44347. * renderAsRenderProps is used to wrap a component and convert
  44348. * the passed property "as" either a string or component, to the
  44349. * rendered tag if a string, or component.
  44350. *
  44351. * See VisuallyHidden hidden for example.
  44352. *
  44353. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T
  44354. * @param {Props<T>} props
  44355. * @return {JSX.Element} The rendered element.
  44356. */
  44357. function renderAsRenderProps({
  44358. as: Component = 'div',
  44359. ...props
  44360. }) {
  44361. if (typeof props.children === 'function') {
  44362. return props.children(props);
  44363. }
  44364. return Object(external_wp_element_["createElement"])(Component, props);
  44365. }
  44366. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js
  44367. var with_next = __webpack_require__("9NHk");
  44368. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/next.js
  44369. /**
  44370. * Internal dependencies
  44371. */
  44372. const VisuallyHidden = false ? undefined : undefined;
  44373. /**
  44374. * There is nothing to adapt, the props are equal.
  44375. *
  44376. * @param {import('.').Props<any>} props
  44377. * @return {import('../ui/visually-hidden/hook').Props} Adapted props
  44378. */
  44379. const adapter = props =>
  44380. /** @type {import('../ui/visually-hidden/hook').Props} */
  44381. props;
  44382. /**
  44383. * The generic type is too difficult to type here, default to any to circumvent that.
  44384. *
  44385. * @param {import('react').ForwardRefExoticComponent<import('.').Props<any>>} Current
  44386. */
  44387. function withNextComponent(Current) {
  44388. return Object(with_next["a" /* withNext */])(Current, VisuallyHidden, 'WPComponentsVisuallyHidden', adapter);
  44389. }
  44390. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js
  44391. /**
  44392. * External dependencies
  44393. */
  44394. /**
  44395. * WordPress dependencies
  44396. */
  44397. /**
  44398. * Internal dependencies
  44399. */
  44400. /**
  44401. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T
  44402. * @typedef OwnProps
  44403. * @property {T} [as='div'] Component to render, e.g. `"div"` or `MyComponent`.
  44404. */
  44405. /**
  44406. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T
  44407. * @typedef {OwnProps<T> & import('react').ComponentPropsWithRef<T>} Props
  44408. */
  44409. /**
  44410. * VisuallyHidden component to render text out non-visually
  44411. * for use in devices such as a screen reader.
  44412. *
  44413. * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T T
  44414. * @param {Props<T>} props
  44415. * @param {import('react').Ref<any>} forwardedRef
  44416. * @return {JSX.Element} Element
  44417. */
  44418. function visually_hidden_VisuallyHidden({
  44419. as = 'div',
  44420. className,
  44421. ...props
  44422. }, forwardedRef) {
  44423. return renderAsRenderProps({
  44424. as,
  44425. className: classnames_default()('components-visually-hidden', className),
  44426. ...props,
  44427. ref: forwardedRef
  44428. });
  44429. }
  44430. /* harmony default export */ var visually_hidden = __webpack_exports__["a"] = (withNextComponent(Object(external_wp_element_["forwardRef"])(visually_hidden_VisuallyHidden)));
  44431. /***/ }),
  44432. /***/ "lzPt":
  44433. /***/ (function(module, exports, __webpack_require__) {
  44434. // eslint-disable-next-line import/no-unresolved
  44435. module.exports = __webpack_require__("VDVV").default;
  44436. /***/ }),
  44437. /***/ "m2ax":
  44438. /***/ (function(module, exports, __webpack_require__) {
  44439. "use strict";
  44440. Object.defineProperty(exports, "__esModule", {
  44441. value: true
  44442. });
  44443. exports["default"] = getCalendarMonthWidth;
  44444. function getCalendarMonthWidth(daySize, calendarMonthPadding) {
  44445. return 7 * daySize + 2 * calendarMonthPadding + 1;
  44446. }
  44447. /***/ }),
  44448. /***/ "mMiH":
  44449. /***/ (function(module, exports, __webpack_require__) {
  44450. "use strict";
  44451. Object.defineProperty(exports, "__esModule", {
  44452. value: true
  44453. });
  44454. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  44455. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  44456. var _object = __webpack_require__("Koq/");
  44457. var _object2 = _interopRequireDefault(_object);
  44458. var _react = __webpack_require__("cDcd");
  44459. var _react2 = _interopRequireDefault(_react);
  44460. var _propTypes = __webpack_require__("17x9");
  44461. var _propTypes2 = _interopRequireDefault(_propTypes);
  44462. var _reactAddonsShallowCompare = __webpack_require__("YZDV");
  44463. var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
  44464. var _reactMomentProptypes = __webpack_require__("XGBb");
  44465. var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
  44466. var _airbnbPropTypes = __webpack_require__("Hsqg");
  44467. var _reactWithStyles = __webpack_require__("TG4+");
  44468. var _moment = __webpack_require__("wy2R");
  44469. var _moment2 = _interopRequireDefault(_moment);
  44470. var _defaultPhrases = __webpack_require__("vV+G");
  44471. var _getPhrasePropTypes = __webpack_require__("yc2e");
  44472. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  44473. var _CalendarWeek = __webpack_require__("2Q00");
  44474. var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek);
  44475. var _CalendarDay = __webpack_require__("N3k4");
  44476. var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
  44477. var _calculateDimension = __webpack_require__("ixyq");
  44478. var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
  44479. var _getCalendarMonthWeeks = __webpack_require__("F7ZS");
  44480. var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks);
  44481. var _isSameDay = __webpack_require__("pRvc");
  44482. var _isSameDay2 = _interopRequireDefault(_isSameDay);
  44483. var _toISODateString = __webpack_require__("pYxT");
  44484. var _toISODateString2 = _interopRequireDefault(_toISODateString);
  44485. var _ModifiersShape = __webpack_require__("J7JS");
  44486. var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
  44487. var _ScrollableOrientationShape = __webpack_require__("aE6U");
  44488. var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
  44489. var _DayOfWeekShape = __webpack_require__("2S2E");
  44490. var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
  44491. var _constants = __webpack_require__("Fv1B");
  44492. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  44493. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44494. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  44495. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-array-index-key: 0 */
  44496. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  44497. month: _reactMomentProptypes2['default'].momentObj,
  44498. horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
  44499. isVisible: _propTypes2['default'].bool,
  44500. enableOutsideDays: _propTypes2['default'].bool,
  44501. modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']),
  44502. orientation: _ScrollableOrientationShape2['default'],
  44503. daySize: _airbnbPropTypes.nonNegativeInteger,
  44504. onDayClick: _propTypes2['default'].func,
  44505. onDayMouseEnter: _propTypes2['default'].func,
  44506. onDayMouseLeave: _propTypes2['default'].func,
  44507. onMonthSelect: _propTypes2['default'].func,
  44508. onYearSelect: _propTypes2['default'].func,
  44509. renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  44510. renderCalendarDay: _propTypes2['default'].func,
  44511. renderDayContents: _propTypes2['default'].func,
  44512. renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
  44513. firstDayOfWeek: _DayOfWeekShape2['default'],
  44514. setMonthTitleHeight: _propTypes2['default'].func,
  44515. verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
  44516. focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
  44517. isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
  44518. // i18n
  44519. monthFormat: _propTypes2['default'].string,
  44520. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
  44521. dayAriaLabelFormat: _propTypes2['default'].string
  44522. }));
  44523. var defaultProps = {
  44524. month: (0, _moment2['default'])(),
  44525. horizontalMonthPadding: 13,
  44526. isVisible: true,
  44527. enableOutsideDays: false,
  44528. modifiers: {},
  44529. orientation: _constants.HORIZONTAL_ORIENTATION,
  44530. daySize: _constants.DAY_SIZE,
  44531. onDayClick: function () {
  44532. function onDayClick() {}
  44533. return onDayClick;
  44534. }(),
  44535. onDayMouseEnter: function () {
  44536. function onDayMouseEnter() {}
  44537. return onDayMouseEnter;
  44538. }(),
  44539. onDayMouseLeave: function () {
  44540. function onDayMouseLeave() {}
  44541. return onDayMouseLeave;
  44542. }(),
  44543. onMonthSelect: function () {
  44544. function onMonthSelect() {}
  44545. return onMonthSelect;
  44546. }(),
  44547. onYearSelect: function () {
  44548. function onYearSelect() {}
  44549. return onYearSelect;
  44550. }(),
  44551. renderMonthText: null,
  44552. renderCalendarDay: function () {
  44553. function renderCalendarDay(props) {
  44554. return _react2['default'].createElement(_CalendarDay2['default'], props);
  44555. }
  44556. return renderCalendarDay;
  44557. }(),
  44558. renderDayContents: null,
  44559. renderMonthElement: null,
  44560. firstDayOfWeek: null,
  44561. setMonthTitleHeight: null,
  44562. focusedDate: null,
  44563. isFocused: false,
  44564. // i18n
  44565. monthFormat: 'MMMM YYYY', // english locale
  44566. phrases: _defaultPhrases.CalendarDayPhrases,
  44567. dayAriaLabelFormat: undefined,
  44568. verticalBorderSpacing: undefined
  44569. };
  44570. var CalendarMonth = function (_React$Component) {
  44571. _inherits(CalendarMonth, _React$Component);
  44572. function CalendarMonth(props) {
  44573. _classCallCheck(this, CalendarMonth);
  44574. var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props));
  44575. _this.state = {
  44576. weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek)
  44577. };
  44578. _this.setCaptionRef = _this.setCaptionRef.bind(_this);
  44579. _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
  44580. return _this;
  44581. }
  44582. _createClass(CalendarMonth, [{
  44583. key: 'componentDidMount',
  44584. value: function () {
  44585. function componentDidMount() {
  44586. this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0);
  44587. }
  44588. return componentDidMount;
  44589. }()
  44590. }, {
  44591. key: 'componentWillReceiveProps',
  44592. value: function () {
  44593. function componentWillReceiveProps(nextProps) {
  44594. var month = nextProps.month,
  44595. enableOutsideDays = nextProps.enableOutsideDays,
  44596. firstDayOfWeek = nextProps.firstDayOfWeek;
  44597. var _props = this.props,
  44598. prevMonth = _props.month,
  44599. prevEnableOutsideDays = _props.enableOutsideDays,
  44600. prevFirstDayOfWeek = _props.firstDayOfWeek;
  44601. if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) {
  44602. this.setState({
  44603. weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek)
  44604. });
  44605. }
  44606. }
  44607. return componentWillReceiveProps;
  44608. }()
  44609. }, {
  44610. key: 'shouldComponentUpdate',
  44611. value: function () {
  44612. function shouldComponentUpdate(nextProps, nextState) {
  44613. return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
  44614. }
  44615. return shouldComponentUpdate;
  44616. }()
  44617. }, {
  44618. key: 'componentWillUnmount',
  44619. value: function () {
  44620. function componentWillUnmount() {
  44621. if (this.setMonthTitleHeightTimeout) {
  44622. clearTimeout(this.setMonthTitleHeightTimeout);
  44623. }
  44624. }
  44625. return componentWillUnmount;
  44626. }()
  44627. }, {
  44628. key: 'setMonthTitleHeight',
  44629. value: function () {
  44630. function setMonthTitleHeight() {
  44631. var setMonthTitleHeight = this.props.setMonthTitleHeight;
  44632. if (setMonthTitleHeight) {
  44633. var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true);
  44634. setMonthTitleHeight(captionHeight);
  44635. }
  44636. }
  44637. return setMonthTitleHeight;
  44638. }()
  44639. }, {
  44640. key: 'setCaptionRef',
  44641. value: function () {
  44642. function setCaptionRef(ref) {
  44643. this.captionRef = ref;
  44644. }
  44645. return setCaptionRef;
  44646. }()
  44647. }, {
  44648. key: 'render',
  44649. value: function () {
  44650. function render() {
  44651. var _props2 = this.props,
  44652. dayAriaLabelFormat = _props2.dayAriaLabelFormat,
  44653. daySize = _props2.daySize,
  44654. focusedDate = _props2.focusedDate,
  44655. horizontalMonthPadding = _props2.horizontalMonthPadding,
  44656. isFocused = _props2.isFocused,
  44657. isVisible = _props2.isVisible,
  44658. modifiers = _props2.modifiers,
  44659. month = _props2.month,
  44660. monthFormat = _props2.monthFormat,
  44661. onDayClick = _props2.onDayClick,
  44662. onDayMouseEnter = _props2.onDayMouseEnter,
  44663. onDayMouseLeave = _props2.onDayMouseLeave,
  44664. onMonthSelect = _props2.onMonthSelect,
  44665. onYearSelect = _props2.onYearSelect,
  44666. orientation = _props2.orientation,
  44667. phrases = _props2.phrases,
  44668. renderCalendarDay = _props2.renderCalendarDay,
  44669. renderDayContents = _props2.renderDayContents,
  44670. renderMonthElement = _props2.renderMonthElement,
  44671. renderMonthText = _props2.renderMonthText,
  44672. styles = _props2.styles,
  44673. verticalBorderSpacing = _props2.verticalBorderSpacing;
  44674. var weeks = this.state.weeks;
  44675. var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat);
  44676. var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
  44677. return _react2['default'].createElement(
  44678. 'div',
  44679. _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
  44680. 'data-visible': isVisible
  44681. }),
  44682. _react2['default'].createElement(
  44683. 'div',
  44684. _extends({
  44685. ref: this.setCaptionRef
  44686. }, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)),
  44687. renderMonthElement ? renderMonthElement({ month: month, onMonthSelect: onMonthSelect, onYearSelect: onYearSelect }) : _react2['default'].createElement(
  44688. 'strong',
  44689. null,
  44690. monthTitle
  44691. )
  44692. ),
  44693. _react2['default'].createElement(
  44694. 'table',
  44695. _extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && { borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px' }), {
  44696. role: 'presentation'
  44697. }),
  44698. _react2['default'].createElement(
  44699. 'tbody',
  44700. null,
  44701. weeks.map(function (week, i) {
  44702. return _react2['default'].createElement(
  44703. _CalendarWeek2['default'],
  44704. { key: i },
  44705. week.map(function (day, dayOfWeek) {
  44706. return renderCalendarDay({
  44707. key: dayOfWeek,
  44708. day: day,
  44709. daySize: daySize,
  44710. isOutsideDay: !day || day.month() !== month.month(),
  44711. tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1,
  44712. isFocused: isFocused,
  44713. onDayMouseEnter: onDayMouseEnter,
  44714. onDayMouseLeave: onDayMouseLeave,
  44715. onDayClick: onDayClick,
  44716. renderDayContents: renderDayContents,
  44717. phrases: phrases,
  44718. modifiers: modifiers[(0, _toISODateString2['default'])(day)],
  44719. ariaLabelFormat: dayAriaLabelFormat
  44720. });
  44721. })
  44722. );
  44723. })
  44724. )
  44725. )
  44726. );
  44727. }
  44728. return render;
  44729. }()
  44730. }]);
  44731. return CalendarMonth;
  44732. }(_react2['default'].Component);
  44733. CalendarMonth.propTypes = propTypes;
  44734. CalendarMonth.defaultProps = defaultProps;
  44735. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
  44736. var _ref$reactDates = _ref.reactDates,
  44737. color = _ref$reactDates.color,
  44738. font = _ref$reactDates.font,
  44739. spacing = _ref$reactDates.spacing;
  44740. return {
  44741. CalendarMonth: {
  44742. background: color.background,
  44743. textAlign: 'center',
  44744. verticalAlign: 'top',
  44745. userSelect: 'none'
  44746. },
  44747. CalendarMonth_table: {
  44748. borderCollapse: 'collapse',
  44749. borderSpacing: 0
  44750. },
  44751. CalendarMonth_verticalSpacing: {
  44752. borderCollapse: 'separate'
  44753. },
  44754. CalendarMonth_caption: {
  44755. color: color.text,
  44756. fontSize: font.captionSize,
  44757. textAlign: 'center',
  44758. paddingTop: spacing.captionPaddingTop,
  44759. paddingBottom: spacing.captionPaddingBottom,
  44760. captionSide: 'initial'
  44761. },
  44762. CalendarMonth_caption__verticalScrollable: {
  44763. paddingTop: 12,
  44764. paddingBottom: 7
  44765. }
  44766. };
  44767. })(CalendarMonth);
  44768. /***/ }),
  44769. /***/ "mjVI":
  44770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44771. "use strict";
  44772. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TOOLBAR_KEYS; });
  44773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return TOOLBAR_ITEM_KEYS; });
  44774. /* unused harmony export b */
  44775. // Automatically generated
  44776. var TOOLBAR_STATE_KEYS = ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "setBaseId", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
  44777. var TOOLBAR_KEYS = TOOLBAR_STATE_KEYS;
  44778. var TOOLBAR_ITEM_KEYS = TOOLBAR_KEYS;
  44779. var TOOLBAR_SEPARATOR_KEYS = TOOLBAR_ITEM_KEYS;
  44780. /***/ }),
  44781. /***/ "n1Y7":
  44782. /***/ (function(module, exports, __webpack_require__) {
  44783. "use strict";
  44784. var define = __webpack_require__("82c2");
  44785. var implementation = __webpack_require__("nRDI");
  44786. var getPolyfill = __webpack_require__("5yQQ");
  44787. var polyfill = getPolyfill();
  44788. var shim = __webpack_require__("Gn0q");
  44789. var boundContains = function contains(node, other) {
  44790. return polyfill.apply(node, [other]);
  44791. };
  44792. define(boundContains, {
  44793. getPolyfill: getPolyfill,
  44794. implementation: implementation,
  44795. shim: shim
  44796. });
  44797. module.exports = boundContains;
  44798. /***/ }),
  44799. /***/ "nKkb":
  44800. /***/ (function(module, exports, __webpack_require__) {
  44801. "use strict";
  44802. var GetIntrinsic = __webpack_require__("rZ7t");
  44803. var $abs = GetIntrinsic('%Math.abs%');
  44804. // http://262.ecma-international.org/5.1/#sec-5.2
  44805. module.exports = function abs(x) {
  44806. return $abs(x);
  44807. };
  44808. /***/ }),
  44809. /***/ "nLTY":
  44810. /***/ (function(module, exports) {
  44811. Object.defineProperty(exports, "__esModule", {
  44812. value: true
  44813. });
  44814. exports['default'] = getClassName;
  44815. /**
  44816. * Construct a class name.
  44817. *
  44818. * namespace {String} Used to construct unique class names.
  44819. * styleName {String} Name identifying the specific style.
  44820. *
  44821. * Return the class name.
  44822. */
  44823. function getClassName(namespace, styleName) {
  44824. var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : '';
  44825. return '' + namespaceSegment + String(styleName);
  44826. }
  44827. /***/ }),
  44828. /***/ "nRDI":
  44829. /***/ (function(module, exports, __webpack_require__) {
  44830. "use strict";
  44831. module.exports = function contains(other) {
  44832. if (arguments.length < 1) {
  44833. throw new TypeError('1 argument is required');
  44834. }
  44835. if (typeof other !== 'object') {
  44836. throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node');
  44837. }
  44838. var node = other;
  44839. do {
  44840. if (this === node) {
  44841. return true;
  44842. }
  44843. if (node) {
  44844. node = node.parentNode;
  44845. }
  44846. } while (node);
  44847. return false;
  44848. };
  44849. /***/ }),
  44850. /***/ "nmnc":
  44851. /***/ (function(module, exports, __webpack_require__) {
  44852. var root = __webpack_require__("Kz5y");
  44853. /** Built-in value references. */
  44854. var Symbol = root.Symbol;
  44855. module.exports = Symbol;
  44856. /***/ }),
  44857. /***/ "oNNP":
  44858. /***/ (function(module, exports, __webpack_require__) {
  44859. "use strict";
  44860. var bind = __webpack_require__("D3zA");
  44861. module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  44862. /***/ }),
  44863. /***/ "oOcr":
  44864. /***/ (function(module, exports, __webpack_require__) {
  44865. "use strict";
  44866. Object.defineProperty(exports, "__esModule", {
  44867. value: true
  44868. });
  44869. exports['default'] = getPhrase;
  44870. function getPhrase(phrase, args) {
  44871. if (typeof phrase === 'string') return phrase;
  44872. if (typeof phrase === 'function') {
  44873. return phrase(args);
  44874. }
  44875. return '';
  44876. }
  44877. /***/ }),
  44878. /***/ "oR9Z":
  44879. /***/ (function(module, exports, __webpack_require__) {
  44880. "use strict";
  44881. Object.defineProperty(exports, "__esModule", {
  44882. value: true
  44883. });
  44884. var _propTypes = __webpack_require__("17x9");
  44885. var _propTypes2 = _interopRequireDefault(_propTypes);
  44886. var _constants = __webpack_require__("Fv1B");
  44887. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  44888. exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
  44889. /***/ }),
  44890. /***/ "oXO/":
  44891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44892. "use strict";
  44893. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  44894. var esm_extends = __webpack_require__("wx14");
  44895. // EXTERNAL MODULE: external ["wp","element"]
  44896. var external_wp_element_ = __webpack_require__("GRId");
  44897. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  44898. var classnames = __webpack_require__("TSYQ");
  44899. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  44900. // EXTERNAL MODULE: external ["wp","dom"]
  44901. var external_wp_dom_ = __webpack_require__("1CF3");
  44902. // EXTERNAL MODULE: external ["wp","keycodes"]
  44903. var external_wp_keycodes_ = __webpack_require__("RxS6");
  44904. // EXTERNAL MODULE: external ["wp","deprecated"]
  44905. var external_wp_deprecated_ = __webpack_require__("NMb1");
  44906. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
  44907. // EXTERNAL MODULE: external ["wp","compose"]
  44908. var external_wp_compose_ = __webpack_require__("K9lf");
  44909. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  44910. var library_close = __webpack_require__("w95h");
  44911. // EXTERNAL MODULE: external ["wp","i18n"]
  44912. var external_wp_i18n_ = __webpack_require__("l3Sj");
  44913. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js
  44914. /**
  44915. * WordPress dependencies
  44916. */
  44917. /**
  44918. * Module constants
  44919. */
  44920. const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
  44921. /**
  44922. * Utility used to compute the popover position over the xAxis
  44923. *
  44924. * @param {Object} anchorRect Anchor Rect.
  44925. * @param {Object} contentSize Content Size.
  44926. * @param {string} xAxis Desired xAxis.
  44927. * @param {string} corner Desired corner.
  44928. * @param {boolean} stickyBoundaryElement The boundary element to use when
  44929. * switching between sticky and normal
  44930. * position.
  44931. * @param {string} chosenYAxis yAxis to be used.
  44932. * @param {Element} boundaryElement Boundary element.
  44933. * @param {boolean} forcePosition Don't adjust position based on anchor.
  44934. * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
  44935. *
  44936. * @return {Object} Popover xAxis position and constraints.
  44937. */
  44938. function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
  44939. const {
  44940. width
  44941. } = contentSize; // Correct xAxis for RTL support
  44942. if (xAxis === 'left' && Object(external_wp_i18n_["isRTL"])()) {
  44943. xAxis = 'right';
  44944. } else if (xAxis === 'right' && Object(external_wp_i18n_["isRTL"])()) {
  44945. xAxis = 'left';
  44946. }
  44947. if (corner === 'left' && Object(external_wp_i18n_["isRTL"])()) {
  44948. corner = 'right';
  44949. } else if (corner === 'right' && Object(external_wp_i18n_["isRTL"])()) {
  44950. corner = 'left';
  44951. } // x axis alignment choices
  44952. const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
  44953. const centerAlignment = {
  44954. popoverLeft: anchorMidPoint,
  44955. contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
  44956. };
  44957. let leftAlignmentX = anchorRect.left;
  44958. if (corner === 'right') {
  44959. leftAlignmentX = anchorRect.right;
  44960. } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
  44961. leftAlignmentX = anchorMidPoint;
  44962. }
  44963. let rightAlignmentX = anchorRect.right;
  44964. if (corner === 'left') {
  44965. rightAlignmentX = anchorRect.left;
  44966. } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
  44967. rightAlignmentX = anchorMidPoint;
  44968. }
  44969. const leftAlignment = {
  44970. popoverLeft: leftAlignmentX,
  44971. contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
  44972. };
  44973. const rightAlignment = {
  44974. popoverLeft: rightAlignmentX,
  44975. contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
  44976. }; // Choosing the x axis
  44977. let chosenXAxis = xAxis;
  44978. let contentWidth = null;
  44979. if (!stickyBoundaryElement && !forcePosition) {
  44980. if (xAxis === 'center' && centerAlignment.contentWidth === width) {
  44981. chosenXAxis = 'center';
  44982. } else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
  44983. chosenXAxis = 'left';
  44984. } else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
  44985. chosenXAxis = 'right';
  44986. } else {
  44987. chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
  44988. const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width
  44989. if (width > window.innerWidth) {
  44990. contentWidth = window.innerWidth;
  44991. } // If we can't find any alignment options that could fit
  44992. // our content, then let's fallback to the center of the viewport.
  44993. if (chosenWidth !== width) {
  44994. chosenXAxis = 'center';
  44995. centerAlignment.popoverLeft = window.innerWidth / 2;
  44996. }
  44997. }
  44998. }
  44999. let popoverLeft;
  45000. if (chosenXAxis === 'center') {
  45001. popoverLeft = centerAlignment.popoverLeft;
  45002. } else if (chosenXAxis === 'left') {
  45003. popoverLeft = leftAlignment.popoverLeft;
  45004. } else {
  45005. popoverLeft = rightAlignment.popoverLeft;
  45006. }
  45007. if (boundaryElement) {
  45008. const boundaryRect = boundaryElement.getBoundingClientRect();
  45009. popoverLeft = Math.min(popoverLeft, boundaryRect.right - width); // Avoid the popover being position beyond the left boundary if the
  45010. // direction is left to right.
  45011. if (!Object(external_wp_i18n_["isRTL"])()) {
  45012. popoverLeft = Math.max(popoverLeft, 0);
  45013. }
  45014. }
  45015. return {
  45016. xAxis: chosenXAxis,
  45017. popoverLeft,
  45018. contentWidth
  45019. };
  45020. }
  45021. /**
  45022. * Utility used to compute the popover position over the yAxis
  45023. *
  45024. * @param {Object} anchorRect Anchor Rect.
  45025. * @param {Object} contentSize Content Size.
  45026. * @param {string} yAxis Desired yAxis.
  45027. * @param {string} corner Desired corner.
  45028. * @param {boolean} stickyBoundaryElement The boundary element to use when
  45029. * switching between sticky and normal
  45030. * position.
  45031. * @param {Element} anchorRef The anchor element.
  45032. * @param {Element} relativeOffsetTop If applicable, top offset of the
  45033. * relative positioned parent container.
  45034. * @param {boolean} forcePosition Don't adjust position based on anchor.
  45035. *
  45036. * @return {Object} Popover xAxis position and constraints.
  45037. */
  45038. function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition) {
  45039. const {
  45040. height
  45041. } = contentSize;
  45042. if (stickyBoundaryElement) {
  45043. const stickyRect = stickyBoundaryElement.getBoundingClientRect();
  45044. const stickyPosition = stickyRect.top + height - relativeOffsetTop;
  45045. if (anchorRect.top <= stickyPosition) {
  45046. return {
  45047. yAxis,
  45048. popoverTop: Math.min(anchorRect.bottom, stickyPosition)
  45049. };
  45050. }
  45051. } // y axis alignment choices
  45052. let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
  45053. if (corner === 'bottom') {
  45054. anchorMidPoint = anchorRect.bottom;
  45055. } else if (corner === 'top') {
  45056. anchorMidPoint = anchorRect.top;
  45057. }
  45058. const middleAlignment = {
  45059. popoverTop: anchorMidPoint,
  45060. contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
  45061. };
  45062. const topAlignment = {
  45063. popoverTop: anchorRect.top,
  45064. contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
  45065. };
  45066. const bottomAlignment = {
  45067. popoverTop: anchorRect.bottom,
  45068. contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
  45069. }; // Choosing the y axis
  45070. let chosenYAxis = yAxis;
  45071. let contentHeight = null;
  45072. if (!stickyBoundaryElement && !forcePosition) {
  45073. if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
  45074. chosenYAxis = 'middle';
  45075. } else if (yAxis === 'top' && topAlignment.contentHeight === height) {
  45076. chosenYAxis = 'top';
  45077. } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
  45078. chosenYAxis = 'bottom';
  45079. } else {
  45080. chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
  45081. const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
  45082. contentHeight = chosenHeight !== height ? chosenHeight : null;
  45083. }
  45084. }
  45085. let popoverTop;
  45086. if (chosenYAxis === 'middle') {
  45087. popoverTop = middleAlignment.popoverTop;
  45088. } else if (chosenYAxis === 'top') {
  45089. popoverTop = topAlignment.popoverTop;
  45090. } else {
  45091. popoverTop = bottomAlignment.popoverTop;
  45092. }
  45093. return {
  45094. yAxis: chosenYAxis,
  45095. popoverTop,
  45096. contentHeight
  45097. };
  45098. }
  45099. /**
  45100. * Utility used to compute the popover position and the content max width/height
  45101. * for a popover given its anchor rect and its content size.
  45102. *
  45103. * @param {Object} anchorRect Anchor Rect.
  45104. * @param {Object} contentSize Content Size.
  45105. * @param {string} position Position.
  45106. * @param {boolean} stickyBoundaryElement The boundary element to use when
  45107. * switching between sticky and normal
  45108. * position.
  45109. * @param {Element} anchorRef The anchor element.
  45110. * @param {number} relativeOffsetTop If applicable, top offset of the
  45111. * relative positioned parent container.
  45112. * @param {Element} boundaryElement Boundary element.
  45113. * @param {boolean} forcePosition Don't adjust position based on anchor.
  45114. * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
  45115. *
  45116. * @return {Object} Popover position and constraints.
  45117. */
  45118. function computePopoverPosition(anchorRect, contentSize, position = 'top', stickyBoundaryElement, anchorRef, relativeOffsetTop, boundaryElement, forcePosition, forceXAlignment) {
  45119. const [yAxis, xAxis = 'center', corner] = position.split(' ');
  45120. const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition);
  45121. const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment);
  45122. return { ...xAxisPosition,
  45123. ...yAxisPosition
  45124. };
  45125. }
  45126. /**
  45127. * Offsets the given rect by the position of the iframe that contains the
  45128. * element. If the owner document is not in an iframe then it returns with the
  45129. * original rect. If the popover container document and the anchor document are
  45130. * the same, the original rect will also be returned.
  45131. *
  45132. * @param {DOMRect} rect bounds of the element
  45133. * @param {Document} ownerDocument document of the element
  45134. * @param {Element} container The popover container to position.
  45135. *
  45136. * @return {DOMRect} offsetted bounds
  45137. */
  45138. function offsetIframe(rect, ownerDocument, container) {
  45139. const {
  45140. defaultView
  45141. } = ownerDocument;
  45142. const {
  45143. frameElement
  45144. } = defaultView;
  45145. if (!frameElement || ownerDocument === container.ownerDocument) {
  45146. return rect;
  45147. }
  45148. const iframeRect = frameElement.getBoundingClientRect();
  45149. return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height);
  45150. }
  45151. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
  45152. var build_module_button = __webpack_require__("kA6J");
  45153. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
  45154. var scroll_lock = __webpack_require__("k8OV");
  45155. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
  45156. var use_slot = __webpack_require__("+WFq");
  45157. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 8 modules
  45158. var slot_fill = __webpack_require__("dSD1");
  45159. // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
  45160. var build_module_animate = __webpack_require__("L8Kx");
  45161. // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
  45162. /**
  45163. * External dependencies
  45164. */
  45165. /**
  45166. * WordPress dependencies
  45167. */
  45168. /**
  45169. * Internal dependencies
  45170. */
  45171. /**
  45172. * Name of slot in which popover should fill.
  45173. *
  45174. * @type {string}
  45175. */
  45176. const SLOT_NAME = 'Popover';
  45177. function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef = false, shouldAnchorIncludePadding, container) {
  45178. if (anchorRect) {
  45179. return anchorRect;
  45180. }
  45181. if (getAnchorRect) {
  45182. if (!anchorRefFallback.current) {
  45183. return;
  45184. }
  45185. const rect = getAnchorRect(anchorRefFallback.current);
  45186. return offsetIframe(rect, rect.ownerDocument || anchorRefFallback.current.ownerDocument, container);
  45187. }
  45188. if (anchorRef !== false) {
  45189. if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) {
  45190. return;
  45191. } // Duck-type to check if `anchorRef` is an instance of Range
  45192. // `anchorRef instanceof window.Range` checks will break across document boundaries
  45193. // such as in an iframe
  45194. if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') {
  45195. return offsetIframe(Object(external_wp_dom_["getRectangleFromRange"])(anchorRef), anchorRef.endContainer.ownerDocument, container);
  45196. } // Duck-type to check if `anchorRef` is an instance of Element
  45197. // `anchorRef instanceof window.Element` checks will break across document boundaries
  45198. // such as in an iframe
  45199. if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') {
  45200. const rect = offsetIframe(anchorRef.getBoundingClientRect(), anchorRef.ownerDocument, container);
  45201. if (shouldAnchorIncludePadding) {
  45202. return rect;
  45203. }
  45204. return withoutPadding(rect, anchorRef);
  45205. }
  45206. const {
  45207. top,
  45208. bottom
  45209. } = anchorRef;
  45210. const topRect = top.getBoundingClientRect();
  45211. const bottomRect = bottom.getBoundingClientRect();
  45212. const rect = offsetIframe(new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top), top.ownerDocument, container);
  45213. if (shouldAnchorIncludePadding) {
  45214. return rect;
  45215. }
  45216. return withoutPadding(rect, anchorRef);
  45217. }
  45218. if (!anchorRefFallback.current) {
  45219. return;
  45220. }
  45221. const {
  45222. parentNode
  45223. } = anchorRefFallback.current;
  45224. const rect = parentNode.getBoundingClientRect();
  45225. if (shouldAnchorIncludePadding) {
  45226. return rect;
  45227. }
  45228. return withoutPadding(rect, parentNode);
  45229. }
  45230. function getComputedStyle(node) {
  45231. return node.ownerDocument.defaultView.getComputedStyle(node);
  45232. }
  45233. function withoutPadding(rect, element) {
  45234. const {
  45235. paddingTop,
  45236. paddingBottom,
  45237. paddingLeft,
  45238. paddingRight
  45239. } = getComputedStyle(element);
  45240. const top = paddingTop ? parseInt(paddingTop, 10) : 0;
  45241. const bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0;
  45242. const left = paddingLeft ? parseInt(paddingLeft, 10) : 0;
  45243. const right = paddingRight ? parseInt(paddingRight, 10) : 0;
  45244. return {
  45245. x: rect.left + left,
  45246. y: rect.top + top,
  45247. width: rect.width - left - right,
  45248. height: rect.height - top - bottom,
  45249. left: rect.left + left,
  45250. right: rect.right - right,
  45251. top: rect.top + top,
  45252. bottom: rect.bottom - bottom
  45253. };
  45254. }
  45255. /**
  45256. * Sets or removes an element attribute.
  45257. *
  45258. * @param {Element} element The element to modify.
  45259. * @param {string} name The attribute name to set or remove.
  45260. * @param {?string} value The value to set. A falsy value will remove the
  45261. * attribute.
  45262. */
  45263. function setAttribute(element, name, value) {
  45264. if (!value) {
  45265. if (element.hasAttribute(name)) {
  45266. element.removeAttribute(name);
  45267. }
  45268. } else if (element.getAttribute(name) !== value) {
  45269. element.setAttribute(name, value);
  45270. }
  45271. }
  45272. /**
  45273. * Sets or removes an element style property.
  45274. *
  45275. * @param {Element} element The element to modify.
  45276. * @param {string} property The property to set or remove.
  45277. * @param {?string} value The value to set. A falsy value will remove the
  45278. * property.
  45279. */
  45280. function setStyle(element, property, value = '') {
  45281. if (element.style[property] !== value) {
  45282. element.style[property] = value;
  45283. }
  45284. }
  45285. /**
  45286. * Sets or removes an element class.
  45287. *
  45288. * @param {Element} element The element to modify.
  45289. * @param {string} name The class to set or remove.
  45290. * @param {boolean} toggle True to set the class, false to remove.
  45291. */
  45292. function setClass(element, name, toggle) {
  45293. if (toggle) {
  45294. if (!element.classList.contains(name)) {
  45295. element.classList.add(name);
  45296. }
  45297. } else if (element.classList.contains(name)) {
  45298. element.classList.remove(name);
  45299. }
  45300. }
  45301. function getAnchorDocument(anchor) {
  45302. if (!anchor) {
  45303. return;
  45304. }
  45305. if (anchor.endContainer) {
  45306. return anchor.endContainer.ownerDocument;
  45307. }
  45308. if (anchor.top) {
  45309. return anchor.top.ownerDocument;
  45310. }
  45311. return anchor.ownerDocument;
  45312. }
  45313. const Popover = ({
  45314. headerTitle,
  45315. onClose,
  45316. children,
  45317. className,
  45318. noArrow = true,
  45319. isAlternate,
  45320. // Disable reason: We generate the `...contentProps` rest as remainder
  45321. // of props which aren't explicitly handled by this component.
  45322. /* eslint-disable no-unused-vars */
  45323. position = 'bottom right',
  45324. range,
  45325. focusOnMount = 'firstElement',
  45326. anchorRef,
  45327. shouldAnchorIncludePadding,
  45328. anchorRect,
  45329. getAnchorRect,
  45330. expandOnMobile,
  45331. animate = true,
  45332. onClickOutside,
  45333. onFocusOutside,
  45334. __unstableStickyBoundaryElement,
  45335. __unstableSlotName = SLOT_NAME,
  45336. __unstableObserveElement,
  45337. __unstableBoundaryParent,
  45338. __unstableForcePosition,
  45339. __unstableForceXAlignment,
  45340. /* eslint-enable no-unused-vars */
  45341. ...contentProps
  45342. }, ref) => {
  45343. const anchorRefFallback = Object(external_wp_element_["useRef"])(null);
  45344. const contentRef = Object(external_wp_element_["useRef"])(null);
  45345. const containerRef = Object(external_wp_element_["useRef"])();
  45346. const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
  45347. const [animateOrigin, setAnimateOrigin] = Object(external_wp_element_["useState"])();
  45348. const slot = Object(use_slot["a" /* default */])(__unstableSlotName);
  45349. const isExpanded = expandOnMobile && isMobileViewport;
  45350. const [containerResizeListener, contentSize] = Object(external_wp_compose_["useResizeObserver"])();
  45351. noArrow = isExpanded || noArrow;
  45352. Object(external_wp_element_["useLayoutEffect"])(() => {
  45353. if (isExpanded) {
  45354. setClass(containerRef.current, 'is-without-arrow', noArrow);
  45355. setClass(containerRef.current, 'is-alternate', isAlternate);
  45356. setAttribute(containerRef.current, 'data-x-axis');
  45357. setAttribute(containerRef.current, 'data-y-axis');
  45358. setStyle(containerRef.current, 'top');
  45359. setStyle(containerRef.current, 'left');
  45360. setStyle(contentRef.current, 'maxHeight');
  45361. setStyle(contentRef.current, 'maxWidth');
  45362. return;
  45363. }
  45364. const refresh = () => {
  45365. if (!containerRef.current || !contentRef.current) {
  45366. return;
  45367. }
  45368. let anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, containerRef.current);
  45369. if (!anchor) {
  45370. return;
  45371. }
  45372. const {
  45373. offsetParent,
  45374. ownerDocument
  45375. } = containerRef.current;
  45376. let relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body,
  45377. // subtract the position from the anchor rect. If the position of
  45378. // the popover is fixed, the offset parent is null or the body
  45379. // element, in which case the position is relative to the viewport.
  45380. // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
  45381. if (offsetParent && offsetParent !== ownerDocument.body) {
  45382. const offsetParentRect = offsetParent.getBoundingClientRect();
  45383. relativeOffsetTop = offsetParentRect.top;
  45384. anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height);
  45385. }
  45386. let boundaryElement;
  45387. if (__unstableBoundaryParent) {
  45388. var _containerRef$current;
  45389. boundaryElement = (_containerRef$current = containerRef.current.closest('.popover-slot')) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.parentNode;
  45390. }
  45391. const usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize;
  45392. const {
  45393. popoverTop,
  45394. popoverLeft,
  45395. xAxis,
  45396. yAxis,
  45397. contentHeight,
  45398. contentWidth
  45399. } = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition, __unstableForceXAlignment);
  45400. if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') {
  45401. setStyle(containerRef.current, 'top', popoverTop + 'px');
  45402. setStyle(containerRef.current, 'left', popoverLeft + 'px');
  45403. }
  45404. setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle');
  45405. setClass(containerRef.current, 'is-alternate', isAlternate);
  45406. setAttribute(containerRef.current, 'data-x-axis', xAxis);
  45407. setAttribute(containerRef.current, 'data-y-axis', yAxis);
  45408. setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
  45409. setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
  45410. const yAxisMapping = {
  45411. top: 'bottom',
  45412. bottom: 'top'
  45413. };
  45414. const xAxisMapping = {
  45415. left: 'right',
  45416. right: 'left'
  45417. };
  45418. const animateYAxis = yAxisMapping[yAxis] || 'middle';
  45419. const animateXAxis = xAxisMapping[xAxis] || 'center';
  45420. setAnimateOrigin(animateXAxis + ' ' + animateYAxis);
  45421. };
  45422. refresh();
  45423. const {
  45424. ownerDocument
  45425. } = containerRef.current;
  45426. const {
  45427. defaultView
  45428. } = ownerDocument;
  45429. /*
  45430. * There are sometimes we need to reposition or resize the popover that
  45431. * are not handled by the resize/scroll window events (i.e. CSS changes
  45432. * in the layout that changes the position of the anchor).
  45433. *
  45434. * For these situations, we refresh the popover every 0.5s
  45435. */
  45436. const intervalHandle = defaultView.setInterval(refresh, 500);
  45437. let rafId;
  45438. const refreshOnAnimationFrame = () => {
  45439. defaultView.cancelAnimationFrame(rafId);
  45440. rafId = defaultView.requestAnimationFrame(refresh);
  45441. }; // Sometimes a click trigger a layout change that affects the popover
  45442. // position. This is an opportunity to immediately refresh rather than
  45443. // at the interval.
  45444. defaultView.addEventListener('click', refreshOnAnimationFrame);
  45445. defaultView.addEventListener('resize', refresh);
  45446. defaultView.addEventListener('scroll', refresh, true);
  45447. const anchorDocument = getAnchorDocument(anchorRef); // If the anchor is within an iframe, the popover position also needs
  45448. // to refrest when the iframe content is scrolled or resized.
  45449. if (anchorDocument && anchorDocument !== ownerDocument) {
  45450. anchorDocument.defaultView.addEventListener('resize', refresh);
  45451. anchorDocument.defaultView.addEventListener('scroll', refresh, true);
  45452. }
  45453. let observer;
  45454. if (__unstableObserveElement) {
  45455. observer = new defaultView.MutationObserver(refresh);
  45456. observer.observe(__unstableObserveElement, {
  45457. attributes: true
  45458. });
  45459. }
  45460. return () => {
  45461. defaultView.clearInterval(intervalHandle);
  45462. defaultView.removeEventListener('resize', refresh);
  45463. defaultView.removeEventListener('scroll', refresh, true);
  45464. defaultView.removeEventListener('click', refreshOnAnimationFrame);
  45465. defaultView.cancelAnimationFrame(rafId);
  45466. if (anchorDocument && anchorDocument !== ownerDocument) {
  45467. anchorDocument.defaultView.removeEventListener('resize', refresh);
  45468. anchorDocument.defaultView.removeEventListener('scroll', refresh, true);
  45469. }
  45470. if (observer) {
  45471. observer.disconnect();
  45472. }
  45473. };
  45474. }, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableStickyBoundaryElement, __unstableObserveElement, __unstableBoundaryParent]); // Event handlers for closing the popover.
  45475. const closeEventRef = Object(external_wp_compose_["useRefEffect"])(node => {
  45476. function maybeClose(event) {
  45477. // Close on escape.
  45478. if (event.keyCode === external_wp_keycodes_["ESCAPE"] && onClose) {
  45479. event.stopPropagation();
  45480. onClose();
  45481. }
  45482. }
  45483. node.addEventListener('keydown', maybeClose);
  45484. return () => {
  45485. node.removeEventListener('keydown', maybeClose);
  45486. };
  45487. }, [onClose]);
  45488. const constrainedTabbingRef = Object(external_wp_compose_["useConstrainedTabbing"])();
  45489. const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])();
  45490. const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])(focusOnMount);
  45491. const focusOutsideProps = Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleOnFocusOutside);
  45492. const mergedRefs = Object(external_wp_compose_["useMergeRefs"])([ref, containerRef, // Don't register the event at all if there's no onClose callback.
  45493. onClose ? closeEventRef : null, focusOnMount ? constrainedTabbingRef : null, focusOnMount ? focusReturnRef : null, focusOnMount ? focusOnMountRef : null]);
  45494. /**
  45495. * Shims an onFocusOutside callback to be compatible with a deprecated
  45496. * onClickOutside prop function, if provided.
  45497. *
  45498. * @param {FocusEvent} event Focus event from onFocusOutside.
  45499. */
  45500. function handleOnFocusOutside(event) {
  45501. // Defer to given `onFocusOutside` if specified. Call `onClose` only if
  45502. // both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
  45503. // assures backwards-compatibility for prior `onClickOutside` default.
  45504. if (onFocusOutside) {
  45505. onFocusOutside(event);
  45506. return;
  45507. } else if (!onClickOutside) {
  45508. if (onClose) {
  45509. onClose();
  45510. }
  45511. return;
  45512. } // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
  45513. // target. MouseEvent constructor is unsupported in Internet Explorer.
  45514. let clickEvent;
  45515. try {
  45516. clickEvent = new window.MouseEvent('click');
  45517. } catch (error) {
  45518. clickEvent = document.createEvent('MouseEvent');
  45519. clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  45520. }
  45521. Object.defineProperty(clickEvent, 'target', {
  45522. get: () => event.relatedTarget
  45523. });
  45524. external_wp_deprecated_default()('Popover onClickOutside prop', {
  45525. since: '5.3',
  45526. alternative: 'onFocusOutside'
  45527. });
  45528. onClickOutside(clickEvent);
  45529. }
  45530. /** @type {false | string} */
  45531. const animateClassName = Boolean(animate && animateOrigin) && Object(build_module_animate["b" /* getAnimateClassName */])({
  45532. type: 'appear',
  45533. origin: animateOrigin
  45534. }); // Disable reason: We care to capture the _bubbled_ events from inputs
  45535. // within popover as inferring close intent.
  45536. let content = // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
  45537. // eslint-disable-next-line jsx-a11y/no-static-element-interactions
  45538. Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
  45539. className: classnames_default()('components-popover', className, animateClassName, {
  45540. 'is-expanded': isExpanded,
  45541. 'is-without-arrow': noArrow,
  45542. 'is-alternate': isAlternate
  45543. })
  45544. }, contentProps, focusOutsideProps, {
  45545. ref: mergedRefs,
  45546. tabIndex: "-1"
  45547. }), isExpanded && Object(external_wp_element_["createElement"])(scroll_lock["a" /* default */], null), isExpanded && Object(external_wp_element_["createElement"])("div", {
  45548. className: "components-popover__header"
  45549. }, Object(external_wp_element_["createElement"])("span", {
  45550. className: "components-popover__header-title"
  45551. }, headerTitle), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
  45552. className: "components-popover__close",
  45553. icon: library_close["a" /* default */],
  45554. onClick: onClose
  45555. })), Object(external_wp_element_["createElement"])("div", {
  45556. ref: contentRef,
  45557. className: "components-popover__content"
  45558. }, Object(external_wp_element_["createElement"])("div", {
  45559. style: {
  45560. position: 'relative'
  45561. }
  45562. }, containerResizeListener, children)));
  45563. if (slot.ref) {
  45564. content = Object(external_wp_element_["createElement"])(slot_fill["a" /* Fill */], {
  45565. name: __unstableSlotName
  45566. }, content);
  45567. }
  45568. if (anchorRef || anchorRect) {
  45569. return content;
  45570. }
  45571. return Object(external_wp_element_["createElement"])("span", {
  45572. ref: anchorRefFallback
  45573. }, content);
  45574. };
  45575. const PopoverContainer = Object(external_wp_element_["forwardRef"])(Popover);
  45576. function PopoverSlot({
  45577. name = SLOT_NAME
  45578. }, ref) {
  45579. return Object(external_wp_element_["createElement"])(slot_fill["c" /* Slot */], {
  45580. bubblesVirtually: true,
  45581. name: name,
  45582. className: "popover-slot",
  45583. ref: ref
  45584. });
  45585. }
  45586. PopoverContainer.Slot = Object(external_wp_element_["forwardRef"])(PopoverSlot);
  45587. /* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer);
  45588. /***/ }),
  45589. /***/ "ouKs":
  45590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45591. "use strict";
  45592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
  45593. /**
  45594. * Returns `element.ownerDocument || document`.
  45595. */
  45596. function getDocument(element) {
  45597. return element ? element.ownerDocument || element : document;
  45598. }
  45599. /***/ }),
  45600. /***/ "pRvc":
  45601. /***/ (function(module, exports, __webpack_require__) {
  45602. "use strict";
  45603. Object.defineProperty(exports, "__esModule", {
  45604. value: true
  45605. });
  45606. exports['default'] = isSameDay;
  45607. var _moment = __webpack_require__("wy2R");
  45608. var _moment2 = _interopRequireDefault(_moment);
  45609. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  45610. function isSameDay(a, b) {
  45611. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  45612. // Compare least significant, most likely to change units first
  45613. // Moment's isSame clones moment inputs and is a tad slow
  45614. return a.date() === b.date() && a.month() === b.month() && a.year() === b.year();
  45615. }
  45616. /***/ }),
  45617. /***/ "pVnL":
  45618. /***/ (function(module, exports) {
  45619. function _extends() {
  45620. module.exports = _extends = Object.assign || function (target) {
  45621. for (var i = 1; i < arguments.length; i++) {
  45622. var source = arguments[i];
  45623. for (var key in source) {
  45624. if (Object.prototype.hasOwnProperty.call(source, key)) {
  45625. target[key] = source[key];
  45626. }
  45627. }
  45628. }
  45629. return target;
  45630. };
  45631. module.exports["default"] = module.exports, module.exports.__esModule = true;
  45632. return _extends.apply(this, arguments);
  45633. }
  45634. module.exports = _extends;
  45635. module.exports["default"] = module.exports, module.exports.__esModule = true;
  45636. /***/ }),
  45637. /***/ "pYxT":
  45638. /***/ (function(module, exports, __webpack_require__) {
  45639. "use strict";
  45640. Object.defineProperty(exports, "__esModule", {
  45641. value: true
  45642. });
  45643. exports['default'] = toISODateString;
  45644. var _moment = __webpack_require__("wy2R");
  45645. var _moment2 = _interopRequireDefault(_moment);
  45646. var _toMomentObject = __webpack_require__("WmS1");
  45647. var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
  45648. var _constants = __webpack_require__("Fv1B");
  45649. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  45650. function toISODateString(date, currentFormat) {
  45651. var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
  45652. if (!dateObj) return null;
  45653. return dateObj.format(_constants.ISO_FORMAT);
  45654. }
  45655. /***/ }),
  45656. /***/ "q86A":
  45657. /***/ (function(module, exports, __webpack_require__) {
  45658. "use strict";
  45659. Object.defineProperty(exports, "__esModule", {
  45660. value: true
  45661. });
  45662. exports["default"] = getTransformStyles;
  45663. function getTransformStyles(transformValue) {
  45664. return {
  45665. transform: transformValue,
  45666. msTransform: transformValue,
  45667. MozTransform: transformValue,
  45668. WebkitTransform: transformValue
  45669. };
  45670. }
  45671. /***/ }),
  45672. /***/ "qGip":
  45673. /***/ (function(module, exports, __webpack_require__) {
  45674. "use strict";
  45675. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  45676. module.exports = function hasSymbols() {
  45677. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  45678. if (typeof Symbol.iterator === 'symbol') { return true; }
  45679. var obj = {};
  45680. var sym = Symbol('test');
  45681. var symObj = Object(sym);
  45682. if (typeof sym === 'string') { return false; }
  45683. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  45684. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  45685. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  45686. // if (sym instanceof Symbol) { return false; }
  45687. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  45688. // if (!(symObj instanceof Symbol)) { return false; }
  45689. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  45690. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  45691. var symVal = 42;
  45692. obj[sym] = symVal;
  45693. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
  45694. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  45695. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  45696. var syms = Object.getOwnPropertySymbols(obj);
  45697. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  45698. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  45699. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  45700. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  45701. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  45702. }
  45703. return true;
  45704. };
  45705. /***/ }),
  45706. /***/ "qOxZ":
  45707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45708. "use strict";
  45709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fireEvent; });
  45710. /* harmony import */ var _createEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("khzz");
  45711. /**
  45712. * Creates and dispatches `Event` in a way that also works on IE 11.
  45713. *
  45714. * @example
  45715. * import { fireEvent } from "reakit-utils";
  45716. *
  45717. * fireEvent(document.getElementById("id"), "blur", {
  45718. * bubbles: true,
  45719. * cancelable: true,
  45720. * });
  45721. */
  45722. function fireEvent(element, type, eventInit) {
  45723. return element.dispatchEvent(Object(_createEvent_js__WEBPACK_IMPORTED_MODULE_0__[/* createEvent */ "a"])(element, type, eventInit));
  45724. }
  45725. /***/ }),
  45726. /***/ "qRz9":
  45727. /***/ (function(module, exports) {
  45728. (function() { module.exports = window["wp"]["richText"]; }());
  45729. /***/ }),
  45730. /***/ "qT12":
  45731. /***/ (function(module, exports, __webpack_require__) {
  45732. "use strict";
  45733. /** @license React v16.13.1
  45734. * react-is.production.min.js
  45735. *
  45736. * Copyright (c) Facebook, Inc. and its affiliates.
  45737. *
  45738. * This source code is licensed under the MIT license found in the
  45739. * LICENSE file in the root directory of this source tree.
  45740. */
  45741. var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
  45742. Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
  45743. function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
  45744. exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
  45745. exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
  45746. exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
  45747. /***/ }),
  45748. /***/ "qdes":
  45749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45750. "use strict";
  45751. // EXPORTS
  45752. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createHook; });
  45753. // EXTERNAL MODULE: external "React"
  45754. var external_React_ = __webpack_require__("cDcd");
  45755. // EXTERNAL MODULE: ./node_modules/reakit-system/es/SystemContext.js
  45756. var SystemContext = __webpack_require__("eUCI");
  45757. // CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js
  45758. /**
  45759. * React custom hook that returns the value of any token defined in the
  45760. * SystemContext. It's mainly used internally in [`useOptions`](#useoptions)
  45761. * and [`useProps`](#useprops).
  45762. *
  45763. * @example
  45764. * import { SystemProvider, useToken } from "reakit-system";
  45765. *
  45766. * const system = {
  45767. * token: "value",
  45768. * };
  45769. *
  45770. * function Component(props) {
  45771. * const token = useToken("token", "default value");
  45772. * return <div {...props}>{token}</div>;
  45773. * }
  45774. *
  45775. * function App() {
  45776. * return (
  45777. * <SystemProvider unstable_system={system}>
  45778. * <Component />
  45779. * </SystemProvider>
  45780. * );
  45781. * }
  45782. */
  45783. function useToken(token, defaultValue) {
  45784. Object(external_React_["useDebugValue"])(token);
  45785. var context = Object(external_React_["useContext"])(SystemContext["a" /* SystemContext */]);
  45786. return context[token] != null ? context[token] : defaultValue;
  45787. }
  45788. // CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js
  45789. /**
  45790. * React custom hook that returns the props returned by a given
  45791. * `use${name}Props` in the SystemContext.
  45792. *
  45793. * @example
  45794. * import { SystemProvider, useProps } from "reakit-system";
  45795. *
  45796. * const system = {
  45797. * useAProps(options, htmlProps) {
  45798. * return {
  45799. * ...htmlProps,
  45800. * href: options.url,
  45801. * };
  45802. * },
  45803. * };
  45804. *
  45805. * function A({ url, ...htmlProps }) {
  45806. * const props = useProps("A", { url }, htmlProps);
  45807. * return <a {...props} />;
  45808. * }
  45809. *
  45810. * function App() {
  45811. * return (
  45812. * <SystemProvider unstable_system={system}>
  45813. * <A url="url">It will convert url into href in useAProps</A>
  45814. * </SystemProvider>
  45815. * );
  45816. * }
  45817. */
  45818. function useProps(name, options, htmlProps) {
  45819. if (options === void 0) {
  45820. options = {};
  45821. }
  45822. if (htmlProps === void 0) {
  45823. htmlProps = {};
  45824. }
  45825. var hookName = "use" + name + "Props";
  45826. Object(external_React_["useDebugValue"])(hookName);
  45827. var useHook = useToken(hookName);
  45828. if (useHook) {
  45829. return useHook(options, htmlProps);
  45830. }
  45831. return htmlProps;
  45832. }
  45833. // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js
  45834. var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__("RDTF");
  45835. // CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js
  45836. /**
  45837. * React custom hook that returns the options returned by a given
  45838. * `use${name}Options` in the SystemContext.
  45839. *
  45840. * @example
  45841. * import React from "react";
  45842. * import { SystemProvider, useOptions } from "reakit-system";
  45843. *
  45844. * const system = {
  45845. * useAOptions(options, htmlProps) {
  45846. * return {
  45847. * ...options,
  45848. * url: htmlProps.href,
  45849. * };
  45850. * },
  45851. * };
  45852. *
  45853. * function A({ url, ...htmlProps }) {
  45854. * const options = useOptions("A", { url }, htmlProps);
  45855. * return <a href={options.url} {...htmlProps} />;
  45856. * }
  45857. *
  45858. * function App() {
  45859. * return (
  45860. * <SystemProvider unstable_system={system}>
  45861. * <A href="url">
  45862. * It will convert href into url in useAOptions and then url into href in A
  45863. * </A>
  45864. * </SystemProvider>
  45865. * );
  45866. * }
  45867. */
  45868. function useOptions(name, options, htmlProps) {
  45869. if (options === void 0) {
  45870. options = {};
  45871. }
  45872. if (htmlProps === void 0) {
  45873. htmlProps = {};
  45874. }
  45875. var hookName = "use" + name + "Options";
  45876. Object(external_React_["useDebugValue"])(hookName);
  45877. var useHook = useToken(hookName);
  45878. if (useHook) {
  45879. return Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, options), useHook(options, htmlProps));
  45880. }
  45881. return options;
  45882. }
  45883. // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js
  45884. var shallowEqual = __webpack_require__("uqqE");
  45885. // CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js
  45886. /**
  45887. * Transforms `arg` into an array if it's not already.
  45888. *
  45889. * @example
  45890. * import { toArray } from "reakit-utils";
  45891. *
  45892. * toArray("a"); // ["a"]
  45893. * toArray(["a"]); // ["a"]
  45894. */
  45895. function toArray(arg) {
  45896. if (Array.isArray(arg)) {
  45897. return arg;
  45898. }
  45899. return typeof arg !== "undefined" ? [arg] : [];
  45900. }
  45901. // CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js
  45902. /**
  45903. * Creates a React custom hook that will return component props.
  45904. *
  45905. * @example
  45906. * import { createHook } from "reakit-system";
  45907. *
  45908. * const useA = createHook({
  45909. * name: "A",
  45910. * keys: ["url"], // custom props/options keys
  45911. * useProps(options, htmlProps) {
  45912. * return {
  45913. * ...htmlProps,
  45914. * href: options.url,
  45915. * };
  45916. * },
  45917. * });
  45918. *
  45919. * function A({ url, ...htmlProps }) {
  45920. * const props = useA({ url }, htmlProps);
  45921. * return <a {...props} />;
  45922. * }
  45923. *
  45924. * @param options
  45925. */
  45926. function createHook(options) {
  45927. var _options$useState, _composedHooks$;
  45928. var composedHooks = toArray(options.compose);
  45929. var __useOptions = function __useOptions(hookOptions, htmlProps) {
  45930. // Call the current hook's useOptions first
  45931. if (options.useOptions) {
  45932. hookOptions = options.useOptions(hookOptions, htmlProps);
  45933. } // If there's name, call useOptions from the system context
  45934. if (options.name) {
  45935. hookOptions = useOptions(options.name, hookOptions, htmlProps);
  45936. } // Run composed hooks useOptions
  45937. if (options.compose) {
  45938. for (var _iterator = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step; !(_step = _iterator()).done;) {
  45939. var hook = _step.value;
  45940. hookOptions = hook.__useOptions(hookOptions, htmlProps);
  45941. }
  45942. }
  45943. return hookOptions;
  45944. };
  45945. var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) {
  45946. if (hookOptions === void 0) {
  45947. hookOptions = {};
  45948. }
  45949. if (htmlProps === void 0) {
  45950. htmlProps = {};
  45951. }
  45952. if (unstable_ignoreUseOptions === void 0) {
  45953. unstable_ignoreUseOptions = false;
  45954. }
  45955. // This won't execute when useHook was called from within another useHook
  45956. if (!unstable_ignoreUseOptions) {
  45957. hookOptions = __useOptions(hookOptions, htmlProps);
  45958. } // Call the current hook's useProps
  45959. if (options.useProps) {
  45960. htmlProps = options.useProps(hookOptions, htmlProps);
  45961. } // If there's name, call useProps from the system context
  45962. if (options.name) {
  45963. htmlProps = useProps(options.name, hookOptions, htmlProps);
  45964. }
  45965. if (options.compose) {
  45966. if (options.useComposeOptions) {
  45967. hookOptions = options.useComposeOptions(hookOptions, htmlProps);
  45968. }
  45969. if (options.useComposeProps) {
  45970. htmlProps = options.useComposeProps(hookOptions, htmlProps);
  45971. } else {
  45972. for (var _iterator2 = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step2; !(_step2 = _iterator2()).done;) {
  45973. var hook = _step2.value;
  45974. htmlProps = hook(hookOptions, htmlProps, true);
  45975. }
  45976. }
  45977. } // Remove undefined values from htmlProps
  45978. var finalHTMLProps = {};
  45979. var definedHTMLProps = htmlProps || {};
  45980. for (var prop in definedHTMLProps) {
  45981. if (definedHTMLProps[prop] !== undefined) {
  45982. finalHTMLProps[prop] = definedHTMLProps[prop];
  45983. }
  45984. }
  45985. return finalHTMLProps;
  45986. };
  45987. useHook.__useOptions = __useOptions;
  45988. var composedKeys = composedHooks.reduce(function (keys, hook) {
  45989. keys.push.apply(keys, hook.__keys || []);
  45990. return keys;
  45991. }, []); // It's used by createComponent to split option props (keys) and html props
  45992. useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []);
  45993. useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual["a" /* shallowEqual */];
  45994. if (false) {}
  45995. return useHook;
  45996. }
  45997. /***/ }),
  45998. /***/ "rDFq":
  45999. /***/ (function(module, exports, __webpack_require__) {
  46000. "use strict";
  46001. var GetIntrinsic = __webpack_require__("rZ7t");
  46002. var $Object = GetIntrinsic('%Object%');
  46003. var isPrimitive = __webpack_require__("BeK9");
  46004. var $preventExtensions = $Object.preventExtensions;
  46005. var $isExtensible = $Object.isExtensible;
  46006. // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
  46007. module.exports = $preventExtensions
  46008. ? function IsExtensible(obj) {
  46009. return !isPrimitive(obj) && $isExtensible(obj);
  46010. }
  46011. : function IsExtensible(obj) {
  46012. return !isPrimitive(obj);
  46013. };
  46014. /***/ }),
  46015. /***/ "rQy3":
  46016. /***/ (function(module, exports, __webpack_require__) {
  46017. "use strict";
  46018. var has = __webpack_require__("oNNP");
  46019. var RequireObjectCoercible = __webpack_require__("25kQ");
  46020. var callBound = __webpack_require__("VF6F");
  46021. var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  46022. module.exports = function values(O) {
  46023. var obj = RequireObjectCoercible(O);
  46024. var vals = [];
  46025. for (var key in obj) {
  46026. if (has(obj, key) && $isEnumerable(obj, key)) {
  46027. vals.push(obj[key]);
  46028. }
  46029. }
  46030. return vals;
  46031. };
  46032. /***/ }),
  46033. /***/ "rZ7t":
  46034. /***/ (function(module, exports, __webpack_require__) {
  46035. "use strict";
  46036. var undefined;
  46037. var $SyntaxError = SyntaxError;
  46038. var $Function = Function;
  46039. var $TypeError = TypeError;
  46040. // eslint-disable-next-line consistent-return
  46041. var getEvalledConstructor = function (expressionSyntax) {
  46042. try {
  46043. return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  46044. } catch (e) {}
  46045. };
  46046. var $gOPD = Object.getOwnPropertyDescriptor;
  46047. if ($gOPD) {
  46048. try {
  46049. $gOPD({}, '');
  46050. } catch (e) {
  46051. $gOPD = null; // this is IE 8, which has a broken gOPD
  46052. }
  46053. }
  46054. var throwTypeError = function () {
  46055. throw new $TypeError();
  46056. };
  46057. var ThrowTypeError = $gOPD
  46058. ? (function () {
  46059. try {
  46060. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  46061. arguments.callee; // IE 8 does not throw here
  46062. return throwTypeError;
  46063. } catch (calleeThrows) {
  46064. try {
  46065. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  46066. return $gOPD(arguments, 'callee').get;
  46067. } catch (gOPDthrows) {
  46068. return throwTypeError;
  46069. }
  46070. }
  46071. }())
  46072. : throwTypeError;
  46073. var hasSymbols = __webpack_require__("HyUg")();
  46074. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  46075. var needsEval = {};
  46076. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  46077. var INTRINSICS = {
  46078. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  46079. '%Array%': Array,
  46080. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  46081. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  46082. '%AsyncFromSyncIteratorPrototype%': undefined,
  46083. '%AsyncFunction%': needsEval,
  46084. '%AsyncGenerator%': needsEval,
  46085. '%AsyncGeneratorFunction%': needsEval,
  46086. '%AsyncIteratorPrototype%': needsEval,
  46087. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  46088. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  46089. '%Boolean%': Boolean,
  46090. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  46091. '%Date%': Date,
  46092. '%decodeURI%': decodeURI,
  46093. '%decodeURIComponent%': decodeURIComponent,
  46094. '%encodeURI%': encodeURI,
  46095. '%encodeURIComponent%': encodeURIComponent,
  46096. '%Error%': Error,
  46097. '%eval%': eval, // eslint-disable-line no-eval
  46098. '%EvalError%': EvalError,
  46099. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  46100. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  46101. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  46102. '%Function%': $Function,
  46103. '%GeneratorFunction%': needsEval,
  46104. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  46105. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  46106. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  46107. '%isFinite%': isFinite,
  46108. '%isNaN%': isNaN,
  46109. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  46110. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  46111. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  46112. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  46113. '%Math%': Math,
  46114. '%Number%': Number,
  46115. '%Object%': Object,
  46116. '%parseFloat%': parseFloat,
  46117. '%parseInt%': parseInt,
  46118. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  46119. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  46120. '%RangeError%': RangeError,
  46121. '%ReferenceError%': ReferenceError,
  46122. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  46123. '%RegExp%': RegExp,
  46124. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  46125. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  46126. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  46127. '%String%': String,
  46128. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  46129. '%Symbol%': hasSymbols ? Symbol : undefined,
  46130. '%SyntaxError%': $SyntaxError,
  46131. '%ThrowTypeError%': ThrowTypeError,
  46132. '%TypedArray%': TypedArray,
  46133. '%TypeError%': $TypeError,
  46134. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  46135. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  46136. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  46137. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  46138. '%URIError%': URIError,
  46139. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  46140. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  46141. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  46142. };
  46143. var doEval = function doEval(name) {
  46144. var value;
  46145. if (name === '%AsyncFunction%') {
  46146. value = getEvalledConstructor('async function () {}');
  46147. } else if (name === '%GeneratorFunction%') {
  46148. value = getEvalledConstructor('function* () {}');
  46149. } else if (name === '%AsyncGeneratorFunction%') {
  46150. value = getEvalledConstructor('async function* () {}');
  46151. } else if (name === '%AsyncGenerator%') {
  46152. var fn = doEval('%AsyncGeneratorFunction%');
  46153. if (fn) {
  46154. value = fn.prototype;
  46155. }
  46156. } else if (name === '%AsyncIteratorPrototype%') {
  46157. var gen = doEval('%AsyncGenerator%');
  46158. if (gen) {
  46159. value = getProto(gen.prototype);
  46160. }
  46161. }
  46162. INTRINSICS[name] = value;
  46163. return value;
  46164. };
  46165. var LEGACY_ALIASES = {
  46166. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  46167. '%ArrayPrototype%': ['Array', 'prototype'],
  46168. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  46169. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  46170. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  46171. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  46172. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  46173. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  46174. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  46175. '%BooleanPrototype%': ['Boolean', 'prototype'],
  46176. '%DataViewPrototype%': ['DataView', 'prototype'],
  46177. '%DatePrototype%': ['Date', 'prototype'],
  46178. '%ErrorPrototype%': ['Error', 'prototype'],
  46179. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  46180. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  46181. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  46182. '%FunctionPrototype%': ['Function', 'prototype'],
  46183. '%Generator%': ['GeneratorFunction', 'prototype'],
  46184. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  46185. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  46186. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  46187. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  46188. '%JSONParse%': ['JSON', 'parse'],
  46189. '%JSONStringify%': ['JSON', 'stringify'],
  46190. '%MapPrototype%': ['Map', 'prototype'],
  46191. '%NumberPrototype%': ['Number', 'prototype'],
  46192. '%ObjectPrototype%': ['Object', 'prototype'],
  46193. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  46194. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  46195. '%PromisePrototype%': ['Promise', 'prototype'],
  46196. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  46197. '%Promise_all%': ['Promise', 'all'],
  46198. '%Promise_reject%': ['Promise', 'reject'],
  46199. '%Promise_resolve%': ['Promise', 'resolve'],
  46200. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  46201. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  46202. '%RegExpPrototype%': ['RegExp', 'prototype'],
  46203. '%SetPrototype%': ['Set', 'prototype'],
  46204. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  46205. '%StringPrototype%': ['String', 'prototype'],
  46206. '%SymbolPrototype%': ['Symbol', 'prototype'],
  46207. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  46208. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  46209. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  46210. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  46211. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  46212. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  46213. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  46214. '%URIErrorPrototype%': ['URIError', 'prototype'],
  46215. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  46216. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  46217. };
  46218. var bind = __webpack_require__("D3zA");
  46219. var hasOwn = __webpack_require__("oNNP");
  46220. var $concat = bind.call(Function.call, Array.prototype.concat);
  46221. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  46222. var $replace = bind.call(Function.call, String.prototype.replace);
  46223. var $strSlice = bind.call(Function.call, String.prototype.slice);
  46224. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  46225. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  46226. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  46227. var stringToPath = function stringToPath(string) {
  46228. var first = $strSlice(string, 0, 1);
  46229. var last = $strSlice(string, -1);
  46230. if (first === '%' && last !== '%') {
  46231. throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
  46232. } else if (last === '%' && first !== '%') {
  46233. throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
  46234. }
  46235. var result = [];
  46236. $replace(string, rePropName, function (match, number, quote, subString) {
  46237. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  46238. });
  46239. return result;
  46240. };
  46241. /* end adaptation */
  46242. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  46243. var intrinsicName = name;
  46244. var alias;
  46245. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  46246. alias = LEGACY_ALIASES[intrinsicName];
  46247. intrinsicName = '%' + alias[0] + '%';
  46248. }
  46249. if (hasOwn(INTRINSICS, intrinsicName)) {
  46250. var value = INTRINSICS[intrinsicName];
  46251. if (value === needsEval) {
  46252. value = doEval(intrinsicName);
  46253. }
  46254. if (typeof value === 'undefined' && !allowMissing) {
  46255. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  46256. }
  46257. return {
  46258. alias: alias,
  46259. name: intrinsicName,
  46260. value: value
  46261. };
  46262. }
  46263. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  46264. };
  46265. module.exports = function GetIntrinsic(name, allowMissing) {
  46266. if (typeof name !== 'string' || name.length === 0) {
  46267. throw new $TypeError('intrinsic name must be a non-empty string');
  46268. }
  46269. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  46270. throw new $TypeError('"allowMissing" argument must be a boolean');
  46271. }
  46272. var parts = stringToPath(name);
  46273. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  46274. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  46275. var intrinsicRealName = intrinsic.name;
  46276. var value = intrinsic.value;
  46277. var skipFurtherCaching = false;
  46278. var alias = intrinsic.alias;
  46279. if (alias) {
  46280. intrinsicBaseName = alias[0];
  46281. $spliceApply(parts, $concat([0, 1], alias));
  46282. }
  46283. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  46284. var part = parts[i];
  46285. var first = $strSlice(part, 0, 1);
  46286. var last = $strSlice(part, -1);
  46287. if (
  46288. (
  46289. (first === '"' || first === "'" || first === '`')
  46290. || (last === '"' || last === "'" || last === '`')
  46291. )
  46292. && first !== last
  46293. ) {
  46294. throw new $SyntaxError('property names with quotes must have matching quotes');
  46295. }
  46296. if (part === 'constructor' || !isOwn) {
  46297. skipFurtherCaching = true;
  46298. }
  46299. intrinsicBaseName += '.' + part;
  46300. intrinsicRealName = '%' + intrinsicBaseName + '%';
  46301. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  46302. value = INTRINSICS[intrinsicRealName];
  46303. } else if (value != null) {
  46304. if (!(part in value)) {
  46305. if (!allowMissing) {
  46306. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  46307. }
  46308. return void undefined;
  46309. }
  46310. if ($gOPD && (i + 1) >= parts.length) {
  46311. var desc = $gOPD(value, part);
  46312. isOwn = !!desc;
  46313. // By convention, when a data property is converted to an accessor
  46314. // property to emulate a data property that does not suffer from
  46315. // the override mistake, that accessor's getter is marked with
  46316. // an `originalValue` property. Here, when we detect this, we
  46317. // uphold the illusion by pretending to see that original data
  46318. // property, i.e., returning the value rather than the getter
  46319. // itself.
  46320. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
  46321. value = desc.get;
  46322. } else {
  46323. value = value[part];
  46324. }
  46325. } else {
  46326. isOwn = hasOwn(value, part);
  46327. value = value[part];
  46328. }
  46329. if (isOwn && !skipFurtherCaching) {
  46330. INTRINSICS[intrinsicRealName] = value;
  46331. }
  46332. }
  46333. }
  46334. return value;
  46335. };
  46336. /***/ }),
  46337. /***/ "reMF":
  46338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46339. "use strict";
  46340. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isUA; });
  46341. /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("+ipW");
  46342. /**
  46343. * Checks if a given string exists in the user agent string.
  46344. */
  46345. function isUA(string) {
  46346. if (!_canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__[/* canUseDOM */ "a"]) return false;
  46347. return window.navigator.userAgent.indexOf(string) !== -1;
  46348. }
  46349. /***/ }),
  46350. /***/ "rl8x":
  46351. /***/ (function(module, exports) {
  46352. (function() { module.exports = window["wp"]["isShallowEqual"]; }());
  46353. /***/ }),
  46354. /***/ "sA9S":
  46355. /***/ (function(module, exports, __webpack_require__) {
  46356. "use strict";
  46357. var GetIntrinsic = __webpack_require__("rZ7t");
  46358. var $Object = GetIntrinsic('%Object%');
  46359. var RequireObjectCoercible = __webpack_require__("S0jC");
  46360. // https://ecma-international.org/ecma-262/6.0/#sec-toobject
  46361. module.exports = function ToObject(value) {
  46362. RequireObjectCoercible(value);
  46363. return $Object(value);
  46364. };
  46365. /***/ }),
  46366. /***/ "sDMB":
  46367. /***/ (function(module, exports, __webpack_require__) {
  46368. "use strict";
  46369. Object.defineProperty(exports, "__esModule", {
  46370. value: true
  46371. });
  46372. var _propTypes = __webpack_require__("17x9");
  46373. var _propTypes2 = _interopRequireDefault(_propTypes);
  46374. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  46375. exports['default'] = _propTypes2['default'].shape({
  46376. getState: _propTypes2['default'].func,
  46377. setState: _propTypes2['default'].func,
  46378. subscribe: _propTypes2['default'].func
  46379. });
  46380. /***/ }),
  46381. /***/ "sEfC":
  46382. /***/ (function(module, exports, __webpack_require__) {
  46383. var isObject = __webpack_require__("GoyQ"),
  46384. now = __webpack_require__("QIyF"),
  46385. toNumber = __webpack_require__("tLB3");
  46386. /** Error message constants. */
  46387. var FUNC_ERROR_TEXT = 'Expected a function';
  46388. /* Built-in method references for those with the same name as other `lodash` methods. */
  46389. var nativeMax = Math.max,
  46390. nativeMin = Math.min;
  46391. /**
  46392. * Creates a debounced function that delays invoking `func` until after `wait`
  46393. * milliseconds have elapsed since the last time the debounced function was
  46394. * invoked. The debounced function comes with a `cancel` method to cancel
  46395. * delayed `func` invocations and a `flush` method to immediately invoke them.
  46396. * Provide `options` to indicate whether `func` should be invoked on the
  46397. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  46398. * with the last arguments provided to the debounced function. Subsequent
  46399. * calls to the debounced function return the result of the last `func`
  46400. * invocation.
  46401. *
  46402. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  46403. * invoked on the trailing edge of the timeout only if the debounced function
  46404. * is invoked more than once during the `wait` timeout.
  46405. *
  46406. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  46407. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  46408. *
  46409. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  46410. * for details over the differences between `_.debounce` and `_.throttle`.
  46411. *
  46412. * @static
  46413. * @memberOf _
  46414. * @since 0.1.0
  46415. * @category Function
  46416. * @param {Function} func The function to debounce.
  46417. * @param {number} [wait=0] The number of milliseconds to delay.
  46418. * @param {Object} [options={}] The options object.
  46419. * @param {boolean} [options.leading=false]
  46420. * Specify invoking on the leading edge of the timeout.
  46421. * @param {number} [options.maxWait]
  46422. * The maximum time `func` is allowed to be delayed before it's invoked.
  46423. * @param {boolean} [options.trailing=true]
  46424. * Specify invoking on the trailing edge of the timeout.
  46425. * @returns {Function} Returns the new debounced function.
  46426. * @example
  46427. *
  46428. * // Avoid costly calculations while the window size is in flux.
  46429. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  46430. *
  46431. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  46432. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  46433. * 'leading': true,
  46434. * 'trailing': false
  46435. * }));
  46436. *
  46437. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  46438. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  46439. * var source = new EventSource('/stream');
  46440. * jQuery(source).on('message', debounced);
  46441. *
  46442. * // Cancel the trailing debounced invocation.
  46443. * jQuery(window).on('popstate', debounced.cancel);
  46444. */
  46445. function debounce(func, wait, options) {
  46446. var lastArgs,
  46447. lastThis,
  46448. maxWait,
  46449. result,
  46450. timerId,
  46451. lastCallTime,
  46452. lastInvokeTime = 0,
  46453. leading = false,
  46454. maxing = false,
  46455. trailing = true;
  46456. if (typeof func != 'function') {
  46457. throw new TypeError(FUNC_ERROR_TEXT);
  46458. }
  46459. wait = toNumber(wait) || 0;
  46460. if (isObject(options)) {
  46461. leading = !!options.leading;
  46462. maxing = 'maxWait' in options;
  46463. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  46464. trailing = 'trailing' in options ? !!options.trailing : trailing;
  46465. }
  46466. function invokeFunc(time) {
  46467. var args = lastArgs,
  46468. thisArg = lastThis;
  46469. lastArgs = lastThis = undefined;
  46470. lastInvokeTime = time;
  46471. result = func.apply(thisArg, args);
  46472. return result;
  46473. }
  46474. function leadingEdge(time) {
  46475. // Reset any `maxWait` timer.
  46476. lastInvokeTime = time;
  46477. // Start the timer for the trailing edge.
  46478. timerId = setTimeout(timerExpired, wait);
  46479. // Invoke the leading edge.
  46480. return leading ? invokeFunc(time) : result;
  46481. }
  46482. function remainingWait(time) {
  46483. var timeSinceLastCall = time - lastCallTime,
  46484. timeSinceLastInvoke = time - lastInvokeTime,
  46485. timeWaiting = wait - timeSinceLastCall;
  46486. return maxing
  46487. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  46488. : timeWaiting;
  46489. }
  46490. function shouldInvoke(time) {
  46491. var timeSinceLastCall = time - lastCallTime,
  46492. timeSinceLastInvoke = time - lastInvokeTime;
  46493. // Either this is the first call, activity has stopped and we're at the
  46494. // trailing edge, the system time has gone backwards and we're treating
  46495. // it as the trailing edge, or we've hit the `maxWait` limit.
  46496. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  46497. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  46498. }
  46499. function timerExpired() {
  46500. var time = now();
  46501. if (shouldInvoke(time)) {
  46502. return trailingEdge(time);
  46503. }
  46504. // Restart the timer.
  46505. timerId = setTimeout(timerExpired, remainingWait(time));
  46506. }
  46507. function trailingEdge(time) {
  46508. timerId = undefined;
  46509. // Only invoke if we have `lastArgs` which means `func` has been
  46510. // debounced at least once.
  46511. if (trailing && lastArgs) {
  46512. return invokeFunc(time);
  46513. }
  46514. lastArgs = lastThis = undefined;
  46515. return result;
  46516. }
  46517. function cancel() {
  46518. if (timerId !== undefined) {
  46519. clearTimeout(timerId);
  46520. }
  46521. lastInvokeTime = 0;
  46522. lastArgs = lastCallTime = lastThis = timerId = undefined;
  46523. }
  46524. function flush() {
  46525. return timerId === undefined ? result : trailingEdge(now());
  46526. }
  46527. function debounced() {
  46528. var time = now(),
  46529. isInvoking = shouldInvoke(time);
  46530. lastArgs = arguments;
  46531. lastThis = this;
  46532. lastCallTime = time;
  46533. if (isInvoking) {
  46534. if (timerId === undefined) {
  46535. return leadingEdge(lastCallTime);
  46536. }
  46537. if (maxing) {
  46538. // Handle invocations in a tight loop.
  46539. clearTimeout(timerId);
  46540. timerId = setTimeout(timerExpired, wait);
  46541. return invokeFunc(lastCallTime);
  46542. }
  46543. }
  46544. if (timerId === undefined) {
  46545. timerId = setTimeout(timerExpired, wait);
  46546. }
  46547. return result;
  46548. }
  46549. debounced.cancel = cancel;
  46550. debounced.flush = flush;
  46551. return debounced;
  46552. }
  46553. module.exports = debounce;
  46554. /***/ }),
  46555. /***/ "sYn3":
  46556. /***/ (function(module, exports, __webpack_require__) {
  46557. "use strict";
  46558. var keysShim;
  46559. if (!Object.keys) {
  46560. // modified from https://github.com/es-shims/es5-shim
  46561. var has = Object.prototype.hasOwnProperty;
  46562. var toStr = Object.prototype.toString;
  46563. var isArgs = __webpack_require__("1KsK"); // eslint-disable-line global-require
  46564. var isEnumerable = Object.prototype.propertyIsEnumerable;
  46565. var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  46566. var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  46567. var dontEnums = [
  46568. 'toString',
  46569. 'toLocaleString',
  46570. 'valueOf',
  46571. 'hasOwnProperty',
  46572. 'isPrototypeOf',
  46573. 'propertyIsEnumerable',
  46574. 'constructor'
  46575. ];
  46576. var equalsConstructorPrototype = function (o) {
  46577. var ctor = o.constructor;
  46578. return ctor && ctor.prototype === o;
  46579. };
  46580. var excludedKeys = {
  46581. $applicationCache: true,
  46582. $console: true,
  46583. $external: true,
  46584. $frame: true,
  46585. $frameElement: true,
  46586. $frames: true,
  46587. $innerHeight: true,
  46588. $innerWidth: true,
  46589. $onmozfullscreenchange: true,
  46590. $onmozfullscreenerror: true,
  46591. $outerHeight: true,
  46592. $outerWidth: true,
  46593. $pageXOffset: true,
  46594. $pageYOffset: true,
  46595. $parent: true,
  46596. $scrollLeft: true,
  46597. $scrollTop: true,
  46598. $scrollX: true,
  46599. $scrollY: true,
  46600. $self: true,
  46601. $webkitIndexedDB: true,
  46602. $webkitStorageInfo: true,
  46603. $window: true
  46604. };
  46605. var hasAutomationEqualityBug = (function () {
  46606. /* global window */
  46607. if (typeof window === 'undefined') { return false; }
  46608. for (var k in window) {
  46609. try {
  46610. if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  46611. try {
  46612. equalsConstructorPrototype(window[k]);
  46613. } catch (e) {
  46614. return true;
  46615. }
  46616. }
  46617. } catch (e) {
  46618. return true;
  46619. }
  46620. }
  46621. return false;
  46622. }());
  46623. var equalsConstructorPrototypeIfNotBuggy = function (o) {
  46624. /* global window */
  46625. if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  46626. return equalsConstructorPrototype(o);
  46627. }
  46628. try {
  46629. return equalsConstructorPrototype(o);
  46630. } catch (e) {
  46631. return false;
  46632. }
  46633. };
  46634. keysShim = function keys(object) {
  46635. var isObject = object !== null && typeof object === 'object';
  46636. var isFunction = toStr.call(object) === '[object Function]';
  46637. var isArguments = isArgs(object);
  46638. var isString = isObject && toStr.call(object) === '[object String]';
  46639. var theKeys = [];
  46640. if (!isObject && !isFunction && !isArguments) {
  46641. throw new TypeError('Object.keys called on a non-object');
  46642. }
  46643. var skipProto = hasProtoEnumBug && isFunction;
  46644. if (isString && object.length > 0 && !has.call(object, 0)) {
  46645. for (var i = 0; i < object.length; ++i) {
  46646. theKeys.push(String(i));
  46647. }
  46648. }
  46649. if (isArguments && object.length > 0) {
  46650. for (var j = 0; j < object.length; ++j) {
  46651. theKeys.push(String(j));
  46652. }
  46653. } else {
  46654. for (var name in object) {
  46655. if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  46656. theKeys.push(String(name));
  46657. }
  46658. }
  46659. }
  46660. if (hasDontEnumBug) {
  46661. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  46662. for (var k = 0; k < dontEnums.length; ++k) {
  46663. if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  46664. theKeys.push(dontEnums[k]);
  46665. }
  46666. }
  46667. }
  46668. return theKeys;
  46669. };
  46670. }
  46671. module.exports = keysShim;
  46672. /***/ }),
  46673. /***/ "tLB3":
  46674. /***/ (function(module, exports, __webpack_require__) {
  46675. var baseTrim = __webpack_require__("jXQH"),
  46676. isObject = __webpack_require__("GoyQ"),
  46677. isSymbol = __webpack_require__("/9aa");
  46678. /** Used as references for various `Number` constants. */
  46679. var NAN = 0 / 0;
  46680. /** Used to detect bad signed hexadecimal string values. */
  46681. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  46682. /** Used to detect binary string values. */
  46683. var reIsBinary = /^0b[01]+$/i;
  46684. /** Used to detect octal string values. */
  46685. var reIsOctal = /^0o[0-7]+$/i;
  46686. /** Built-in method references without a dependency on `root`. */
  46687. var freeParseInt = parseInt;
  46688. /**
  46689. * Converts `value` to a number.
  46690. *
  46691. * @static
  46692. * @memberOf _
  46693. * @since 4.0.0
  46694. * @category Lang
  46695. * @param {*} value The value to process.
  46696. * @returns {number} Returns the number.
  46697. * @example
  46698. *
  46699. * _.toNumber(3.2);
  46700. * // => 3.2
  46701. *
  46702. * _.toNumber(Number.MIN_VALUE);
  46703. * // => 5e-324
  46704. *
  46705. * _.toNumber(Infinity);
  46706. * // => Infinity
  46707. *
  46708. * _.toNumber('3.2');
  46709. * // => 3.2
  46710. */
  46711. function toNumber(value) {
  46712. if (typeof value == 'number') {
  46713. return value;
  46714. }
  46715. if (isSymbol(value)) {
  46716. return NAN;
  46717. }
  46718. if (isObject(value)) {
  46719. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  46720. value = isObject(other) ? (other + '') : other;
  46721. }
  46722. if (typeof value != 'string') {
  46723. return value === 0 ? value : +value;
  46724. }
  46725. value = baseTrim(value);
  46726. var isBinary = reIsBinary.test(value);
  46727. return (isBinary || reIsOctal.test(value))
  46728. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  46729. : (reIsBadHex.test(value) ? NAN : +value);
  46730. }
  46731. module.exports = toNumber;
  46732. /***/ }),
  46733. /***/ "tQ+x":
  46734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46735. "use strict";
  46736. /* unused harmony export REACT_TYPEOF_KEY */
  46737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPONENT_NAMESPACE; });
  46738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CONNECTED_NAMESPACE; });
  46739. /* unused harmony export CONTEXT_COMPONENT_NAMESPACE */
  46740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CONNECT_STATIC_NAMESPACE; });
  46741. const REACT_TYPEOF_KEY = '$$typeof';
  46742. const COMPONENT_NAMESPACE = 'data-wp-component';
  46743. const CONNECTED_NAMESPACE = 'data-wp-c16t';
  46744. const CONTEXT_COMPONENT_NAMESPACE = 'data-wp-c5tc8t';
  46745. /**
  46746. * Special key where the connected namespaces are stored.
  46747. * This is attached to Context connected components as a static property.
  46748. */
  46749. const CONNECT_STATIC_NAMESPACE = '__contextSystemKey__';
  46750. /***/ }),
  46751. /***/ "u5Fq":
  46752. /***/ (function(module, exports, __webpack_require__) {
  46753. "use strict";
  46754. Object.defineProperty(exports, "__esModule", {
  46755. value: true
  46756. });
  46757. exports['default'] = getVisibleDays;
  46758. var _moment = __webpack_require__("wy2R");
  46759. var _moment2 = _interopRequireDefault(_moment);
  46760. var _toISOMonthString = __webpack_require__("jenk");
  46761. var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
  46762. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  46763. function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) {
  46764. if (!_moment2['default'].isMoment(month)) return {};
  46765. var visibleDaysByMonth = {};
  46766. var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month');
  46767. for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
  46768. var visibleDays = [];
  46769. // set utc offset to get correct dates in future (when timezone changes)
  46770. var baseDate = currentMonth.clone();
  46771. var firstOfMonth = baseDate.clone().startOf('month').hour(12);
  46772. var lastOfMonth = baseDate.clone().endOf('month').hour(12);
  46773. var currentDay = firstOfMonth.clone();
  46774. // days belonging to the previous month
  46775. if (enableOutsideDays) {
  46776. for (var j = 0; j < currentDay.weekday(); j += 1) {
  46777. var prevDay = currentDay.clone().subtract(j + 1, 'day');
  46778. visibleDays.unshift(prevDay);
  46779. }
  46780. }
  46781. while (currentDay < lastOfMonth) {
  46782. visibleDays.push(currentDay.clone());
  46783. currentDay.add(1, 'day');
  46784. }
  46785. if (enableOutsideDays) {
  46786. // weekday() returns the index of the day of the week according to the locale
  46787. // this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1
  46788. if (currentDay.weekday() !== 0) {
  46789. // days belonging to the next month
  46790. for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) {
  46791. var nextDay = currentDay.clone().add(count, 'day');
  46792. visibleDays.push(nextDay);
  46793. }
  46794. }
  46795. }
  46796. visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays;
  46797. currentMonth = currentMonth.clone().add(1, 'month');
  46798. }
  46799. return visibleDaysByMonth;
  46800. }
  46801. /***/ }),
  46802. /***/ "uGfJ":
  46803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46804. "use strict";
  46805. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  46806. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  46807. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  46808. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  46809. /**
  46810. * WordPress dependencies
  46811. */
  46812. const textColor = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  46813. xmlns: "http://www.w3.org/2000/svg",
  46814. viewBox: "0 0 24 24"
  46815. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  46816. d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"
  46817. }));
  46818. /* harmony default export */ __webpack_exports__["a"] = (textColor);
  46819. /***/ }),
  46820. /***/ "ulUS":
  46821. /***/ (function(module, exports, __webpack_require__) {
  46822. "use strict";
  46823. Object.defineProperty(exports, "__esModule", {
  46824. value: true
  46825. });
  46826. exports['default'] = isSameMonth;
  46827. var _moment = __webpack_require__("wy2R");
  46828. var _moment2 = _interopRequireDefault(_moment);
  46829. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  46830. function isSameMonth(a, b) {
  46831. if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
  46832. // Compare least significant, most likely to change units first
  46833. // Moment's isSame clones moment inputs and is a tad slow
  46834. return a.month() === b.month() && a.year() === b.year();
  46835. }
  46836. /***/ }),
  46837. /***/ "uqqE":
  46838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46839. "use strict";
  46840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return shallowEqual; });
  46841. /**
  46842. * Compares two objects.
  46843. *
  46844. * @example
  46845. * import { shallowEqual } from "reakit-utils";
  46846. *
  46847. * shallowEqual({ a: "a" }, {}); // false
  46848. * shallowEqual({ a: "a" }, { b: "b" }); // false
  46849. * shallowEqual({ a: "a" }, { a: "a" }); // true
  46850. * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false
  46851. */
  46852. function shallowEqual(objA, objB) {
  46853. if (objA === objB) return true;
  46854. if (!objA) return false;
  46855. if (!objB) return false;
  46856. if (typeof objA !== "object") return false;
  46857. if (typeof objB !== "object") return false;
  46858. var aKeys = Object.keys(objA);
  46859. var bKeys = Object.keys(objB);
  46860. var length = aKeys.length;
  46861. if (bKeys.length !== length) return false;
  46862. for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
  46863. var key = _aKeys[_i];
  46864. if (objA[key] !== objB[key]) {
  46865. return false;
  46866. }
  46867. }
  46868. return true;
  46869. }
  46870. /***/ }),
  46871. /***/ "utzN":
  46872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46873. "use strict";
  46874. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contains; });
  46875. /**
  46876. * Similar to `Element.prototype.contains`, but a little bit faster when
  46877. * `element` is the same as `child`.
  46878. *
  46879. * @example
  46880. * import { contains } from "reakit-utils";
  46881. *
  46882. * contains(document.getElementById("parent"), document.getElementById("child"));
  46883. */
  46884. function contains(parent, child) {
  46885. return parent === child || parent.contains(child);
  46886. }
  46887. /***/ }),
  46888. /***/ "v3P4":
  46889. /***/ (function(module, exports, __webpack_require__) {
  46890. "use strict";
  46891. var define = __webpack_require__("82c2");
  46892. var getPolyfill = __webpack_require__("22yB");
  46893. module.exports = function shimFlat() {
  46894. var polyfill = getPolyfill();
  46895. define(
  46896. Array.prototype,
  46897. { flat: polyfill },
  46898. { flat: function () { return Array.prototype.flat !== polyfill; } }
  46899. );
  46900. return polyfill;
  46901. };
  46902. /***/ }),
  46903. /***/ "v7lB":
  46904. /***/ (function(module, exports, __webpack_require__) {
  46905. "use strict";
  46906. /* globals
  46907. AggregateError,
  46908. Atomics,
  46909. FinalizationRegistry,
  46910. SharedArrayBuffer,
  46911. WeakRef,
  46912. */
  46913. var undefined;
  46914. var $SyntaxError = SyntaxError;
  46915. var $Function = Function;
  46916. var $TypeError = TypeError;
  46917. // eslint-disable-next-line consistent-return
  46918. var getEvalledConstructor = function (expressionSyntax) {
  46919. try {
  46920. // eslint-disable-next-line no-new-func
  46921. return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  46922. } catch (e) {}
  46923. };
  46924. var $gOPD = Object.getOwnPropertyDescriptor;
  46925. if ($gOPD) {
  46926. try {
  46927. $gOPD({}, '');
  46928. } catch (e) {
  46929. $gOPD = null; // this is IE 8, which has a broken gOPD
  46930. }
  46931. }
  46932. var throwTypeError = function () { throw new $TypeError(); };
  46933. var ThrowTypeError = $gOPD
  46934. ? (function () {
  46935. try {
  46936. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  46937. arguments.callee; // IE 8 does not throw here
  46938. return throwTypeError;
  46939. } catch (calleeThrows) {
  46940. try {
  46941. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  46942. return $gOPD(arguments, 'callee').get;
  46943. } catch (gOPDthrows) {
  46944. return throwTypeError;
  46945. }
  46946. }
  46947. }())
  46948. : throwTypeError;
  46949. var hasSymbols = __webpack_require__("UVaH")();
  46950. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  46951. var asyncGenFunction = getEvalledConstructor('async function* () {}');
  46952. var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
  46953. var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
  46954. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  46955. var INTRINSICS = {
  46956. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  46957. '%Array%': Array,
  46958. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  46959. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  46960. '%AsyncFromSyncIteratorPrototype%': undefined,
  46961. '%AsyncFunction%': getEvalledConstructor('async function () {}'),
  46962. '%AsyncGenerator%': asyncGenFunctionPrototype,
  46963. '%AsyncGeneratorFunction%': asyncGenFunction,
  46964. '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
  46965. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  46966. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  46967. '%Boolean%': Boolean,
  46968. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  46969. '%Date%': Date,
  46970. '%decodeURI%': decodeURI,
  46971. '%decodeURIComponent%': decodeURIComponent,
  46972. '%encodeURI%': encodeURI,
  46973. '%encodeURIComponent%': encodeURIComponent,
  46974. '%Error%': Error,
  46975. '%eval%': eval, // eslint-disable-line no-eval
  46976. '%EvalError%': EvalError,
  46977. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  46978. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  46979. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  46980. '%Function%': $Function,
  46981. '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
  46982. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  46983. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  46984. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  46985. '%isFinite%': isFinite,
  46986. '%isNaN%': isNaN,
  46987. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  46988. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  46989. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  46990. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  46991. '%Math%': Math,
  46992. '%Number%': Number,
  46993. '%Object%': Object,
  46994. '%parseFloat%': parseFloat,
  46995. '%parseInt%': parseInt,
  46996. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  46997. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  46998. '%RangeError%': RangeError,
  46999. '%ReferenceError%': ReferenceError,
  47000. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  47001. '%RegExp%': RegExp,
  47002. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  47003. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  47004. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  47005. '%String%': String,
  47006. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  47007. '%Symbol%': hasSymbols ? Symbol : undefined,
  47008. '%SyntaxError%': $SyntaxError,
  47009. '%ThrowTypeError%': ThrowTypeError,
  47010. '%TypedArray%': TypedArray,
  47011. '%TypeError%': $TypeError,
  47012. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  47013. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  47014. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  47015. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  47016. '%URIError%': URIError,
  47017. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  47018. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  47019. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  47020. };
  47021. var LEGACY_ALIASES = {
  47022. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  47023. '%ArrayPrototype%': ['Array', 'prototype'],
  47024. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  47025. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  47026. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  47027. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  47028. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  47029. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  47030. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  47031. '%BooleanPrototype%': ['Boolean', 'prototype'],
  47032. '%DataViewPrototype%': ['DataView', 'prototype'],
  47033. '%DatePrototype%': ['Date', 'prototype'],
  47034. '%ErrorPrototype%': ['Error', 'prototype'],
  47035. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  47036. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  47037. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  47038. '%FunctionPrototype%': ['Function', 'prototype'],
  47039. '%Generator%': ['GeneratorFunction', 'prototype'],
  47040. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  47041. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  47042. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  47043. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  47044. '%JSONParse%': ['JSON', 'parse'],
  47045. '%JSONStringify%': ['JSON', 'stringify'],
  47046. '%MapPrototype%': ['Map', 'prototype'],
  47047. '%NumberPrototype%': ['Number', 'prototype'],
  47048. '%ObjectPrototype%': ['Object', 'prototype'],
  47049. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  47050. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  47051. '%PromisePrototype%': ['Promise', 'prototype'],
  47052. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  47053. '%Promise_all%': ['Promise', 'all'],
  47054. '%Promise_reject%': ['Promise', 'reject'],
  47055. '%Promise_resolve%': ['Promise', 'resolve'],
  47056. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  47057. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  47058. '%RegExpPrototype%': ['RegExp', 'prototype'],
  47059. '%SetPrototype%': ['Set', 'prototype'],
  47060. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  47061. '%StringPrototype%': ['String', 'prototype'],
  47062. '%SymbolPrototype%': ['Symbol', 'prototype'],
  47063. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  47064. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  47065. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  47066. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  47067. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  47068. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  47069. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  47070. '%URIErrorPrototype%': ['URIError', 'prototype'],
  47071. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  47072. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  47073. };
  47074. var bind = __webpack_require__("D3zA");
  47075. var hasOwn = __webpack_require__("oNNP");
  47076. var $concat = bind.call(Function.call, Array.prototype.concat);
  47077. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  47078. var $replace = bind.call(Function.call, String.prototype.replace);
  47079. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  47080. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  47081. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  47082. var stringToPath = function stringToPath(string) {
  47083. var result = [];
  47084. $replace(string, rePropName, function (match, number, quote, subString) {
  47085. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  47086. });
  47087. return result;
  47088. };
  47089. /* end adaptation */
  47090. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  47091. var intrinsicName = name;
  47092. var alias;
  47093. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  47094. alias = LEGACY_ALIASES[intrinsicName];
  47095. intrinsicName = '%' + alias[0] + '%';
  47096. }
  47097. if (hasOwn(INTRINSICS, intrinsicName)) {
  47098. var value = INTRINSICS[intrinsicName];
  47099. if (typeof value === 'undefined' && !allowMissing) {
  47100. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  47101. }
  47102. return {
  47103. alias: alias,
  47104. name: intrinsicName,
  47105. value: value
  47106. };
  47107. }
  47108. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  47109. };
  47110. module.exports = function GetIntrinsic(name, allowMissing) {
  47111. if (typeof name !== 'string' || name.length === 0) {
  47112. throw new $TypeError('intrinsic name must be a non-empty string');
  47113. }
  47114. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  47115. throw new $TypeError('"allowMissing" argument must be a boolean');
  47116. }
  47117. var parts = stringToPath(name);
  47118. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  47119. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  47120. var intrinsicRealName = intrinsic.name;
  47121. var value = intrinsic.value;
  47122. var skipFurtherCaching = false;
  47123. var alias = intrinsic.alias;
  47124. if (alias) {
  47125. intrinsicBaseName = alias[0];
  47126. $spliceApply(parts, $concat([0, 1], alias));
  47127. }
  47128. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  47129. var part = parts[i];
  47130. if (part === 'constructor' || !isOwn) {
  47131. skipFurtherCaching = true;
  47132. }
  47133. intrinsicBaseName += '.' + part;
  47134. intrinsicRealName = '%' + intrinsicBaseName + '%';
  47135. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  47136. value = INTRINSICS[intrinsicRealName];
  47137. } else if (value != null) {
  47138. if ($gOPD && (i + 1) >= parts.length) {
  47139. var desc = $gOPD(value, part);
  47140. isOwn = !!desc;
  47141. if (!allowMissing && !(part in value)) {
  47142. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  47143. }
  47144. // By convention, when a data property is converted to an accessor
  47145. // property to emulate a data property that does not suffer from
  47146. // the override mistake, that accessor's getter is marked with
  47147. // an `originalValue` property. Here, when we detect this, we
  47148. // uphold the illusion by pretending to see that original data
  47149. // property, i.e., returning the value rather than the getter
  47150. // itself.
  47151. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
  47152. value = desc.get;
  47153. } else {
  47154. value = value[part];
  47155. }
  47156. } else {
  47157. isOwn = hasOwn(value, part);
  47158. value = value[part];
  47159. }
  47160. if (isOwn && !skipFurtherCaching) {
  47161. INTRINSICS[intrinsicRealName] = value;
  47162. }
  47163. }
  47164. }
  47165. return value;
  47166. };
  47167. /***/ }),
  47168. /***/ "vLdR":
  47169. /***/ (function(module, exports, __webpack_require__) {
  47170. "use strict";
  47171. // http://262.ecma-international.org/5.1/#sec-9.1
  47172. module.exports = __webpack_require__("Lxf3");
  47173. /***/ }),
  47174. /***/ "vUUf":
  47175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47176. "use strict";
  47177. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wx14");
  47178. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GRId");
  47179. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  47180. /**
  47181. * @typedef OwnProps
  47182. *
  47183. * @property {string} icon Icon name
  47184. * @property {string} [className] Class name
  47185. */
  47186. /** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */
  47187. /**
  47188. * @param {Props} props
  47189. * @return {JSX.Element} Element
  47190. */
  47191. function Dashicon({
  47192. icon,
  47193. className,
  47194. ...extraProps
  47195. }) {
  47196. const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
  47197. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
  47198. className: iconClass
  47199. }, extraProps));
  47200. }
  47201. /* harmony default export */ __webpack_exports__["a"] = (Dashicon);
  47202. /***/ }),
  47203. /***/ "vV+G":
  47204. /***/ (function(module, exports, __webpack_require__) {
  47205. "use strict";
  47206. Object.defineProperty(exports, "__esModule", {
  47207. value: true
  47208. });
  47209. var calendarLabel = 'Calendar';
  47210. var closeDatePicker = 'Close';
  47211. var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
  47212. var clearDate = 'Clear Date';
  47213. var clearDates = 'Clear Dates';
  47214. var jumpToPrevMonth = 'Move backward to switch to the previous month.';
  47215. var jumpToNextMonth = 'Move forward to switch to the next month.';
  47216. var keyboardShortcuts = 'Keyboard Shortcuts';
  47217. var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
  47218. var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
  47219. var openThisPanel = 'Open this panel.';
  47220. var enterKey = 'Enter key';
  47221. var leftArrowRightArrow = 'Right and left arrow keys';
  47222. var upArrowDownArrow = 'up and down arrow keys';
  47223. var pageUpPageDown = 'page up and page down keys';
  47224. var homeEnd = 'Home and end keys';
  47225. var escape = 'Escape key';
  47226. var questionMark = 'Question mark';
  47227. var selectFocusedDate = 'Select the date in focus.';
  47228. var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
  47229. var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
  47230. var moveFocusByOneMonth = 'Switch months.';
  47231. var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
  47232. var returnFocusToInput = 'Return to the date input field.';
  47233. var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
  47234. var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
  47235. var date = _ref.date;
  47236. return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.';
  47237. };
  47238. var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
  47239. var date = _ref2.date;
  47240. return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
  47241. };
  47242. var chooseAvailableDate = function chooseAvailableDate(_ref3) {
  47243. var date = _ref3.date;
  47244. return date;
  47245. };
  47246. var dateIsUnavailable = function dateIsUnavailable(_ref4) {
  47247. var date = _ref4.date;
  47248. return 'Not available. ' + String(date);
  47249. };
  47250. var dateIsSelected = function dateIsSelected(_ref5) {
  47251. var date = _ref5.date;
  47252. return 'Selected. ' + String(date);
  47253. };
  47254. exports['default'] = {
  47255. calendarLabel: calendarLabel,
  47256. closeDatePicker: closeDatePicker,
  47257. focusStartDate: focusStartDate,
  47258. clearDate: clearDate,
  47259. clearDates: clearDates,
  47260. jumpToPrevMonth: jumpToPrevMonth,
  47261. jumpToNextMonth: jumpToNextMonth,
  47262. keyboardShortcuts: keyboardShortcuts,
  47263. showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
  47264. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  47265. openThisPanel: openThisPanel,
  47266. enterKey: enterKey,
  47267. leftArrowRightArrow: leftArrowRightArrow,
  47268. upArrowDownArrow: upArrowDownArrow,
  47269. pageUpPageDown: pageUpPageDown,
  47270. homeEnd: homeEnd,
  47271. escape: escape,
  47272. questionMark: questionMark,
  47273. selectFocusedDate: selectFocusedDate,
  47274. moveFocusByOneDay: moveFocusByOneDay,
  47275. moveFocusByOneWeek: moveFocusByOneWeek,
  47276. moveFocusByOneMonth: moveFocusByOneMonth,
  47277. moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
  47278. returnFocusToInput: returnFocusToInput,
  47279. keyboardNavigationInstructions: keyboardNavigationInstructions,
  47280. chooseAvailableStartDate: chooseAvailableStartDate,
  47281. chooseAvailableEndDate: chooseAvailableEndDate,
  47282. dateIsUnavailable: dateIsUnavailable,
  47283. dateIsSelected: dateIsSelected
  47284. };
  47285. var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
  47286. calendarLabel: calendarLabel,
  47287. closeDatePicker: closeDatePicker,
  47288. clearDates: clearDates,
  47289. focusStartDate: focusStartDate,
  47290. jumpToPrevMonth: jumpToPrevMonth,
  47291. jumpToNextMonth: jumpToNextMonth,
  47292. keyboardShortcuts: keyboardShortcuts,
  47293. showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
  47294. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  47295. openThisPanel: openThisPanel,
  47296. enterKey: enterKey,
  47297. leftArrowRightArrow: leftArrowRightArrow,
  47298. upArrowDownArrow: upArrowDownArrow,
  47299. pageUpPageDown: pageUpPageDown,
  47300. homeEnd: homeEnd,
  47301. escape: escape,
  47302. questionMark: questionMark,
  47303. selectFocusedDate: selectFocusedDate,
  47304. moveFocusByOneDay: moveFocusByOneDay,
  47305. moveFocusByOneWeek: moveFocusByOneWeek,
  47306. moveFocusByOneMonth: moveFocusByOneMonth,
  47307. moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
  47308. returnFocusToInput: returnFocusToInput,
  47309. keyboardNavigationInstructions: keyboardNavigationInstructions,
  47310. chooseAvailableStartDate: chooseAvailableStartDate,
  47311. chooseAvailableEndDate: chooseAvailableEndDate,
  47312. dateIsUnavailable: dateIsUnavailable,
  47313. dateIsSelected: dateIsSelected
  47314. };
  47315. var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {
  47316. focusStartDate: focusStartDate,
  47317. clearDates: clearDates,
  47318. keyboardNavigationInstructions: keyboardNavigationInstructions
  47319. };
  47320. var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {
  47321. calendarLabel: calendarLabel,
  47322. closeDatePicker: closeDatePicker,
  47323. clearDate: clearDate,
  47324. jumpToPrevMonth: jumpToPrevMonth,
  47325. jumpToNextMonth: jumpToNextMonth,
  47326. keyboardShortcuts: keyboardShortcuts,
  47327. showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
  47328. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  47329. openThisPanel: openThisPanel,
  47330. enterKey: enterKey,
  47331. leftArrowRightArrow: leftArrowRightArrow,
  47332. upArrowDownArrow: upArrowDownArrow,
  47333. pageUpPageDown: pageUpPageDown,
  47334. homeEnd: homeEnd,
  47335. escape: escape,
  47336. questionMark: questionMark,
  47337. selectFocusedDate: selectFocusedDate,
  47338. moveFocusByOneDay: moveFocusByOneDay,
  47339. moveFocusByOneWeek: moveFocusByOneWeek,
  47340. moveFocusByOneMonth: moveFocusByOneMonth,
  47341. moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
  47342. returnFocusToInput: returnFocusToInput,
  47343. keyboardNavigationInstructions: keyboardNavigationInstructions,
  47344. chooseAvailableDate: chooseAvailableDate,
  47345. dateIsUnavailable: dateIsUnavailable,
  47346. dateIsSelected: dateIsSelected
  47347. };
  47348. var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = {
  47349. clearDate: clearDate,
  47350. keyboardNavigationInstructions: keyboardNavigationInstructions
  47351. };
  47352. var DayPickerPhrases = exports.DayPickerPhrases = {
  47353. calendarLabel: calendarLabel,
  47354. jumpToPrevMonth: jumpToPrevMonth,
  47355. jumpToNextMonth: jumpToNextMonth,
  47356. keyboardShortcuts: keyboardShortcuts,
  47357. showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
  47358. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  47359. openThisPanel: openThisPanel,
  47360. enterKey: enterKey,
  47361. leftArrowRightArrow: leftArrowRightArrow,
  47362. upArrowDownArrow: upArrowDownArrow,
  47363. pageUpPageDown: pageUpPageDown,
  47364. homeEnd: homeEnd,
  47365. escape: escape,
  47366. questionMark: questionMark,
  47367. selectFocusedDate: selectFocusedDate,
  47368. moveFocusByOneDay: moveFocusByOneDay,
  47369. moveFocusByOneWeek: moveFocusByOneWeek,
  47370. moveFocusByOneMonth: moveFocusByOneMonth,
  47371. moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
  47372. returnFocusToInput: returnFocusToInput,
  47373. chooseAvailableStartDate: chooseAvailableStartDate,
  47374. chooseAvailableEndDate: chooseAvailableEndDate,
  47375. chooseAvailableDate: chooseAvailableDate,
  47376. dateIsUnavailable: dateIsUnavailable,
  47377. dateIsSelected: dateIsSelected
  47378. };
  47379. var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = {
  47380. keyboardShortcuts: keyboardShortcuts,
  47381. showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
  47382. hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
  47383. openThisPanel: openThisPanel,
  47384. enterKey: enterKey,
  47385. leftArrowRightArrow: leftArrowRightArrow,
  47386. upArrowDownArrow: upArrowDownArrow,
  47387. pageUpPageDown: pageUpPageDown,
  47388. homeEnd: homeEnd,
  47389. escape: escape,
  47390. questionMark: questionMark,
  47391. selectFocusedDate: selectFocusedDate,
  47392. moveFocusByOneDay: moveFocusByOneDay,
  47393. moveFocusByOneWeek: moveFocusByOneWeek,
  47394. moveFocusByOneMonth: moveFocusByOneMonth,
  47395. moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
  47396. returnFocusToInput: returnFocusToInput
  47397. };
  47398. var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = {
  47399. jumpToPrevMonth: jumpToPrevMonth,
  47400. jumpToNextMonth: jumpToNextMonth
  47401. };
  47402. var CalendarDayPhrases = exports.CalendarDayPhrases = {
  47403. chooseAvailableDate: chooseAvailableDate,
  47404. dateIsUnavailable: dateIsUnavailable,
  47405. dateIsSelected: dateIsSelected
  47406. };
  47407. /***/ }),
  47408. /***/ "w3Ut":
  47409. /***/ (function(module, exports, __webpack_require__) {
  47410. "use strict";
  47411. var MAX_SAFE_INTEGER = __webpack_require__("yyeE");
  47412. var ToInteger = __webpack_require__("ddK1");
  47413. module.exports = function ToLength(argument) {
  47414. var len = ToInteger(argument);
  47415. if (len <= 0) { return 0; } // includes converting -0 to +0
  47416. if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
  47417. return len;
  47418. };
  47419. /***/ }),
  47420. /***/ "w95h":
  47421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47422. "use strict";
  47423. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  47424. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  47425. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  47426. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  47427. /**
  47428. * WordPress dependencies
  47429. */
  47430. const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  47431. xmlns: "http://www.w3.org/2000/svg",
  47432. viewBox: "0 0 24 24"
  47433. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  47434. d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
  47435. }));
  47436. /* harmony default export */ __webpack_exports__["a"] = (close);
  47437. /***/ }),
  47438. /***/ "wTIp":
  47439. /***/ (function(module, exports, __webpack_require__) {
  47440. "use strict";
  47441. var GetIntrinsic = __webpack_require__("rZ7t");
  47442. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  47443. if ($defineProperty) {
  47444. try {
  47445. $defineProperty({}, 'a', { value: 1 });
  47446. } catch (e) {
  47447. // IE 8 has a broken defineProperty
  47448. $defineProperty = null;
  47449. }
  47450. }
  47451. var callBound = __webpack_require__("EXo9");
  47452. var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  47453. // eslint-disable-next-line max-params
  47454. module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
  47455. if (!$defineProperty) {
  47456. if (!IsDataDescriptor(desc)) {
  47457. // ES3 does not support getters/setters
  47458. return false;
  47459. }
  47460. if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
  47461. return false;
  47462. }
  47463. // fallback for ES3
  47464. if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
  47465. // a non-enumerable existing property
  47466. return false;
  47467. }
  47468. // property does not exist at all, or exists but is enumerable
  47469. var V = desc['[[Value]]'];
  47470. // eslint-disable-next-line no-param-reassign
  47471. O[P] = V; // will use [[Define]]
  47472. return SameValue(O[P], V);
  47473. }
  47474. $defineProperty(O, P, FromPropertyDescriptor(desc));
  47475. return true;
  47476. };
  47477. /***/ }),
  47478. /***/ "wx14":
  47479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47480. "use strict";
  47481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  47482. function _extends() {
  47483. _extends = Object.assign || function (target) {
  47484. for (var i = 1; i < arguments.length; i++) {
  47485. var source = arguments[i];
  47486. for (var key in source) {
  47487. if (Object.prototype.hasOwnProperty.call(source, key)) {
  47488. target[key] = source[key];
  47489. }
  47490. }
  47491. }
  47492. return target;
  47493. };
  47494. return _extends.apply(this, arguments);
  47495. }
  47496. /***/ }),
  47497. /***/ "wy2R":
  47498. /***/ (function(module, exports) {
  47499. (function() { module.exports = window["moment"]; }());
  47500. /***/ }),
  47501. /***/ "xCFm":
  47502. /***/ (function(module, exports, __webpack_require__) {
  47503. "use strict";
  47504. var GetIntrinsic = __webpack_require__("rZ7t");
  47505. var $TypeError = GetIntrinsic('%TypeError%');
  47506. var $Number = GetIntrinsic('%Number%');
  47507. var $RegExp = GetIntrinsic('%RegExp%');
  47508. var $parseInteger = GetIntrinsic('%parseInt%');
  47509. var callBound = __webpack_require__("EXo9");
  47510. var regexTester = __webpack_require__("ZbWB");
  47511. var isPrimitive = __webpack_require__("BeK9");
  47512. var $strSlice = callBound('String.prototype.slice');
  47513. var isBinary = regexTester(/^0b[01]+$/i);
  47514. var isOctal = regexTester(/^0o[0-7]+$/i);
  47515. var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
  47516. var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
  47517. var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
  47518. var hasNonWS = regexTester(nonWSregex);
  47519. // whitespace from: https://es5.github.io/#x15.5.4.20
  47520. // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
  47521. var ws = [
  47522. '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
  47523. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
  47524. '\u2029\uFEFF'
  47525. ].join('');
  47526. var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
  47527. var $replace = callBound('String.prototype.replace');
  47528. var $trim = function (value) {
  47529. return $replace(value, trimRegex, '');
  47530. };
  47531. var ToPrimitive = __webpack_require__("L7Wv");
  47532. // https://ecma-international.org/ecma-262/6.0/#sec-tonumber
  47533. module.exports = function ToNumber(argument) {
  47534. var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
  47535. if (typeof value === 'symbol') {
  47536. throw new $TypeError('Cannot convert a Symbol value to a number');
  47537. }
  47538. if (typeof value === 'bigint') {
  47539. throw new $TypeError('Conversion from \'BigInt\' to \'number\' is not allowed.');
  47540. }
  47541. if (typeof value === 'string') {
  47542. if (isBinary(value)) {
  47543. return ToNumber($parseInteger($strSlice(value, 2), 2));
  47544. } else if (isOctal(value)) {
  47545. return ToNumber($parseInteger($strSlice(value, 2), 8));
  47546. } else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
  47547. return NaN;
  47548. } else {
  47549. var trimmed = $trim(value);
  47550. if (trimmed !== value) {
  47551. return ToNumber(trimmed);
  47552. }
  47553. }
  47554. }
  47555. return $Number(value);
  47556. };
  47557. /***/ }),
  47558. /***/ "xEte":
  47559. /***/ (function(module, exports, __webpack_require__) {
  47560. "use strict";
  47561. Object.defineProperty(exports, "__esModule", {
  47562. value: true
  47563. });
  47564. var _react = __webpack_require__("cDcd");
  47565. var _react2 = _interopRequireDefault(_react);
  47566. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  47567. var CloseButton = function () {
  47568. function CloseButton(props) {
  47569. return _react2['default'].createElement(
  47570. 'svg',
  47571. props,
  47572. _react2['default'].createElement('path', {
  47573. fillRule: 'evenodd',
  47574. d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'
  47575. })
  47576. );
  47577. }
  47578. return CloseButton;
  47579. }();
  47580. CloseButton.defaultProps = {
  47581. viewBox: '0 0 12 12'
  47582. };
  47583. exports['default'] = CloseButton;
  47584. /***/ }),
  47585. /***/ "xOhs":
  47586. /***/ (function(module, exports, __webpack_require__) {
  47587. "use strict";
  47588. Object.defineProperty(exports, "__esModule", {
  47589. value: true
  47590. });
  47591. var core = {
  47592. white: '#fff',
  47593. gray: '#484848',
  47594. grayLight: '#82888a',
  47595. grayLighter: '#cacccd',
  47596. grayLightest: '#f2f2f2',
  47597. borderMedium: '#c4c4c4',
  47598. border: '#dbdbdb',
  47599. borderLight: '#e4e7e7',
  47600. borderLighter: '#eceeee',
  47601. borderBright: '#f4f5f5',
  47602. primary: '#00a699',
  47603. primaryShade_1: '#33dacd',
  47604. primaryShade_2: '#66e2da',
  47605. primaryShade_3: '#80e8e0',
  47606. primaryShade_4: '#b2f1ec',
  47607. primary_dark: '#008489',
  47608. secondary: '#007a87',
  47609. yellow: '#ffe8bc',
  47610. yellow_dark: '#ffce71'
  47611. };
  47612. exports['default'] = {
  47613. reactDates: {
  47614. zIndex: 0,
  47615. border: {
  47616. input: {
  47617. border: 0,
  47618. borderTop: 0,
  47619. borderRight: 0,
  47620. borderBottom: '2px solid transparent',
  47621. borderLeft: 0,
  47622. outlineFocused: 0,
  47623. borderFocused: 0,
  47624. borderTopFocused: 0,
  47625. borderLeftFocused: 0,
  47626. borderBottomFocused: '2px solid ' + String(core.primary_dark),
  47627. borderRightFocused: 0,
  47628. borderRadius: 0
  47629. },
  47630. pickerInput: {
  47631. borderWidth: 1,
  47632. borderStyle: 'solid',
  47633. borderRadius: 2
  47634. }
  47635. },
  47636. color: {
  47637. core: core,
  47638. disabled: core.grayLightest,
  47639. background: core.white,
  47640. backgroundDark: '#f2f2f2',
  47641. backgroundFocused: core.white,
  47642. border: 'rgb(219, 219, 219)',
  47643. text: core.gray,
  47644. textDisabled: core.border,
  47645. textFocused: '#007a87',
  47646. placeholderText: '#757575',
  47647. outside: {
  47648. backgroundColor: core.white,
  47649. backgroundColor_active: core.white,
  47650. backgroundColor_hover: core.white,
  47651. color: core.gray,
  47652. color_active: core.gray,
  47653. color_hover: core.gray
  47654. },
  47655. highlighted: {
  47656. backgroundColor: core.yellow,
  47657. backgroundColor_active: core.yellow_dark,
  47658. backgroundColor_hover: core.yellow_dark,
  47659. color: core.gray,
  47660. color_active: core.gray,
  47661. color_hover: core.gray
  47662. },
  47663. minimumNights: {
  47664. backgroundColor: core.white,
  47665. backgroundColor_active: core.white,
  47666. backgroundColor_hover: core.white,
  47667. borderColor: core.borderLighter,
  47668. color: core.grayLighter,
  47669. color_active: core.grayLighter,
  47670. color_hover: core.grayLighter
  47671. },
  47672. hoveredSpan: {
  47673. backgroundColor: core.primaryShade_4,
  47674. backgroundColor_active: core.primaryShade_3,
  47675. backgroundColor_hover: core.primaryShade_4,
  47676. borderColor: core.primaryShade_3,
  47677. borderColor_active: core.primaryShade_3,
  47678. borderColor_hover: core.primaryShade_3,
  47679. color: core.secondary,
  47680. color_active: core.secondary,
  47681. color_hover: core.secondary
  47682. },
  47683. selectedSpan: {
  47684. backgroundColor: core.primaryShade_2,
  47685. backgroundColor_active: core.primaryShade_1,
  47686. backgroundColor_hover: core.primaryShade_1,
  47687. borderColor: core.primaryShade_1,
  47688. borderColor_active: core.primary,
  47689. borderColor_hover: core.primary,
  47690. color: core.white,
  47691. color_active: core.white,
  47692. color_hover: core.white
  47693. },
  47694. selected: {
  47695. backgroundColor: core.primary,
  47696. backgroundColor_active: core.primary,
  47697. backgroundColor_hover: core.primary,
  47698. borderColor: core.primary,
  47699. borderColor_active: core.primary,
  47700. borderColor_hover: core.primary,
  47701. color: core.white,
  47702. color_active: core.white,
  47703. color_hover: core.white
  47704. },
  47705. blocked_calendar: {
  47706. backgroundColor: core.grayLighter,
  47707. backgroundColor_active: core.grayLighter,
  47708. backgroundColor_hover: core.grayLighter,
  47709. borderColor: core.grayLighter,
  47710. borderColor_active: core.grayLighter,
  47711. borderColor_hover: core.grayLighter,
  47712. color: core.grayLight,
  47713. color_active: core.grayLight,
  47714. color_hover: core.grayLight
  47715. },
  47716. blocked_out_of_range: {
  47717. backgroundColor: core.white,
  47718. backgroundColor_active: core.white,
  47719. backgroundColor_hover: core.white,
  47720. borderColor: core.borderLight,
  47721. borderColor_active: core.borderLight,
  47722. borderColor_hover: core.borderLight,
  47723. color: core.grayLighter,
  47724. color_active: core.grayLighter,
  47725. color_hover: core.grayLighter
  47726. }
  47727. },
  47728. spacing: {
  47729. dayPickerHorizontalPadding: 9,
  47730. captionPaddingTop: 22,
  47731. captionPaddingBottom: 37,
  47732. inputPadding: 0,
  47733. displayTextPaddingVertical: undefined,
  47734. displayTextPaddingTop: 11,
  47735. displayTextPaddingBottom: 9,
  47736. displayTextPaddingHorizontal: undefined,
  47737. displayTextPaddingLeft: 11,
  47738. displayTextPaddingRight: 11,
  47739. displayTextPaddingVertical_small: undefined,
  47740. displayTextPaddingTop_small: 7,
  47741. displayTextPaddingBottom_small: 5,
  47742. displayTextPaddingHorizontal_small: undefined,
  47743. displayTextPaddingLeft_small: 7,
  47744. displayTextPaddingRight_small: 7
  47745. },
  47746. sizing: {
  47747. inputWidth: 130,
  47748. inputWidth_small: 97,
  47749. arrowWidth: 24
  47750. },
  47751. noScrollBarOnVerticalScrollable: false,
  47752. font: {
  47753. size: 14,
  47754. captionSize: 18,
  47755. input: {
  47756. size: 19,
  47757. lineHeight: '24px',
  47758. size_small: 15,
  47759. lineHeight_small: '18px',
  47760. letterSpacing_small: '0.2px',
  47761. styleDisabled: 'italic'
  47762. }
  47763. }
  47764. }
  47765. };
  47766. /***/ }),
  47767. /***/ "xoj2":
  47768. /***/ (function(module, exports, __webpack_require__) {
  47769. "use strict";
  47770. var implementation = __webpack_require__("rQy3");
  47771. module.exports = function getPolyfill() {
  47772. return typeof Object.values === 'function' ? Object.values : implementation;
  47773. };
  47774. /***/ }),
  47775. /***/ "y9oe":
  47776. /***/ (function(module, exports, __webpack_require__) {
  47777. "use strict";
  47778. var GetIntrinsic = __webpack_require__("rZ7t");
  47779. var $TypeError = GetIntrinsic('%TypeError%');
  47780. var Get = __webpack_require__("3aeR");
  47781. var ToLength = __webpack_require__("w3Ut");
  47782. var Type = __webpack_require__("V1cy");
  47783. // https://262.ecma-international.org/11.0/#sec-lengthofarraylike
  47784. module.exports = function LengthOfArrayLike(obj) {
  47785. if (Type(obj) !== 'Object') {
  47786. throw new $TypeError('Assertion failed: `obj` must be an Object');
  47787. }
  47788. return ToLength(Get(obj, 'length'));
  47789. };
  47790. // TODO: use this all over
  47791. /***/ }),
  47792. /***/ "yLpj":
  47793. /***/ (function(module, exports) {
  47794. var g;
  47795. // This works in non-strict mode
  47796. g = (function() {
  47797. return this;
  47798. })();
  47799. try {
  47800. // This works if eval is allowed (see CSP)
  47801. g = g || new Function("return this")();
  47802. } catch (e) {
  47803. // This works if the window reference is available
  47804. if (typeof window === "object") g = window;
  47805. }
  47806. // g can still be undefined, but nothing to do about it...
  47807. // We return undefined, instead of nothing here, so it's
  47808. // easier to handle this case. if(!global) { ...}
  47809. module.exports = g;
  47810. /***/ }),
  47811. /***/ "yLpt":
  47812. /***/ (function(module, exports, __webpack_require__) {
  47813. "use strict";
  47814. var implementation = __webpack_require__("FufO");
  47815. var lacksProperEnumerationOrder = function () {
  47816. if (!Object.assign) {
  47817. return false;
  47818. }
  47819. /*
  47820. * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
  47821. * note: this does not detect the bug unless there's 20 characters
  47822. */
  47823. var str = 'abcdefghijklmnopqrst';
  47824. var letters = str.split('');
  47825. var map = {};
  47826. for (var i = 0; i < letters.length; ++i) {
  47827. map[letters[i]] = letters[i];
  47828. }
  47829. var obj = Object.assign({}, map);
  47830. var actual = '';
  47831. for (var k in obj) {
  47832. actual += k;
  47833. }
  47834. return str !== actual;
  47835. };
  47836. var assignHasPendingExceptions = function () {
  47837. if (!Object.assign || !Object.preventExtensions) {
  47838. return false;
  47839. }
  47840. /*
  47841. * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
  47842. * which is 72% slower than our shim, and Firefox 40's native implementation.
  47843. */
  47844. var thrower = Object.preventExtensions({ 1: 2 });
  47845. try {
  47846. Object.assign(thrower, 'xy');
  47847. } catch (e) {
  47848. return thrower[1] === 'y';
  47849. }
  47850. return false;
  47851. };
  47852. module.exports = function getPolyfill() {
  47853. if (!Object.assign) {
  47854. return implementation;
  47855. }
  47856. if (lacksProperEnumerationOrder()) {
  47857. return implementation;
  47858. }
  47859. if (assignHasPendingExceptions()) {
  47860. return implementation;
  47861. }
  47862. return Object.assign;
  47863. };
  47864. /***/ }),
  47865. /***/ "yN6O":
  47866. /***/ (function(module, exports, __webpack_require__) {
  47867. "use strict";
  47868. var ArraySpeciesCreate = __webpack_require__("7Ji+");
  47869. var FlattenIntoArray = __webpack_require__("iz0l");
  47870. var Get = __webpack_require__("3aeR");
  47871. var ToInteger = __webpack_require__("ddK1");
  47872. var ToLength = __webpack_require__("w3Ut");
  47873. var ToObject = __webpack_require__("sA9S");
  47874. module.exports = function flat() {
  47875. var O = ToObject(this);
  47876. var sourceLen = ToLength(Get(O, 'length'));
  47877. var depthNum = 1;
  47878. if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
  47879. depthNum = ToInteger(arguments[0]);
  47880. }
  47881. var A = ArraySpeciesCreate(O, 0);
  47882. FlattenIntoArray(A, O, sourceLen, 0, depthNum);
  47883. return A;
  47884. };
  47885. /***/ }),
  47886. /***/ "yc2e":
  47887. /***/ (function(module, exports, __webpack_require__) {
  47888. "use strict";
  47889. Object.defineProperty(exports, "__esModule", {
  47890. value: true
  47891. });
  47892. exports['default'] = getPhrasePropTypes;
  47893. var _object = __webpack_require__("Koq/");
  47894. var _object2 = _interopRequireDefault(_object);
  47895. var _propTypes = __webpack_require__("17x9");
  47896. var _propTypes2 = _interopRequireDefault(_propTypes);
  47897. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  47898. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  47899. function getPhrasePropTypes(defaultPhrases) {
  47900. return Object.keys(defaultPhrases).reduce(function (phrases, key) {
  47901. return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));
  47902. }, {});
  47903. }
  47904. /***/ }),
  47905. /***/ "ym77":
  47906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47907. "use strict";
  47908. /* unused harmony export unstable_Id */
  47909. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_useId; });
  47910. /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
  47911. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
  47912. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
  47913. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
  47914. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  47915. /* harmony import */ var _IdProvider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("KCH1");
  47916. // Automatically generated
  47917. var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"];
  47918. var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]);
  47919. var unstable_useId = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
  47920. keys: ID_KEYS,
  47921. useOptions: function useOptions(options, htmlProps) {
  47922. var generateId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_IdProvider_js__WEBPACK_IMPORTED_MODULE_4__[/* unstable_IdContext */ "a"]);
  47923. var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(function () {
  47924. // This comes from useIdState
  47925. if (options.unstable_idCountRef) {
  47926. options.unstable_idCountRef.current += 1;
  47927. return "-" + options.unstable_idCountRef.current;
  47928. } // If there's no useIdState, we check if `baseId` was passed (as a prop,
  47929. // not from useIdState).
  47930. if (options.baseId) {
  47931. return "-" + generateId("");
  47932. }
  47933. return "";
  47934. }),
  47935. suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState.
  47936. // If there's neither, then it'll fallback to Context's generateId.
  47937. // This generateId can result in a sequential ID (if there's a Provider)
  47938. // or a random string (without Provider).
  47939. var baseId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
  47940. return options.baseId || generateId();
  47941. }, [options.baseId, generateId]);
  47942. var id = htmlProps.id || options.id || "" + baseId + suffix;
  47943. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, {
  47944. id: id
  47945. });
  47946. },
  47947. useProps: function useProps(options, htmlProps) {
  47948. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
  47949. id: options.id
  47950. }, htmlProps);
  47951. }
  47952. });
  47953. var unstable_Id = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
  47954. as: "div",
  47955. useHook: unstable_useId
  47956. });
  47957. /***/ }),
  47958. /***/ "yy3d":
  47959. /***/ (function(module, exports, __webpack_require__) {
  47960. "use strict";
  47961. var GetIntrinsic = __webpack_require__("rZ7t");
  47962. var $match = GetIntrinsic('%Symbol.match%', true);
  47963. var hasRegExpMatcher = __webpack_require__("SegQ");
  47964. var ToBoolean = __webpack_require__("kvlw");
  47965. // https://ecma-international.org/ecma-262/6.0/#sec-isregexp
  47966. module.exports = function IsRegExp(argument) {
  47967. if (!argument || typeof argument !== 'object') {
  47968. return false;
  47969. }
  47970. if ($match) {
  47971. var isRegExp = argument[$match];
  47972. if (typeof isRegExp !== 'undefined') {
  47973. return ToBoolean(isRegExp);
  47974. }
  47975. }
  47976. return hasRegExpMatcher(argument);
  47977. };
  47978. /***/ }),
  47979. /***/ "yyeE":
  47980. /***/ (function(module, exports, __webpack_require__) {
  47981. "use strict";
  47982. var GetIntrinsic = __webpack_require__("rZ7t");
  47983. var $Math = GetIntrinsic('%Math%');
  47984. var $Number = GetIntrinsic('%Number%');
  47985. module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1;
  47986. /***/ }),
  47987. /***/ "z3X9":
  47988. /***/ (function(module, exports, __webpack_require__) {
  47989. "use strict";
  47990. var has = __webpack_require__("oNNP");
  47991. var assertRecord = __webpack_require__("10Kj");
  47992. var Type = __webpack_require__("V1cy");
  47993. // https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
  47994. module.exports = function IsAccessorDescriptor(Desc) {
  47995. if (typeof Desc === 'undefined') {
  47996. return false;
  47997. }
  47998. assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
  47999. if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
  48000. return false;
  48001. }
  48002. return true;
  48003. };
  48004. /***/ }),
  48005. /***/ "z9I/":
  48006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48007. "use strict";
  48008. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StyleSheet; });
  48009. /*
  48010. Based off glamor's StyleSheet, thanks Sunil ❤️
  48011. high performance StyleSheet for css-in-js systems
  48012. - uses multiple style tags behind the scenes for millions of rules
  48013. - uses `insertRule` for appending in production for *much* faster performance
  48014. // usage
  48015. import { StyleSheet } from '@emotion/sheet'
  48016. let styleSheet = new StyleSheet({ key: '', container: document.head })
  48017. styleSheet.insert('#box { border: 1px solid red; }')
  48018. - appends a css rule into the stylesheet
  48019. styleSheet.flush()
  48020. - empties the stylesheet of all its contents
  48021. */
  48022. // $FlowFixMe
  48023. function sheetForTag(tag) {
  48024. if (tag.sheet) {
  48025. // $FlowFixMe
  48026. return tag.sheet;
  48027. } // this weirdness brought to you by firefox
  48028. /* istanbul ignore next */
  48029. for (var i = 0; i < document.styleSheets.length; i++) {
  48030. if (document.styleSheets[i].ownerNode === tag) {
  48031. // $FlowFixMe
  48032. return document.styleSheets[i];
  48033. }
  48034. }
  48035. }
  48036. function createStyleElement(options) {
  48037. var tag = document.createElement('style');
  48038. tag.setAttribute('data-emotion', options.key);
  48039. if (options.nonce !== undefined) {
  48040. tag.setAttribute('nonce', options.nonce);
  48041. }
  48042. tag.appendChild(document.createTextNode(''));
  48043. return tag;
  48044. }
  48045. var StyleSheet =
  48046. /*#__PURE__*/
  48047. function () {
  48048. function StyleSheet(options) {
  48049. this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
  48050. this.tags = [];
  48051. this.ctr = 0;
  48052. this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
  48053. this.key = options.key;
  48054. this.container = options.container;
  48055. this.before = null;
  48056. }
  48057. var _proto = StyleSheet.prototype;
  48058. _proto.insert = function insert(rule) {
  48059. // the max length is how many rules we have per style tag, it's 65000 in speedy mode
  48060. // it's 1 in dev because we insert source maps that map a single rule to a location
  48061. // and you can only have one source map per style tag
  48062. if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
  48063. var _tag = createStyleElement(this);
  48064. var before;
  48065. if (this.tags.length === 0) {
  48066. before = this.before;
  48067. } else {
  48068. before = this.tags[this.tags.length - 1].nextSibling;
  48069. }
  48070. this.container.insertBefore(_tag, before);
  48071. this.tags.push(_tag);
  48072. }
  48073. var tag = this.tags[this.tags.length - 1];
  48074. if (this.isSpeedy) {
  48075. var sheet = sheetForTag(tag);
  48076. try {
  48077. // this is a really hot path
  48078. // we check the second character first because having "i"
  48079. // as the second character will happen less often than
  48080. // having "@" as the first character
  48081. var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
  48082. // the big drawback is that the css won't be editable in devtools
  48083. sheet.insertRule(rule, // we need to insert @import rules before anything else
  48084. // otherwise there will be an error
  48085. // technically this means that the @import rules will
  48086. // _usually_(not always since there could be multiple style tags)
  48087. // be the first ones in prod and generally later in dev
  48088. // this shouldn't really matter in the real world though
  48089. // @import is generally only used for font faces from google fonts and etc.
  48090. // so while this could be technically correct then it would be slower and larger
  48091. // for a tiny bit of correctness that won't matter in the real world
  48092. isImportRule ? 0 : sheet.cssRules.length);
  48093. } catch (e) {
  48094. if (false) {}
  48095. }
  48096. } else {
  48097. tag.appendChild(document.createTextNode(rule));
  48098. }
  48099. this.ctr++;
  48100. };
  48101. _proto.flush = function flush() {
  48102. // $FlowFixMe
  48103. this.tags.forEach(function (tag) {
  48104. return tag.parentNode.removeChild(tag);
  48105. });
  48106. this.tags = [];
  48107. this.ctr = 0;
  48108. };
  48109. return StyleSheet;
  48110. }();
  48111. /***/ }),
  48112. /***/ "zGFp":
  48113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48114. "use strict";
  48115. /* unused harmony export Role */
  48116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useRole; });
  48117. /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
  48118. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
  48119. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
  48120. /* harmony import */ var reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("uqqE");
  48121. // Automatically generated
  48122. var ROLE_KEYS = ["unstable_system"];
  48123. var useRole = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
  48124. name: "Role",
  48125. keys: ROLE_KEYS,
  48126. propsAreEqual: function propsAreEqual(prev, next) {
  48127. var prevSystem = prev.unstable_system,
  48128. prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["unstable_system"]);
  48129. var nextSystem = next.unstable_system,
  48130. nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["unstable_system"]);
  48131. if (prevSystem !== nextSystem && !Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevSystem, nextSystem)) {
  48132. return false;
  48133. }
  48134. return Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevProps, nextProps);
  48135. }
  48136. });
  48137. var Role = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
  48138. as: "div",
  48139. useHook: useRole
  48140. });
  48141. /***/ }),
  48142. /***/ "zN8g":
  48143. /***/ (function(module, exports, __webpack_require__) {
  48144. "use strict";
  48145. Object.defineProperty(exports, "__esModule", {
  48146. value: true
  48147. });
  48148. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  48149. var _object = __webpack_require__("Koq/");
  48150. var _object2 = _interopRequireDefault(_object);
  48151. var _react = __webpack_require__("cDcd");
  48152. var _react2 = _interopRequireDefault(_react);
  48153. var _propTypes = __webpack_require__("17x9");
  48154. var _propTypes2 = _interopRequireDefault(_propTypes);
  48155. var _airbnbPropTypes = __webpack_require__("Hsqg");
  48156. var _reactWithStyles = __webpack_require__("TG4+");
  48157. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  48158. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  48159. unicode: _propTypes2['default'].string.isRequired,
  48160. label: _propTypes2['default'].string.isRequired,
  48161. action: _propTypes2['default'].string.isRequired,
  48162. block: _propTypes2['default'].bool
  48163. }));
  48164. var defaultProps = {
  48165. block: false
  48166. };
  48167. function KeyboardShortcutRow(_ref) {
  48168. var unicode = _ref.unicode,
  48169. label = _ref.label,
  48170. action = _ref.action,
  48171. block = _ref.block,
  48172. styles = _ref.styles;
  48173. return _react2['default'].createElement(
  48174. 'li',
  48175. (0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block),
  48176. _react2['default'].createElement(
  48177. 'div',
  48178. (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block),
  48179. _react2['default'].createElement(
  48180. 'span',
  48181. _extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), {
  48182. role: 'img',
  48183. 'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action
  48184. }),
  48185. unicode
  48186. )
  48187. ),
  48188. _react2['default'].createElement(
  48189. 'div',
  48190. (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action),
  48191. action
  48192. )
  48193. );
  48194. }
  48195. KeyboardShortcutRow.propTypes = propTypes;
  48196. KeyboardShortcutRow.defaultProps = defaultProps;
  48197. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
  48198. var color = _ref2.reactDates.color;
  48199. return {
  48200. KeyboardShortcutRow: {
  48201. listStyle: 'none',
  48202. margin: '6px 0'
  48203. },
  48204. KeyboardShortcutRow__block: {
  48205. marginBottom: 16
  48206. },
  48207. KeyboardShortcutRow_keyContainer: {
  48208. display: 'inline-block',
  48209. whiteSpace: 'nowrap',
  48210. textAlign: 'right',
  48211. marginRight: 6
  48212. },
  48213. KeyboardShortcutRow_keyContainer__block: {
  48214. textAlign: 'left',
  48215. display: 'inline'
  48216. },
  48217. KeyboardShortcutRow_key: {
  48218. fontFamily: 'monospace',
  48219. fontSize: 12,
  48220. textTransform: 'uppercase',
  48221. background: color.core.grayLightest,
  48222. padding: '2px 6px'
  48223. },
  48224. KeyboardShortcutRow_action: {
  48225. display: 'inline',
  48226. wordBreak: 'break-word',
  48227. marginLeft: 8
  48228. }
  48229. };
  48230. })(KeyboardShortcutRow);
  48231. /***/ }),
  48232. /***/ "zTEx":
  48233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48234. "use strict";
  48235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarItem; });
  48236. /* unused harmony export useToolbarItem */
  48237. /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("hE48");
  48238. /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("qdes");
  48239. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("cDcd");
  48240. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  48241. /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("KA1K");
  48242. /* harmony import */ var _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("kTC8");
  48243. /* harmony import */ var _keys_ae468c11_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("mjVI");
  48244. var useToolbarItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_1__[/* createHook */ "a"])({
  48245. name: "ToolbarItem",
  48246. compose: _Composite_CompositeItem_js__WEBPACK_IMPORTED_MODULE_4__[/* useCompositeItem */ "b"],
  48247. keys: _keys_ae468c11_js__WEBPACK_IMPORTED_MODULE_5__[/* a */ "b"]
  48248. });
  48249. var ToolbarItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_0__[/* createComponent */ "a"])({
  48250. as: "button",
  48251. memo: true,
  48252. useHook: useToolbarItem
  48253. });
  48254. /***/ }),
  48255. /***/ "zYbv":
  48256. /***/ (function(module, exports, __webpack_require__) {
  48257. "use strict";
  48258. var assertRecord = __webpack_require__("10Kj");
  48259. var Type = __webpack_require__("V1cy");
  48260. // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
  48261. module.exports = function FromPropertyDescriptor(Desc) {
  48262. if (typeof Desc === 'undefined') {
  48263. return Desc;
  48264. }
  48265. assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
  48266. var obj = {};
  48267. if ('[[Value]]' in Desc) {
  48268. obj.value = Desc['[[Value]]'];
  48269. }
  48270. if ('[[Writable]]' in Desc) {
  48271. obj.writable = Desc['[[Writable]]'];
  48272. }
  48273. if ('[[Get]]' in Desc) {
  48274. obj.get = Desc['[[Get]]'];
  48275. }
  48276. if ('[[Set]]' in Desc) {
  48277. obj.set = Desc['[[Set]]'];
  48278. }
  48279. if ('[[Enumerable]]' in Desc) {
  48280. obj.enumerable = Desc['[[Enumerable]]'];
  48281. }
  48282. if ('[[Configurable]]' in Desc) {
  48283. obj.configurable = Desc['[[Configurable]]'];
  48284. }
  48285. return obj;
  48286. };
  48287. /***/ }),
  48288. /***/ "zfJ5":
  48289. /***/ (function(module, exports, __webpack_require__) {
  48290. "use strict";
  48291. Object.defineProperty(exports, "__esModule", {
  48292. value: true
  48293. });
  48294. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  48295. var _object = __webpack_require__("Koq/");
  48296. var _object2 = _interopRequireDefault(_object);
  48297. var _react = __webpack_require__("cDcd");
  48298. var _react2 = _interopRequireDefault(_react);
  48299. var _propTypes = __webpack_require__("17x9");
  48300. var _propTypes2 = _interopRequireDefault(_propTypes);
  48301. var _airbnbPropTypes = __webpack_require__("Hsqg");
  48302. var _reactWithStyles = __webpack_require__("TG4+");
  48303. var _defaultPhrases = __webpack_require__("vV+G");
  48304. var _getPhrasePropTypes = __webpack_require__("yc2e");
  48305. var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
  48306. var _LeftArrow = __webpack_require__("0XP8");
  48307. var _LeftArrow2 = _interopRequireDefault(_LeftArrow);
  48308. var _RightArrow = __webpack_require__("gZI3");
  48309. var _RightArrow2 = _interopRequireDefault(_RightArrow);
  48310. var _ChevronUp = __webpack_require__("9gmn");
  48311. var _ChevronUp2 = _interopRequireDefault(_ChevronUp);
  48312. var _ChevronDown = __webpack_require__("DHWS");
  48313. var _ChevronDown2 = _interopRequireDefault(_ChevronDown);
  48314. var _ScrollableOrientationShape = __webpack_require__("aE6U");
  48315. var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
  48316. var _constants = __webpack_require__("Fv1B");
  48317. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  48318. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  48319. var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
  48320. navPrev: _propTypes2['default'].node,
  48321. navNext: _propTypes2['default'].node,
  48322. orientation: _ScrollableOrientationShape2['default'],
  48323. onPrevMonthClick: _propTypes2['default'].func,
  48324. onNextMonthClick: _propTypes2['default'].func,
  48325. // internationalization
  48326. phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)),
  48327. isRTL: _propTypes2['default'].bool
  48328. }));
  48329. var defaultProps = {
  48330. navPrev: null,
  48331. navNext: null,
  48332. orientation: _constants.HORIZONTAL_ORIENTATION,
  48333. onPrevMonthClick: function () {
  48334. function onPrevMonthClick() {}
  48335. return onPrevMonthClick;
  48336. }(),
  48337. onNextMonthClick: function () {
  48338. function onNextMonthClick() {}
  48339. return onNextMonthClick;
  48340. }(),
  48341. // internationalization
  48342. phrases: _defaultPhrases.DayPickerNavigationPhrases,
  48343. isRTL: false
  48344. };
  48345. function DayPickerNavigation(_ref) {
  48346. var navPrev = _ref.navPrev,
  48347. navNext = _ref.navNext,
  48348. onPrevMonthClick = _ref.onPrevMonthClick,
  48349. onNextMonthClick = _ref.onNextMonthClick,
  48350. orientation = _ref.orientation,
  48351. phrases = _ref.phrases,
  48352. isRTL = _ref.isRTL,
  48353. styles = _ref.styles;
  48354. var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
  48355. var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION;
  48356. var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
  48357. var navPrevIcon = navPrev;
  48358. var navNextIcon = navNext;
  48359. var isDefaultNavPrev = false;
  48360. var isDefaultNavNext = false;
  48361. if (!navPrevIcon) {
  48362. isDefaultNavPrev = true;
  48363. var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default'];
  48364. if (isRTL && !isVertical) {
  48365. Icon = _RightArrow2['default'];
  48366. }
  48367. navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
  48368. }
  48369. if (!navNextIcon) {
  48370. isDefaultNavNext = true;
  48371. var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default'];
  48372. if (isRTL && !isVertical) {
  48373. _Icon = _LeftArrow2['default'];
  48374. }
  48375. navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
  48376. }
  48377. var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev;
  48378. return _react2['default'].createElement(
  48379. 'div',
  48380. _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))),
  48381. !isVerticalScrollable && _react2['default'].createElement(
  48382. 'div',
  48383. _extends({
  48384. role: 'button',
  48385. tabIndex: '0'
  48386. }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), {
  48387. 'aria-label': phrases.jumpToPrevMonth,
  48388. onClick: onPrevMonthClick,
  48389. onKeyUp: function () {
  48390. function onKeyUp(e) {
  48391. var key = e.key;
  48392. if (key === 'Enter' || key === ' ') onPrevMonthClick(e);
  48393. }
  48394. return onKeyUp;
  48395. }(),
  48396. onMouseUp: function () {
  48397. function onMouseUp(e) {
  48398. e.currentTarget.blur();
  48399. }
  48400. return onMouseUp;
  48401. }()
  48402. }),
  48403. navPrevIcon
  48404. ),
  48405. _react2['default'].createElement(
  48406. 'div',
  48407. _extends({
  48408. role: 'button',
  48409. tabIndex: '0'
  48410. }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), {
  48411. 'aria-label': phrases.jumpToNextMonth,
  48412. onClick: onNextMonthClick,
  48413. onKeyUp: function () {
  48414. function onKeyUp(e) {
  48415. var key = e.key;
  48416. if (key === 'Enter' || key === ' ') onNextMonthClick(e);
  48417. }
  48418. return onKeyUp;
  48419. }(),
  48420. onMouseUp: function () {
  48421. function onMouseUp(e) {
  48422. e.currentTarget.blur();
  48423. }
  48424. return onMouseUp;
  48425. }()
  48426. }),
  48427. navNextIcon
  48428. )
  48429. );
  48430. }
  48431. DayPickerNavigation.propTypes = propTypes;
  48432. DayPickerNavigation.defaultProps = defaultProps;
  48433. exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
  48434. var _ref2$reactDates = _ref2.reactDates,
  48435. color = _ref2$reactDates.color,
  48436. zIndex = _ref2$reactDates.zIndex;
  48437. return {
  48438. DayPickerNavigation: {
  48439. position: 'relative',
  48440. zIndex: zIndex + 2
  48441. },
  48442. DayPickerNavigation__horizontal: {
  48443. height: 0
  48444. },
  48445. DayPickerNavigation__vertical: {},
  48446. DayPickerNavigation__verticalScrollable: {},
  48447. DayPickerNavigation__verticalDefault: {
  48448. position: 'absolute',
  48449. width: '100%',
  48450. height: 52,
  48451. bottom: 0,
  48452. left: 0
  48453. },
  48454. DayPickerNavigation__verticalScrollableDefault: {
  48455. position: 'relative'
  48456. },
  48457. DayPickerNavigation_button: {
  48458. cursor: 'pointer',
  48459. userSelect: 'none',
  48460. border: 0,
  48461. padding: 0,
  48462. margin: 0
  48463. },
  48464. DayPickerNavigation_button__default: {
  48465. border: '1px solid ' + String(color.core.borderLight),
  48466. backgroundColor: color.background,
  48467. color: color.placeholderText,
  48468. ':focus': {
  48469. border: '1px solid ' + String(color.core.borderMedium)
  48470. },
  48471. ':hover': {
  48472. border: '1px solid ' + String(color.core.borderMedium)
  48473. },
  48474. ':active': {
  48475. background: color.backgroundDark
  48476. }
  48477. },
  48478. DayPickerNavigation_button__horizontal: {},
  48479. DayPickerNavigation_button__horizontalDefault: {
  48480. position: 'absolute',
  48481. top: 18,
  48482. lineHeight: 0.78,
  48483. borderRadius: 3,
  48484. padding: '6px 9px'
  48485. },
  48486. DayPickerNavigation_leftButton__horizontalDefault: {
  48487. left: 22
  48488. },
  48489. DayPickerNavigation_rightButton__horizontalDefault: {
  48490. right: 22
  48491. },
  48492. DayPickerNavigation_button__vertical: {},
  48493. DayPickerNavigation_button__verticalDefault: {
  48494. padding: 5,
  48495. background: color.background,
  48496. boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)',
  48497. position: 'relative',
  48498. display: 'inline-block',
  48499. height: '100%',
  48500. width: '50%'
  48501. },
  48502. DayPickerNavigation_prevButton__verticalDefault: {},
  48503. DayPickerNavigation_nextButton__verticalDefault: {
  48504. borderLeft: 0
  48505. },
  48506. DayPickerNavigation_nextButton__verticalScrollableDefault: {
  48507. width: '100%'
  48508. },
  48509. DayPickerNavigation_svg__horizontal: {
  48510. height: 19,
  48511. width: 19,
  48512. fill: color.core.grayLight,
  48513. display: 'block'
  48514. },
  48515. DayPickerNavigation_svg__vertical: {
  48516. height: 42,
  48517. width: 42,
  48518. fill: color.text,
  48519. display: 'block'
  48520. }
  48521. };
  48522. })(DayPickerNavigation);
  48523. /***/ }),
  48524. /***/ "zt9T":
  48525. /***/ (function(module, exports, __webpack_require__) {
  48526. "use strict";
  48527. var util = __webpack_require__("jB5C");
  48528. function scrollIntoView(elem, container, config) {
  48529. config = config || {};
  48530. // document 归一化到 window
  48531. if (container.nodeType === 9) {
  48532. container = util.getWindow(container);
  48533. }
  48534. var allowHorizontalScroll = config.allowHorizontalScroll;
  48535. var onlyScrollIfNeeded = config.onlyScrollIfNeeded;
  48536. var alignWithTop = config.alignWithTop;
  48537. var alignWithLeft = config.alignWithLeft;
  48538. var offsetTop = config.offsetTop || 0;
  48539. var offsetLeft = config.offsetLeft || 0;
  48540. var offsetBottom = config.offsetBottom || 0;
  48541. var offsetRight = config.offsetRight || 0;
  48542. allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
  48543. var isWin = util.isWindow(container);
  48544. var elemOffset = util.offset(elem);
  48545. var eh = util.outerHeight(elem);
  48546. var ew = util.outerWidth(elem);
  48547. var containerOffset = undefined;
  48548. var ch = undefined;
  48549. var cw = undefined;
  48550. var containerScroll = undefined;
  48551. var diffTop = undefined;
  48552. var diffBottom = undefined;
  48553. var win = undefined;
  48554. var winScroll = undefined;
  48555. var ww = undefined;
  48556. var wh = undefined;
  48557. if (isWin) {
  48558. win = container;
  48559. wh = util.height(win);
  48560. ww = util.width(win);
  48561. winScroll = {
  48562. left: util.scrollLeft(win),
  48563. top: util.scrollTop(win)
  48564. };
  48565. // elem 相对 container 可视视窗的距离
  48566. diffTop = {
  48567. left: elemOffset.left - winScroll.left - offsetLeft,
  48568. top: elemOffset.top - winScroll.top - offsetTop
  48569. };
  48570. diffBottom = {
  48571. left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,
  48572. top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom
  48573. };
  48574. containerScroll = winScroll;
  48575. } else {
  48576. containerOffset = util.offset(container);
  48577. ch = container.clientHeight;
  48578. cw = container.clientWidth;
  48579. containerScroll = {
  48580. left: container.scrollLeft,
  48581. top: container.scrollTop
  48582. };
  48583. // elem 相对 container 可视视窗的距离
  48584. // 注意边框, offset 是边框到根节点
  48585. diffTop = {
  48586. left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,
  48587. top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop
  48588. };
  48589. diffBottom = {
  48590. left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,
  48591. top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom
  48592. };
  48593. }
  48594. if (diffTop.top < 0 || diffBottom.top > 0) {
  48595. // 强制向上
  48596. if (alignWithTop === true) {
  48597. util.scrollTop(container, containerScroll.top + diffTop.top);
  48598. } else if (alignWithTop === false) {
  48599. util.scrollTop(container, containerScroll.top + diffBottom.top);
  48600. } else {
  48601. // 自动调整
  48602. if (diffTop.top < 0) {
  48603. util.scrollTop(container, containerScroll.top + diffTop.top);
  48604. } else {
  48605. util.scrollTop(container, containerScroll.top + diffBottom.top);
  48606. }
  48607. }
  48608. } else {
  48609. if (!onlyScrollIfNeeded) {
  48610. alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;
  48611. if (alignWithTop) {
  48612. util.scrollTop(container, containerScroll.top + diffTop.top);
  48613. } else {
  48614. util.scrollTop(container, containerScroll.top + diffBottom.top);
  48615. }
  48616. }
  48617. }
  48618. if (allowHorizontalScroll) {
  48619. if (diffTop.left < 0 || diffBottom.left > 0) {
  48620. // 强制向上
  48621. if (alignWithLeft === true) {
  48622. util.scrollLeft(container, containerScroll.left + diffTop.left);
  48623. } else if (alignWithLeft === false) {
  48624. util.scrollLeft(container, containerScroll.left + diffBottom.left);
  48625. } else {
  48626. // 自动调整
  48627. if (diffTop.left < 0) {
  48628. util.scrollLeft(container, containerScroll.left + diffTop.left);
  48629. } else {
  48630. util.scrollLeft(container, containerScroll.left + diffBottom.left);
  48631. }
  48632. }
  48633. } else {
  48634. if (!onlyScrollIfNeeded) {
  48635. alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;
  48636. if (alignWithLeft) {
  48637. util.scrollLeft(container, containerScroll.left + diffTop.left);
  48638. } else {
  48639. util.scrollLeft(container, containerScroll.left + diffBottom.left);
  48640. }
  48641. }
  48642. }
  48643. }
  48644. }
  48645. module.exports = scrollIntoView;
  48646. /***/ })
  48647. /******/ });