Nessuna descrizione

edit-post.js 665KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082
  1. this["wp"] = this["wp"] || {}; this["wp"]["editPost"] =
  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 = "dSQ2");
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ "0dt7":
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return STORE_NAME; });
  93. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VIEW_AS_LINK_SELECTOR; });
  94. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return VIEW_AS_PREVIEW_LINK_SELECTOR; });
  95. /**
  96. * The identifier for the data store.
  97. *
  98. * @type {string}
  99. */
  100. const STORE_NAME = 'core/edit-post';
  101. /**
  102. * CSS selector string for the admin bar view post link anchor tag.
  103. *
  104. * @type {string}
  105. */
  106. const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';
  107. /**
  108. * CSS selector string for the admin bar preview post link anchor tag.
  109. *
  110. * @type {string}
  111. */
  112. const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';
  113. /***/ }),
  114. /***/ "1ZqX":
  115. /***/ (function(module, exports) {
  116. (function() { module.exports = window["wp"]["data"]; }());
  117. /***/ }),
  118. /***/ "4qRI":
  119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120. "use strict";
  121. function memoize(fn) {
  122. var cache = {};
  123. return function (arg) {
  124. if (cache[arg] === undefined) cache[arg] = fn(arg);
  125. return cache[arg];
  126. };
  127. }
  128. /* harmony default export */ __webpack_exports__["a"] = (memoize);
  129. /***/ }),
  130. /***/ "51Zz":
  131. /***/ (function(module, exports) {
  132. (function() { module.exports = window["wp"]["dataControls"]; }());
  133. /***/ }),
  134. /***/ "6aBm":
  135. /***/ (function(module, exports) {
  136. (function() { module.exports = window["wp"]["mediaUtils"]; }());
  137. /***/ }),
  138. /***/ "8oxB":
  139. /***/ (function(module, exports) {
  140. // shim for using process in browser
  141. var process = module.exports = {};
  142. // cached from whatever global is present so that test runners that stub it
  143. // don't break things. But we need to wrap it in a try catch in case it is
  144. // wrapped in strict mode code which doesn't define any globals. It's inside a
  145. // function because try/catches deoptimize in certain engines.
  146. var cachedSetTimeout;
  147. var cachedClearTimeout;
  148. function defaultSetTimout() {
  149. throw new Error('setTimeout has not been defined');
  150. }
  151. function defaultClearTimeout () {
  152. throw new Error('clearTimeout has not been defined');
  153. }
  154. (function () {
  155. try {
  156. if (typeof setTimeout === 'function') {
  157. cachedSetTimeout = setTimeout;
  158. } else {
  159. cachedSetTimeout = defaultSetTimout;
  160. }
  161. } catch (e) {
  162. cachedSetTimeout = defaultSetTimout;
  163. }
  164. try {
  165. if (typeof clearTimeout === 'function') {
  166. cachedClearTimeout = clearTimeout;
  167. } else {
  168. cachedClearTimeout = defaultClearTimeout;
  169. }
  170. } catch (e) {
  171. cachedClearTimeout = defaultClearTimeout;
  172. }
  173. } ())
  174. function runTimeout(fun) {
  175. if (cachedSetTimeout === setTimeout) {
  176. //normal enviroments in sane situations
  177. return setTimeout(fun, 0);
  178. }
  179. // if setTimeout wasn't available but was latter defined
  180. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  181. cachedSetTimeout = setTimeout;
  182. return setTimeout(fun, 0);
  183. }
  184. try {
  185. // when when somebody has screwed with setTimeout but no I.E. maddness
  186. return cachedSetTimeout(fun, 0);
  187. } catch(e){
  188. try {
  189. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  190. return cachedSetTimeout.call(null, fun, 0);
  191. } catch(e){
  192. // 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
  193. return cachedSetTimeout.call(this, fun, 0);
  194. }
  195. }
  196. }
  197. function runClearTimeout(marker) {
  198. if (cachedClearTimeout === clearTimeout) {
  199. //normal enviroments in sane situations
  200. return clearTimeout(marker);
  201. }
  202. // if clearTimeout wasn't available but was latter defined
  203. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  204. cachedClearTimeout = clearTimeout;
  205. return clearTimeout(marker);
  206. }
  207. try {
  208. // when when somebody has screwed with setTimeout but no I.E. maddness
  209. return cachedClearTimeout(marker);
  210. } catch (e){
  211. try {
  212. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  213. return cachedClearTimeout.call(null, marker);
  214. } catch (e){
  215. // 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.
  216. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  217. return cachedClearTimeout.call(this, marker);
  218. }
  219. }
  220. }
  221. var queue = [];
  222. var draining = false;
  223. var currentQueue;
  224. var queueIndex = -1;
  225. function cleanUpNextTick() {
  226. if (!draining || !currentQueue) {
  227. return;
  228. }
  229. draining = false;
  230. if (currentQueue.length) {
  231. queue = currentQueue.concat(queue);
  232. } else {
  233. queueIndex = -1;
  234. }
  235. if (queue.length) {
  236. drainQueue();
  237. }
  238. }
  239. function drainQueue() {
  240. if (draining) {
  241. return;
  242. }
  243. var timeout = runTimeout(cleanUpNextTick);
  244. draining = true;
  245. var len = queue.length;
  246. while(len) {
  247. currentQueue = queue;
  248. queue = [];
  249. while (++queueIndex < len) {
  250. if (currentQueue) {
  251. currentQueue[queueIndex].run();
  252. }
  253. }
  254. queueIndex = -1;
  255. len = queue.length;
  256. }
  257. currentQueue = null;
  258. draining = false;
  259. runClearTimeout(timeout);
  260. }
  261. process.nextTick = function (fun) {
  262. var args = new Array(arguments.length - 1);
  263. if (arguments.length > 1) {
  264. for (var i = 1; i < arguments.length; i++) {
  265. args[i - 1] = arguments[i];
  266. }
  267. }
  268. queue.push(new Item(fun, args));
  269. if (queue.length === 1 && !draining) {
  270. runTimeout(drainQueue);
  271. }
  272. };
  273. // v8 likes predictible objects
  274. function Item(fun, array) {
  275. this.fun = fun;
  276. this.array = array;
  277. }
  278. Item.prototype.run = function () {
  279. this.fun.apply(null, this.array);
  280. };
  281. process.title = 'browser';
  282. process.browser = true;
  283. process.env = {};
  284. process.argv = [];
  285. process.version = ''; // empty string to avoid regexp issues
  286. process.versions = {};
  287. function noop() {}
  288. process.on = noop;
  289. process.addListener = noop;
  290. process.once = noop;
  291. process.off = noop;
  292. process.removeListener = noop;
  293. process.removeAllListeners = noop;
  294. process.emit = noop;
  295. process.prependListener = noop;
  296. process.prependOnceListener = noop;
  297. process.listeners = function (name) { return [] }
  298. process.binding = function (name) {
  299. throw new Error('process.binding is not supported');
  300. };
  301. process.cwd = function () { return '/' };
  302. process.chdir = function (dir) {
  303. throw new Error('process.chdir is not supported');
  304. };
  305. process.umask = function() { return 0; };
  306. /***/ }),
  307. /***/ "9uj6":
  308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  309. "use strict";
  310. __webpack_require__.r(__webpack_exports__);
  311. /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4qRI");
  312. 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
  313. var index = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(function (prop) {
  314. return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
  315. /* o */
  316. && prop.charCodeAt(1) === 110
  317. /* n */
  318. && prop.charCodeAt(2) < 91;
  319. }
  320. /* Z+1 */
  321. );
  322. /* harmony default export */ __webpack_exports__["default"] = (index);
  323. /***/ }),
  324. /***/ "Cg8A":
  325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  326. "use strict";
  327. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  328. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  329. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  330. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  331. /**
  332. * WordPress dependencies
  333. */
  334. const cog = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  335. xmlns: "http://www.w3.org/2000/svg",
  336. viewBox: "0 0 24 24"
  337. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  338. fillRule: "evenodd",
  339. d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",
  340. clipRule: "evenodd"
  341. }));
  342. /* harmony default export */ __webpack_exports__["a"] = (cog);
  343. /***/ }),
  344. /***/ "Civd":
  345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  346. "use strict";
  347. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  348. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  349. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  350. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  351. /**
  352. * WordPress dependencies
  353. */
  354. const layout = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  355. xmlns: "http://www.w3.org/2000/svg",
  356. viewBox: "0 0 24 24"
  357. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  358. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  359. }));
  360. /* harmony default export */ __webpack_exports__["a"] = (layout);
  361. /***/ }),
  362. /***/ "GRId":
  363. /***/ (function(module, exports) {
  364. (function() { module.exports = window["wp"]["element"]; }());
  365. /***/ }),
  366. /***/ "HSyU":
  367. /***/ (function(module, exports) {
  368. (function() { module.exports = window["wp"]["blocks"]; }());
  369. /***/ }),
  370. /***/ "K+tz":
  371. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  372. "use strict";
  373. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  374. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  375. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  376. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  377. /**
  378. * WordPress dependencies
  379. */
  380. const external = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  381. xmlns: "http://www.w3.org/2000/svg",
  382. viewBox: "0 0 24 24"
  383. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  384. 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"
  385. }));
  386. /* harmony default export */ __webpack_exports__["a"] = (external);
  387. /***/ }),
  388. /***/ "K9lf":
  389. /***/ (function(module, exports) {
  390. (function() { module.exports = window["wp"]["compose"]; }());
  391. /***/ }),
  392. /***/ "KEfo":
  393. /***/ (function(module, exports) {
  394. (function() { module.exports = window["wp"]["viewport"]; }());
  395. /***/ }),
  396. /***/ "Mmq9":
  397. /***/ (function(module, exports) {
  398. (function() { module.exports = window["wp"]["url"]; }());
  399. /***/ }),
  400. /***/ "NWDH":
  401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  402. "use strict";
  403. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  404. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  405. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  406. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  407. /**
  408. * WordPress dependencies
  409. */
  410. const chevronDown = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  411. viewBox: "0 0 24 24",
  412. xmlns: "http://www.w3.org/2000/svg"
  413. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  414. d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
  415. }));
  416. /* harmony default export */ __webpack_exports__["a"] = (chevronDown);
  417. /***/ }),
  418. /***/ "OzlF":
  419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  420. "use strict";
  421. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  422. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  423. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  424. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  425. /**
  426. * WordPress dependencies
  427. */
  428. const listView = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  429. viewBox: "0 0 24 24",
  430. xmlns: "http://www.w3.org/2000/svg"
  431. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  432. d: "M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"
  433. }));
  434. /* harmony default export */ __webpack_exports__["a"] = (listView);
  435. /***/ }),
  436. /***/ "Q4Sy":
  437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  438. "use strict";
  439. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  440. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  441. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  442. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  443. /**
  444. * WordPress dependencies
  445. */
  446. const plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  447. xmlns: "http://www.w3.org/2000/svg",
  448. viewBox: "0 0 24 24"
  449. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  450. d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"
  451. }));
  452. /* harmony default export */ __webpack_exports__["a"] = (plus);
  453. /***/ }),
  454. /***/ "QyPg":
  455. /***/ (function(module, exports) {
  456. (function() { module.exports = window["wp"]["blockLibrary"]; }());
  457. /***/ }),
  458. /***/ "RMJe":
  459. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  460. "use strict";
  461. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  462. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  463. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  464. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  465. /**
  466. * WordPress dependencies
  467. */
  468. const check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  469. xmlns: "http://www.w3.org/2000/svg",
  470. viewBox: "0 0 24 24"
  471. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  472. d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"
  473. }));
  474. /* harmony default export */ __webpack_exports__["a"] = (check);
  475. /***/ }),
  476. /***/ "RxS6":
  477. /***/ (function(module, exports) {
  478. (function() { module.exports = window["wp"]["keycodes"]; }());
  479. /***/ }),
  480. /***/ "T40v":
  481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  482. "use strict";
  483. // EXPORTS
  484. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ store; });
  485. // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
  486. var actions_namespaceObject = {};
  487. __webpack_require__.r(actions_namespaceObject);
  488. __webpack_require__.d(actions_namespaceObject, "openGeneralSidebar", function() { return openGeneralSidebar; });
  489. __webpack_require__.d(actions_namespaceObject, "closeGeneralSidebar", function() { return closeGeneralSidebar; });
  490. __webpack_require__.d(actions_namespaceObject, "openModal", function() { return openModal; });
  491. __webpack_require__.d(actions_namespaceObject, "closeModal", function() { return closeModal; });
  492. __webpack_require__.d(actions_namespaceObject, "openPublishSidebar", function() { return openPublishSidebar; });
  493. __webpack_require__.d(actions_namespaceObject, "closePublishSidebar", function() { return closePublishSidebar; });
  494. __webpack_require__.d(actions_namespaceObject, "togglePublishSidebar", function() { return togglePublishSidebar; });
  495. __webpack_require__.d(actions_namespaceObject, "toggleEditorPanelEnabled", function() { return toggleEditorPanelEnabled; });
  496. __webpack_require__.d(actions_namespaceObject, "toggleEditorPanelOpened", function() { return toggleEditorPanelOpened; });
  497. __webpack_require__.d(actions_namespaceObject, "removeEditorPanel", function() { return removeEditorPanel; });
  498. __webpack_require__.d(actions_namespaceObject, "toggleFeature", function() { return toggleFeature; });
  499. __webpack_require__.d(actions_namespaceObject, "switchEditorMode", function() { return switchEditorMode; });
  500. __webpack_require__.d(actions_namespaceObject, "togglePinnedPluginItem", function() { return togglePinnedPluginItem; });
  501. __webpack_require__.d(actions_namespaceObject, "hideBlockTypes", function() { return hideBlockTypes; });
  502. __webpack_require__.d(actions_namespaceObject, "updatePreferredStyleVariations", function() { return updatePreferredStyleVariations; });
  503. __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateLocalAutosaveInterval", function() { return __experimentalUpdateLocalAutosaveInterval; });
  504. __webpack_require__.d(actions_namespaceObject, "showBlockTypes", function() { return showBlockTypes; });
  505. __webpack_require__.d(actions_namespaceObject, "setAvailableMetaBoxesPerLocation", function() { return setAvailableMetaBoxesPerLocation; });
  506. __webpack_require__.d(actions_namespaceObject, "requestMetaBoxUpdates", function() { return requestMetaBoxUpdates; });
  507. __webpack_require__.d(actions_namespaceObject, "metaBoxUpdatesSuccess", function() { return metaBoxUpdatesSuccess; });
  508. __webpack_require__.d(actions_namespaceObject, "__experimentalSetPreviewDeviceType", function() { return __experimentalSetPreviewDeviceType; });
  509. __webpack_require__.d(actions_namespaceObject, "setIsInserterOpened", function() { return setIsInserterOpened; });
  510. __webpack_require__.d(actions_namespaceObject, "setIsListViewOpened", function() { return setIsListViewOpened; });
  511. __webpack_require__.d(actions_namespaceObject, "setIsEditingTemplate", function() { return setIsEditingTemplate; });
  512. __webpack_require__.d(actions_namespaceObject, "__unstableSwitchToTemplateMode", function() { return __unstableSwitchToTemplateMode; });
  513. __webpack_require__.d(actions_namespaceObject, "initializeMetaBoxes", function() { return initializeMetaBoxes; });
  514. // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
  515. var selectors_namespaceObject = {};
  516. __webpack_require__.r(selectors_namespaceObject);
  517. __webpack_require__.d(selectors_namespaceObject, "getEditorMode", function() { return getEditorMode; });
  518. __webpack_require__.d(selectors_namespaceObject, "isEditorSidebarOpened", function() { return isEditorSidebarOpened; });
  519. __webpack_require__.d(selectors_namespaceObject, "isPluginSidebarOpened", function() { return isPluginSidebarOpened; });
  520. __webpack_require__.d(selectors_namespaceObject, "getActiveGeneralSidebarName", function() { return getActiveGeneralSidebarName; });
  521. __webpack_require__.d(selectors_namespaceObject, "getPreferences", function() { return getPreferences; });
  522. __webpack_require__.d(selectors_namespaceObject, "getPreference", function() { return getPreference; });
  523. __webpack_require__.d(selectors_namespaceObject, "isPublishSidebarOpened", function() { return isPublishSidebarOpened; });
  524. __webpack_require__.d(selectors_namespaceObject, "isEditorPanelRemoved", function() { return isEditorPanelRemoved; });
  525. __webpack_require__.d(selectors_namespaceObject, "isEditorPanelEnabled", function() { return isEditorPanelEnabled; });
  526. __webpack_require__.d(selectors_namespaceObject, "isEditorPanelOpened", function() { return isEditorPanelOpened; });
  527. __webpack_require__.d(selectors_namespaceObject, "isModalActive", function() { return isModalActive; });
  528. __webpack_require__.d(selectors_namespaceObject, "isFeatureActive", function() { return isFeatureActive; });
  529. __webpack_require__.d(selectors_namespaceObject, "isPluginItemPinned", function() { return isPluginItemPinned; });
  530. __webpack_require__.d(selectors_namespaceObject, "getActiveMetaBoxLocations", function() { return getActiveMetaBoxLocations; });
  531. __webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationVisible", function() { return isMetaBoxLocationVisible; });
  532. __webpack_require__.d(selectors_namespaceObject, "isMetaBoxLocationActive", function() { return isMetaBoxLocationActive; });
  533. __webpack_require__.d(selectors_namespaceObject, "getMetaBoxesPerLocation", function() { return getMetaBoxesPerLocation; });
  534. __webpack_require__.d(selectors_namespaceObject, "getAllMetaBoxes", function() { return getAllMetaBoxes; });
  535. __webpack_require__.d(selectors_namespaceObject, "hasMetaBoxes", function() { return selectors_hasMetaBoxes; });
  536. __webpack_require__.d(selectors_namespaceObject, "isSavingMetaBoxes", function() { return selectors_isSavingMetaBoxes; });
  537. __webpack_require__.d(selectors_namespaceObject, "__experimentalGetPreviewDeviceType", function() { return __experimentalGetPreviewDeviceType; });
  538. __webpack_require__.d(selectors_namespaceObject, "isInserterOpened", function() { return isInserterOpened; });
  539. __webpack_require__.d(selectors_namespaceObject, "__experimentalGetInsertionPoint", function() { return __experimentalGetInsertionPoint; });
  540. __webpack_require__.d(selectors_namespaceObject, "isListViewOpened", function() { return isListViewOpened; });
  541. __webpack_require__.d(selectors_namespaceObject, "isEditingTemplate", function() { return selectors_isEditingTemplate; });
  542. __webpack_require__.d(selectors_namespaceObject, "areMetaBoxesInitialized", function() { return areMetaBoxesInitialized; });
  543. __webpack_require__.d(selectors_namespaceObject, "getEditedPostTemplate", function() { return getEditedPostTemplate; });
  544. // EXTERNAL MODULE: external ["wp","data"]
  545. var external_wp_data_ = __webpack_require__("1ZqX");
  546. // EXTERNAL MODULE: external ["wp","dataControls"]
  547. var external_wp_dataControls_ = __webpack_require__("51Zz");
  548. // EXTERNAL MODULE: external "lodash"
  549. var external_lodash_ = __webpack_require__("YLtl");
  550. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/defaults.js
  551. const PREFERENCES_DEFAULTS = {
  552. editorMode: 'visual',
  553. panels: {
  554. 'post-status': {
  555. opened: true
  556. }
  557. },
  558. features: {
  559. fixedToolbar: false,
  560. welcomeGuide: true,
  561. fullscreenMode: true,
  562. showIconLabels: false,
  563. themeStyles: true,
  564. showBlockBreadcrumbs: true,
  565. welcomeGuideTemplate: true
  566. },
  567. hiddenBlockTypes: [],
  568. preferredStyleVariations: {},
  569. localAutosaveInterval: 15
  570. };
  571. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
  572. /**
  573. * External dependencies
  574. */
  575. /**
  576. * WordPress dependencies
  577. */
  578. /**
  579. * Internal dependencies
  580. */
  581. /**
  582. * Higher-order reducer creator which provides the given initial state for the
  583. * original reducer.
  584. *
  585. * @param {*} initialState Initial state to provide to reducer.
  586. *
  587. * @return {Function} Higher-order reducer.
  588. */
  589. const createWithInitialState = initialState => reducer => {
  590. return (state = initialState, action) => reducer(state, action);
  591. };
  592. /**
  593. * Reducer returning the user preferences.
  594. *
  595. * @param {Object} state Current state.
  596. * @param {string} state.mode Current editor mode, either
  597. * "visual" or "text".
  598. * @param {boolean} state.isGeneralSidebarDismissed Whether general sidebar is
  599. * dismissed. False by default
  600. * or when closing general
  601. * sidebar, true when opening
  602. * sidebar.
  603. * @param {boolean} state.isSidebarOpened Whether the sidebar is
  604. * opened or closed.
  605. * @param {Object} state.panels The state of the different
  606. * sidebar panels.
  607. * @param {Object} action Dispatched action.
  608. *
  609. * @return {Object} Updated state.
  610. */
  611. const preferences = Object(external_lodash_["flow"])([external_wp_data_["combineReducers"], createWithInitialState(PREFERENCES_DEFAULTS)])({
  612. panels(state, action) {
  613. switch (action.type) {
  614. case 'TOGGLE_PANEL_ENABLED':
  615. {
  616. const {
  617. panelName
  618. } = action;
  619. return { ...state,
  620. [panelName]: { ...state[panelName],
  621. enabled: !Object(external_lodash_["get"])(state, [panelName, 'enabled'], true)
  622. }
  623. };
  624. }
  625. case 'TOGGLE_PANEL_OPENED':
  626. {
  627. const {
  628. panelName
  629. } = action;
  630. const isOpen = state[panelName] === true || Object(external_lodash_["get"])(state, [panelName, 'opened'], false);
  631. return { ...state,
  632. [panelName]: { ...state[panelName],
  633. opened: !isOpen
  634. }
  635. };
  636. }
  637. }
  638. return state;
  639. },
  640. features(state, action) {
  641. if (action.type === 'TOGGLE_FEATURE') {
  642. return { ...state,
  643. [action.feature]: !state[action.feature]
  644. };
  645. }
  646. return state;
  647. },
  648. editorMode(state, action) {
  649. if (action.type === 'SWITCH_MODE') {
  650. return action.mode;
  651. }
  652. return state;
  653. },
  654. hiddenBlockTypes(state, action) {
  655. switch (action.type) {
  656. case 'SHOW_BLOCK_TYPES':
  657. return Object(external_lodash_["without"])(state, ...action.blockNames);
  658. case 'HIDE_BLOCK_TYPES':
  659. return Object(external_lodash_["union"])(state, action.blockNames);
  660. }
  661. return state;
  662. },
  663. preferredStyleVariations(state, action) {
  664. switch (action.type) {
  665. case 'UPDATE_PREFERRED_STYLE_VARIATIONS':
  666. {
  667. if (!action.blockName) {
  668. return state;
  669. }
  670. if (!action.blockStyle) {
  671. return Object(external_lodash_["omit"])(state, [action.blockName]);
  672. }
  673. return { ...state,
  674. [action.blockName]: action.blockStyle
  675. };
  676. }
  677. }
  678. return state;
  679. },
  680. localAutosaveInterval(state, action) {
  681. switch (action.type) {
  682. case 'UPDATE_LOCAL_AUTOSAVE_INTERVAL':
  683. return action.interval;
  684. }
  685. return state;
  686. }
  687. });
  688. /**
  689. * Reducer storing the list of all programmatically removed panels.
  690. *
  691. * @param {Array} state Current state.
  692. * @param {Object} action Action object.
  693. *
  694. * @return {Array} Updated state.
  695. */
  696. function removedPanels(state = [], action) {
  697. switch (action.type) {
  698. case 'REMOVE_PANEL':
  699. if (!Object(external_lodash_["includes"])(state, action.panelName)) {
  700. return [...state, action.panelName];
  701. }
  702. }
  703. return state;
  704. }
  705. /**
  706. * Reducer for storing the name of the open modal, or null if no modal is open.
  707. *
  708. * @param {Object} state Previous state.
  709. * @param {Object} action Action object containing the `name` of the modal
  710. *
  711. * @return {Object} Updated state
  712. */
  713. function activeModal(state = null, action) {
  714. switch (action.type) {
  715. case 'OPEN_MODAL':
  716. return action.name;
  717. case 'CLOSE_MODAL':
  718. return null;
  719. }
  720. return state;
  721. }
  722. function publishSidebarActive(state = false, action) {
  723. switch (action.type) {
  724. case 'OPEN_PUBLISH_SIDEBAR':
  725. return true;
  726. case 'CLOSE_PUBLISH_SIDEBAR':
  727. return false;
  728. case 'TOGGLE_PUBLISH_SIDEBAR':
  729. return !state;
  730. }
  731. return state;
  732. }
  733. /**
  734. * Reducer keeping track of the meta boxes isSaving state.
  735. * A "true" value means the meta boxes saving request is in-flight.
  736. *
  737. *
  738. * @param {boolean} state Previous state.
  739. * @param {Object} action Action Object.
  740. *
  741. * @return {Object} Updated state.
  742. */
  743. function isSavingMetaBoxes(state = false, action) {
  744. switch (action.type) {
  745. case 'REQUEST_META_BOX_UPDATES':
  746. return true;
  747. case 'META_BOX_UPDATES_SUCCESS':
  748. return false;
  749. default:
  750. return state;
  751. }
  752. }
  753. /**
  754. * Reducer keeping track of the meta boxes per location.
  755. *
  756. * @param {boolean} state Previous state.
  757. * @param {Object} action Action Object.
  758. *
  759. * @return {Object} Updated state.
  760. */
  761. function metaBoxLocations(state = {}, action) {
  762. switch (action.type) {
  763. case 'SET_META_BOXES_PER_LOCATIONS':
  764. return action.metaBoxesPerLocation;
  765. }
  766. return state;
  767. }
  768. /**
  769. * Reducer returning the editing canvas device type.
  770. *
  771. * @param {Object} state Current state.
  772. * @param {Object} action Dispatched action.
  773. *
  774. * @return {Object} Updated state.
  775. */
  776. function deviceType(state = 'Desktop', action) {
  777. switch (action.type) {
  778. case 'SET_PREVIEW_DEVICE_TYPE':
  779. return action.deviceType;
  780. }
  781. return state;
  782. }
  783. /**
  784. * Reducer to set the block inserter panel open or closed.
  785. *
  786. * Note: this reducer interacts with the list view panel reducer
  787. * to make sure that only one of the two panels is open at the same time.
  788. *
  789. * @param {Object} state Current state.
  790. * @param {Object} action Dispatched action.
  791. */
  792. function blockInserterPanel(state = false, action) {
  793. switch (action.type) {
  794. case 'SET_IS_LIST_VIEW_OPENED':
  795. return action.isOpen ? false : state;
  796. case 'SET_IS_INSERTER_OPENED':
  797. return action.value;
  798. }
  799. return state;
  800. }
  801. /**
  802. * Reducer to set the list view panel open or closed.
  803. *
  804. * Note: this reducer interacts with the inserter panel reducer
  805. * to make sure that only one of the two panels is open at the same time.
  806. *
  807. * @param {Object} state Current state.
  808. * @param {Object} action Dispatched action.
  809. */
  810. function listViewPanel(state = false, action) {
  811. switch (action.type) {
  812. case 'SET_IS_INSERTER_OPENED':
  813. return action.value ? false : state;
  814. case 'SET_IS_LIST_VIEW_OPENED':
  815. return action.isOpen;
  816. }
  817. return state;
  818. }
  819. /**
  820. * Reducer tracking whether the inserter is open.
  821. *
  822. * @param {boolean} state
  823. * @param {Object} action
  824. */
  825. function isEditingTemplate(state = false, action) {
  826. switch (action.type) {
  827. case 'SET_IS_EDITING_TEMPLATE':
  828. return action.value;
  829. }
  830. return state;
  831. }
  832. /**
  833. * Reducer tracking whether meta boxes are initialized.
  834. *
  835. * @param {boolean} state
  836. * @param {Object} action
  837. *
  838. * @return {boolean} Updated state.
  839. */
  840. function metaBoxesInitialized(state = false, action) {
  841. switch (action.type) {
  842. case 'META_BOXES_INITIALIZED':
  843. return true;
  844. }
  845. return state;
  846. }
  847. const metaBoxes = Object(external_wp_data_["combineReducers"])({
  848. isSaving: isSavingMetaBoxes,
  849. locations: metaBoxLocations,
  850. initialized: metaBoxesInitialized
  851. });
  852. /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
  853. activeModal,
  854. metaBoxes,
  855. preferences,
  856. publishSidebarActive,
  857. removedPanels,
  858. deviceType,
  859. blockInserterPanel,
  860. listViewPanel,
  861. isEditingTemplate
  862. }));
  863. // EXTERNAL MODULE: external ["wp","i18n"]
  864. var external_wp_i18n_ = __webpack_require__("l3Sj");
  865. // EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 15 modules
  866. var build_module = __webpack_require__("U60i");
  867. // EXTERNAL MODULE: external ["wp","a11y"]
  868. var external_wp_a11y_ = __webpack_require__("gdqT");
  869. // EXTERNAL MODULE: external ["wp","notices"]
  870. var external_wp_notices_ = __webpack_require__("onLe");
  871. // EXTERNAL MODULE: external ["wp","coreData"]
  872. var external_wp_coreData_ = __webpack_require__("jZUy");
  873. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
  874. /**
  875. * Function returning the current Meta Boxes DOM Node in the editor
  876. * whether the meta box area is opened or not.
  877. * If the MetaBox Area is visible returns it, and returns the original container instead.
  878. *
  879. * @param {string} location Meta Box location.
  880. * @return {string} HTML content.
  881. */
  882. const getMetaBoxContainer = location => {
  883. const area = document.querySelector(`.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}`);
  884. if (area) {
  885. return area;
  886. }
  887. return document.querySelector('#metaboxes .metabox-location-' + location);
  888. };
  889. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
  890. /**
  891. * External dependencies
  892. */
  893. /**
  894. * WordPress dependencies
  895. */
  896. /**
  897. * Internal dependencies
  898. */
  899. /**
  900. * Returns an action object used in signalling that the user opened an editor sidebar.
  901. *
  902. * @param {?string} name Sidebar name to be opened.
  903. *
  904. * @yield {Object} Action object.
  905. */
  906. function* openGeneralSidebar(name) {
  907. yield external_wp_data_["controls"].dispatch(build_module["g" /* store */].name, 'enableComplementaryArea', store.name, name);
  908. }
  909. /**
  910. * Returns an action object signalling that the user closed the sidebar.
  911. *
  912. * @yield {Object} Action object.
  913. */
  914. function* closeGeneralSidebar() {
  915. yield external_wp_data_["controls"].dispatch(build_module["g" /* store */].name, 'disableComplementaryArea', store.name);
  916. }
  917. /**
  918. * Returns an action object used in signalling that the user opened a modal.
  919. *
  920. * @param {string} name A string that uniquely identifies the modal.
  921. *
  922. * @return {Object} Action object.
  923. */
  924. function openModal(name) {
  925. return {
  926. type: 'OPEN_MODAL',
  927. name
  928. };
  929. }
  930. /**
  931. * Returns an action object signalling that the user closed a modal.
  932. *
  933. * @return {Object} Action object.
  934. */
  935. function closeModal() {
  936. return {
  937. type: 'CLOSE_MODAL'
  938. };
  939. }
  940. /**
  941. * Returns an action object used in signalling that the user opened the publish
  942. * sidebar.
  943. *
  944. * @return {Object} Action object
  945. */
  946. function openPublishSidebar() {
  947. return {
  948. type: 'OPEN_PUBLISH_SIDEBAR'
  949. };
  950. }
  951. /**
  952. * Returns an action object used in signalling that the user closed the
  953. * publish sidebar.
  954. *
  955. * @return {Object} Action object.
  956. */
  957. function closePublishSidebar() {
  958. return {
  959. type: 'CLOSE_PUBLISH_SIDEBAR'
  960. };
  961. }
  962. /**
  963. * Returns an action object used in signalling that the user toggles the publish sidebar.
  964. *
  965. * @return {Object} Action object
  966. */
  967. function togglePublishSidebar() {
  968. return {
  969. type: 'TOGGLE_PUBLISH_SIDEBAR'
  970. };
  971. }
  972. /**
  973. * Returns an action object used to enable or disable a panel in the editor.
  974. *
  975. * @param {string} panelName A string that identifies the panel to enable or disable.
  976. *
  977. * @return {Object} Action object.
  978. */
  979. function toggleEditorPanelEnabled(panelName) {
  980. return {
  981. type: 'TOGGLE_PANEL_ENABLED',
  982. panelName
  983. };
  984. }
  985. /**
  986. * Returns an action object used to open or close a panel in the editor.
  987. *
  988. * @param {string} panelName A string that identifies the panel to open or close.
  989. *
  990. * @return {Object} Action object.
  991. */
  992. function toggleEditorPanelOpened(panelName) {
  993. return {
  994. type: 'TOGGLE_PANEL_OPENED',
  995. panelName
  996. };
  997. }
  998. /**
  999. * Returns an action object used to remove a panel from the editor.
  1000. *
  1001. * @param {string} panelName A string that identifies the panel to remove.
  1002. *
  1003. * @return {Object} Action object.
  1004. */
  1005. function removeEditorPanel(panelName) {
  1006. return {
  1007. type: 'REMOVE_PANEL',
  1008. panelName
  1009. };
  1010. }
  1011. /**
  1012. * Returns an action object used to toggle a feature flag.
  1013. *
  1014. * @param {string} feature Feature name.
  1015. *
  1016. * @return {Object} Action object.
  1017. */
  1018. function toggleFeature(feature) {
  1019. return {
  1020. type: 'TOGGLE_FEATURE',
  1021. feature
  1022. };
  1023. }
  1024. function* switchEditorMode(mode) {
  1025. yield {
  1026. type: 'SWITCH_MODE',
  1027. mode
  1028. }; // Unselect blocks when we switch to the code editor.
  1029. if (mode !== 'visual') {
  1030. yield external_wp_data_["controls"].dispatch('core/block-editor', 'clearSelectedBlock');
  1031. }
  1032. const message = mode === 'visual' ? Object(external_wp_i18n_["__"])('Visual editor selected') : Object(external_wp_i18n_["__"])('Code editor selected');
  1033. Object(external_wp_a11y_["speak"])(message, 'assertive');
  1034. }
  1035. /**
  1036. * Returns an action object used to toggle a plugin name flag.
  1037. *
  1038. * @param {string} pluginName Plugin name.
  1039. *
  1040. * @return {Object} Action object.
  1041. */
  1042. function togglePinnedPluginItem(pluginName) {
  1043. return {
  1044. type: 'TOGGLE_PINNED_PLUGIN_ITEM',
  1045. pluginName
  1046. };
  1047. }
  1048. /**
  1049. * Returns an action object used in signalling that block types by the given
  1050. * name(s) should be hidden.
  1051. *
  1052. * @param {string[]} blockNames Names of block types to hide.
  1053. *
  1054. * @return {Object} Action object.
  1055. */
  1056. function hideBlockTypes(blockNames) {
  1057. return {
  1058. type: 'HIDE_BLOCK_TYPES',
  1059. blockNames: Object(external_lodash_["castArray"])(blockNames)
  1060. };
  1061. }
  1062. /**
  1063. * Returns an action object used in signaling that a style should be auto-applied when a block is created.
  1064. *
  1065. * @param {string} blockName Name of the block.
  1066. * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the "auto apply" setting of the block is removed.
  1067. *
  1068. * @return {Object} Action object.
  1069. */
  1070. function updatePreferredStyleVariations(blockName, blockStyle) {
  1071. return {
  1072. type: 'UPDATE_PREFERRED_STYLE_VARIATIONS',
  1073. blockName,
  1074. blockStyle
  1075. };
  1076. }
  1077. /**
  1078. * Returns an action object used in signalling that the editor should attempt
  1079. * to locally autosave the current post every `interval` seconds.
  1080. *
  1081. * @param {number} interval The new interval, in seconds.
  1082. * @return {Object} Action object.
  1083. */
  1084. function __experimentalUpdateLocalAutosaveInterval(interval) {
  1085. return {
  1086. type: 'UPDATE_LOCAL_AUTOSAVE_INTERVAL',
  1087. interval
  1088. };
  1089. }
  1090. /**
  1091. * Returns an action object used in signalling that block types by the given
  1092. * name(s) should be shown.
  1093. *
  1094. * @param {string[]} blockNames Names of block types to show.
  1095. *
  1096. * @return {Object} Action object.
  1097. */
  1098. function showBlockTypes(blockNames) {
  1099. return {
  1100. type: 'SHOW_BLOCK_TYPES',
  1101. blockNames: Object(external_lodash_["castArray"])(blockNames)
  1102. };
  1103. }
  1104. /**
  1105. * Returns an action object used in signaling
  1106. * what Meta boxes are available in which location.
  1107. *
  1108. * @param {Object} metaBoxesPerLocation Meta boxes per location.
  1109. *
  1110. * @yield {Object} Action object.
  1111. */
  1112. function* setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
  1113. yield {
  1114. type: 'SET_META_BOXES_PER_LOCATIONS',
  1115. metaBoxesPerLocation
  1116. };
  1117. }
  1118. /**
  1119. * Returns an action object used to request meta box update.
  1120. *
  1121. * @yield {Object} Action object.
  1122. */
  1123. function* requestMetaBoxUpdates() {
  1124. yield {
  1125. type: 'REQUEST_META_BOX_UPDATES'
  1126. }; // Saves the wp_editor fields
  1127. if (window.tinyMCE) {
  1128. window.tinyMCE.triggerSave();
  1129. } // Additional data needed for backward compatibility.
  1130. // If we do not provide this data, the post will be overridden with the default values.
  1131. const post = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPost');
  1132. const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean); // We gather all the metaboxes locations data and the base form data
  1133. const baseFormData = new window.FormData(document.querySelector('.metabox-base-form'));
  1134. const activeMetaBoxLocations = yield external_wp_data_["controls"].select(store.name, 'getActiveMetaBoxLocations');
  1135. const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))]; // Merge all form data objects into a single one.
  1136. const formData = Object(external_lodash_["reduce"])(formDataToMerge, (memo, currentFormData) => {
  1137. for (const [key, value] of currentFormData) {
  1138. memo.append(key, value);
  1139. }
  1140. return memo;
  1141. }, new window.FormData());
  1142. additionalData.forEach(([key, value]) => formData.append(key, value)); // Save the metaboxes
  1143. yield Object(external_wp_dataControls_["apiFetch"])({
  1144. url: window._wpMetaBoxUrl,
  1145. method: 'POST',
  1146. body: formData,
  1147. parse: false
  1148. });
  1149. yield external_wp_data_["controls"].dispatch(store.name, 'metaBoxUpdatesSuccess');
  1150. }
  1151. /**
  1152. * Returns an action object used signal a successful meta box update.
  1153. *
  1154. * @return {Object} Action object.
  1155. */
  1156. function metaBoxUpdatesSuccess() {
  1157. return {
  1158. type: 'META_BOX_UPDATES_SUCCESS'
  1159. };
  1160. }
  1161. /**
  1162. * Returns an action object used to toggle the width of the editing canvas.
  1163. *
  1164. * @param {string} deviceType
  1165. *
  1166. * @return {Object} Action object.
  1167. */
  1168. function __experimentalSetPreviewDeviceType(deviceType) {
  1169. return {
  1170. type: 'SET_PREVIEW_DEVICE_TYPE',
  1171. deviceType
  1172. };
  1173. }
  1174. /**
  1175. * Returns an action object used to open/close the inserter.
  1176. *
  1177. * @param {boolean|Object} value Whether the inserter should be
  1178. * opened (true) or closed (false).
  1179. * To specify an insertion point,
  1180. * use an object.
  1181. * @param {string} value.rootClientId The root client ID to insert at.
  1182. * @param {number} value.insertionIndex The index to insert at.
  1183. *
  1184. * @return {Object} Action object.
  1185. */
  1186. function setIsInserterOpened(value) {
  1187. return {
  1188. type: 'SET_IS_INSERTER_OPENED',
  1189. value
  1190. };
  1191. }
  1192. /**
  1193. * Returns an action object used to open/close the list view.
  1194. *
  1195. * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
  1196. * @return {Object} Action object.
  1197. */
  1198. function setIsListViewOpened(isOpen) {
  1199. return {
  1200. type: 'SET_IS_LIST_VIEW_OPENED',
  1201. isOpen
  1202. };
  1203. }
  1204. /**
  1205. * Returns an action object used to switch to template editing.
  1206. *
  1207. * @param {boolean} value Is editing template.
  1208. * @return {Object} Action object.
  1209. */
  1210. function setIsEditingTemplate(value) {
  1211. return {
  1212. type: 'SET_IS_EDITING_TEMPLATE',
  1213. value
  1214. };
  1215. }
  1216. /**
  1217. * Potentially create a block based template and switches to the template mode.
  1218. *
  1219. * @param {Object?} template template to create and assign before switching.
  1220. */
  1221. function* __unstableSwitchToTemplateMode(template) {
  1222. if (!!template) {
  1223. const savedTemplate = yield external_wp_data_["controls"].dispatch(external_wp_coreData_["store"], 'saveEntityRecord', 'postType', 'wp_template', template);
  1224. const post = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPost');
  1225. yield external_wp_data_["controls"].dispatch(external_wp_coreData_["store"], 'editEntityRecord', 'postType', post.type, post.id, {
  1226. template: savedTemplate.slug
  1227. });
  1228. }
  1229. yield setIsEditingTemplate(true);
  1230. const isWelcomeGuideActive = yield external_wp_data_["controls"].select('core/edit-post', 'isFeatureActive', 'welcomeGuideTemplate');
  1231. if (!isWelcomeGuideActive) {
  1232. const message = !!template ? Object(external_wp_i18n_["__"])("Custom template created. You're in template mode now.") : Object(external_wp_i18n_["__"])('Editing template. Changes made here affect all posts and pages that use the template.');
  1233. yield external_wp_data_["controls"].dispatch(external_wp_notices_["store"], 'createSuccessNotice', message, {
  1234. type: 'snackbar'
  1235. });
  1236. }
  1237. }
  1238. let actions_metaBoxesInitialized = false;
  1239. /**
  1240. * Initializes WordPress `postboxes` script and the logic for saving meta boxes.
  1241. */
  1242. function* initializeMetaBoxes() {
  1243. const isEditorReady = yield external_wp_data_["controls"].select('core/editor', '__unstableIsEditorReady');
  1244. if (!isEditorReady) {
  1245. return;
  1246. }
  1247. const postType = yield external_wp_data_["controls"].select('core/editor', 'getCurrentPostType'); // Only initialize once.
  1248. if (actions_metaBoxesInitialized) {
  1249. return;
  1250. }
  1251. if (window.postboxes.page !== postType) {
  1252. window.postboxes.add_postbox_toggles(postType);
  1253. }
  1254. actions_metaBoxesInitialized = true;
  1255. let wasSavingPost = yield external_wp_data_["controls"].select('core/editor', 'isSavingPost');
  1256. let wasAutosavingPost = yield external_wp_data_["controls"].select('core/editor', 'isAutosavingPost');
  1257. const hasMetaBoxes = yield external_wp_data_["controls"].select(store, 'hasMetaBoxes'); // Save metaboxes when performing a full save on the post.
  1258. Object(external_wp_data_["subscribe"])(() => {
  1259. const isSavingPost = Object(external_wp_data_["select"])('core/editor').isSavingPost();
  1260. const isAutosavingPost = Object(external_wp_data_["select"])('core/editor').isAutosavingPost(); // Save metaboxes on save completion, except for autosaves that are not a post preview.
  1261. //
  1262. // Meta boxes are initialized once at page load. It is not necessary to
  1263. // account for updates on each state change.
  1264. //
  1265. // See: https://github.com/WordPress/WordPress/blob/5.1.1/wp-admin/includes/post.php#L2307-L2309
  1266. const shouldTriggerMetaboxesSave = hasMetaBoxes && wasSavingPost && !isSavingPost && !wasAutosavingPost; // Save current state for next inspection.
  1267. wasSavingPost = isSavingPost;
  1268. wasAutosavingPost = isAutosavingPost;
  1269. if (shouldTriggerMetaboxesSave) {
  1270. Object(external_wp_data_["dispatch"])(store).requestMetaBoxUpdates();
  1271. }
  1272. });
  1273. return {
  1274. type: 'META_BOXES_INITIALIZED'
  1275. };
  1276. }
  1277. // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
  1278. var rememo = __webpack_require__("pPDe");
  1279. // EXTERNAL MODULE: external ["wp","editor"]
  1280. var external_wp_editor_ = __webpack_require__("jSdM");
  1281. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
  1282. /**
  1283. * External dependencies
  1284. */
  1285. /**
  1286. * WordPress dependencies
  1287. */
  1288. /**
  1289. * Returns the current editing mode.
  1290. *
  1291. * @param {Object} state Global application state.
  1292. *
  1293. * @return {string} Editing mode.
  1294. */
  1295. function getEditorMode(state) {
  1296. return getPreference(state, 'editorMode', 'visual');
  1297. }
  1298. /**
  1299. * Returns true if the editor sidebar is opened.
  1300. *
  1301. * @param {Object} state Global application state
  1302. *
  1303. * @return {boolean} Whether the editor sidebar is opened.
  1304. */
  1305. const isEditorSidebarOpened = Object(external_wp_data_["createRegistrySelector"])(select => () => {
  1306. const activeGeneralSidebar = select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post');
  1307. return Object(external_lodash_["includes"])(['edit-post/document', 'edit-post/block'], activeGeneralSidebar);
  1308. });
  1309. /**
  1310. * Returns true if the plugin sidebar is opened.
  1311. *
  1312. * @param {Object} state Global application state
  1313. * @return {boolean} Whether the plugin sidebar is opened.
  1314. */
  1315. const isPluginSidebarOpened = Object(external_wp_data_["createRegistrySelector"])(select => () => {
  1316. const activeGeneralSidebar = select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post');
  1317. return !!activeGeneralSidebar && !Object(external_lodash_["includes"])(['edit-post/document', 'edit-post/block'], activeGeneralSidebar);
  1318. });
  1319. /**
  1320. * Returns the current active general sidebar name, or null if there is no
  1321. * general sidebar active. The active general sidebar is a unique name to
  1322. * identify either an editor or plugin sidebar.
  1323. *
  1324. * Examples:
  1325. *
  1326. * - `edit-post/document`
  1327. * - `my-plugin/insert-image-sidebar`
  1328. *
  1329. * @param {Object} state Global application state.
  1330. *
  1331. * @return {?string} Active general sidebar name.
  1332. */
  1333. const getActiveGeneralSidebarName = Object(external_wp_data_["createRegistrySelector"])(select => () => {
  1334. return select(build_module["g" /* store */]).getActiveComplementaryArea('core/edit-post');
  1335. });
  1336. /**
  1337. * Returns the preferences (these preferences are persisted locally).
  1338. *
  1339. * @param {Object} state Global application state.
  1340. *
  1341. * @return {Object} Preferences Object.
  1342. */
  1343. function getPreferences(state) {
  1344. return state.preferences;
  1345. }
  1346. /**
  1347. *
  1348. * @param {Object} state Global application state.
  1349. * @param {string} preferenceKey Preference Key.
  1350. * @param {*} defaultValue Default Value.
  1351. *
  1352. * @return {*} Preference Value.
  1353. */
  1354. function getPreference(state, preferenceKey, defaultValue) {
  1355. const preferences = getPreferences(state);
  1356. const value = preferences[preferenceKey];
  1357. return value === undefined ? defaultValue : value;
  1358. }
  1359. /**
  1360. * Returns true if the publish sidebar is opened.
  1361. *
  1362. * @param {Object} state Global application state
  1363. *
  1364. * @return {boolean} Whether the publish sidebar is open.
  1365. */
  1366. function isPublishSidebarOpened(state) {
  1367. return state.publishSidebarActive;
  1368. }
  1369. /**
  1370. * Returns true if the given panel was programmatically removed, or false otherwise.
  1371. * All panels are not removed by default.
  1372. *
  1373. * @param {Object} state Global application state.
  1374. * @param {string} panelName A string that identifies the panel.
  1375. *
  1376. * @return {boolean} Whether or not the panel is removed.
  1377. */
  1378. function isEditorPanelRemoved(state, panelName) {
  1379. return Object(external_lodash_["includes"])(state.removedPanels, panelName);
  1380. }
  1381. /**
  1382. * Returns true if the given panel is enabled, or false otherwise. Panels are
  1383. * enabled by default.
  1384. *
  1385. * @param {Object} state Global application state.
  1386. * @param {string} panelName A string that identifies the panel.
  1387. *
  1388. * @return {boolean} Whether or not the panel is enabled.
  1389. */
  1390. function isEditorPanelEnabled(state, panelName) {
  1391. const panels = getPreference(state, 'panels');
  1392. return !isEditorPanelRemoved(state, panelName) && Object(external_lodash_["get"])(panels, [panelName, 'enabled'], true);
  1393. }
  1394. /**
  1395. * Returns true if the given panel is open, or false otherwise. Panels are
  1396. * closed by default.
  1397. *
  1398. * @param {Object} state Global application state.
  1399. * @param {string} panelName A string that identifies the panel.
  1400. *
  1401. * @return {boolean} Whether or not the panel is open.
  1402. */
  1403. function isEditorPanelOpened(state, panelName) {
  1404. const panels = getPreference(state, 'panels');
  1405. return Object(external_lodash_["get"])(panels, [panelName]) === true || Object(external_lodash_["get"])(panels, [panelName, 'opened']) === true;
  1406. }
  1407. /**
  1408. * Returns true if a modal is active, or false otherwise.
  1409. *
  1410. * @param {Object} state Global application state.
  1411. * @param {string} modalName A string that uniquely identifies the modal.
  1412. *
  1413. * @return {boolean} Whether the modal is active.
  1414. */
  1415. function isModalActive(state, modalName) {
  1416. return state.activeModal === modalName;
  1417. }
  1418. /**
  1419. * Returns whether the given feature is enabled or not.
  1420. *
  1421. * @param {Object} state Global application state.
  1422. * @param {string} feature Feature slug.
  1423. *
  1424. * @return {boolean} Is active.
  1425. */
  1426. function isFeatureActive(state, feature) {
  1427. return Object(external_lodash_["get"])(state.preferences.features, [feature], false);
  1428. }
  1429. /**
  1430. * Returns true if the plugin item is pinned to the header.
  1431. * When the value is not set it defaults to true.
  1432. *
  1433. * @param {Object} state Global application state.
  1434. * @param {string} pluginName Plugin item name.
  1435. *
  1436. * @return {boolean} Whether the plugin item is pinned.
  1437. */
  1438. const isPluginItemPinned = Object(external_wp_data_["createRegistrySelector"])(select => pluginName => {
  1439. return select(build_module["g" /* store */]).isItemPinned('core/edit-post', pluginName);
  1440. });
  1441. /**
  1442. * Returns an array of active meta box locations.
  1443. *
  1444. * @param {Object} state Post editor state.
  1445. *
  1446. * @return {string[]} Active meta box locations.
  1447. */
  1448. const getActiveMetaBoxLocations = Object(rememo["a" /* default */])(state => {
  1449. return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location));
  1450. }, state => [state.metaBoxes.locations]);
  1451. /**
  1452. * Returns true if a metabox location is active and visible
  1453. *
  1454. * @param {Object} state Post editor state.
  1455. * @param {string} location Meta box location to test.
  1456. *
  1457. * @return {boolean} Whether the meta box location is active and visible.
  1458. */
  1459. function isMetaBoxLocationVisible(state, location) {
  1460. return isMetaBoxLocationActive(state, location) && Object(external_lodash_["some"])(getMetaBoxesPerLocation(state, location), ({
  1461. id
  1462. }) => {
  1463. return isEditorPanelEnabled(state, `meta-box-${id}`);
  1464. });
  1465. }
  1466. /**
  1467. * Returns true if there is an active meta box in the given location, or false
  1468. * otherwise.
  1469. *
  1470. * @param {Object} state Post editor state.
  1471. * @param {string} location Meta box location to test.
  1472. *
  1473. * @return {boolean} Whether the meta box location is active.
  1474. */
  1475. function isMetaBoxLocationActive(state, location) {
  1476. const metaBoxes = getMetaBoxesPerLocation(state, location);
  1477. return !!metaBoxes && metaBoxes.length !== 0;
  1478. }
  1479. /**
  1480. * Returns the list of all the available meta boxes for a given location.
  1481. *
  1482. * @param {Object} state Global application state.
  1483. * @param {string} location Meta box location to test.
  1484. *
  1485. * @return {?Array} List of meta boxes.
  1486. */
  1487. function getMetaBoxesPerLocation(state, location) {
  1488. return state.metaBoxes.locations[location];
  1489. }
  1490. /**
  1491. * Returns the list of all the available meta boxes.
  1492. *
  1493. * @param {Object} state Global application state.
  1494. *
  1495. * @return {Array} List of meta boxes.
  1496. */
  1497. const getAllMetaBoxes = Object(rememo["a" /* default */])(state => {
  1498. return Object(external_lodash_["flatten"])(Object(external_lodash_["values"])(state.metaBoxes.locations));
  1499. }, state => [state.metaBoxes.locations]);
  1500. /**
  1501. * Returns true if the post is using Meta Boxes
  1502. *
  1503. * @param {Object} state Global application state
  1504. *
  1505. * @return {boolean} Whether there are metaboxes or not.
  1506. */
  1507. function selectors_hasMetaBoxes(state) {
  1508. return getActiveMetaBoxLocations(state).length > 0;
  1509. }
  1510. /**
  1511. * Returns true if the Meta Boxes are being saved.
  1512. *
  1513. * @param {Object} state Global application state.
  1514. *
  1515. * @return {boolean} Whether the metaboxes are being saved.
  1516. */
  1517. function selectors_isSavingMetaBoxes(state) {
  1518. return state.metaBoxes.isSaving;
  1519. }
  1520. /**
  1521. * Returns the current editing canvas device type.
  1522. *
  1523. * @param {Object} state Global application state.
  1524. *
  1525. * @return {string} Device type.
  1526. */
  1527. function __experimentalGetPreviewDeviceType(state) {
  1528. return state.deviceType;
  1529. }
  1530. /**
  1531. * Returns true if the inserter is opened.
  1532. *
  1533. * @param {Object} state Global application state.
  1534. *
  1535. * @return {boolean} Whether the inserter is opened.
  1536. */
  1537. function isInserterOpened(state) {
  1538. return !!state.blockInserterPanel;
  1539. }
  1540. /**
  1541. * Get the insertion point for the inserter.
  1542. *
  1543. * @param {Object} state Global application state.
  1544. *
  1545. * @return {Object} The root client ID and index to insert at.
  1546. */
  1547. function __experimentalGetInsertionPoint(state) {
  1548. const {
  1549. rootClientId,
  1550. insertionIndex
  1551. } = state.blockInserterPanel;
  1552. return {
  1553. rootClientId,
  1554. insertionIndex
  1555. };
  1556. }
  1557. /**
  1558. * Returns true if the list view is opened.
  1559. *
  1560. * @param {Object} state Global application state.
  1561. *
  1562. * @return {boolean} Whether the list view is opened.
  1563. */
  1564. function isListViewOpened(state) {
  1565. return state.listViewPanel;
  1566. }
  1567. /**
  1568. * Returns true if the template editing mode is enabled.
  1569. *
  1570. * @param {Object} state Global application state.
  1571. *
  1572. * @return {boolean} Whether we're editing the template.
  1573. */
  1574. function selectors_isEditingTemplate(state) {
  1575. return state.isEditingTemplate;
  1576. }
  1577. /**
  1578. * Returns true if meta boxes are initialized.
  1579. *
  1580. * @param {Object} state Global application state.
  1581. *
  1582. * @return {boolean} Whether meta boxes are initialized.
  1583. */
  1584. function areMetaBoxesInitialized(state) {
  1585. return state.metaBoxes.initialized;
  1586. }
  1587. /**
  1588. * Retrieves the template of the currently edited post.
  1589. *
  1590. * @return {Object?} Post Template.
  1591. */
  1592. const getEditedPostTemplate = Object(external_wp_data_["createRegistrySelector"])(select => () => {
  1593. const currentTemplate = select(external_wp_editor_["store"]).getEditedPostAttribute('template');
  1594. if (currentTemplate) {
  1595. var _select$getEntityReco;
  1596. const templateWithSameSlug = (_select$getEntityReco = select(external_wp_coreData_["store"]).getEntityRecords('postType', 'wp_template')) === null || _select$getEntityReco === void 0 ? void 0 : _select$getEntityReco.find(template => template.slug === currentTemplate);
  1597. if (!templateWithSameSlug) {
  1598. return templateWithSameSlug;
  1599. }
  1600. return select(external_wp_coreData_["store"]).getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id);
  1601. }
  1602. const post = select(external_wp_editor_["store"]).getCurrentPost();
  1603. if (post.link && post.status !== 'auto-draft') {
  1604. return select(external_wp_coreData_["store"]).__experimentalGetTemplateForLink(post.link);
  1605. }
  1606. return null;
  1607. });
  1608. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
  1609. var constants = __webpack_require__("0dt7");
  1610. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js
  1611. /**
  1612. * WordPress dependencies
  1613. */
  1614. /**
  1615. * Internal dependencies
  1616. */
  1617. const storeConfig = {
  1618. reducer: reducer,
  1619. actions: actions_namespaceObject,
  1620. selectors: selectors_namespaceObject,
  1621. controls: external_wp_dataControls_["controls"],
  1622. persist: ['preferences']
  1623. };
  1624. /**
  1625. * Store definition for the edit post namespace.
  1626. *
  1627. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
  1628. *
  1629. * @type {Object}
  1630. */
  1631. const store = Object(external_wp_data_["createReduxStore"])(constants["a" /* STORE_NAME */], storeConfig); // Ideally we use register instead of register store.
  1632. Object(external_wp_data_["registerStore"])(constants["a" /* STORE_NAME */], storeConfig);
  1633. /***/ }),
  1634. /***/ "TSYQ":
  1635. /***/ (function(module, exports, __webpack_require__) {
  1636. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  1637. Copyright (c) 2018 Jed Watson.
  1638. Licensed under the MIT License (MIT), see
  1639. http://jedwatson.github.io/classnames
  1640. */
  1641. /* global define */
  1642. (function () {
  1643. 'use strict';
  1644. var hasOwn = {}.hasOwnProperty;
  1645. function classNames() {
  1646. var classes = [];
  1647. for (var i = 0; i < arguments.length; i++) {
  1648. var arg = arguments[i];
  1649. if (!arg) continue;
  1650. var argType = typeof arg;
  1651. if (argType === 'string' || argType === 'number') {
  1652. classes.push(arg);
  1653. } else if (Array.isArray(arg)) {
  1654. if (arg.length) {
  1655. var inner = classNames.apply(null, arg);
  1656. if (inner) {
  1657. classes.push(inner);
  1658. }
  1659. }
  1660. } else if (argType === 'object') {
  1661. if (arg.toString === Object.prototype.toString) {
  1662. for (var key in arg) {
  1663. if (hasOwn.call(arg, key) && arg[key]) {
  1664. classes.push(key);
  1665. }
  1666. }
  1667. } else {
  1668. classes.push(arg.toString());
  1669. }
  1670. }
  1671. }
  1672. return classes.join(' ');
  1673. }
  1674. if ( true && module.exports) {
  1675. classNames.default = classNames;
  1676. module.exports = classNames;
  1677. } else if (true) {
  1678. // register as 'classnames', consistent with npm package name
  1679. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  1680. return classNames;
  1681. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  1682. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1683. } else {}
  1684. }());
  1685. /***/ }),
  1686. /***/ "Tqx9":
  1687. /***/ (function(module, exports) {
  1688. (function() { module.exports = window["wp"]["primitives"]; }());
  1689. /***/ }),
  1690. /***/ "TvNi":
  1691. /***/ (function(module, exports) {
  1692. (function() { module.exports = window["wp"]["plugins"]; }());
  1693. /***/ }),
  1694. /***/ "U60i":
  1695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1696. "use strict";
  1697. // EXPORTS
  1698. __webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ store; });
  1699. __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ complementary_area; });
  1700. __webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ ComplementaryAreaMoreMenuItem; });
  1701. __webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ fullscreen_mode; });
  1702. __webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ interface_skeleton; });
  1703. __webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ pinned_items; });
  1704. __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ action_item; });
  1705. // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
  1706. var actions_namespaceObject = {};
  1707. __webpack_require__.r(actions_namespaceObject);
  1708. __webpack_require__.d(actions_namespaceObject, "enableComplementaryArea", function() { return actions_enableComplementaryArea; });
  1709. __webpack_require__.d(actions_namespaceObject, "disableComplementaryArea", function() { return actions_disableComplementaryArea; });
  1710. __webpack_require__.d(actions_namespaceObject, "pinItem", function() { return actions_pinItem; });
  1711. __webpack_require__.d(actions_namespaceObject, "unpinItem", function() { return actions_unpinItem; });
  1712. // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
  1713. var selectors_namespaceObject = {};
  1714. __webpack_require__.r(selectors_namespaceObject);
  1715. __webpack_require__.d(selectors_namespaceObject, "getActiveComplementaryArea", function() { return selectors_getActiveComplementaryArea; });
  1716. __webpack_require__.d(selectors_namespaceObject, "isItemPinned", function() { return selectors_isItemPinned; });
  1717. // EXTERNAL MODULE: external ["wp","data"]
  1718. var external_wp_data_ = __webpack_require__("1ZqX");
  1719. // EXTERNAL MODULE: external "lodash"
  1720. var external_lodash_ = __webpack_require__("YLtl");
  1721. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js
  1722. /**
  1723. * External dependencies
  1724. */
  1725. /**
  1726. * WordPress dependencies
  1727. */
  1728. /**
  1729. * Reducer to keep tract of the active area per scope.
  1730. *
  1731. * @param {boolean} state Previous state.
  1732. * @param {Object} action Action object.
  1733. * @param {string} action.type Action type.
  1734. * @param {string} action.itemType Type of item.
  1735. * @param {string} action.scope Item scope.
  1736. * @param {string} action.item Item name.
  1737. *
  1738. * @return {Object} Updated state.
  1739. */
  1740. function singleEnableItems(state = {}, {
  1741. type,
  1742. itemType,
  1743. scope,
  1744. item
  1745. }) {
  1746. if (type !== 'SET_SINGLE_ENABLE_ITEM' || !itemType || !scope) {
  1747. return state;
  1748. }
  1749. return { ...state,
  1750. [itemType]: { ...state[itemType],
  1751. [scope]: item || null
  1752. }
  1753. };
  1754. }
  1755. /**
  1756. * Reducer keeping track of the "pinned" items per scope.
  1757. *
  1758. * @param {boolean} state Previous state.
  1759. * @param {Object} action Action object.
  1760. * @param {string} action.type Action type.
  1761. * @param {string} action.itemType Type of item.
  1762. * @param {string} action.scope Item scope.
  1763. * @param {string} action.item Item name.
  1764. * @param {boolean} action.isEnable Whether the item is pinned.
  1765. *
  1766. * @return {Object} Updated state.
  1767. */
  1768. function multipleEnableItems(state = {}, {
  1769. type,
  1770. itemType,
  1771. scope,
  1772. item,
  1773. isEnable
  1774. }) {
  1775. if (type !== 'SET_MULTIPLE_ENABLE_ITEM' || !itemType || !scope || !item || Object(external_lodash_["get"])(state, [itemType, scope, item]) === isEnable) {
  1776. return state;
  1777. }
  1778. const currentTypeState = state[itemType] || {};
  1779. const currentScopeState = currentTypeState[scope] || {};
  1780. return { ...state,
  1781. [itemType]: { ...currentTypeState,
  1782. [scope]: { ...currentScopeState,
  1783. [item]: isEnable || false
  1784. }
  1785. }
  1786. };
  1787. }
  1788. const enableItems = Object(external_wp_data_["combineReducers"])({
  1789. singleEnableItems,
  1790. multipleEnableItems
  1791. });
  1792. /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
  1793. enableItems
  1794. }));
  1795. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/actions.js
  1796. /**
  1797. * Returns an action object used in signalling that an active area should be changed.
  1798. *
  1799. * @param {string} itemType Type of item.
  1800. * @param {string} scope Item scope.
  1801. * @param {string} item Item identifier.
  1802. *
  1803. * @return {Object} Action object.
  1804. */
  1805. function setSingleEnableItem(itemType, scope, item) {
  1806. return {
  1807. type: 'SET_SINGLE_ENABLE_ITEM',
  1808. itemType,
  1809. scope,
  1810. item
  1811. };
  1812. }
  1813. /**
  1814. * Returns an action object used in signalling that a complementary item should be enabled.
  1815. *
  1816. * @param {string} scope Complementary area scope.
  1817. * @param {string} area Area identifier.
  1818. *
  1819. * @return {Object} Action object.
  1820. */
  1821. function actions_enableComplementaryArea(scope, area) {
  1822. return setSingleEnableItem('complementaryArea', scope, area);
  1823. }
  1824. /**
  1825. * Returns an action object used in signalling that the complementary area of a given scope should be disabled.
  1826. *
  1827. * @param {string} scope Complementary area scope.
  1828. *
  1829. * @return {Object} Action object.
  1830. */
  1831. function actions_disableComplementaryArea(scope) {
  1832. return setSingleEnableItem('complementaryArea', scope, undefined);
  1833. }
  1834. /**
  1835. * Returns an action object to make an area enabled/disabled.
  1836. *
  1837. * @param {string} itemType Type of item.
  1838. * @param {string} scope Item scope.
  1839. * @param {string} item Item identifier.
  1840. * @param {boolean} isEnable Boolean indicating if an area should be pinned or not.
  1841. *
  1842. * @return {Object} Action object.
  1843. */
  1844. function setMultipleEnableItem(itemType, scope, item, isEnable) {
  1845. return {
  1846. type: 'SET_MULTIPLE_ENABLE_ITEM',
  1847. itemType,
  1848. scope,
  1849. item,
  1850. isEnable
  1851. };
  1852. }
  1853. /**
  1854. * Returns an action object used in signalling that an item should be pinned.
  1855. *
  1856. * @param {string} scope Item scope.
  1857. * @param {string} itemId Item identifier.
  1858. *
  1859. * @return {Object} Action object.
  1860. */
  1861. function actions_pinItem(scope, itemId) {
  1862. return setMultipleEnableItem('pinnedItems', scope, itemId, true);
  1863. }
  1864. /**
  1865. * Returns an action object used in signalling that an item should be unpinned.
  1866. *
  1867. * @param {string} scope Item scope.
  1868. * @param {string} itemId Item identifier.
  1869. *
  1870. * @return {Object} Action object.
  1871. */
  1872. function actions_unpinItem(scope, itemId) {
  1873. return setMultipleEnableItem('pinnedItems', scope, itemId, false);
  1874. }
  1875. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js
  1876. /**
  1877. * External dependencies
  1878. */
  1879. /**
  1880. * Returns the item that is enabled in a given scope.
  1881. *
  1882. * @param {Object} state Global application state.
  1883. * @param {string} itemType Type of item.
  1884. * @param {string} scope Item scope.
  1885. *
  1886. * @return {?string|null} The item that is enabled in the passed scope and type.
  1887. */
  1888. function getSingleEnableItem(state, itemType, scope) {
  1889. return Object(external_lodash_["get"])(state.enableItems.singleEnableItems, [itemType, scope]);
  1890. }
  1891. /**
  1892. * Returns the complementary area that is active in a given scope.
  1893. *
  1894. * @param {Object} state Global application state.
  1895. * @param {string} scope Item scope.
  1896. *
  1897. * @return {string} The complementary area that is active in the given scope.
  1898. */
  1899. function selectors_getActiveComplementaryArea(state, scope) {
  1900. return getSingleEnableItem(state, 'complementaryArea', scope);
  1901. }
  1902. /**
  1903. * Returns a boolean indicating if an item is enabled or not in a given scope.
  1904. *
  1905. * @param {Object} state Global application state.
  1906. * @param {string} itemType Type of item.
  1907. * @param {string} scope Scope.
  1908. * @param {string} item Item to check.
  1909. *
  1910. * @return {boolean|undefined} True if the item is enabled, false otherwise if the item is explicitly disabled, and undefined if there is no information for that item.
  1911. */
  1912. function isMultipleEnabledItemEnabled(state, itemType, scope, item) {
  1913. return Object(external_lodash_["get"])(state.enableItems.multipleEnableItems, [itemType, scope, item]);
  1914. }
  1915. /**
  1916. * Returns a boolean indicating if an item is pinned or not.
  1917. *
  1918. * @param {Object} state Global application state.
  1919. * @param {string} scope Scope.
  1920. * @param {string} item Item to check.
  1921. *
  1922. * @return {boolean} True if the item is pinned and false otherwise.
  1923. */
  1924. function selectors_isItemPinned(state, scope, item) {
  1925. return isMultipleEnabledItemEnabled(state, 'pinnedItems', scope, item) !== false;
  1926. }
  1927. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js
  1928. /**
  1929. * The identifier for the data store.
  1930. *
  1931. * @type {string}
  1932. */
  1933. const STORE_NAME = 'core/interface';
  1934. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js
  1935. /**
  1936. * WordPress dependencies
  1937. */
  1938. /**
  1939. * Internal dependencies
  1940. */
  1941. /**
  1942. * Store definition for the interface namespace.
  1943. *
  1944. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
  1945. *
  1946. * @type {Object}
  1947. */
  1948. const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, {
  1949. reducer: reducer,
  1950. actions: actions_namespaceObject,
  1951. selectors: selectors_namespaceObject,
  1952. persist: ['enableItems']
  1953. }); // Once we build a more generic persistence plugin that works across types of stores
  1954. // we'd be able to replace this with a register call.
  1955. Object(external_wp_data_["registerStore"])(STORE_NAME, {
  1956. reducer: reducer,
  1957. actions: actions_namespaceObject,
  1958. selectors: selectors_namespaceObject,
  1959. persist: ['enableItems']
  1960. });
  1961. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  1962. var esm_extends = __webpack_require__("wx14");
  1963. // EXTERNAL MODULE: external ["wp","element"]
  1964. var external_wp_element_ = __webpack_require__("GRId");
  1965. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  1966. var classnames = __webpack_require__("TSYQ");
  1967. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  1968. // EXTERNAL MODULE: external ["wp","components"]
  1969. var external_wp_components_ = __webpack_require__("tI+e");
  1970. // EXTERNAL MODULE: external ["wp","i18n"]
  1971. var external_wp_i18n_ = __webpack_require__("l3Sj");
  1972. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  1973. var check = __webpack_require__("RMJe");
  1974. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
  1975. var star_filled = __webpack_require__("URob");
  1976. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
  1977. var star_empty = __webpack_require__("Xxwi");
  1978. // EXTERNAL MODULE: external ["wp","viewport"]
  1979. var external_wp_viewport_ = __webpack_require__("KEfo");
  1980. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  1981. var close_small = __webpack_require__("bWcr");
  1982. // EXTERNAL MODULE: external ["wp","plugins"]
  1983. var external_wp_plugins_ = __webpack_require__("TvNi");
  1984. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js
  1985. /**
  1986. * WordPress dependencies
  1987. */
  1988. /* harmony default export */ var complementary_area_context = (Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => {
  1989. return {
  1990. icon: ownProps.icon || context.icon,
  1991. identifier: ownProps.identifier || `${context.name}/${ownProps.name}`
  1992. };
  1993. }));
  1994. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
  1995. /**
  1996. * External dependencies
  1997. */
  1998. /**
  1999. * WordPress dependencies
  2000. */
  2001. /**
  2002. * Internal dependencies
  2003. */
  2004. function ComplementaryAreaToggle({
  2005. as = external_wp_components_["Button"],
  2006. scope,
  2007. identifier,
  2008. icon,
  2009. selectedIcon,
  2010. ...props
  2011. }) {
  2012. const ComponentToUse = as;
  2013. const isSelected = Object(external_wp_data_["useSelect"])(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier]);
  2014. const {
  2015. enableComplementaryArea,
  2016. disableComplementaryArea
  2017. } = Object(external_wp_data_["useDispatch"])(store);
  2018. return Object(external_wp_element_["createElement"])(ComponentToUse, Object(esm_extends["a" /* default */])({
  2019. icon: selectedIcon && isSelected ? selectedIcon : icon,
  2020. onClick: () => {
  2021. if (isSelected) {
  2022. disableComplementaryArea(scope);
  2023. } else {
  2024. enableComplementaryArea(scope, identifier);
  2025. }
  2026. }
  2027. }, Object(external_lodash_["omit"])(props, ['name'])));
  2028. }
  2029. /* harmony default export */ var complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle));
  2030. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
  2031. /**
  2032. * External dependencies
  2033. */
  2034. /**
  2035. * WordPress dependencies
  2036. */
  2037. /**
  2038. * Internal dependencies
  2039. */
  2040. const ComplementaryAreaHeader = ({
  2041. smallScreenTitle,
  2042. children,
  2043. className,
  2044. toggleButtonProps
  2045. }) => {
  2046. const toggleButton = Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
  2047. icon: close_small["a" /* default */]
  2048. }, toggleButtonProps));
  2049. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
  2050. className: "components-panel__header interface-complementary-area-header__small"
  2051. }, smallScreenTitle && Object(external_wp_element_["createElement"])("span", {
  2052. className: "interface-complementary-area-header__small-title"
  2053. }, smallScreenTitle), toggleButton), Object(external_wp_element_["createElement"])("div", {
  2054. className: classnames_default()('components-panel__header', 'interface-complementary-area-header', className),
  2055. tabIndex: -1
  2056. }, children, toggleButton));
  2057. };
  2058. /* harmony default export */ var complementary_area_header = (ComplementaryAreaHeader);
  2059. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
  2060. /**
  2061. * External dependencies
  2062. */
  2063. /**
  2064. * WordPress dependencies
  2065. */
  2066. function ActionItemSlot({
  2067. name,
  2068. as: Component = external_wp_components_["ButtonGroup"],
  2069. fillProps = {},
  2070. bubblesVirtually,
  2071. ...props
  2072. }) {
  2073. return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], {
  2074. name: name,
  2075. bubblesVirtually: bubblesVirtually,
  2076. fillProps: fillProps
  2077. }, fills => {
  2078. if (Object(external_lodash_["isEmpty"])(external_wp_element_["Children"].toArray(fills))) {
  2079. return null;
  2080. } // Special handling exists for backward compatibility.
  2081. // It ensures that menu items created by plugin authors aren't
  2082. // duplicated with automatically injected menu items coming
  2083. // from pinnable plugin sidebars.
  2084. // @see https://github.com/WordPress/gutenberg/issues/14457
  2085. const initializedByPlugins = [];
  2086. external_wp_element_["Children"].forEach(fills, ({
  2087. props: {
  2088. __unstableExplicitMenuItem,
  2089. __unstableTarget
  2090. }
  2091. }) => {
  2092. if (__unstableTarget && __unstableExplicitMenuItem) {
  2093. initializedByPlugins.push(__unstableTarget);
  2094. }
  2095. });
  2096. const children = external_wp_element_["Children"].map(fills, child => {
  2097. if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) {
  2098. return null;
  2099. }
  2100. return child;
  2101. });
  2102. return Object(external_wp_element_["createElement"])(Component, props, children);
  2103. });
  2104. }
  2105. function ActionItem({
  2106. name,
  2107. as: Component = external_wp_components_["Button"],
  2108. onClick,
  2109. ...props
  2110. }) {
  2111. return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
  2112. name: name
  2113. }, ({
  2114. onClick: fpOnClick
  2115. }) => {
  2116. return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
  2117. onClick: onClick || fpOnClick ? (...args) => {
  2118. (onClick || external_lodash_["noop"])(...args);
  2119. (fpOnClick || external_lodash_["noop"])(...args);
  2120. } : undefined
  2121. }, props));
  2122. });
  2123. }
  2124. ActionItem.Slot = ActionItemSlot;
  2125. /* harmony default export */ var action_item = (ActionItem);
  2126. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
  2127. /**
  2128. * External dependencies
  2129. */
  2130. /**
  2131. * WordPress dependencies
  2132. */
  2133. /**
  2134. * Internal dependencies
  2135. */
  2136. const PluginsMenuItem = props => // Menu item is marked with unstable prop for backward compatibility.
  2137. // They are removed so they don't leak to DOM elements.
  2138. // @see https://github.com/WordPress/gutenberg/issues/14457
  2139. Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], Object(external_lodash_["omit"])(props, ['__unstableExplicitMenuItem', '__unstableTarget']));
  2140. function ComplementaryAreaMoreMenuItem({
  2141. scope,
  2142. target,
  2143. __unstableExplicitMenuItem,
  2144. ...props
  2145. }) {
  2146. return Object(external_wp_element_["createElement"])(complementary_area_toggle, Object(esm_extends["a" /* default */])({
  2147. as: toggleProps => {
  2148. return Object(external_wp_element_["createElement"])(action_item, Object(esm_extends["a" /* default */])({
  2149. __unstableExplicitMenuItem: __unstableExplicitMenuItem,
  2150. __unstableTarget: `${scope}/${target}`,
  2151. as: PluginsMenuItem,
  2152. name: `${scope}/plugin-more-menu`
  2153. }, toggleProps));
  2154. },
  2155. role: "menuitemcheckbox",
  2156. selectedIcon: check["a" /* default */],
  2157. name: target,
  2158. scope: scope
  2159. }, props));
  2160. }
  2161. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
  2162. /**
  2163. * External dependencies
  2164. */
  2165. /**
  2166. * WordPress dependencies
  2167. */
  2168. function PinnedItems({
  2169. scope,
  2170. ...props
  2171. }) {
  2172. return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], Object(esm_extends["a" /* default */])({
  2173. name: `PinnedItems/${scope}`
  2174. }, props));
  2175. }
  2176. function PinnedItemsSlot({
  2177. scope,
  2178. className,
  2179. ...props
  2180. }) {
  2181. return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
  2182. name: `PinnedItems/${scope}`
  2183. }, props), fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])("div", {
  2184. className: classnames_default()(className, 'interface-pinned-items')
  2185. }, fills));
  2186. }
  2187. PinnedItems.Slot = PinnedItemsSlot;
  2188. /* harmony default export */ var pinned_items = (PinnedItems);
  2189. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
  2190. /**
  2191. * External dependencies
  2192. */
  2193. /**
  2194. * WordPress dependencies
  2195. */
  2196. /**
  2197. * Internal dependencies
  2198. */
  2199. function ComplementaryAreaSlot({
  2200. scope,
  2201. ...props
  2202. }) {
  2203. return Object(external_wp_element_["createElement"])(external_wp_components_["Slot"], Object(esm_extends["a" /* default */])({
  2204. name: `ComplementaryArea/${scope}`
  2205. }, props));
  2206. }
  2207. function ComplementaryAreaFill({
  2208. scope,
  2209. children,
  2210. className
  2211. }) {
  2212. return Object(external_wp_element_["createElement"])(external_wp_components_["Fill"], {
  2213. name: `ComplementaryArea/${scope}`
  2214. }, Object(external_wp_element_["createElement"])("div", {
  2215. className: className
  2216. }, children));
  2217. }
  2218. function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
  2219. const previousIsSmall = Object(external_wp_element_["useRef"])(false);
  2220. const shouldOpenWhenNotSmall = Object(external_wp_element_["useRef"])(false);
  2221. const {
  2222. enableComplementaryArea,
  2223. disableComplementaryArea
  2224. } = Object(external_wp_data_["useDispatch"])(store);
  2225. Object(external_wp_element_["useEffect"])(() => {
  2226. // If the complementary area is active and the editor is switching from a big to a small window size.
  2227. if (isActive && isSmall && !previousIsSmall.current) {
  2228. // Disable the complementary area.
  2229. disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size goes from small to big.
  2230. shouldOpenWhenNotSmall.current = true;
  2231. } else if ( // If there is a flag indicating the complementary area should be enabled when we go from small to big window size
  2232. // and we are going from a small to big window size.
  2233. shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) {
  2234. // Remove the flag indicating the complementary area should be enabled.
  2235. shouldOpenWhenNotSmall.current = false; // Enable the complementary area.
  2236. enableComplementaryArea(scope, identifier);
  2237. } else if ( // If the flag is indicating the current complementary should be reopened but another complementary area becomes active,
  2238. // remove the flag.
  2239. shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) {
  2240. shouldOpenWhenNotSmall.current = false;
  2241. }
  2242. if (isSmall !== previousIsSmall.current) {
  2243. previousIsSmall.current = isSmall;
  2244. }
  2245. }, [isActive, isSmall, scope, identifier, activeArea]);
  2246. }
  2247. function ComplementaryArea({
  2248. children,
  2249. className,
  2250. closeLabel = Object(external_wp_i18n_["__"])('Close plugin'),
  2251. identifier,
  2252. header,
  2253. headerClassName,
  2254. icon,
  2255. isPinnable = true,
  2256. panelClassName,
  2257. scope,
  2258. name,
  2259. smallScreenTitle,
  2260. title,
  2261. toggleShortcut,
  2262. isActiveByDefault,
  2263. showIconLabels = false
  2264. }) {
  2265. const {
  2266. isActive,
  2267. isPinned,
  2268. activeArea,
  2269. isSmall,
  2270. isLarge
  2271. } = Object(external_wp_data_["useSelect"])(select => {
  2272. const {
  2273. getActiveComplementaryArea,
  2274. isItemPinned
  2275. } = select(store);
  2276. const _activeArea = getActiveComplementaryArea(scope);
  2277. return {
  2278. isActive: _activeArea === identifier,
  2279. isPinned: isItemPinned(scope, identifier),
  2280. activeArea: _activeArea,
  2281. isSmall: select(external_wp_viewport_["store"]).isViewportMatch('< medium'),
  2282. isLarge: select(external_wp_viewport_["store"]).isViewportMatch('large')
  2283. };
  2284. }, [identifier, scope]);
  2285. useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall);
  2286. const {
  2287. enableComplementaryArea,
  2288. disableComplementaryArea,
  2289. pinItem,
  2290. unpinItem
  2291. } = Object(external_wp_data_["useDispatch"])(store);
  2292. Object(external_wp_element_["useEffect"])(() => {
  2293. if (isActiveByDefault && activeArea === undefined && !isSmall) {
  2294. enableComplementaryArea(scope, identifier);
  2295. }
  2296. }, [activeArea, isActiveByDefault, scope, identifier, isSmall]);
  2297. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isPinnable && Object(external_wp_element_["createElement"])(pinned_items, {
  2298. scope: scope
  2299. }, isPinned && Object(external_wp_element_["createElement"])(complementary_area_toggle, {
  2300. scope: scope,
  2301. identifier: identifier,
  2302. isPressed: isActive && (!showIconLabels || isLarge),
  2303. "aria-expanded": isActive,
  2304. label: title,
  2305. icon: showIconLabels ? check["a" /* default */] : icon,
  2306. showTooltip: !showIconLabels,
  2307. isTertiary: showIconLabels
  2308. })), name && isPinnable && Object(external_wp_element_["createElement"])(ComplementaryAreaMoreMenuItem, {
  2309. target: name,
  2310. scope: scope,
  2311. icon: icon
  2312. }, title), isActive && Object(external_wp_element_["createElement"])(ComplementaryAreaFill, {
  2313. className: classnames_default()('interface-complementary-area', className),
  2314. scope: scope
  2315. }, Object(external_wp_element_["createElement"])(complementary_area_header, {
  2316. className: headerClassName,
  2317. closeLabel: closeLabel,
  2318. onClose: () => disableComplementaryArea(scope),
  2319. smallScreenTitle: smallScreenTitle,
  2320. toggleButtonProps: {
  2321. label: closeLabel,
  2322. shortcut: toggleShortcut,
  2323. scope,
  2324. identifier
  2325. }
  2326. }, header || Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("strong", null, title), isPinnable && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  2327. className: "interface-complementary-area__pin-unpin-item",
  2328. icon: isPinned ? star_filled["a" /* default */] : star_empty["a" /* default */],
  2329. label: isPinned ? Object(external_wp_i18n_["__"])('Unpin from toolbar') : Object(external_wp_i18n_["__"])('Pin to toolbar'),
  2330. onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier),
  2331. isPressed: isPinned,
  2332. "aria-expanded": isPinned
  2333. }))), Object(external_wp_element_["createElement"])(external_wp_components_["Panel"], {
  2334. className: panelClassName
  2335. }, children)));
  2336. }
  2337. const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea);
  2338. ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;
  2339. /* harmony default export */ var complementary_area = (ComplementaryAreaWrapped);
  2340. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js
  2341. /**
  2342. * WordPress dependencies
  2343. */
  2344. class fullscreen_mode_FullscreenMode extends external_wp_element_["Component"] {
  2345. componentDidMount() {
  2346. this.isSticky = false;
  2347. this.sync(); // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
  2348. // `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
  2349. // even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
  2350. // a consequence of the FullscreenMode setup
  2351. if (document.body.classList.contains('sticky-menu')) {
  2352. this.isSticky = true;
  2353. document.body.classList.remove('sticky-menu');
  2354. }
  2355. }
  2356. componentWillUnmount() {
  2357. if (this.isSticky) {
  2358. document.body.classList.add('sticky-menu');
  2359. }
  2360. if (this.props.isActive) {
  2361. document.body.classList.remove('is-fullscreen-mode');
  2362. }
  2363. }
  2364. componentDidUpdate(prevProps) {
  2365. if (this.props.isActive !== prevProps.isActive) {
  2366. this.sync();
  2367. }
  2368. }
  2369. sync() {
  2370. const {
  2371. isActive
  2372. } = this.props;
  2373. if (isActive) {
  2374. document.body.classList.add('is-fullscreen-mode');
  2375. } else {
  2376. document.body.classList.remove('is-fullscreen-mode');
  2377. }
  2378. }
  2379. render() {
  2380. return null;
  2381. }
  2382. }
  2383. /* harmony default export */ var fullscreen_mode = (fullscreen_mode_FullscreenMode);
  2384. // EXTERNAL MODULE: external ["wp","compose"]
  2385. var external_wp_compose_ = __webpack_require__("K9lf");
  2386. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
  2387. /**
  2388. * External dependencies
  2389. */
  2390. /**
  2391. * WordPress dependencies
  2392. */
  2393. /**
  2394. * WordPress dependencies
  2395. */
  2396. function useHTMLClass(className) {
  2397. Object(external_wp_element_["useEffect"])(() => {
  2398. const element = document && document.querySelector(`html:not(.${className})`);
  2399. if (!element) {
  2400. return;
  2401. }
  2402. element.classList.toggle(className);
  2403. return () => {
  2404. element.classList.toggle(className);
  2405. };
  2406. }, [className]);
  2407. }
  2408. function InterfaceSkeleton({
  2409. footer,
  2410. header,
  2411. sidebar,
  2412. secondarySidebar,
  2413. notices,
  2414. content,
  2415. drawer,
  2416. actions,
  2417. labels,
  2418. className,
  2419. shortcuts
  2420. }, ref) {
  2421. const fallbackRef = Object(external_wp_element_["useRef"])();
  2422. const regionsClassName = Object(external_wp_components_["__unstableUseNavigateRegions"])(fallbackRef, shortcuts);
  2423. useHTMLClass('interface-interface-skeleton__html-container');
  2424. const defaultLabels = {
  2425. /* translators: accessibility text for the nav bar landmark region. */
  2426. drawer: Object(external_wp_i18n_["__"])('Drawer'),
  2427. /* translators: accessibility text for the top bar landmark region. */
  2428. header: Object(external_wp_i18n_["__"])('Header'),
  2429. /* translators: accessibility text for the content landmark region. */
  2430. body: Object(external_wp_i18n_["__"])('Content'),
  2431. /* translators: accessibility text for the secondary sidebar landmark region. */
  2432. secondarySidebar: Object(external_wp_i18n_["__"])('Block Library'),
  2433. /* translators: accessibility text for the settings landmark region. */
  2434. sidebar: Object(external_wp_i18n_["__"])('Settings'),
  2435. /* translators: accessibility text for the publish landmark region. */
  2436. actions: Object(external_wp_i18n_["__"])('Publish'),
  2437. /* translators: accessibility text for the footer landmark region. */
  2438. footer: Object(external_wp_i18n_["__"])('Footer')
  2439. };
  2440. const mergedLabels = { ...defaultLabels,
  2441. ...labels
  2442. };
  2443. return Object(external_wp_element_["createElement"])("div", {
  2444. ref: Object(external_wp_compose_["useMergeRefs"])([ref, fallbackRef]),
  2445. className: classnames_default()(className, 'interface-interface-skeleton', regionsClassName, !!footer && 'has-footer')
  2446. }, !!drawer && Object(external_wp_element_["createElement"])("div", {
  2447. className: "interface-interface-skeleton__drawer",
  2448. role: "region",
  2449. "aria-label": mergedLabels.drawer
  2450. }, drawer), Object(external_wp_element_["createElement"])("div", {
  2451. className: "interface-interface-skeleton__editor"
  2452. }, !!header && Object(external_wp_element_["createElement"])("div", {
  2453. className: "interface-interface-skeleton__header",
  2454. role: "region",
  2455. "aria-label": mergedLabels.header,
  2456. tabIndex: "-1"
  2457. }, header), Object(external_wp_element_["createElement"])("div", {
  2458. className: "interface-interface-skeleton__body"
  2459. }, !!secondarySidebar && Object(external_wp_element_["createElement"])("div", {
  2460. className: "interface-interface-skeleton__secondary-sidebar",
  2461. role: "region",
  2462. "aria-label": mergedLabels.secondarySidebar,
  2463. tabIndex: "-1"
  2464. }, secondarySidebar), !!notices && Object(external_wp_element_["createElement"])("div", {
  2465. className: "interface-interface-skeleton__notices"
  2466. }, notices), Object(external_wp_element_["createElement"])("div", {
  2467. className: "interface-interface-skeleton__content",
  2468. role: "region",
  2469. "aria-label": mergedLabels.body,
  2470. tabIndex: "-1"
  2471. }, content), !!sidebar && Object(external_wp_element_["createElement"])("div", {
  2472. className: "interface-interface-skeleton__sidebar",
  2473. role: "region",
  2474. "aria-label": mergedLabels.sidebar,
  2475. tabIndex: "-1"
  2476. }, sidebar), !!actions && Object(external_wp_element_["createElement"])("div", {
  2477. className: "interface-interface-skeleton__actions",
  2478. role: "region",
  2479. "aria-label": mergedLabels.actions,
  2480. tabIndex: "-1"
  2481. }, actions))), !!footer && Object(external_wp_element_["createElement"])("div", {
  2482. className: "interface-interface-skeleton__footer",
  2483. role: "region",
  2484. "aria-label": mergedLabels.footer,
  2485. tabIndex: "-1"
  2486. }, footer));
  2487. }
  2488. /* harmony default export */ var interface_skeleton = (Object(external_wp_element_["forwardRef"])(InterfaceSkeleton));
  2489. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
  2490. // CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
  2491. /***/ }),
  2492. /***/ "URob":
  2493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2494. "use strict";
  2495. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  2496. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  2497. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  2498. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  2499. /**
  2500. * WordPress dependencies
  2501. */
  2502. const starFilled = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  2503. xmlns: "http://www.w3.org/2000/svg",
  2504. viewBox: "0 0 24 24"
  2505. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  2506. d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
  2507. }));
  2508. /* harmony default export */ __webpack_exports__["a"] = (starFilled);
  2509. /***/ }),
  2510. /***/ "VKE3":
  2511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2512. "use strict";
  2513. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  2514. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  2515. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  2516. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  2517. /**
  2518. * WordPress dependencies
  2519. */
  2520. const moreVertical = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  2521. xmlns: "http://www.w3.org/2000/svg",
  2522. viewBox: "0 0 24 24"
  2523. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  2524. d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
  2525. }));
  2526. /* harmony default export */ __webpack_exports__["a"] = (moreVertical);
  2527. /***/ }),
  2528. /***/ "Xxwi":
  2529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2530. "use strict";
  2531. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  2532. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  2533. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  2534. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  2535. /**
  2536. * WordPress dependencies
  2537. */
  2538. const starEmpty = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  2539. xmlns: "http://www.w3.org/2000/svg",
  2540. viewBox: "0 0 24 24"
  2541. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  2542. fillRule: "evenodd",
  2543. d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
  2544. clipRule: "evenodd"
  2545. }));
  2546. /* harmony default export */ __webpack_exports__["a"] = (starEmpty);
  2547. /***/ }),
  2548. /***/ "Y5n4":
  2549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2550. "use strict";
  2551. // EXPORTS
  2552. __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ enable_custom_fields; });
  2553. __webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ enable_panel; });
  2554. __webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ enable_plugin_document_setting_panel; });
  2555. __webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ enable_publish_sidebar; });
  2556. __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ enable_feature; });
  2557. // EXTERNAL MODULE: external ["wp","element"]
  2558. var external_wp_element_ = __webpack_require__("GRId");
  2559. // EXTERNAL MODULE: external ["wp","i18n"]
  2560. var external_wp_i18n_ = __webpack_require__("l3Sj");
  2561. // EXTERNAL MODULE: external ["wp","components"]
  2562. var external_wp_components_ = __webpack_require__("tI+e");
  2563. // EXTERNAL MODULE: external ["wp","data"]
  2564. var external_wp_data_ = __webpack_require__("1ZqX");
  2565. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/base.js
  2566. /**
  2567. * WordPress dependencies
  2568. */
  2569. function BaseOption({
  2570. help,
  2571. label,
  2572. isChecked,
  2573. onChange,
  2574. children
  2575. }) {
  2576. return Object(external_wp_element_["createElement"])("div", {
  2577. className: "edit-post-preferences-modal__option"
  2578. }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
  2579. help: help,
  2580. label: label,
  2581. checked: isChecked,
  2582. onChange: onChange
  2583. }), children);
  2584. }
  2585. /* harmony default export */ var base = (BaseOption);
  2586. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-custom-fields.js
  2587. /**
  2588. * WordPress dependencies
  2589. */
  2590. /**
  2591. * Internal dependencies
  2592. */
  2593. function CustomFieldsConfirmation({
  2594. willEnable
  2595. }) {
  2596. const [isReloading, setIsReloading] = Object(external_wp_element_["useState"])(false);
  2597. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("p", {
  2598. className: "edit-post-preferences-modal__custom-fields-confirmation-message"
  2599. }, Object(external_wp_i18n_["__"])('A page reload is required for this change. Make sure your content is saved before reloading.')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  2600. className: "edit-post-preferences-modal__custom-fields-confirmation-button",
  2601. isSecondary: true,
  2602. isBusy: isReloading,
  2603. disabled: isReloading,
  2604. onClick: () => {
  2605. setIsReloading(true);
  2606. document.getElementById('toggle-custom-fields-form').submit();
  2607. }
  2608. }, willEnable ? Object(external_wp_i18n_["__"])('Enable & Reload') : Object(external_wp_i18n_["__"])('Disable & Reload')));
  2609. }
  2610. function EnableCustomFieldsOption({
  2611. label,
  2612. areCustomFieldsEnabled
  2613. }) {
  2614. const [isChecked, setIsChecked] = Object(external_wp_element_["useState"])(areCustomFieldsEnabled);
  2615. return Object(external_wp_element_["createElement"])(base, {
  2616. label: label,
  2617. isChecked: isChecked,
  2618. onChange: setIsChecked
  2619. }, isChecked !== areCustomFieldsEnabled && Object(external_wp_element_["createElement"])(CustomFieldsConfirmation, {
  2620. willEnable: isChecked
  2621. }));
  2622. }
  2623. /* harmony default export */ var enable_custom_fields = (Object(external_wp_data_["withSelect"])(select => ({
  2624. areCustomFieldsEnabled: !!select('core/editor').getEditorSettings().enableCustomFields
  2625. }))(EnableCustomFieldsOption));
  2626. // EXTERNAL MODULE: external ["wp","compose"]
  2627. var external_wp_compose_ = __webpack_require__("K9lf");
  2628. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules
  2629. var store = __webpack_require__("T40v");
  2630. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-panel.js
  2631. /**
  2632. * WordPress dependencies
  2633. */
  2634. /**
  2635. * Internal dependencies
  2636. */
  2637. /* harmony default export */ var enable_panel = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, {
  2638. panelName
  2639. }) => {
  2640. const {
  2641. isEditorPanelEnabled,
  2642. isEditorPanelRemoved
  2643. } = select(store["a" /* store */]);
  2644. return {
  2645. isRemoved: isEditorPanelRemoved(panelName),
  2646. isChecked: isEditorPanelEnabled(panelName)
  2647. };
  2648. }), Object(external_wp_compose_["ifCondition"])(({
  2649. isRemoved
  2650. }) => !isRemoved), Object(external_wp_data_["withDispatch"])((dispatch, {
  2651. panelName
  2652. }) => ({
  2653. onChange: () => dispatch(store["a" /* store */]).toggleEditorPanelEnabled(panelName)
  2654. })))(base));
  2655. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js
  2656. /**
  2657. * WordPress dependencies
  2658. */
  2659. /**
  2660. * Internal dependencies
  2661. */
  2662. const {
  2663. Fill,
  2664. Slot
  2665. } = Object(external_wp_components_["createSlotFill"])('EnablePluginDocumentSettingPanelOption');
  2666. const EnablePluginDocumentSettingPanelOption = ({
  2667. label,
  2668. panelName
  2669. }) => Object(external_wp_element_["createElement"])(Fill, null, Object(external_wp_element_["createElement"])(enable_panel, {
  2670. label: label,
  2671. panelName: panelName
  2672. }));
  2673. EnablePluginDocumentSettingPanelOption.Slot = Slot;
  2674. /* harmony default export */ var enable_plugin_document_setting_panel = (EnablePluginDocumentSettingPanelOption);
  2675. // EXTERNAL MODULE: external ["wp","viewport"]
  2676. var external_wp_viewport_ = __webpack_require__("KEfo");
  2677. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-publish-sidebar.js
  2678. /**
  2679. * WordPress dependencies
  2680. */
  2681. /**
  2682. * Internal dependencies
  2683. */
  2684. /* harmony default export */ var enable_publish_sidebar = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({
  2685. isChecked: select('core/editor').isPublishSidebarEnabled()
  2686. })), Object(external_wp_data_["withDispatch"])(dispatch => {
  2687. const {
  2688. enablePublishSidebar,
  2689. disablePublishSidebar
  2690. } = dispatch('core/editor');
  2691. return {
  2692. onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar()
  2693. };
  2694. }), // In < medium viewports we override this option and always show the publish sidebar.
  2695. // See the edit-post's header component for the specific logic.
  2696. Object(external_wp_viewport_["ifViewportMatches"])('medium'))(base));
  2697. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/enable-feature.js
  2698. /**
  2699. * WordPress dependencies
  2700. */
  2701. /**
  2702. * Internal dependencies
  2703. */
  2704. /* harmony default export */ var enable_feature = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, {
  2705. featureName
  2706. }) => {
  2707. const {
  2708. isFeatureActive
  2709. } = select(store["a" /* store */]);
  2710. return {
  2711. isChecked: isFeatureActive(featureName)
  2712. };
  2713. }), Object(external_wp_data_["withDispatch"])((dispatch, {
  2714. featureName
  2715. }) => ({
  2716. onChange: () => dispatch(store["a" /* store */]).toggleFeature(featureName)
  2717. })))(base));
  2718. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js
  2719. /***/ }),
  2720. /***/ "YLtl":
  2721. /***/ (function(module, exports) {
  2722. (function() { module.exports = window["lodash"]; }());
  2723. /***/ }),
  2724. /***/ "Z23Y":
  2725. /***/ (function(module, exports) {
  2726. (function() { module.exports = window["wp"]["warning"]; }());
  2727. /***/ }),
  2728. /***/ "axFQ":
  2729. /***/ (function(module, exports) {
  2730. (function() { module.exports = window["wp"]["blockEditor"]; }());
  2731. /***/ }),
  2732. /***/ "bWcr":
  2733. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2734. "use strict";
  2735. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  2736. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  2737. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  2738. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  2739. /**
  2740. * WordPress dependencies
  2741. */
  2742. const closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  2743. xmlns: "http://www.w3.org/2000/svg",
  2744. viewBox: "0 0 24 24"
  2745. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  2746. 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"
  2747. }));
  2748. /* harmony default export */ __webpack_exports__["a"] = (closeSmall);
  2749. /***/ }),
  2750. /***/ "cDcd":
  2751. /***/ (function(module, exports) {
  2752. (function() { module.exports = window["React"]; }());
  2753. /***/ }),
  2754. /***/ "cjQ8":
  2755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2756. "use strict";
  2757. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  2758. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  2759. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  2760. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  2761. /**
  2762. * WordPress dependencies
  2763. */
  2764. const arrowLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  2765. xmlns: "http://www.w3.org/2000/svg",
  2766. viewBox: "0 0 24 24"
  2767. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  2768. d: "M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"
  2769. }));
  2770. /* harmony default export */ __webpack_exports__["a"] = (arrowLeft);
  2771. /***/ }),
  2772. /***/ "dSQ2":
  2773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2774. "use strict";
  2775. // ESM COMPAT FLAG
  2776. __webpack_require__.r(__webpack_exports__);
  2777. // EXPORTS
  2778. __webpack_require__.d(__webpack_exports__, "reinitializeEditor", function() { return /* binding */ reinitializeEditor; });
  2779. __webpack_require__.d(__webpack_exports__, "initializeEditor", function() { return /* binding */ initializeEditor; });
  2780. __webpack_require__.d(__webpack_exports__, "PluginBlockSettingsMenuItem", function() { return /* reexport */ plugin_block_settings_menu_item; });
  2781. __webpack_require__.d(__webpack_exports__, "PluginDocumentSettingPanel", function() { return /* reexport */ plugin_document_setting_panel["a" /* default */]; });
  2782. __webpack_require__.d(__webpack_exports__, "PluginMoreMenuItem", function() { return /* reexport */ plugin_more_menu_item; });
  2783. __webpack_require__.d(__webpack_exports__, "PluginPostPublishPanel", function() { return /* reexport */ plugin_post_publish_panel; });
  2784. __webpack_require__.d(__webpack_exports__, "PluginPostStatusInfo", function() { return /* reexport */ plugin_post_status_info; });
  2785. __webpack_require__.d(__webpack_exports__, "PluginPrePublishPanel", function() { return /* reexport */ plugin_pre_publish_panel; });
  2786. __webpack_require__.d(__webpack_exports__, "PluginSidebar", function() { return /* reexport */ PluginSidebarEditPost; });
  2787. __webpack_require__.d(__webpack_exports__, "PluginSidebarMoreMenuItem", function() { return /* reexport */ PluginSidebarMoreMenuItem; });
  2788. __webpack_require__.d(__webpack_exports__, "__experimentalFullscreenModeClose", function() { return /* reexport */ fullscreen_mode_close; });
  2789. __webpack_require__.d(__webpack_exports__, "__experimentalMainDashboardButton", function() { return /* reexport */ main_dashboard_button; });
  2790. __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store["a" /* store */]; });
  2791. // EXTERNAL MODULE: external ["wp","element"]
  2792. var external_wp_element_ = __webpack_require__("GRId");
  2793. // EXTERNAL MODULE: external ["wp","coreData"]
  2794. var external_wp_coreData_ = __webpack_require__("jZUy");
  2795. // EXTERNAL MODULE: external ["wp","blockEditor"]
  2796. var external_wp_blockEditor_ = __webpack_require__("axFQ");
  2797. // EXTERNAL MODULE: external ["wp","editor"]
  2798. var external_wp_editor_ = __webpack_require__("jSdM");
  2799. // EXTERNAL MODULE: external ["wp","blockLibrary"]
  2800. var external_wp_blockLibrary_ = __webpack_require__("QyPg");
  2801. // EXTERNAL MODULE: external ["wp","hooks"]
  2802. var external_wp_hooks_ = __webpack_require__("g56x");
  2803. // EXTERNAL MODULE: external ["wp","mediaUtils"]
  2804. var external_wp_mediaUtils_ = __webpack_require__("6aBm");
  2805. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/components/index.js
  2806. /**
  2807. * WordPress dependencies
  2808. */
  2809. const replaceMediaUpload = () => external_wp_mediaUtils_["MediaUpload"];
  2810. Object(external_wp_hooks_["addFilter"])('editor.MediaUpload', 'core/edit-post/replace-media-upload', replaceMediaUpload);
  2811. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  2812. var esm_extends = __webpack_require__("wx14");
  2813. // EXTERNAL MODULE: external "lodash"
  2814. var external_lodash_ = __webpack_require__("YLtl");
  2815. // EXTERNAL MODULE: external ["wp","blocks"]
  2816. var external_wp_blocks_ = __webpack_require__("HSyU");
  2817. // EXTERNAL MODULE: external ["wp","components"]
  2818. var external_wp_components_ = __webpack_require__("tI+e");
  2819. // EXTERNAL MODULE: external ["wp","data"]
  2820. var external_wp_data_ = __webpack_require__("1ZqX");
  2821. // EXTERNAL MODULE: external ["wp","i18n"]
  2822. var external_wp_i18n_ = __webpack_require__("l3Sj");
  2823. // EXTERNAL MODULE: external ["wp","compose"]
  2824. var external_wp_compose_ = __webpack_require__("K9lf");
  2825. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/validate-multiple-use/index.js
  2826. /**
  2827. * External dependencies
  2828. */
  2829. /**
  2830. * WordPress dependencies
  2831. */
  2832. const enhance = Object(external_wp_compose_["compose"])(
  2833. /**
  2834. * For blocks whose block type doesn't support `multiple`, provides the
  2835. * wrapped component with `originalBlockClientId` -- a reference to the
  2836. * first block of the same type in the content -- if and only if that
  2837. * "original" block is not the current one. Thus, an inexisting
  2838. * `originalBlockClientId` prop signals that the block is valid.
  2839. *
  2840. * @param {WPComponent} WrappedBlockEdit A filtered BlockEdit instance.
  2841. *
  2842. * @return {WPComponent} Enhanced component with merged state data props.
  2843. */
  2844. Object(external_wp_data_["withSelect"])((select, block) => {
  2845. const multiple = Object(external_wp_blocks_["hasBlockSupport"])(block.name, 'multiple', true); // For block types with `multiple` support, there is no "original
  2846. // block" to be found in the content, as the block itself is valid.
  2847. if (multiple) {
  2848. return {};
  2849. } // Otherwise, only pass `originalBlockClientId` if it refers to a different
  2850. // block from the current one.
  2851. const blocks = select(external_wp_blockEditor_["store"]).getBlocks();
  2852. const firstOfSameType = Object(external_lodash_["find"])(blocks, ({
  2853. name
  2854. }) => block.name === name);
  2855. const isInvalid = firstOfSameType && firstOfSameType.clientId !== block.clientId;
  2856. return {
  2857. originalBlockClientId: isInvalid && firstOfSameType.clientId
  2858. };
  2859. }), Object(external_wp_data_["withDispatch"])((dispatch, {
  2860. originalBlockClientId
  2861. }) => ({
  2862. selectFirst: () => dispatch(external_wp_blockEditor_["store"]).selectBlock(originalBlockClientId)
  2863. })));
  2864. const withMultipleValidation = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => {
  2865. return enhance(({
  2866. originalBlockClientId,
  2867. selectFirst,
  2868. ...props
  2869. }) => {
  2870. if (!originalBlockClientId) {
  2871. return Object(external_wp_element_["createElement"])(BlockEdit, props);
  2872. }
  2873. const blockType = Object(external_wp_blocks_["getBlockType"])(props.name);
  2874. const outboundType = getOutboundType(props.name);
  2875. return [Object(external_wp_element_["createElement"])("div", {
  2876. key: "invalid-preview",
  2877. style: {
  2878. minHeight: '60px'
  2879. }
  2880. }, Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({
  2881. key: "block-edit"
  2882. }, props))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
  2883. key: "multiple-use-warning",
  2884. actions: [Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  2885. key: "find-original",
  2886. isSecondary: true,
  2887. onClick: selectFirst
  2888. }, Object(external_wp_i18n_["__"])('Find original')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  2889. key: "remove",
  2890. isSecondary: true,
  2891. onClick: () => props.onReplace([])
  2892. }, Object(external_wp_i18n_["__"])('Remove')), outboundType && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  2893. key: "transform",
  2894. isSecondary: true,
  2895. onClick: () => props.onReplace(Object(external_wp_blocks_["createBlock"])(outboundType.name, props.attributes))
  2896. }, Object(external_wp_i18n_["__"])('Transform into:'), " ", outboundType.title)]
  2897. }, Object(external_wp_element_["createElement"])("strong", null, blockType.title, ": "), Object(external_wp_i18n_["__"])('This block can only be used once.'))];
  2898. });
  2899. }, 'withMultipleValidation');
  2900. /**
  2901. * Given a base block name, returns the default block type to which to offer
  2902. * transforms.
  2903. *
  2904. * @param {string} blockName Base block name.
  2905. *
  2906. * @return {?Object} The chosen default block type.
  2907. */
  2908. function getOutboundType(blockName) {
  2909. // Grab the first outbound transform
  2910. const transform = Object(external_wp_blocks_["findTransform"])(Object(external_wp_blocks_["getBlockTransforms"])('to', blockName), ({
  2911. type,
  2912. blocks
  2913. }) => type === 'block' && blocks.length === 1 // What about when .length > 1?
  2914. );
  2915. if (!transform) {
  2916. return null;
  2917. }
  2918. return Object(external_wp_blocks_["getBlockType"])(transform.blocks[0]);
  2919. }
  2920. Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/edit-post/validate-multiple-use/with-multiple-validation', withMultipleValidation);
  2921. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/index.js
  2922. /**
  2923. * Internal dependencies
  2924. */
  2925. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
  2926. var external = __webpack_require__("K+tz");
  2927. // EXTERNAL MODULE: external ["wp","plugins"]
  2928. var external_wp_plugins_ = __webpack_require__("TvNi");
  2929. // EXTERNAL MODULE: external ["wp","url"]
  2930. var external_wp_url_ = __webpack_require__("Mmq9");
  2931. // EXTERNAL MODULE: external ["wp","notices"]
  2932. var external_wp_notices_ = __webpack_require__("onLe");
  2933. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/copy-content-menu-item/index.js
  2934. /**
  2935. * WordPress dependencies
  2936. */
  2937. function CopyContentMenuItem() {
  2938. const {
  2939. createNotice
  2940. } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
  2941. const getText = Object(external_wp_data_["useSelect"])(select => () => select(external_wp_editor_["store"]).getEditedPostAttribute('content'), []);
  2942. function onSuccess() {
  2943. createNotice('info', Object(external_wp_i18n_["__"])('All content copied.'), {
  2944. isDismissible: true,
  2945. type: 'snackbar'
  2946. });
  2947. }
  2948. const ref = Object(external_wp_compose_["useCopyToClipboard"])(getText, onSuccess);
  2949. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  2950. ref: ref
  2951. }, Object(external_wp_i18n_["__"])('Copy all content'));
  2952. }
  2953. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js + 5 modules
  2954. var store = __webpack_require__("T40v");
  2955. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/manage-blocks-menu-item/index.js
  2956. /**
  2957. * WordPress dependencies
  2958. */
  2959. /**
  2960. * Internal dependencies
  2961. */
  2962. function ManageBlocksMenuItem({
  2963. openModal
  2964. }) {
  2965. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  2966. onClick: () => {
  2967. openModal('edit-post/manage-blocks');
  2968. }
  2969. }, Object(external_wp_i18n_["__"])('Block Manager'));
  2970. }
  2971. /* harmony default export */ var manage_blocks_menu_item = (Object(external_wp_data_["withDispatch"])(dispatch => {
  2972. const {
  2973. openModal
  2974. } = dispatch(store["a" /* store */]);
  2975. return {
  2976. openModal
  2977. };
  2978. })(ManageBlocksMenuItem));
  2979. // EXTERNAL MODULE: external ["wp","keycodes"]
  2980. var external_wp_keycodes_ = __webpack_require__("RxS6");
  2981. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js
  2982. /**
  2983. * WordPress dependencies
  2984. */
  2985. /**
  2986. * Internal dependencies
  2987. */
  2988. function KeyboardShortcutsHelpMenuItem({
  2989. openModal
  2990. }) {
  2991. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  2992. onClick: () => {
  2993. openModal('edit-post/keyboard-shortcut-help');
  2994. },
  2995. shortcut: external_wp_keycodes_["displayShortcut"].access('h')
  2996. }, Object(external_wp_i18n_["__"])('Keyboard shortcuts'));
  2997. }
  2998. /* harmony default export */ var keyboard_shortcuts_help_menu_item = (Object(external_wp_data_["withDispatch"])(dispatch => {
  2999. const {
  3000. openModal
  3001. } = dispatch(store["a" /* store */]);
  3002. return {
  3003. openModal
  3004. };
  3005. })(KeyboardShortcutsHelpMenuItem));
  3006. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/tools-more-menu-group/index.js
  3007. /**
  3008. * External dependencies
  3009. */
  3010. /**
  3011. * WordPress dependencies
  3012. */
  3013. const {
  3014. Fill: ToolsMoreMenuGroup,
  3015. Slot
  3016. } = Object(external_wp_components_["createSlotFill"])('ToolsMoreMenuGroup');
  3017. ToolsMoreMenuGroup.Slot = ({
  3018. fillProps
  3019. }) => Object(external_wp_element_["createElement"])(Slot, {
  3020. fillProps: fillProps
  3021. }, fills => !Object(external_lodash_["isEmpty"])(fills) && Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
  3022. label: Object(external_wp_i18n_["__"])('Tools')
  3023. }, fills));
  3024. /* harmony default export */ var tools_more_menu_group = (ToolsMoreMenuGroup);
  3025. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/welcome-guide-menu-item/index.js
  3026. /**
  3027. * WordPress dependencies
  3028. */
  3029. /**
  3030. * Internal dependencies
  3031. */
  3032. function WelcomeGuideMenuItem() {
  3033. const isTemplateMode = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).isEditingTemplate(), []);
  3034. const {
  3035. toggleFeature
  3036. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  3037. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  3038. onClick: () => toggleFeature(isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide')
  3039. }, Object(external_wp_i18n_["__"])('Welcome Guide'));
  3040. }
  3041. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/index.js
  3042. /**
  3043. * WordPress dependencies
  3044. */
  3045. /**
  3046. * Internal dependencies
  3047. */
  3048. Object(external_wp_plugins_["registerPlugin"])('edit-post', {
  3049. render() {
  3050. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(tools_more_menu_group, null, ({
  3051. onClose
  3052. }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(manage_blocks_menu_item, {
  3053. onSelect: onClose
  3054. }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  3055. role: "menuitem",
  3056. href: Object(external_wp_url_["addQueryArgs"])('edit.php', {
  3057. post_type: 'wp_block'
  3058. })
  3059. }, Object(external_wp_i18n_["__"])('Manage Reusable blocks')), Object(external_wp_element_["createElement"])(keyboard_shortcuts_help_menu_item, {
  3060. onSelect: onClose
  3061. }), Object(external_wp_element_["createElement"])(WelcomeGuideMenuItem, null), Object(external_wp_element_["createElement"])(CopyContentMenuItem, null), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  3062. role: "menuitem",
  3063. icon: external["a" /* default */],
  3064. href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/'),
  3065. target: "_blank",
  3066. rel: "noopener noreferrer"
  3067. }, Object(external_wp_i18n_["__"])('Help'), Object(external_wp_element_["createElement"])(external_wp_components_["VisuallyHidden"], {
  3068. as: "span"
  3069. },
  3070. /* translators: accessibility text */
  3071. Object(external_wp_i18n_["__"])('(opens in a new tab)'))))));
  3072. }
  3073. });
  3074. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/prevent-event-discovery.js
  3075. /* harmony default export */ var prevent_event_discovery = ({
  3076. 't a l e s o f g u t e n b e r g': event => {
  3077. const {
  3078. ownerDocument
  3079. } = event.target;
  3080. if (!ownerDocument.activeElement.classList.contains('edit-post-visual-editor') && ownerDocument.activeElement !== ownerDocument.body) {
  3081. return;
  3082. }
  3083. event.preventDefault();
  3084. window.wp.data.dispatch('core/block-editor').insertBlock(window.wp.blocks.createBlock('core/paragraph', {
  3085. content: '🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️'
  3086. }));
  3087. }
  3088. });
  3089. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  3090. var classnames = __webpack_require__("TSYQ");
  3091. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  3092. // EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 15 modules
  3093. var build_module = __webpack_require__("U60i");
  3094. // EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
  3095. var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
  3096. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/text-editor/index.js
  3097. /**
  3098. * WordPress dependencies
  3099. */
  3100. /**
  3101. * Internal dependencies
  3102. */
  3103. function TextEditor({
  3104. onExit,
  3105. isRichEditingEnabled
  3106. }) {
  3107. return Object(external_wp_element_["createElement"])("div", {
  3108. className: "edit-post-text-editor"
  3109. }, isRichEditingEnabled && Object(external_wp_element_["createElement"])("div", {
  3110. className: "edit-post-text-editor__toolbar"
  3111. }, Object(external_wp_element_["createElement"])("h2", null, Object(external_wp_i18n_["__"])('Editing code')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  3112. isTertiary: true,
  3113. onClick: onExit,
  3114. shortcut: external_wp_keycodes_["displayShortcut"].secondary('m')
  3115. }, Object(external_wp_i18n_["__"])('Exit code editor')), Object(external_wp_element_["createElement"])(external_wp_editor_["TextEditorGlobalKeyboardShortcuts"], null)), Object(external_wp_element_["createElement"])("div", {
  3116. className: "edit-post-text-editor__body"
  3117. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTextEditor"], null)));
  3118. }
  3119. /* harmony default export */ var text_editor = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({
  3120. isRichEditingEnabled: select('core/editor').getEditorSettings().richEditingEnabled
  3121. })), Object(external_wp_data_["withDispatch"])(dispatch => {
  3122. return {
  3123. onExit() {
  3124. dispatch(store["a" /* store */]).switchEditorMode('visual');
  3125. }
  3126. };
  3127. }))(TextEditor));
  3128. // CONCATENATED MODULE: ./node_modules/framer-motion/node_modules/tslib/tslib.es6.js
  3129. /*! *****************************************************************************
  3130. Copyright (c) Microsoft Corporation.
  3131. Permission to use, copy, modify, and/or distribute this software for any
  3132. purpose with or without fee is hereby granted.
  3133. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  3134. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  3135. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  3136. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  3137. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  3138. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  3139. PERFORMANCE OF THIS SOFTWARE.
  3140. ***************************************************************************** */
  3141. /* global Reflect, Promise */
  3142. var extendStatics = function(d, b) {
  3143. extendStatics = Object.setPrototypeOf ||
  3144. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3145. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  3146. return extendStatics(d, b);
  3147. };
  3148. function __extends(d, b) {
  3149. if (typeof b !== "function" && b !== null)
  3150. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  3151. extendStatics(d, b);
  3152. function __() { this.constructor = d; }
  3153. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3154. }
  3155. var __assign = function() {
  3156. __assign = Object.assign || function __assign(t) {
  3157. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3158. s = arguments[i];
  3159. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3160. }
  3161. return t;
  3162. }
  3163. return __assign.apply(this, arguments);
  3164. }
  3165. function __rest(s, e) {
  3166. var t = {};
  3167. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  3168. t[p] = s[p];
  3169. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  3170. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  3171. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  3172. t[p[i]] = s[p[i]];
  3173. }
  3174. return t;
  3175. }
  3176. function __decorate(decorators, target, key, desc) {
  3177. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  3178. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  3179. 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;
  3180. return c > 3 && r && Object.defineProperty(target, key, r), r;
  3181. }
  3182. function __param(paramIndex, decorator) {
  3183. return function (target, key) { decorator(target, key, paramIndex); }
  3184. }
  3185. function __metadata(metadataKey, metadataValue) {
  3186. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  3187. }
  3188. function __awaiter(thisArg, _arguments, P, generator) {
  3189. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3190. return new (P || (P = Promise))(function (resolve, reject) {
  3191. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3192. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3193. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3194. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3195. });
  3196. }
  3197. function __generator(thisArg, body) {
  3198. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  3199. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  3200. function verb(n) { return function (v) { return step([n, v]); }; }
  3201. function step(op) {
  3202. if (f) throw new TypeError("Generator is already executing.");
  3203. while (_) try {
  3204. 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;
  3205. if (y = 0, t) op = [op[0] & 2, t.value];
  3206. switch (op[0]) {
  3207. case 0: case 1: t = op; break;
  3208. case 4: _.label++; return { value: op[1], done: false };
  3209. case 5: _.label++; y = op[1]; op = [0]; continue;
  3210. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  3211. default:
  3212. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  3213. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  3214. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  3215. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  3216. if (t[2]) _.ops.pop();
  3217. _.trys.pop(); continue;
  3218. }
  3219. op = body.call(thisArg, _);
  3220. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  3221. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  3222. }
  3223. }
  3224. var __createBinding = Object.create ? (function(o, m, k, k2) {
  3225. if (k2 === undefined) k2 = k;
  3226. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3227. }) : (function(o, m, k, k2) {
  3228. if (k2 === undefined) k2 = k;
  3229. o[k2] = m[k];
  3230. });
  3231. function __exportStar(m, o) {
  3232. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  3233. }
  3234. function __values(o) {
  3235. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  3236. if (m) return m.call(o);
  3237. if (o && typeof o.length === "number") return {
  3238. next: function () {
  3239. if (o && i >= o.length) o = void 0;
  3240. return { value: o && o[i++], done: !o };
  3241. }
  3242. };
  3243. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  3244. }
  3245. function __read(o, n) {
  3246. var m = typeof Symbol === "function" && o[Symbol.iterator];
  3247. if (!m) return o;
  3248. var i = m.call(o), r, ar = [], e;
  3249. try {
  3250. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  3251. }
  3252. catch (error) { e = { error: error }; }
  3253. finally {
  3254. try {
  3255. if (r && !r.done && (m = i["return"])) m.call(i);
  3256. }
  3257. finally { if (e) throw e.error; }
  3258. }
  3259. return ar;
  3260. }
  3261. /** @deprecated */
  3262. function __spread() {
  3263. for (var ar = [], i = 0; i < arguments.length; i++)
  3264. ar = ar.concat(__read(arguments[i]));
  3265. return ar;
  3266. }
  3267. /** @deprecated */
  3268. function __spreadArrays() {
  3269. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  3270. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  3271. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  3272. r[k] = a[j];
  3273. return r;
  3274. }
  3275. function __spreadArray(to, from, pack) {
  3276. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  3277. if (ar || !(i in from)) {
  3278. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  3279. ar[i] = from[i];
  3280. }
  3281. }
  3282. return to.concat(ar || Array.prototype.slice.call(from));
  3283. }
  3284. function __await(v) {
  3285. return this instanceof __await ? (this.v = v, this) : new __await(v);
  3286. }
  3287. function __asyncGenerator(thisArg, _arguments, generator) {
  3288. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  3289. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  3290. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  3291. 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); }); }; }
  3292. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  3293. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  3294. function fulfill(value) { resume("next", value); }
  3295. function reject(value) { resume("throw", value); }
  3296. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  3297. }
  3298. function __asyncDelegator(o) {
  3299. var i, p;
  3300. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  3301. 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; }
  3302. }
  3303. function __asyncValues(o) {
  3304. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  3305. var m = o[Symbol.asyncIterator], i;
  3306. 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);
  3307. 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); }); }; }
  3308. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  3309. }
  3310. function __makeTemplateObject(cooked, raw) {
  3311. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  3312. return cooked;
  3313. };
  3314. var __setModuleDefault = Object.create ? (function(o, v) {
  3315. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3316. }) : function(o, v) {
  3317. o["default"] = v;
  3318. };
  3319. function __importStar(mod) {
  3320. if (mod && mod.__esModule) return mod;
  3321. var result = {};
  3322. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3323. __setModuleDefault(result, mod);
  3324. return result;
  3325. }
  3326. function __importDefault(mod) {
  3327. return (mod && mod.__esModule) ? mod : { default: mod };
  3328. }
  3329. function __classPrivateFieldGet(receiver, state, kind, f) {
  3330. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  3331. 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");
  3332. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  3333. }
  3334. function __classPrivateFieldSet(receiver, state, value, kind, f) {
  3335. if (kind === "m") throw new TypeError("Private method is not writable");
  3336. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  3337. 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");
  3338. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  3339. }
  3340. // EXTERNAL MODULE: external "React"
  3341. var external_React_ = __webpack_require__("cDcd");
  3342. var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
  3343. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.js
  3344. var createDefinition = function (propNames) { return ({
  3345. isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); },
  3346. }); };
  3347. var featureDefinitions = {
  3348. measureLayout: createDefinition([
  3349. "layout",
  3350. "layoutId",
  3351. "drag",
  3352. "_layoutResetTransform",
  3353. ]),
  3354. animation: createDefinition([
  3355. "animate",
  3356. "exit",
  3357. "variants",
  3358. "whileHover",
  3359. "whileTap",
  3360. "whileFocus",
  3361. "whileDrag",
  3362. ]),
  3363. exit: createDefinition(["exit"]),
  3364. drag: createDefinition(["drag", "dragControls"]),
  3365. focus: createDefinition(["whileFocus"]),
  3366. hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]),
  3367. tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]),
  3368. pan: createDefinition([
  3369. "onPan",
  3370. "onPanStart",
  3371. "onPanSessionStart",
  3372. "onPanEnd",
  3373. ]),
  3374. layoutAnimation: createDefinition(["layout", "layoutId"]),
  3375. };
  3376. function loadFeatures(features) {
  3377. for (var key in features) {
  3378. var Component = features[key];
  3379. if (Component !== null)
  3380. featureDefinitions[key].Component = Component;
  3381. }
  3382. }
  3383. // CONCATENATED MODULE: ./node_modules/hey-listen/dist/hey-listen.es.js
  3384. var warning = function () { };
  3385. var invariant = function () { };
  3386. if (false) {}
  3387. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.js
  3388. var LazyContext = Object(external_React_["createContext"])({ strict: false });
  3389. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-features.js
  3390. var featureNames = Object.keys(featureDefinitions);
  3391. var numFeatures = featureNames.length;
  3392. /**
  3393. * Load features via renderless components based on the provided MotionProps.
  3394. */
  3395. function useFeatures(props, visualElement, preloadedFeatures) {
  3396. var features = [];
  3397. var lazyContext = Object(external_React_["useContext"])(LazyContext);
  3398. if (!visualElement)
  3399. return null;
  3400. /**
  3401. * If we're in development mode, check to make sure we're not rendering a motion component
  3402. * as a child of LazyMotion, as this will break the file-size benefits of using it.
  3403. */
  3404. if (false) {}
  3405. for (var i = 0; i < numFeatures; i++) {
  3406. var name_1 = featureNames[i];
  3407. var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;
  3408. /**
  3409. * It might be possible in the future to use this moment to
  3410. * dynamically request functionality. In initial tests this
  3411. * was producing a lot of duplication amongst bundles.
  3412. */
  3413. if (isEnabled(props) && Component) {
  3414. features.push(external_React_["createElement"](Component, __assign({ key: name_1 }, props, { visualElement: visualElement })));
  3415. }
  3416. }
  3417. return features;
  3418. }
  3419. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.js
  3420. /**
  3421. * @public
  3422. */
  3423. var MotionConfigContext = Object(external_React_["createContext"])({
  3424. transformPagePoint: function (p) { return p; },
  3425. isStatic: false,
  3426. });
  3427. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.js
  3428. var MotionContext = Object(external_React_["createContext"])({});
  3429. function useVisualElementContext() {
  3430. return Object(external_React_["useContext"])(MotionContext).visualElement;
  3431. }
  3432. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.js
  3433. /**
  3434. * @public
  3435. */
  3436. var PresenceContext = Object(external_React_["createContext"])(null);
  3437. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.js
  3438. /**
  3439. * Creates a constant value over the lifecycle of a component.
  3440. *
  3441. * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
  3442. * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
  3443. * you can ensure that initialisers don't execute twice or more.
  3444. */
  3445. function useConstant(init) {
  3446. var ref = Object(external_React_["useRef"])(null);
  3447. if (ref.current === null) {
  3448. ref.current = init();
  3449. }
  3450. return ref.current;
  3451. }
  3452. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js
  3453. /**
  3454. * When a component is the child of `AnimatePresence`, it can use `usePresence`
  3455. * to access information about whether it's still present in the React tree.
  3456. *
  3457. * ```jsx
  3458. * import { usePresence } from "framer-motion"
  3459. *
  3460. * export const Component = () => {
  3461. * const [isPresent, safeToRemove] = usePresence()
  3462. *
  3463. * useEffect(() => {
  3464. * !isPresent && setTimeout(safeToRemove, 1000)
  3465. * }, [isPresent])
  3466. *
  3467. * return <div />
  3468. * }
  3469. * ```
  3470. *
  3471. * If `isPresent` is `false`, it means that a component has been removed the tree, but
  3472. * `AnimatePresence` won't really remove it until `safeToRemove` has been called.
  3473. *
  3474. * @public
  3475. */
  3476. function usePresence() {
  3477. var context = Object(external_React_["useContext"])(PresenceContext);
  3478. if (context === null)
  3479. return [true, null];
  3480. var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register;
  3481. // It's safe to call the following hooks conditionally (after an early return) because the context will always
  3482. // either be null or non-null for the lifespan of the component.
  3483. // Replace with useOpaqueId when released in React
  3484. var id = useUniqueId();
  3485. Object(external_React_["useEffect"])(function () { return register(id); }, []);
  3486. var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };
  3487. return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
  3488. }
  3489. /**
  3490. * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
  3491. * There is no `safeToRemove` function.
  3492. *
  3493. * ```jsx
  3494. * import { useIsPresent } from "framer-motion"
  3495. *
  3496. * export const Component = () => {
  3497. * const isPresent = useIsPresent()
  3498. *
  3499. * useEffect(() => {
  3500. * !isPresent && console.log("I've been removed!")
  3501. * }, [isPresent])
  3502. *
  3503. * return <div />
  3504. * }
  3505. * ```
  3506. *
  3507. * @public
  3508. */
  3509. function useIsPresent() {
  3510. return use_presence_isPresent(Object(external_React_["useContext"])(PresenceContext));
  3511. }
  3512. function use_presence_isPresent(context) {
  3513. return context === null ? true : context.isPresent;
  3514. }
  3515. var counter = 0;
  3516. var incrementId = function () { return counter++; };
  3517. var useUniqueId = function () { return useConstant(incrementId); };
  3518. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.js
  3519. /**
  3520. * @internal
  3521. */
  3522. var LayoutGroupContext = Object(external_React_["createContext"])(null);
  3523. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.js
  3524. var isBrowser = typeof window !== "undefined";
  3525. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js
  3526. var useIsomorphicLayoutEffect = isBrowser ? external_React_["useLayoutEffect"] : external_React_["useEffect"];
  3527. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js
  3528. function useLayoutId(_a) {
  3529. var layoutId = _a.layoutId;
  3530. var layoutGroupId = Object(external_React_["useContext"])(LayoutGroupContext);
  3531. return layoutGroupId && layoutId !== undefined
  3532. ? layoutGroupId + "-" + layoutId
  3533. : layoutId;
  3534. }
  3535. function useVisualElement(Component, visualState, props, createVisualElement) {
  3536. var config = Object(external_React_["useContext"])(MotionConfigContext);
  3537. var lazyContext = Object(external_React_["useContext"])(LazyContext);
  3538. var parent = useVisualElementContext();
  3539. var presenceContext = Object(external_React_["useContext"])(PresenceContext);
  3540. var layoutId = useLayoutId(props);
  3541. var visualElementRef = Object(external_React_["useRef"])(undefined);
  3542. /**
  3543. * If we haven't preloaded a renderer, check to see if we have one lazy-loaded
  3544. */
  3545. if (!createVisualElement)
  3546. createVisualElement = lazyContext.renderer;
  3547. if (!visualElementRef.current && createVisualElement) {
  3548. visualElementRef.current = createVisualElement(Component, {
  3549. visualState: visualState,
  3550. parent: parent,
  3551. props: __assign(__assign({}, props), { layoutId: layoutId }),
  3552. presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id,
  3553. blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false,
  3554. });
  3555. }
  3556. var visualElement = visualElementRef.current;
  3557. useIsomorphicLayoutEffect(function () {
  3558. if (!visualElement)
  3559. return;
  3560. visualElement.setProps(__assign(__assign(__assign({}, config), props), { layoutId: layoutId }));
  3561. visualElement.isPresent = use_presence_isPresent(presenceContext);
  3562. visualElement.isPresenceRoot =
  3563. !parent || parent.presenceId !== (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id);
  3564. /**
  3565. * Fire a render to ensure the latest state is reflected on-screen.
  3566. */
  3567. visualElement.syncRender();
  3568. });
  3569. Object(external_React_["useEffect"])(function () {
  3570. var _a;
  3571. if (!visualElement)
  3572. return;
  3573. /**
  3574. * In a future refactor we can replace the features-as-components and
  3575. * have this loop through them all firing "effect" listeners
  3576. */
  3577. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges();
  3578. });
  3579. useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []);
  3580. return visualElement;
  3581. }
  3582. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.js
  3583. function isRefObject(ref) {
  3584. return (typeof ref === "object" &&
  3585. Object.prototype.hasOwnProperty.call(ref, "current"));
  3586. }
  3587. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js
  3588. /**
  3589. * Creates a ref function that, when called, hydrates the provided
  3590. * external ref and VisualElement.
  3591. */
  3592. function useMotionRef(visualState, visualElement, externalRef) {
  3593. return Object(external_React_["useCallback"])(function (instance) {
  3594. var _a;
  3595. instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance));
  3596. if (visualElement) {
  3597. instance
  3598. ? visualElement.mount(instance)
  3599. : visualElement.unmount();
  3600. }
  3601. if (externalRef) {
  3602. if (typeof externalRef === "function") {
  3603. externalRef(instance);
  3604. }
  3605. else if (isRefObject(externalRef)) {
  3606. externalRef.current = instance;
  3607. }
  3608. }
  3609. },
  3610. /**
  3611. * Only pass a new ref callback to React if we've received a visual element
  3612. * factory. Otherwise we'll be mounting/remounting every time externalRef
  3613. * or other dependencies change.
  3614. */
  3615. [visualElement]);
  3616. }
  3617. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variants.js
  3618. /**
  3619. * Decides if the supplied variable is an array of variant labels
  3620. */
  3621. function isVariantLabels(v) {
  3622. return Array.isArray(v);
  3623. }
  3624. /**
  3625. * Decides if the supplied variable is variant label
  3626. */
  3627. function isVariantLabel(v) {
  3628. return typeof v === "string" || isVariantLabels(v);
  3629. }
  3630. /**
  3631. * Creates an object containing the latest state of every MotionValue on a VisualElement
  3632. */
  3633. function getCurrent(visualElement) {
  3634. var current = {};
  3635. visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); });
  3636. return current;
  3637. }
  3638. /**
  3639. * Creates an object containing the latest velocity of every MotionValue on a VisualElement
  3640. */
  3641. function getVelocity(visualElement) {
  3642. var velocity = {};
  3643. visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });
  3644. return velocity;
  3645. }
  3646. function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) {
  3647. var _a;
  3648. if (currentValues === void 0) { currentValues = {}; }
  3649. if (currentVelocity === void 0) { currentVelocity = {}; }
  3650. if (typeof definition === "string") {
  3651. definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition];
  3652. }
  3653. return typeof definition === "function"
  3654. ? definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity)
  3655. : definition;
  3656. }
  3657. function resolveVariant(visualElement, definition, custom) {
  3658. var props = visualElement.getProps();
  3659. return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));
  3660. }
  3661. function checkIfControllingVariants(props) {
  3662. var _a;
  3663. return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" ||
  3664. isVariantLabel(props.initial) ||
  3665. isVariantLabel(props.animate) ||
  3666. isVariantLabel(props.whileHover) ||
  3667. isVariantLabel(props.whileDrag) ||
  3668. isVariantLabel(props.whileTap) ||
  3669. isVariantLabel(props.whileFocus) ||
  3670. isVariantLabel(props.exit));
  3671. }
  3672. function checkIfVariantNode(props) {
  3673. return Boolean(checkIfControllingVariants(props) || props.variants);
  3674. }
  3675. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.js
  3676. function getCurrentTreeVariants(props, context) {
  3677. if (checkIfControllingVariants(props)) {
  3678. var initial = props.initial, animate = props.animate;
  3679. return {
  3680. initial: initial === false || isVariantLabel(initial)
  3681. ? initial
  3682. : undefined,
  3683. animate: isVariantLabel(animate) ? animate : undefined,
  3684. };
  3685. }
  3686. return props.inherit !== false ? context : {};
  3687. }
  3688. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.js
  3689. function useCreateMotionContext(props, isStatic) {
  3690. var _a = getCurrentTreeVariants(props, Object(external_React_["useContext"])(MotionContext)), initial = _a.initial, animate = _a.animate;
  3691. return Object(external_React_["useMemo"])(function () { return ({ initial: initial, animate: animate }); },
  3692. /**
  3693. * Only break memoisation in static mode
  3694. */
  3695. isStatic
  3696. ? [
  3697. variantLabelsAsDependency(initial),
  3698. variantLabelsAsDependency(animate),
  3699. ]
  3700. : []);
  3701. }
  3702. function variantLabelsAsDependency(prop) {
  3703. return Array.isArray(prop) ? prop.join(" ") : prop;
  3704. }
  3705. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.js
  3706. /**
  3707. * Create a `motion` component.
  3708. *
  3709. * This function accepts a Component argument, which can be either a string (ie "div"
  3710. * for `motion.div`), or an actual React component.
  3711. *
  3712. * Alongside this is a config option which provides a way of rendering the provided
  3713. * component "offline", or outside the React render cycle.
  3714. *
  3715. * @internal
  3716. */
  3717. function createMotionComponent(_a) {
  3718. var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;
  3719. preloadedFeatures && loadFeatures(preloadedFeatures);
  3720. function MotionComponent(props, externalRef) {
  3721. /**
  3722. * If we're rendering in a static environment, we only visually update the component
  3723. * as a result of a React-rerender rather than interactions or animations. This
  3724. * means we don't need to load additional memory structures like VisualElement,
  3725. * or any gesture/animation features.
  3726. */
  3727. var isStatic = Object(external_React_["useContext"])(MotionConfigContext).isStatic;
  3728. var features = null;
  3729. /**
  3730. * Create the tree context. This is memoized and will only trigger renders
  3731. * when the current tree variant changes in static mode.
  3732. */
  3733. var context = useCreateMotionContext(props, isStatic);
  3734. /**
  3735. *
  3736. */
  3737. var visualState = useVisualState(props, isStatic);
  3738. if (!isStatic && isBrowser) {
  3739. /**
  3740. * Create a VisualElement for this component. A VisualElement provides a common
  3741. * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
  3742. * providing a way of rendering to these APIs outside of the React render loop
  3743. * for more performant animations and interactions
  3744. */
  3745. context.visualElement = useVisualElement(Component, visualState, props, createVisualElement);
  3746. /**
  3747. * Load Motion gesture and animation features. These are rendered as renderless
  3748. * components so each feature can optionally make use of React lifecycle methods.
  3749. *
  3750. * TODO: The intention is to move these away from a React-centric to a
  3751. * VisualElement-centric lifecycle scheme.
  3752. */
  3753. features = useFeatures(props, context.visualElement, preloadedFeatures);
  3754. }
  3755. /**
  3756. * The mount order and hierarchy is specific to ensure our element ref
  3757. * is hydrated by the time features fire their effects.
  3758. */
  3759. return (external_React_["createElement"](external_React_["Fragment"], null,
  3760. external_React_["createElement"](MotionContext.Provider, { value: context }, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic)),
  3761. features));
  3762. }
  3763. return Object(external_React_["forwardRef"])(MotionComponent);
  3764. }
  3765. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion-proxy.js
  3766. /**
  3767. * Convert any React component into a `motion` component. The provided component
  3768. * **must** use `React.forwardRef` to the underlying DOM component you want to animate.
  3769. *
  3770. * ```jsx
  3771. * const Component = React.forwardRef((props, ref) => {
  3772. * return <div ref={ref} />
  3773. * })
  3774. *
  3775. * const MotionComponent = motion(Component)
  3776. * ```
  3777. *
  3778. * @public
  3779. */
  3780. function createMotionProxy(createConfig) {
  3781. function custom(Component, customMotionComponentConfig) {
  3782. if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; }
  3783. return createMotionComponent(createConfig(Component, customMotionComponentConfig));
  3784. }
  3785. /**
  3786. * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
  3787. * Rather than generating them anew every render.
  3788. */
  3789. var componentCache = new Map();
  3790. return new Proxy(custom, {
  3791. /**
  3792. * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
  3793. * The prop name is passed through as `key` and we can use that to generate a `motion`
  3794. * DOM component with that name.
  3795. */
  3796. get: function (_target, key) {
  3797. /**
  3798. * If this element doesn't exist in the component cache, create it and cache.
  3799. */
  3800. if (!componentCache.has(key)) {
  3801. componentCache.set(key, custom(key));
  3802. }
  3803. return componentCache.get(key);
  3804. },
  3805. });
  3806. }
  3807. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js
  3808. /**
  3809. * We keep these listed seperately as we use the lowercase tag names as part
  3810. * of the runtime bundle to detect SVG components
  3811. */
  3812. var lowercaseSVGElements = [
  3813. "animate",
  3814. "circle",
  3815. "defs",
  3816. "desc",
  3817. "ellipse",
  3818. "g",
  3819. "image",
  3820. "line",
  3821. "filter",
  3822. "marker",
  3823. "mask",
  3824. "metadata",
  3825. "path",
  3826. "pattern",
  3827. "polygon",
  3828. "polyline",
  3829. "rect",
  3830. "stop",
  3831. "svg",
  3832. "switch",
  3833. "symbol",
  3834. "text",
  3835. "tspan",
  3836. "use",
  3837. "view",
  3838. ];
  3839. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js
  3840. function isSVGComponent(Component) {
  3841. if (
  3842. /**
  3843. * If it's not a string, it's a custom React component. Currently we only support
  3844. * HTML custom React components.
  3845. */
  3846. typeof Component !== "string" ||
  3847. /**
  3848. * If it contains a dash, the element is a custom HTML webcomponent.
  3849. */
  3850. Component.includes("-")) {
  3851. return false;
  3852. }
  3853. else if (
  3854. /**
  3855. * If it's in our list of lowercase SVG tags, it's an SVG component
  3856. */
  3857. lowercaseSVGElements.indexOf(Component) > -1 ||
  3858. /**
  3859. * If it contains a capital letter, it's an SVG component
  3860. */
  3861. /[A-Z]/.test(Component)) {
  3862. return true;
  3863. }
  3864. return false;
  3865. }
  3866. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/scale-correction.js
  3867. var valueScaleCorrection = {};
  3868. /**
  3869. * @internal
  3870. */
  3871. function addScaleCorrection(correctors) {
  3872. for (var key in correctors) {
  3873. valueScaleCorrection[key] = correctors[key];
  3874. }
  3875. }
  3876. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/transform.js
  3877. /**
  3878. * A list of all transformable axes. We'll use this list to generated a version
  3879. * of each axes for each transform.
  3880. */
  3881. var transformAxes = ["", "X", "Y", "Z"];
  3882. /**
  3883. * An ordered array of each transformable value. By default, transform values
  3884. * will be sorted to this order.
  3885. */
  3886. var transform_order = ["translate", "scale", "rotate", "skew"];
  3887. /**
  3888. * Generate a list of every possible transform key.
  3889. */
  3890. var transformProps = ["transformPerspective", "x", "y", "z"];
  3891. transform_order.forEach(function (operationKey) {
  3892. return transformAxes.forEach(function (axesKey) {
  3893. return transformProps.push(operationKey + axesKey);
  3894. });
  3895. });
  3896. /**
  3897. * A function to use with Array.sort to sort transform keys by their default order.
  3898. */
  3899. function sortTransformProps(a, b) {
  3900. return transformProps.indexOf(a) - transformProps.indexOf(b);
  3901. }
  3902. /**
  3903. * A quick lookup for transform props.
  3904. */
  3905. var transformPropSet = new Set(transformProps);
  3906. function isTransformProp(key) {
  3907. return transformPropSet.has(key);
  3908. }
  3909. /**
  3910. * A quick lookup for transform origin props
  3911. */
  3912. var transformOriginProps = new Set(["originX", "originY", "originZ"]);
  3913. function isTransformOriginProp(key) {
  3914. return transformOriginProps.has(key);
  3915. }
  3916. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js
  3917. function isForcedMotionValue(key, _a) {
  3918. var layout = _a.layout, layoutId = _a.layoutId;
  3919. return (isTransformProp(key) ||
  3920. isTransformOriginProp(key) ||
  3921. ((layout || layoutId !== undefined) &&
  3922. (!!valueScaleCorrection[key] || key === "opacity")));
  3923. }
  3924. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.js
  3925. var isMotionValue = function (value) {
  3926. return value !== null && typeof value === "object" && value.getVelocity;
  3927. };
  3928. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.js
  3929. var translateAlias = {
  3930. x: "translateX",
  3931. y: "translateY",
  3932. z: "translateZ",
  3933. transformPerspective: "perspective",
  3934. };
  3935. /**
  3936. * Build a CSS transform style from individual x/y/scale etc properties.
  3937. *
  3938. * This outputs with a default order of transforms/scales/rotations, this can be customised by
  3939. * providing a transformTemplate function.
  3940. */
  3941. function buildTransform(_a, _b, transformIsDefault, transformTemplate) {
  3942. var transform = _a.transform, transformKeys = _a.transformKeys;
  3943. var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d;
  3944. // The transform string we're going to build into.
  3945. var transformString = "";
  3946. // Transform keys into their default order - this will determine the output order.
  3947. transformKeys.sort(sortTransformProps);
  3948. // Track whether the defined transform has a defined z so we don't add a
  3949. // second to enable hardware acceleration
  3950. var transformHasZ = false;
  3951. // Loop over each transform and build them into transformString
  3952. var numTransformKeys = transformKeys.length;
  3953. for (var i = 0; i < numTransformKeys; i++) {
  3954. var key = transformKeys[i];
  3955. transformString += (translateAlias[key] || key) + "(" + transform[key] + ") ";
  3956. if (key === "z")
  3957. transformHasZ = true;
  3958. }
  3959. if (!transformHasZ && enableHardwareAcceleration) {
  3960. transformString += "translateZ(0)";
  3961. }
  3962. else {
  3963. transformString = transformString.trim();
  3964. }
  3965. // If we have a custom `transform` template, pass our transform values and
  3966. // generated transformString to that before returning
  3967. if (transformTemplate) {
  3968. transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
  3969. }
  3970. else if (allowTransformNone && transformIsDefault) {
  3971. transformString = "none";
  3972. }
  3973. return transformString;
  3974. }
  3975. /**
  3976. * Build a transformOrigin style. Uses the same defaults as the browser for
  3977. * undefined origins.
  3978. */
  3979. function buildTransformOrigin(_a) {
  3980. var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d;
  3981. return originX + " " + originY + " " + originZ;
  3982. }
  3983. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js
  3984. /**
  3985. * Returns true if the provided key is a CSS variable
  3986. */
  3987. function isCSSVariable(key) {
  3988. return key.startsWith("--");
  3989. }
  3990. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js
  3991. /**
  3992. * Provided a value and a ValueType, returns the value as that value type.
  3993. */
  3994. var getValueAsType = function (value, type) {
  3995. return type && typeof value === "number"
  3996. ? type.transform(value)
  3997. : value;
  3998. };
  3999. // CONCATENATED MODULE: ./node_modules/style-value-types/node_modules/tslib/tslib.es6.js
  4000. /*! *****************************************************************************
  4001. Copyright (c) Microsoft Corporation.
  4002. Permission to use, copy, modify, and/or distribute this software for any
  4003. purpose with or without fee is hereby granted.
  4004. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  4005. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  4006. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  4007. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  4008. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  4009. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  4010. PERFORMANCE OF THIS SOFTWARE.
  4011. ***************************************************************************** */
  4012. /* global Reflect, Promise */
  4013. var tslib_es6_extendStatics = function(d, b) {
  4014. tslib_es6_extendStatics = Object.setPrototypeOf ||
  4015. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4016. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  4017. return tslib_es6_extendStatics(d, b);
  4018. };
  4019. function tslib_es6_extends(d, b) {
  4020. if (typeof b !== "function" && b !== null)
  4021. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  4022. tslib_es6_extendStatics(d, b);
  4023. function __() { this.constructor = d; }
  4024. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4025. }
  4026. var tslib_es6_assign = function() {
  4027. tslib_es6_assign = Object.assign || function __assign(t) {
  4028. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4029. s = arguments[i];
  4030. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  4031. }
  4032. return t;
  4033. }
  4034. return tslib_es6_assign.apply(this, arguments);
  4035. }
  4036. function tslib_es6_rest(s, e) {
  4037. var t = {};
  4038. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  4039. t[p] = s[p];
  4040. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  4041. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  4042. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  4043. t[p[i]] = s[p[i]];
  4044. }
  4045. return t;
  4046. }
  4047. function tslib_es6_decorate(decorators, target, key, desc) {
  4048. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4049. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4050. 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;
  4051. return c > 3 && r && Object.defineProperty(target, key, r), r;
  4052. }
  4053. function tslib_es6_param(paramIndex, decorator) {
  4054. return function (target, key) { decorator(target, key, paramIndex); }
  4055. }
  4056. function tslib_es6_metadata(metadataKey, metadataValue) {
  4057. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  4058. }
  4059. function tslib_es6_awaiter(thisArg, _arguments, P, generator) {
  4060. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4061. return new (P || (P = Promise))(function (resolve, reject) {
  4062. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4063. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4064. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4065. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4066. });
  4067. }
  4068. function tslib_es6_generator(thisArg, body) {
  4069. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  4070. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  4071. function verb(n) { return function (v) { return step([n, v]); }; }
  4072. function step(op) {
  4073. if (f) throw new TypeError("Generator is already executing.");
  4074. while (_) try {
  4075. 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;
  4076. if (y = 0, t) op = [op[0] & 2, t.value];
  4077. switch (op[0]) {
  4078. case 0: case 1: t = op; break;
  4079. case 4: _.label++; return { value: op[1], done: false };
  4080. case 5: _.label++; y = op[1]; op = [0]; continue;
  4081. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  4082. default:
  4083. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  4084. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  4085. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  4086. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  4087. if (t[2]) _.ops.pop();
  4088. _.trys.pop(); continue;
  4089. }
  4090. op = body.call(thisArg, _);
  4091. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  4092. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  4093. }
  4094. }
  4095. var tslib_es6_createBinding = Object.create ? (function(o, m, k, k2) {
  4096. if (k2 === undefined) k2 = k;
  4097. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4098. }) : (function(o, m, k, k2) {
  4099. if (k2 === undefined) k2 = k;
  4100. o[k2] = m[k];
  4101. });
  4102. function tslib_es6_exportStar(m, o) {
  4103. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) tslib_es6_createBinding(o, m, p);
  4104. }
  4105. function tslib_es6_values(o) {
  4106. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  4107. if (m) return m.call(o);
  4108. if (o && typeof o.length === "number") return {
  4109. next: function () {
  4110. if (o && i >= o.length) o = void 0;
  4111. return { value: o && o[i++], done: !o };
  4112. }
  4113. };
  4114. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  4115. }
  4116. function tslib_es6_read(o, n) {
  4117. var m = typeof Symbol === "function" && o[Symbol.iterator];
  4118. if (!m) return o;
  4119. var i = m.call(o), r, ar = [], e;
  4120. try {
  4121. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  4122. }
  4123. catch (error) { e = { error: error }; }
  4124. finally {
  4125. try {
  4126. if (r && !r.done && (m = i["return"])) m.call(i);
  4127. }
  4128. finally { if (e) throw e.error; }
  4129. }
  4130. return ar;
  4131. }
  4132. /** @deprecated */
  4133. function tslib_es6_spread() {
  4134. for (var ar = [], i = 0; i < arguments.length; i++)
  4135. ar = ar.concat(tslib_es6_read(arguments[i]));
  4136. return ar;
  4137. }
  4138. /** @deprecated */
  4139. function tslib_es6_spreadArrays() {
  4140. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  4141. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  4142. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  4143. r[k] = a[j];
  4144. return r;
  4145. }
  4146. function tslib_es6_spreadArray(to, from, pack) {
  4147. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  4148. if (ar || !(i in from)) {
  4149. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  4150. ar[i] = from[i];
  4151. }
  4152. }
  4153. return to.concat(ar || Array.prototype.slice.call(from));
  4154. }
  4155. function tslib_es6_await(v) {
  4156. return this instanceof tslib_es6_await ? (this.v = v, this) : new tslib_es6_await(v);
  4157. }
  4158. function tslib_es6_asyncGenerator(thisArg, _arguments, generator) {
  4159. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  4160. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  4161. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  4162. 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); }); }; }
  4163. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  4164. function step(r) { r.value instanceof tslib_es6_await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  4165. function fulfill(value) { resume("next", value); }
  4166. function reject(value) { resume("throw", value); }
  4167. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  4168. }
  4169. function tslib_es6_asyncDelegator(o) {
  4170. var i, p;
  4171. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  4172. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: tslib_es6_await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  4173. }
  4174. function tslib_es6_asyncValues(o) {
  4175. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  4176. var m = o[Symbol.asyncIterator], i;
  4177. return m ? m.call(o) : (o = typeof tslib_es6_values === "function" ? tslib_es6_values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  4178. 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); }); }; }
  4179. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  4180. }
  4181. function tslib_es6_makeTemplateObject(cooked, raw) {
  4182. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  4183. return cooked;
  4184. };
  4185. var tslib_es6_setModuleDefault = Object.create ? (function(o, v) {
  4186. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4187. }) : function(o, v) {
  4188. o["default"] = v;
  4189. };
  4190. function tslib_es6_importStar(mod) {
  4191. if (mod && mod.__esModule) return mod;
  4192. var result = {};
  4193. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) tslib_es6_createBinding(result, mod, k);
  4194. tslib_es6_setModuleDefault(result, mod);
  4195. return result;
  4196. }
  4197. function tslib_es6_importDefault(mod) {
  4198. return (mod && mod.__esModule) ? mod : { default: mod };
  4199. }
  4200. function tslib_es6_classPrivateFieldGet(receiver, state, kind, f) {
  4201. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  4202. 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");
  4203. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  4204. }
  4205. function tslib_es6_classPrivateFieldSet(receiver, state, value, kind, f) {
  4206. if (kind === "m") throw new TypeError("Private method is not writable");
  4207. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  4208. 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");
  4209. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  4210. }
  4211. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/utils.js
  4212. var clamp = function (min, max) { return function (v) {
  4213. return Math.max(Math.min(v, max), min);
  4214. }; };
  4215. var sanitize = function (v) { return (v % 1 ? Number(v.toFixed(5)) : v); };
  4216. var floatRegex = /(-)?([\d]*\.?[\d])+/g;
  4217. var colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi;
  4218. var singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;
  4219. function isString(v) {
  4220. return typeof v === 'string';
  4221. }
  4222. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/units.js
  4223. var createUnitType = function (unit) { return ({
  4224. test: function (v) {
  4225. return isString(v) && v.endsWith(unit) && v.split(' ').length === 1;
  4226. },
  4227. parse: parseFloat,
  4228. transform: function (v) { return "" + v + unit; },
  4229. }); };
  4230. var degrees = createUnitType('deg');
  4231. var percent = createUnitType('%');
  4232. var px = createUnitType('px');
  4233. var vh = createUnitType('vh');
  4234. var vw = createUnitType('vw');
  4235. var progressPercentage = tslib_es6_assign(tslib_es6_assign({}, percent), { parse: function (v) { return percent.parse(v) / 100; }, transform: function (v) { return percent.transform(v * 100); } });
  4236. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/index.js
  4237. var numbers_number = {
  4238. test: function (v) { return typeof v === 'number'; },
  4239. parse: parseFloat,
  4240. transform: function (v) { return v; },
  4241. };
  4242. var numbers_alpha = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { transform: clamp(0, 1) });
  4243. var numbers_scale = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { default: 1 });
  4244. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js
  4245. var type_int_int = __assign(__assign({}, numbers_number), { transform: Math.round });
  4246. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.js
  4247. var numberValueTypes = {
  4248. // Border props
  4249. borderWidth: px,
  4250. borderTopWidth: px,
  4251. borderRightWidth: px,
  4252. borderBottomWidth: px,
  4253. borderLeftWidth: px,
  4254. borderRadius: px,
  4255. radius: px,
  4256. borderTopLeftRadius: px,
  4257. borderTopRightRadius: px,
  4258. borderBottomRightRadius: px,
  4259. borderBottomLeftRadius: px,
  4260. // Positioning props
  4261. width: px,
  4262. maxWidth: px,
  4263. height: px,
  4264. maxHeight: px,
  4265. size: px,
  4266. top: px,
  4267. right: px,
  4268. bottom: px,
  4269. left: px,
  4270. // Spacing props
  4271. padding: px,
  4272. paddingTop: px,
  4273. paddingRight: px,
  4274. paddingBottom: px,
  4275. paddingLeft: px,
  4276. margin: px,
  4277. marginTop: px,
  4278. marginRight: px,
  4279. marginBottom: px,
  4280. marginLeft: px,
  4281. // Transform props
  4282. rotate: degrees,
  4283. rotateX: degrees,
  4284. rotateY: degrees,
  4285. rotateZ: degrees,
  4286. scale: numbers_scale,
  4287. scaleX: numbers_scale,
  4288. scaleY: numbers_scale,
  4289. scaleZ: numbers_scale,
  4290. skew: degrees,
  4291. skewX: degrees,
  4292. skewY: degrees,
  4293. distance: px,
  4294. translateX: px,
  4295. translateY: px,
  4296. translateZ: px,
  4297. x: px,
  4298. y: px,
  4299. z: px,
  4300. perspective: px,
  4301. transformPerspective: px,
  4302. opacity: numbers_alpha,
  4303. originX: progressPercentage,
  4304. originY: progressPercentage,
  4305. originZ: px,
  4306. // Misc
  4307. zIndex: type_int_int,
  4308. // SVG
  4309. fillOpacity: numbers_alpha,
  4310. strokeOpacity: numbers_alpha,
  4311. numOctaves: type_int_int,
  4312. };
  4313. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.js
  4314. function buildHTMLStyles(state, latestValues, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) {
  4315. var _a;
  4316. var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin;
  4317. // Empty the transformKeys array. As we're throwing out refs to its items
  4318. // this might not be as cheap as suspected. Maybe using the array as a buffer
  4319. // with a manual incrementation would be better.
  4320. transformKeys.length = 0;
  4321. // Track whether we encounter any transform or transformOrigin values.
  4322. var hasTransform = false;
  4323. var hasTransformOrigin = false;
  4324. // Does the calculated transform essentially equal "none"?
  4325. var transformIsNone = true;
  4326. /**
  4327. * Loop over all our latest animated values and decide whether to handle them
  4328. * as a style or CSS variable.
  4329. *
  4330. * Transforms and transform origins are kept seperately for further processing.
  4331. */
  4332. for (var key in latestValues) {
  4333. var value = latestValues[key];
  4334. /**
  4335. * If this is a CSS variable we don't do any further processing.
  4336. */
  4337. if (isCSSVariable(key)) {
  4338. vars[key] = value;
  4339. continue;
  4340. }
  4341. // Convert the value to its default value type, ie 0 -> "0px"
  4342. var valueType = numberValueTypes[key];
  4343. var valueAsType = getValueAsType(value, valueType);
  4344. if (isTransformProp(key)) {
  4345. // If this is a transform, flag to enable further transform processing
  4346. hasTransform = true;
  4347. transform[key] = valueAsType;
  4348. transformKeys.push(key);
  4349. // If we already know we have a non-default transform, early return
  4350. if (!transformIsNone)
  4351. continue;
  4352. // Otherwise check to see if this is a default transform
  4353. if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0))
  4354. transformIsNone = false;
  4355. }
  4356. else if (isTransformOriginProp(key)) {
  4357. transformOrigin[key] = valueAsType;
  4358. // If this is a transform origin, flag and enable further transform-origin processing
  4359. hasTransformOrigin = true;
  4360. }
  4361. else {
  4362. /**
  4363. * If layout projection is on, and we need to perform scale correction for this
  4364. * value type, perform it.
  4365. */
  4366. if ((projection === null || projection === void 0 ? void 0 : projection.isHydrated) &&
  4367. (layoutState === null || layoutState === void 0 ? void 0 : layoutState.isHydrated) &&
  4368. valueScaleCorrection[key]) {
  4369. var correctedValue = valueScaleCorrection[key].process(value, layoutState, projection);
  4370. /**
  4371. * Scale-correctable values can define a number of other values to break
  4372. * down into. For instance borderRadius needs applying to borderBottomLeftRadius etc
  4373. */
  4374. var applyTo = valueScaleCorrection[key].applyTo;
  4375. if (applyTo) {
  4376. var num = applyTo.length;
  4377. for (var i = 0; i < num; i++) {
  4378. style[applyTo[i]] = correctedValue;
  4379. }
  4380. }
  4381. else {
  4382. style[key] = correctedValue;
  4383. }
  4384. }
  4385. else {
  4386. style[key] = valueAsType;
  4387. }
  4388. }
  4389. }
  4390. if (layoutState &&
  4391. projection &&
  4392. buildProjectionTransform &&
  4393. buildProjectionTransformOrigin) {
  4394. style.transform = buildProjectionTransform(layoutState.deltaFinal, layoutState.treeScale, hasTransform ? transform : undefined);
  4395. if (transformTemplate) {
  4396. style.transform = transformTemplate(transform, style.transform);
  4397. }
  4398. style.transformOrigin = buildProjectionTransformOrigin(layoutState);
  4399. }
  4400. else {
  4401. if (hasTransform) {
  4402. style.transform = buildTransform(state, options, transformIsNone, transformTemplate);
  4403. }
  4404. if (hasTransformOrigin) {
  4405. style.transformOrigin = buildTransformOrigin(transformOrigin);
  4406. }
  4407. }
  4408. }
  4409. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js
  4410. var createHtmlRenderState = function () { return ({
  4411. style: {},
  4412. transform: {},
  4413. transformKeys: [],
  4414. transformOrigin: {},
  4415. vars: {},
  4416. }); };
  4417. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.js
  4418. function copyRawValuesOnly(target, source, props) {
  4419. for (var key in source) {
  4420. if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
  4421. target[key] = source[key];
  4422. }
  4423. }
  4424. }
  4425. function useInitialMotionValues(_a, visualState, isStatic) {
  4426. var transformTemplate = _a.transformTemplate;
  4427. return Object(external_React_["useMemo"])(function () {
  4428. var state = createHtmlRenderState();
  4429. buildHTMLStyles(state, visualState, undefined, undefined, { enableHardwareAcceleration: !isStatic }, transformTemplate);
  4430. var vars = state.vars, style = state.style;
  4431. return __assign(__assign({}, vars), style);
  4432. }, [visualState]);
  4433. }
  4434. function useStyle(props, visualState, isStatic) {
  4435. var styleProp = props.style || {};
  4436. var style = {};
  4437. /**
  4438. * Copy non-Motion Values straight into style
  4439. */
  4440. copyRawValuesOnly(style, styleProp, props);
  4441. Object.assign(style, useInitialMotionValues(props, visualState, isStatic));
  4442. if (props.transformValues) {
  4443. style = props.transformValues(style);
  4444. }
  4445. return style;
  4446. }
  4447. function useHTMLProps(props, visualState, isStatic) {
  4448. // The `any` isn't ideal but it is the type of createElement props argument
  4449. var htmlProps = {};
  4450. var style = useStyle(props, visualState, isStatic);
  4451. if (Boolean(props.drag)) {
  4452. // Disable the ghost element when a user drags
  4453. htmlProps.draggable = false;
  4454. // Disable text selection
  4455. style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout =
  4456. "none";
  4457. // Disable scrolling on the draggable direction
  4458. style.touchAction =
  4459. props.drag === true
  4460. ? "none"
  4461. : "pan-" + (props.drag === "x" ? "y" : "x");
  4462. }
  4463. htmlProps.style = style;
  4464. return htmlProps;
  4465. }
  4466. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.js
  4467. /**
  4468. * A list of all valid MotionProps.
  4469. *
  4470. * @internalremarks
  4471. * This doesn't throw if a `MotionProp` name is missing - it should.
  4472. */
  4473. var validMotionProps = new Set([
  4474. "initial",
  4475. "animate",
  4476. "exit",
  4477. "style",
  4478. "variants",
  4479. "transition",
  4480. "transformTemplate",
  4481. "transformValues",
  4482. "custom",
  4483. "inherit",
  4484. "layout",
  4485. "layoutId",
  4486. "_layoutResetTransform",
  4487. "onLayoutAnimationComplete",
  4488. "onViewportBoxUpdate",
  4489. "onLayoutMeasure",
  4490. "onBeforeLayoutMeasure",
  4491. "onAnimationStart",
  4492. "onAnimationComplete",
  4493. "onUpdate",
  4494. "onDragStart",
  4495. "onDrag",
  4496. "onDragEnd",
  4497. "onMeasureDragConstraints",
  4498. "onDirectionLock",
  4499. "onDragTransitionEnd",
  4500. "drag",
  4501. "dragControls",
  4502. "dragListener",
  4503. "dragConstraints",
  4504. "dragDirectionLock",
  4505. "_dragX",
  4506. "_dragY",
  4507. "dragElastic",
  4508. "dragMomentum",
  4509. "dragPropagation",
  4510. "dragTransition",
  4511. "whileDrag",
  4512. "onPan",
  4513. "onPanStart",
  4514. "onPanEnd",
  4515. "onPanSessionStart",
  4516. "onTap",
  4517. "onTapStart",
  4518. "onTapCancel",
  4519. "onHoverStart",
  4520. "onHoverEnd",
  4521. "whileFocus",
  4522. "whileTap",
  4523. "whileHover",
  4524. ]);
  4525. /**
  4526. * Check whether a prop name is a valid `MotionProp` key.
  4527. *
  4528. * @param key - Name of the property to check
  4529. * @returns `true` is key is a valid `MotionProp`.
  4530. *
  4531. * @public
  4532. */
  4533. function isValidMotionProp(key) {
  4534. return validMotionProps.has(key);
  4535. }
  4536. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js
  4537. var shouldForward = function (key) { return !isValidMotionProp(key); };
  4538. /**
  4539. * Emotion and Styled Components both allow users to pass through arbitrary props to their components
  4540. * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
  4541. * of these should be passed to the underlying DOM node.
  4542. *
  4543. * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
  4544. * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
  4545. * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
  4546. * `@emotion/is-prop-valid`, however to fix this problem we need to use it.
  4547. *
  4548. * By making it an optionalDependency we can offer this functionality only in the situations where it's
  4549. * actually required.
  4550. */
  4551. try {
  4552. var emotionIsPropValid_1 = __webpack_require__("9uj6").default;
  4553. shouldForward = function (key) {
  4554. // Handle events explicitly as Emotion validates them all as true
  4555. if (key.startsWith("on")) {
  4556. return !isValidMotionProp(key);
  4557. }
  4558. else {
  4559. return emotionIsPropValid_1(key);
  4560. }
  4561. };
  4562. }
  4563. catch (_a) {
  4564. // We don't need to actually do anything here - the fallback is the existing `isPropValid`.
  4565. }
  4566. function filterProps(props, isDom, forwardMotionProps) {
  4567. var filteredProps = {};
  4568. for (var key in props) {
  4569. if (shouldForward(key) ||
  4570. (forwardMotionProps === true && isValidMotionProp(key)) ||
  4571. (!isDom && !isValidMotionProp(key))) {
  4572. filteredProps[key] = props[key];
  4573. }
  4574. }
  4575. return filteredProps;
  4576. }
  4577. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js
  4578. function calcOrigin(origin, offset, size) {
  4579. return typeof origin === "string"
  4580. ? origin
  4581. : px.transform(offset + size * origin);
  4582. }
  4583. /**
  4584. * The SVG transform origin defaults are different to CSS and is less intuitive,
  4585. * so we use the measured dimensions of the SVG to reconcile these.
  4586. */
  4587. function calcSVGTransformOrigin(dimensions, originX, originY) {
  4588. var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
  4589. var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
  4590. return pxOriginX + " " + pxOriginY;
  4591. }
  4592. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.js
  4593. // Convert a progress 0-1 to a pixels value based on the provided length
  4594. var progressToPixels = function (progress, length) {
  4595. return px.transform(progress * length);
  4596. };
  4597. var dashKeys = {
  4598. offset: "stroke-dashoffset",
  4599. array: "stroke-dasharray",
  4600. };
  4601. var camelKeys = {
  4602. offset: "strokeDashoffset",
  4603. array: "strokeDasharray",
  4604. };
  4605. /**
  4606. * Build SVG path properties. Uses the path's measured length to convert
  4607. * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
  4608. * and stroke-dasharray attributes.
  4609. *
  4610. * This function is mutative to reduce per-frame GC.
  4611. */
  4612. function buildSVGPath(attrs, totalLength, length, spacing, offset, useDashCase) {
  4613. if (spacing === void 0) { spacing = 1; }
  4614. if (offset === void 0) { offset = 0; }
  4615. if (useDashCase === void 0) { useDashCase = true; }
  4616. // We use dash case when setting attributes directly to the DOM node and camel case
  4617. // when defining props on a React component.
  4618. var keys = useDashCase ? dashKeys : camelKeys;
  4619. // Build the dash offset
  4620. attrs[keys.offset] = progressToPixels(-offset, totalLength);
  4621. // Build the dash array
  4622. var pathLength = progressToPixels(length, totalLength);
  4623. var pathSpacing = progressToPixels(spacing, totalLength);
  4624. attrs[keys.array] = pathLength + " " + pathSpacing;
  4625. }
  4626. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js
  4627. /**
  4628. * Build SVG visual attrbutes, like cx and style.transform
  4629. */
  4630. function buildSVGAttrs(state, _a, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) {
  4631. var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c,
  4632. // This is object creation, which we try to avoid per-frame.
  4633. latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
  4634. buildHTMLStyles(state, latest, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin);
  4635. state.attrs = state.style;
  4636. state.style = {};
  4637. var attrs = state.attrs, style = state.style, dimensions = state.dimensions, totalPathLength = state.totalPathLength;
  4638. /**
  4639. * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs
  4640. * and copy it into style.
  4641. */
  4642. if (attrs.transform) {
  4643. if (dimensions)
  4644. style.transform = attrs.transform;
  4645. delete attrs.transform;
  4646. }
  4647. // Parse transformOrigin
  4648. if (dimensions &&
  4649. (originX !== undefined || originY !== undefined || style.transform)) {
  4650. style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);
  4651. }
  4652. // Treat x/y not as shortcuts but as actual attributes
  4653. if (attrX !== undefined)
  4654. attrs.x = attrX;
  4655. if (attrY !== undefined)
  4656. attrs.y = attrY;
  4657. // Build SVG path if one has been measured
  4658. if (totalPathLength !== undefined && pathLength !== undefined) {
  4659. buildSVGPath(attrs, totalPathLength, pathLength, pathSpacing, pathOffset, false);
  4660. }
  4661. }
  4662. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js
  4663. var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); };
  4664. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.js
  4665. function useSVGProps(props, visualState) {
  4666. var visualProps = Object(external_React_["useMemo"])(function () {
  4667. var state = createSvgRenderState();
  4668. buildSVGAttrs(state, visualState, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate);
  4669. return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) });
  4670. }, [visualState]);
  4671. if (props.style) {
  4672. var rawStyles = {};
  4673. copyRawValuesOnly(rawStyles, props.style, props);
  4674. visualProps.style = __assign(__assign({}, rawStyles), visualProps.style);
  4675. }
  4676. return visualProps;
  4677. }
  4678. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.js
  4679. function createUseRender(forwardMotionProps) {
  4680. if (forwardMotionProps === void 0) { forwardMotionProps = false; }
  4681. var useRender = function (Component, props, ref, _a, isStatic) {
  4682. var latestValues = _a.latestValues;
  4683. var useVisualProps = isSVGComponent(Component)
  4684. ? useSVGProps
  4685. : useHTMLProps;
  4686. var visualProps = useVisualProps(props, latestValues, isStatic);
  4687. var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
  4688. var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref });
  4689. return Object(external_React_["createElement"])(Component, elementProps);
  4690. };
  4691. return useRender;
  4692. }
  4693. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js
  4694. var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g;
  4695. var REPLACE_TEMPLATE = "$1-$2";
  4696. /**
  4697. * Convert camelCase to dash-case properties.
  4698. */
  4699. var camelToDash = function (str) {
  4700. return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase();
  4701. };
  4702. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.js
  4703. function renderHTML(element, _a) {
  4704. var style = _a.style, vars = _a.vars;
  4705. // Directly assign style into the Element's style prop. In tests Object.assign is the
  4706. // fastest way to assign styles.
  4707. Object.assign(element.style, style);
  4708. // Loop over any CSS variables and assign those.
  4709. for (var key in vars) {
  4710. element.style.setProperty(key, vars[key]);
  4711. }
  4712. }
  4713. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js
  4714. /**
  4715. * A set of attribute names that are always read/written as camel case.
  4716. */
  4717. var camelCaseAttributes = new Set([
  4718. "baseFrequency",
  4719. "diffuseConstant",
  4720. "kernelMatrix",
  4721. "kernelUnitLength",
  4722. "keySplines",
  4723. "keyTimes",
  4724. "limitingConeAngle",
  4725. "markerHeight",
  4726. "markerWidth",
  4727. "numOctaves",
  4728. "targetX",
  4729. "targetY",
  4730. "surfaceScale",
  4731. "specularConstant",
  4732. "specularExponent",
  4733. "stdDeviation",
  4734. "tableValues",
  4735. "viewBox",
  4736. "gradientTransform",
  4737. ]);
  4738. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.js
  4739. function renderSVG(element, renderState) {
  4740. renderHTML(element, renderState);
  4741. for (var key in renderState.attrs) {
  4742. element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
  4743. }
  4744. }
  4745. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js
  4746. function scrape_motion_values_scrapeMotionValuesFromProps(props) {
  4747. var style = props.style;
  4748. var newValues = {};
  4749. for (var key in style) {
  4750. if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) {
  4751. newValues[key] = style[key];
  4752. }
  4753. }
  4754. return newValues;
  4755. }
  4756. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js
  4757. function utils_scrape_motion_values_scrapeMotionValuesFromProps(props) {
  4758. var newValues = scrape_motion_values_scrapeMotionValuesFromProps(props);
  4759. for (var key in props) {
  4760. if (isMotionValue(props[key])) {
  4761. var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key;
  4762. newValues[targetKey] = props[key];
  4763. }
  4764. }
  4765. return newValues;
  4766. }
  4767. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js
  4768. function isAnimationControls(v) {
  4769. return typeof v === "object" && typeof v.start === "function";
  4770. }
  4771. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js
  4772. var isKeyframesTarget = function (v) {
  4773. return Array.isArray(v);
  4774. };
  4775. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.js
  4776. var isCustomValue = function (v) {
  4777. return Boolean(v && typeof v === "object" && v.mix && v.toValue);
  4778. };
  4779. var resolveFinalValueInKeyframes = function (v) {
  4780. // TODO maybe throw if v.length - 1 is placeholder token?
  4781. return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
  4782. };
  4783. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js
  4784. /**
  4785. * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
  4786. *
  4787. * TODO: Remove and move to library
  4788. *
  4789. * @internal
  4790. */
  4791. function resolveMotionValue(value) {
  4792. var unwrappedValue = isMotionValue(value) ? value.get() : value;
  4793. return isCustomValue(unwrappedValue)
  4794. ? unwrappedValue.toValue()
  4795. : unwrappedValue;
  4796. }
  4797. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js
  4798. function makeState(_a, props, context, presenceContext) {
  4799. var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount;
  4800. var state = {
  4801. latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
  4802. renderState: createRenderState(),
  4803. };
  4804. if (onMount) {
  4805. state.mount = function (instance) { return onMount(props, instance, state); };
  4806. }
  4807. return state;
  4808. }
  4809. var makeUseVisualState = function (config) { return function (props, isStatic) {
  4810. var context = Object(external_React_["useContext"])(MotionContext);
  4811. var presenceContext = Object(external_React_["useContext"])(PresenceContext);
  4812. return isStatic
  4813. ? makeState(config, props, context, presenceContext)
  4814. : useConstant(function () { return makeState(config, props, context, presenceContext); });
  4815. }; };
  4816. function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
  4817. var values = {};
  4818. var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false;
  4819. var motionValues = scrapeMotionValues(props);
  4820. for (var key in motionValues) {
  4821. values[key] = resolveMotionValue(motionValues[key]);
  4822. }
  4823. var initial = props.initial, animate = props.animate;
  4824. var isControllingVariants = checkIfControllingVariants(props);
  4825. var isVariantNode = checkIfVariantNode(props);
  4826. if (context &&
  4827. isVariantNode &&
  4828. !isControllingVariants &&
  4829. props.inherit !== false) {
  4830. initial !== null && initial !== void 0 ? initial : (initial = context.initial);
  4831. animate !== null && animate !== void 0 ? animate : (animate = context.animate);
  4832. }
  4833. var variantToSet = blockInitialAnimation || initial === false ? animate : initial;
  4834. if (variantToSet &&
  4835. typeof variantToSet !== "boolean" &&
  4836. !isAnimationControls(variantToSet)) {
  4837. var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
  4838. list.forEach(function (definition) {
  4839. var resolved = resolveVariantFromProps(props, definition);
  4840. if (!resolved)
  4841. return;
  4842. var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, ["transitionEnd", "transition"]);
  4843. for (var key in target)
  4844. values[key] = target[key];
  4845. for (var key in transitionEnd)
  4846. values[key] = transitionEnd[key];
  4847. });
  4848. }
  4849. return values;
  4850. }
  4851. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.js
  4852. var svgMotionConfig = {
  4853. useVisualState: makeUseVisualState({
  4854. scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps,
  4855. createRenderState: createSvgRenderState,
  4856. onMount: function (props, instance, _a) {
  4857. var renderState = _a.renderState, latestValues = _a.latestValues;
  4858. try {
  4859. renderState.dimensions =
  4860. typeof instance.getBBox ===
  4861. "function"
  4862. ? instance.getBBox()
  4863. : instance.getBoundingClientRect();
  4864. }
  4865. catch (e) {
  4866. // Most likely trying to measure an unrendered element under Firefox
  4867. renderState.dimensions = {
  4868. x: 0,
  4869. y: 0,
  4870. width: 0,
  4871. height: 0,
  4872. };
  4873. }
  4874. if (isPath(instance)) {
  4875. renderState.totalPathLength = instance.getTotalLength();
  4876. }
  4877. buildSVGAttrs(renderState, latestValues, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate);
  4878. // TODO: Replace with direct assignment
  4879. renderSVG(instance, renderState);
  4880. },
  4881. }),
  4882. };
  4883. function isPath(element) {
  4884. return element.tagName === "path";
  4885. }
  4886. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.js
  4887. var htmlMotionConfig = {
  4888. useVisualState: makeUseVisualState({
  4889. scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
  4890. createRenderState: createHtmlRenderState,
  4891. }),
  4892. };
  4893. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/create-config.js
  4894. function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement) {
  4895. var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
  4896. var baseConfig = isSVGComponent(Component)
  4897. ? svgMotionConfig
  4898. : htmlMotionConfig;
  4899. return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement,
  4900. Component: Component });
  4901. }
  4902. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/types.js
  4903. var AnimationType;
  4904. (function (AnimationType) {
  4905. AnimationType["Animate"] = "animate";
  4906. AnimationType["Hover"] = "whileHover";
  4907. AnimationType["Tap"] = "whileTap";
  4908. AnimationType["Drag"] = "whileDrag";
  4909. AnimationType["Focus"] = "whileFocus";
  4910. AnimationType["Exit"] = "exit";
  4911. })(AnimationType || (AnimationType = {}));
  4912. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-dom-event.js
  4913. function addDomEvent(target, eventName, handler, options) {
  4914. target.addEventListener(eventName, handler, options);
  4915. return function () { return target.removeEventListener(eventName, handler, options); };
  4916. }
  4917. /**
  4918. * Attaches an event listener directly to the provided DOM element.
  4919. *
  4920. * Bypassing React's event system can be desirable, for instance when attaching non-passive
  4921. * event handlers.
  4922. *
  4923. * ```jsx
  4924. * const ref = useRef(null)
  4925. *
  4926. * useDomEvent(ref, 'wheel', onWheel, { passive: false })
  4927. *
  4928. * return <div ref={ref} />
  4929. * ```
  4930. *
  4931. * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.
  4932. * @param eventName - Name of the event you want listen for.
  4933. * @param handler - Function to fire when receiving the event.
  4934. * @param options - Options to pass to `Event.addEventListener`.
  4935. *
  4936. * @public
  4937. */
  4938. function useDomEvent(ref, eventName, handler, options) {
  4939. Object(external_React_["useEffect"])(function () {
  4940. var element = ref.current;
  4941. if (handler && element) {
  4942. return addDomEvent(element, eventName, handler, options);
  4943. }
  4944. }, [ref, eventName, handler, options]);
  4945. }
  4946. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.js
  4947. /**
  4948. *
  4949. * @param props
  4950. * @param ref
  4951. * @internal
  4952. */
  4953. function useFocusGesture(_a) {
  4954. var whileFocus = _a.whileFocus, visualElement = _a.visualElement;
  4955. var onFocus = function () {
  4956. var _a;
  4957. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true);
  4958. };
  4959. var onBlur = function () {
  4960. var _a;
  4961. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false);
  4962. };
  4963. useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined);
  4964. useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined);
  4965. }
  4966. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/event-type.js
  4967. function isMouseEvent(event) {
  4968. // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.
  4969. if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) {
  4970. return !!(event.pointerType === "mouse");
  4971. }
  4972. return event instanceof MouseEvent;
  4973. }
  4974. function isTouchEvent(event) {
  4975. var hasTouches = !!event.touches;
  4976. return hasTouches;
  4977. }
  4978. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.js
  4979. /**
  4980. * Filters out events not attached to the primary pointer (currently left mouse button)
  4981. * @param eventHandler
  4982. */
  4983. function filterPrimaryPointer(eventHandler) {
  4984. return function (event) {
  4985. var isMouseEvent = event instanceof MouseEvent;
  4986. var isPrimaryPointer = !isMouseEvent ||
  4987. (isMouseEvent && event.button === 0);
  4988. if (isPrimaryPointer) {
  4989. eventHandler(event);
  4990. }
  4991. };
  4992. }
  4993. var defaultPagePoint = { pageX: 0, pageY: 0 };
  4994. function pointFromTouch(e, pointType) {
  4995. if (pointType === void 0) { pointType = "page"; }
  4996. var primaryTouch = e.touches[0] || e.changedTouches[0];
  4997. var point = primaryTouch || defaultPagePoint;
  4998. return {
  4999. x: point[pointType + "X"],
  5000. y: point[pointType + "Y"],
  5001. };
  5002. }
  5003. function pointFromMouse(point, pointType) {
  5004. if (pointType === void 0) { pointType = "page"; }
  5005. return {
  5006. x: point[pointType + "X"],
  5007. y: point[pointType + "Y"],
  5008. };
  5009. }
  5010. function extractEventInfo(event, pointType) {
  5011. if (pointType === void 0) { pointType = "page"; }
  5012. return {
  5013. point: isTouchEvent(event)
  5014. ? pointFromTouch(event, pointType)
  5015. : pointFromMouse(event, pointType),
  5016. };
  5017. }
  5018. function getViewportPointFromEvent(event) {
  5019. return extractEventInfo(event, "client");
  5020. }
  5021. var wrapHandler = function (handler, shouldFilterPrimaryPointer) {
  5022. if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; }
  5023. var listener = function (event) {
  5024. return handler(event, extractEventInfo(event));
  5025. };
  5026. return shouldFilterPrimaryPointer
  5027. ? filterPrimaryPointer(listener)
  5028. : listener;
  5029. };
  5030. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/utils.js
  5031. // We check for event support via functions in case they've been mocked by a testing suite.
  5032. var supportsPointerEvents = function () {
  5033. return isBrowser && window.onpointerdown === null;
  5034. };
  5035. var supportsTouchEvents = function () {
  5036. return isBrowser && window.ontouchstart === null;
  5037. };
  5038. var supportsMouseEvents = function () {
  5039. return isBrowser && window.onmousedown === null;
  5040. };
  5041. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-pointer-event.js
  5042. var mouseEventNames = {
  5043. pointerdown: "mousedown",
  5044. pointermove: "mousemove",
  5045. pointerup: "mouseup",
  5046. pointercancel: "mousecancel",
  5047. pointerover: "mouseover",
  5048. pointerout: "mouseout",
  5049. pointerenter: "mouseenter",
  5050. pointerleave: "mouseleave",
  5051. };
  5052. var touchEventNames = {
  5053. pointerdown: "touchstart",
  5054. pointermove: "touchmove",
  5055. pointerup: "touchend",
  5056. pointercancel: "touchcancel",
  5057. };
  5058. function getPointerEventName(name) {
  5059. if (supportsPointerEvents()) {
  5060. return name;
  5061. }
  5062. else if (supportsTouchEvents()) {
  5063. return touchEventNames[name];
  5064. }
  5065. else if (supportsMouseEvents()) {
  5066. return mouseEventNames[name];
  5067. }
  5068. return name;
  5069. }
  5070. function addPointerEvent(target, eventName, handler, options) {
  5071. return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options);
  5072. }
  5073. function usePointerEvent(ref, eventName, handler, options) {
  5074. return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options);
  5075. }
  5076. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js
  5077. function createLock(name) {
  5078. var lock = null;
  5079. return function () {
  5080. var openLock = function () {
  5081. lock = null;
  5082. };
  5083. if (lock === null) {
  5084. lock = name;
  5085. return openLock;
  5086. }
  5087. return false;
  5088. };
  5089. }
  5090. var globalHorizontalLock = createLock("dragHorizontal");
  5091. var globalVerticalLock = createLock("dragVertical");
  5092. function getGlobalLock(drag) {
  5093. var lock = false;
  5094. if (drag === "y") {
  5095. lock = globalVerticalLock();
  5096. }
  5097. else if (drag === "x") {
  5098. lock = globalHorizontalLock();
  5099. }
  5100. else {
  5101. var openHorizontal_1 = globalHorizontalLock();
  5102. var openVertical_1 = globalVerticalLock();
  5103. if (openHorizontal_1 && openVertical_1) {
  5104. lock = function () {
  5105. openHorizontal_1();
  5106. openVertical_1();
  5107. };
  5108. }
  5109. else {
  5110. // Release the locks because we don't use them
  5111. if (openHorizontal_1)
  5112. openHorizontal_1();
  5113. if (openVertical_1)
  5114. openVertical_1();
  5115. }
  5116. }
  5117. return lock;
  5118. }
  5119. function isDragActive() {
  5120. // Check the gesture lock - if we get it, it means no drag gesture is active
  5121. // and we can safely fire the tap gesture.
  5122. var openGestureLock = getGlobalLock(true);
  5123. if (!openGestureLock)
  5124. return true;
  5125. openGestureLock();
  5126. return false;
  5127. }
  5128. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.js
  5129. function createHoverEvent(visualElement, isActive, callback) {
  5130. return function (event, info) {
  5131. var _a;
  5132. if (!isMouseEvent(event) || isDragActive())
  5133. return;
  5134. callback === null || callback === void 0 ? void 0 : callback(event, info);
  5135. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive);
  5136. };
  5137. }
  5138. function useHoverGesture(_a) {
  5139. var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;
  5140. usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover
  5141. ? createHoverEvent(visualElement, true, onHoverStart)
  5142. : undefined);
  5143. usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover
  5144. ? createHoverEvent(visualElement, false, onHoverEnd)
  5145. : undefined);
  5146. }
  5147. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js
  5148. /**
  5149. * Recursively traverse up the tree to check whether the provided child node
  5150. * is the parent or a descendant of it.
  5151. *
  5152. * @param parent - Element to find
  5153. * @param child - Element to test against parent
  5154. */
  5155. var isNodeOrChild = function (parent, child) {
  5156. if (!child) {
  5157. return false;
  5158. }
  5159. else if (parent === child) {
  5160. return true;
  5161. }
  5162. else {
  5163. return isNodeOrChild(parent, child.parentElement);
  5164. }
  5165. };
  5166. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-unmount-effect.js
  5167. function useUnmountEffect(callback) {
  5168. return Object(external_React_["useEffect"])(function () { return function () { return callback(); }; }, []);
  5169. }
  5170. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/pipe.js
  5171. var combineFunctions = function (a, b) { return function (v) { return b(a(v)); }; };
  5172. var pipe = function () {
  5173. var transformers = [];
  5174. for (var _i = 0; _i < arguments.length; _i++) {
  5175. transformers[_i] = arguments[_i];
  5176. }
  5177. return transformers.reduce(combineFunctions);
  5178. };
  5179. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.js
  5180. /**
  5181. * @param handlers -
  5182. * @internal
  5183. */
  5184. function useTapGesture(_a) {
  5185. var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement;
  5186. var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
  5187. var isPressing = Object(external_React_["useRef"])(false);
  5188. var cancelPointerEndListeners = Object(external_React_["useRef"])(null);
  5189. function removePointerEndListener() {
  5190. var _a;
  5191. (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);
  5192. cancelPointerEndListeners.current = null;
  5193. }
  5194. function checkPointerEnd() {
  5195. var _a;
  5196. removePointerEndListener();
  5197. isPressing.current = false;
  5198. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false);
  5199. return !isDragActive();
  5200. }
  5201. function onPointerUp(event, info) {
  5202. if (!checkPointerEnd())
  5203. return;
  5204. /**
  5205. * We only count this as a tap gesture if the event.target is the same
  5206. * as, or a child of, this component's element
  5207. */
  5208. !isNodeOrChild(visualElement.getInstance(), event.target)
  5209. ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info)
  5210. : onTap === null || onTap === void 0 ? void 0 : onTap(event, info);
  5211. }
  5212. function onPointerCancel(event, info) {
  5213. if (!checkPointerEnd())
  5214. return;
  5215. onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info);
  5216. }
  5217. function onPointerDown(event, info) {
  5218. var _a;
  5219. removePointerEndListener();
  5220. if (isPressing.current)
  5221. return;
  5222. isPressing.current = true;
  5223. cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel));
  5224. onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);
  5225. (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true);
  5226. }
  5227. usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined);
  5228. useUnmountEffect(removePointerEndListener);
  5229. }
  5230. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.js
  5231. var makeRenderlessComponent = function (hook) { return function (props) {
  5232. hook(props);
  5233. return null;
  5234. }; };
  5235. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.js
  5236. var gestureAnimations = {
  5237. tap: makeRenderlessComponent(useTapGesture),
  5238. focus: makeRenderlessComponent(useFocusGesture),
  5239. hover: makeRenderlessComponent(useHoverGesture),
  5240. };
  5241. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.js
  5242. function shallowCompare(next, prev) {
  5243. if (!Array.isArray(prev))
  5244. return false;
  5245. var prevLength = prev.length;
  5246. if (prevLength !== next.length)
  5247. return false;
  5248. for (var i = 0; i < prevLength; i++) {
  5249. if (prev[i] !== next[i])
  5250. return false;
  5251. }
  5252. return true;
  5253. }
  5254. // CONCATENATED MODULE: ./node_modules/popmotion/node_modules/tslib/tslib.es6.js
  5255. /*! *****************************************************************************
  5256. Copyright (c) Microsoft Corporation.
  5257. Permission to use, copy, modify, and/or distribute this software for any
  5258. purpose with or without fee is hereby granted.
  5259. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  5260. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  5261. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  5262. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  5263. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  5264. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  5265. PERFORMANCE OF THIS SOFTWARE.
  5266. ***************************************************************************** */
  5267. /* global Reflect, Promise */
  5268. var tslib_tslib_es6_extendStatics = function(d, b) {
  5269. tslib_tslib_es6_extendStatics = Object.setPrototypeOf ||
  5270. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5271. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  5272. return tslib_tslib_es6_extendStatics(d, b);
  5273. };
  5274. function tslib_tslib_es6_extends(d, b) {
  5275. if (typeof b !== "function" && b !== null)
  5276. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  5277. tslib_tslib_es6_extendStatics(d, b);
  5278. function __() { this.constructor = d; }
  5279. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5280. }
  5281. var tslib_tslib_es6_assign = function() {
  5282. tslib_tslib_es6_assign = Object.assign || function __assign(t) {
  5283. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5284. s = arguments[i];
  5285. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  5286. }
  5287. return t;
  5288. }
  5289. return tslib_tslib_es6_assign.apply(this, arguments);
  5290. }
  5291. function tslib_tslib_es6_rest(s, e) {
  5292. var t = {};
  5293. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  5294. t[p] = s[p];
  5295. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  5296. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  5297. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  5298. t[p[i]] = s[p[i]];
  5299. }
  5300. return t;
  5301. }
  5302. function tslib_tslib_es6_decorate(decorators, target, key, desc) {
  5303. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  5304. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  5305. 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;
  5306. return c > 3 && r && Object.defineProperty(target, key, r), r;
  5307. }
  5308. function tslib_tslib_es6_param(paramIndex, decorator) {
  5309. return function (target, key) { decorator(target, key, paramIndex); }
  5310. }
  5311. function tslib_tslib_es6_metadata(metadataKey, metadataValue) {
  5312. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  5313. }
  5314. function tslib_tslib_es6_awaiter(thisArg, _arguments, P, generator) {
  5315. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5316. return new (P || (P = Promise))(function (resolve, reject) {
  5317. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5318. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5319. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5320. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5321. });
  5322. }
  5323. function tslib_tslib_es6_generator(thisArg, body) {
  5324. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  5325. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  5326. function verb(n) { return function (v) { return step([n, v]); }; }
  5327. function step(op) {
  5328. if (f) throw new TypeError("Generator is already executing.");
  5329. while (_) try {
  5330. 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;
  5331. if (y = 0, t) op = [op[0] & 2, t.value];
  5332. switch (op[0]) {
  5333. case 0: case 1: t = op; break;
  5334. case 4: _.label++; return { value: op[1], done: false };
  5335. case 5: _.label++; y = op[1]; op = [0]; continue;
  5336. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  5337. default:
  5338. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  5339. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  5340. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  5341. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  5342. if (t[2]) _.ops.pop();
  5343. _.trys.pop(); continue;
  5344. }
  5345. op = body.call(thisArg, _);
  5346. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  5347. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  5348. }
  5349. }
  5350. var tslib_tslib_es6_createBinding = Object.create ? (function(o, m, k, k2) {
  5351. if (k2 === undefined) k2 = k;
  5352. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5353. }) : (function(o, m, k, k2) {
  5354. if (k2 === undefined) k2 = k;
  5355. o[k2] = m[k];
  5356. });
  5357. function tslib_tslib_es6_exportStar(m, o) {
  5358. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) tslib_tslib_es6_createBinding(o, m, p);
  5359. }
  5360. function tslib_tslib_es6_values(o) {
  5361. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  5362. if (m) return m.call(o);
  5363. if (o && typeof o.length === "number") return {
  5364. next: function () {
  5365. if (o && i >= o.length) o = void 0;
  5366. return { value: o && o[i++], done: !o };
  5367. }
  5368. };
  5369. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  5370. }
  5371. function tslib_tslib_es6_read(o, n) {
  5372. var m = typeof Symbol === "function" && o[Symbol.iterator];
  5373. if (!m) return o;
  5374. var i = m.call(o), r, ar = [], e;
  5375. try {
  5376. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  5377. }
  5378. catch (error) { e = { error: error }; }
  5379. finally {
  5380. try {
  5381. if (r && !r.done && (m = i["return"])) m.call(i);
  5382. }
  5383. finally { if (e) throw e.error; }
  5384. }
  5385. return ar;
  5386. }
  5387. /** @deprecated */
  5388. function tslib_tslib_es6_spread() {
  5389. for (var ar = [], i = 0; i < arguments.length; i++)
  5390. ar = ar.concat(tslib_tslib_es6_read(arguments[i]));
  5391. return ar;
  5392. }
  5393. /** @deprecated */
  5394. function tslib_tslib_es6_spreadArrays() {
  5395. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  5396. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  5397. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  5398. r[k] = a[j];
  5399. return r;
  5400. }
  5401. function tslib_tslib_es6_spreadArray(to, from, pack) {
  5402. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  5403. if (ar || !(i in from)) {
  5404. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  5405. ar[i] = from[i];
  5406. }
  5407. }
  5408. return to.concat(ar || Array.prototype.slice.call(from));
  5409. }
  5410. function tslib_tslib_es6_await(v) {
  5411. return this instanceof tslib_tslib_es6_await ? (this.v = v, this) : new tslib_tslib_es6_await(v);
  5412. }
  5413. function tslib_tslib_es6_asyncGenerator(thisArg, _arguments, generator) {
  5414. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  5415. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  5416. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  5417. 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); }); }; }
  5418. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  5419. function step(r) { r.value instanceof tslib_tslib_es6_await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  5420. function fulfill(value) { resume("next", value); }
  5421. function reject(value) { resume("throw", value); }
  5422. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  5423. }
  5424. function tslib_tslib_es6_asyncDelegator(o) {
  5425. var i, p;
  5426. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  5427. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: tslib_tslib_es6_await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  5428. }
  5429. function tslib_tslib_es6_asyncValues(o) {
  5430. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  5431. var m = o[Symbol.asyncIterator], i;
  5432. return m ? m.call(o) : (o = typeof tslib_tslib_es6_values === "function" ? tslib_tslib_es6_values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  5433. 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); }); }; }
  5434. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  5435. }
  5436. function tslib_tslib_es6_makeTemplateObject(cooked, raw) {
  5437. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  5438. return cooked;
  5439. };
  5440. var tslib_tslib_es6_setModuleDefault = Object.create ? (function(o, v) {
  5441. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5442. }) : function(o, v) {
  5443. o["default"] = v;
  5444. };
  5445. function tslib_tslib_es6_importStar(mod) {
  5446. if (mod && mod.__esModule) return mod;
  5447. var result = {};
  5448. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) tslib_tslib_es6_createBinding(result, mod, k);
  5449. tslib_tslib_es6_setModuleDefault(result, mod);
  5450. return result;
  5451. }
  5452. function tslib_tslib_es6_importDefault(mod) {
  5453. return (mod && mod.__esModule) ? mod : { default: mod };
  5454. }
  5455. function tslib_tslib_es6_classPrivateFieldGet(receiver, state, kind, f) {
  5456. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  5457. 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");
  5458. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  5459. }
  5460. function tslib_tslib_es6_classPrivateFieldSet(receiver, state, value, kind, f) {
  5461. if (kind === "m") throw new TypeError("Private method is not writable");
  5462. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  5463. 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");
  5464. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  5465. }
  5466. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/clamp.js
  5467. var clamp_clamp = function (min, max, v) {
  5468. return Math.min(Math.max(v, min), max);
  5469. };
  5470. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/find-spring.js
  5471. var safeMin = 0.001;
  5472. var minDuration = 0.01;
  5473. var maxDuration = 10.0;
  5474. var minDamping = 0.05;
  5475. var maxDamping = 1;
  5476. function findSpring(_a) {
  5477. var _b = _a.duration, duration = _b === void 0 ? 800 : _b, _c = _a.bounce, bounce = _c === void 0 ? 0.25 : _c, _d = _a.velocity, velocity = _d === void 0 ? 0 : _d, _e = _a.mass, mass = _e === void 0 ? 1 : _e;
  5478. var envelope;
  5479. var derivative;
  5480. warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less");
  5481. var dampingRatio = 1 - bounce;
  5482. dampingRatio = clamp_clamp(minDamping, maxDamping, dampingRatio);
  5483. duration = clamp_clamp(minDuration, maxDuration, duration / 1000);
  5484. if (dampingRatio < 1) {
  5485. envelope = function (undampedFreq) {
  5486. var exponentialDecay = undampedFreq * dampingRatio;
  5487. var delta = exponentialDecay * duration;
  5488. var a = exponentialDecay - velocity;
  5489. var b = calcAngularFreq(undampedFreq, dampingRatio);
  5490. var c = Math.exp(-delta);
  5491. return safeMin - (a / b) * c;
  5492. };
  5493. derivative = function (undampedFreq) {
  5494. var exponentialDecay = undampedFreq * dampingRatio;
  5495. var delta = exponentialDecay * duration;
  5496. var d = delta * velocity + velocity;
  5497. var e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
  5498. var f = Math.exp(-delta);
  5499. var g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
  5500. var factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
  5501. return (factor * ((d - e) * f)) / g;
  5502. };
  5503. }
  5504. else {
  5505. envelope = function (undampedFreq) {
  5506. var a = Math.exp(-undampedFreq * duration);
  5507. var b = (undampedFreq - velocity) * duration + 1;
  5508. return -safeMin + a * b;
  5509. };
  5510. derivative = function (undampedFreq) {
  5511. var a = Math.exp(-undampedFreq * duration);
  5512. var b = (velocity - undampedFreq) * (duration * duration);
  5513. return a * b;
  5514. };
  5515. }
  5516. var initialGuess = 5 / duration;
  5517. var undampedFreq = approximateRoot(envelope, derivative, initialGuess);
  5518. duration = duration * 1000;
  5519. if (isNaN(undampedFreq)) {
  5520. return {
  5521. stiffness: 100,
  5522. damping: 10,
  5523. duration: duration,
  5524. };
  5525. }
  5526. else {
  5527. var stiffness = Math.pow(undampedFreq, 2) * mass;
  5528. return {
  5529. stiffness: stiffness,
  5530. damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
  5531. duration: duration,
  5532. };
  5533. }
  5534. }
  5535. var rootIterations = 12;
  5536. function approximateRoot(envelope, derivative, initialGuess) {
  5537. var result = initialGuess;
  5538. for (var i = 1; i < rootIterations; i++) {
  5539. result = result - envelope(result) / derivative(result);
  5540. }
  5541. return result;
  5542. }
  5543. function calcAngularFreq(undampedFreq, dampingRatio) {
  5544. return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
  5545. }
  5546. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/spring.js
  5547. var durationKeys = ["duration", "bounce"];
  5548. var physicsKeys = ["stiffness", "damping", "mass"];
  5549. function isSpringType(options, keys) {
  5550. return keys.some(function (key) { return options[key] !== undefined; });
  5551. }
  5552. function getSpringOptions(options) {
  5553. var springOptions = tslib_tslib_es6_assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options);
  5554. if (!isSpringType(options, physicsKeys) &&
  5555. isSpringType(options, durationKeys)) {
  5556. var derived = findSpring(options);
  5557. springOptions = tslib_tslib_es6_assign(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 });
  5558. springOptions.isResolvedFromDuration = true;
  5559. }
  5560. return springOptions;
  5561. }
  5562. function spring(_a) {
  5563. var _b = _a.from, from = _b === void 0 ? 0.0 : _b, _c = _a.to, to = _c === void 0 ? 1.0 : _c, _d = _a.restSpeed, restSpeed = _d === void 0 ? 2 : _d, restDelta = _a.restDelta, options = tslib_tslib_es6_rest(_a, ["from", "to", "restSpeed", "restDelta"]);
  5564. var state = { done: false, value: from };
  5565. var _e = getSpringOptions(options), stiffness = _e.stiffness, damping = _e.damping, mass = _e.mass, velocity = _e.velocity, duration = _e.duration, isResolvedFromDuration = _e.isResolvedFromDuration;
  5566. var resolveSpring = zero;
  5567. var resolveVelocity = zero;
  5568. function createSpring() {
  5569. var initialVelocity = velocity ? -(velocity / 1000) : 0.0;
  5570. var initialDelta = to - from;
  5571. var dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
  5572. var undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000;
  5573. restDelta !== null && restDelta !== void 0 ? restDelta : (restDelta = Math.abs(to - from) <= 1 ? 0.01 : 0.4);
  5574. if (dampingRatio < 1) {
  5575. var angularFreq_1 = calcAngularFreq(undampedAngularFreq, dampingRatio);
  5576. resolveSpring = function (t) {
  5577. var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
  5578. return (to -
  5579. envelope *
  5580. (((initialVelocity +
  5581. dampingRatio * undampedAngularFreq * initialDelta) /
  5582. angularFreq_1) *
  5583. Math.sin(angularFreq_1 * t) +
  5584. initialDelta * Math.cos(angularFreq_1 * t)));
  5585. };
  5586. resolveVelocity = function (t) {
  5587. var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
  5588. return (dampingRatio *
  5589. undampedAngularFreq *
  5590. envelope *
  5591. ((Math.sin(angularFreq_1 * t) *
  5592. (initialVelocity +
  5593. dampingRatio *
  5594. undampedAngularFreq *
  5595. initialDelta)) /
  5596. angularFreq_1 +
  5597. initialDelta * Math.cos(angularFreq_1 * t)) -
  5598. envelope *
  5599. (Math.cos(angularFreq_1 * t) *
  5600. (initialVelocity +
  5601. dampingRatio *
  5602. undampedAngularFreq *
  5603. initialDelta) -
  5604. angularFreq_1 *
  5605. initialDelta *
  5606. Math.sin(angularFreq_1 * t)));
  5607. };
  5608. }
  5609. else if (dampingRatio === 1) {
  5610. resolveSpring = function (t) {
  5611. return to -
  5612. Math.exp(-undampedAngularFreq * t) *
  5613. (initialDelta +
  5614. (initialVelocity + undampedAngularFreq * initialDelta) *
  5615. t);
  5616. };
  5617. }
  5618. else {
  5619. var dampedAngularFreq_1 = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
  5620. resolveSpring = function (t) {
  5621. var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
  5622. var freqForT = Math.min(dampedAngularFreq_1 * t, 300);
  5623. return (to -
  5624. (envelope *
  5625. ((initialVelocity +
  5626. dampingRatio * undampedAngularFreq * initialDelta) *
  5627. Math.sinh(freqForT) +
  5628. dampedAngularFreq_1 *
  5629. initialDelta *
  5630. Math.cosh(freqForT))) /
  5631. dampedAngularFreq_1);
  5632. };
  5633. }
  5634. }
  5635. createSpring();
  5636. return {
  5637. next: function (t) {
  5638. var current = resolveSpring(t);
  5639. if (!isResolvedFromDuration) {
  5640. var currentVelocity = resolveVelocity(t) * 1000;
  5641. var isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
  5642. var isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta;
  5643. state.done =
  5644. isBelowVelocityThreshold && isBelowDisplacementThreshold;
  5645. }
  5646. else {
  5647. state.done = t >= duration;
  5648. }
  5649. state.value = state.done ? to : current;
  5650. return state;
  5651. },
  5652. flipTarget: function () {
  5653. var _a;
  5654. velocity = -velocity;
  5655. _a = [to, from], from = _a[0], to = _a[1];
  5656. createSpring();
  5657. },
  5658. };
  5659. }
  5660. spring.needsInterpolation = function (a, b) {
  5661. return typeof a === "string" || typeof b === "string";
  5662. };
  5663. var zero = function (_t) { return 0; };
  5664. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/progress.js
  5665. var progress_progress = function (from, to, value) {
  5666. var toFromDifference = to - from;
  5667. return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
  5668. };
  5669. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix.js
  5670. var mix = function (from, to, progress) {
  5671. return -progress * from + progress * to + from;
  5672. };
  5673. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/utils.js
  5674. var isColorString = function (type, testProp) { return function (v) {
  5675. return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||
  5676. (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));
  5677. }; };
  5678. var splitColor = function (aName, bName, cName) { return function (v) {
  5679. var _a;
  5680. if (!isString(v))
  5681. return v;
  5682. var _b = v.match(floatRegex), a = _b[0], b = _b[1], c = _b[2], alpha = _b[3];
  5683. return _a = {},
  5684. _a[aName] = parseFloat(a),
  5685. _a[bName] = parseFloat(b),
  5686. _a[cName] = parseFloat(c),
  5687. _a.alpha = alpha !== undefined ? parseFloat(alpha) : 1,
  5688. _a;
  5689. }; };
  5690. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/rgba.js
  5691. var clampRgbUnit = clamp(0, 255);
  5692. var rgbUnit = tslib_es6_assign(tslib_es6_assign({}, numbers_number), { transform: function (v) { return Math.round(clampRgbUnit(v)); } });
  5693. var rgba = {
  5694. test: isColorString('rgb', 'red'),
  5695. parse: splitColor('red', 'green', 'blue'),
  5696. transform: function (_a) {
  5697. var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;
  5698. return 'rgba(' +
  5699. rgbUnit.transform(red) +
  5700. ', ' +
  5701. rgbUnit.transform(green) +
  5702. ', ' +
  5703. rgbUnit.transform(blue) +
  5704. ', ' +
  5705. sanitize(numbers_alpha.transform(alpha$1)) +
  5706. ')';
  5707. },
  5708. };
  5709. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hex.js
  5710. function parseHex(v) {
  5711. var r = '';
  5712. var g = '';
  5713. var b = '';
  5714. var a = '';
  5715. if (v.length > 5) {
  5716. r = v.substr(1, 2);
  5717. g = v.substr(3, 2);
  5718. b = v.substr(5, 2);
  5719. a = v.substr(7, 2);
  5720. }
  5721. else {
  5722. r = v.substr(1, 1);
  5723. g = v.substr(2, 1);
  5724. b = v.substr(3, 1);
  5725. a = v.substr(4, 1);
  5726. r += r;
  5727. g += g;
  5728. b += b;
  5729. a += a;
  5730. }
  5731. return {
  5732. red: parseInt(r, 16),
  5733. green: parseInt(g, 16),
  5734. blue: parseInt(b, 16),
  5735. alpha: a ? parseInt(a, 16) / 255 : 1,
  5736. };
  5737. }
  5738. var hex = {
  5739. test: isColorString('#'),
  5740. parse: parseHex,
  5741. transform: rgba.transform,
  5742. };
  5743. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hsla.js
  5744. var hsla = {
  5745. test: isColorString('hsl', 'hue'),
  5746. parse: splitColor('hue', 'saturation', 'lightness'),
  5747. transform: function (_a) {
  5748. var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;
  5749. return ('hsla(' +
  5750. Math.round(hue) +
  5751. ', ' +
  5752. percent.transform(sanitize(saturation)) +
  5753. ', ' +
  5754. percent.transform(sanitize(lightness)) +
  5755. ', ' +
  5756. sanitize(numbers_alpha.transform(alpha$1)) +
  5757. ')');
  5758. },
  5759. };
  5760. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-color.js
  5761. var mixLinearColor = function (from, to, v) {
  5762. var fromExpo = from * from;
  5763. var toExpo = to * to;
  5764. return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo));
  5765. };
  5766. var colorTypes = [hex, rgba, hsla];
  5767. var getColorType = function (v) {
  5768. return colorTypes.find(function (type) { return type.test(v); });
  5769. };
  5770. var notAnimatable = function (color) {
  5771. return "'" + color + "' is not an animatable color. Use the equivalent color code instead.";
  5772. };
  5773. var mixColor = function (from, to) {
  5774. var fromColorType = getColorType(from);
  5775. var toColorType = getColorType(to);
  5776. invariant(!!fromColorType, notAnimatable(from));
  5777. invariant(!!toColorType, notAnimatable(to));
  5778. invariant(fromColorType.transform === toColorType.transform, "Both colors must be hex/RGBA, OR both must be HSLA.");
  5779. var fromColor = fromColorType.parse(from);
  5780. var toColor = toColorType.parse(to);
  5781. var blended = tslib_tslib_es6_assign({}, fromColor);
  5782. var mixFunc = fromColorType === hsla ? mix : mixLinearColor;
  5783. return function (v) {
  5784. for (var key in blended) {
  5785. if (key !== "alpha") {
  5786. blended[key] = mixFunc(fromColor[key], toColor[key], v);
  5787. }
  5788. }
  5789. blended.alpha = mix(fromColor.alpha, toColor.alpha, v);
  5790. return fromColorType.transform(blended);
  5791. };
  5792. };
  5793. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/index.js
  5794. var color = {
  5795. test: function (v) { return rgba.test(v) || hex.test(v) || hsla.test(v); },
  5796. parse: function (v) {
  5797. if (rgba.test(v)) {
  5798. return rgba.parse(v);
  5799. }
  5800. else if (hsla.test(v)) {
  5801. return hsla.parse(v);
  5802. }
  5803. else {
  5804. return hex.parse(v);
  5805. }
  5806. },
  5807. transform: function (v) {
  5808. return isString(v)
  5809. ? v
  5810. : v.hasOwnProperty('red')
  5811. ? rgba.transform(v)
  5812. : hsla.transform(v);
  5813. },
  5814. };
  5815. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/index.js
  5816. var colorToken = '${c}';
  5817. var numberToken = '${n}';
  5818. function test(v) {
  5819. var _a, _b, _c, _d;
  5820. return (isNaN(v) &&
  5821. isString(v) &&
  5822. ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0);
  5823. }
  5824. function analyse(v) {
  5825. var values = [];
  5826. var numColors = 0;
  5827. var colors = v.match(colorRegex);
  5828. if (colors) {
  5829. numColors = colors.length;
  5830. v = v.replace(colorRegex, colorToken);
  5831. values.push.apply(values, colors.map(color.parse));
  5832. }
  5833. var numbers = v.match(floatRegex);
  5834. if (numbers) {
  5835. v = v.replace(floatRegex, numberToken);
  5836. values.push.apply(values, numbers.map(numbers_number.parse));
  5837. }
  5838. return { values: values, numColors: numColors, tokenised: v };
  5839. }
  5840. function parse(v) {
  5841. return analyse(v).values;
  5842. }
  5843. function createTransformer(v) {
  5844. var _a = analyse(v), values = _a.values, numColors = _a.numColors, tokenised = _a.tokenised;
  5845. var numValues = values.length;
  5846. return function (v) {
  5847. var output = tokenised;
  5848. for (var i = 0; i < numValues; i++) {
  5849. output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i]));
  5850. }
  5851. return output;
  5852. };
  5853. }
  5854. var convertNumbersToZero = function (v) {
  5855. return typeof v === 'number' ? 0 : v;
  5856. };
  5857. function getAnimatableNone(v) {
  5858. var parsed = parse(v);
  5859. var transformer = createTransformer(v);
  5860. return transformer(parsed.map(convertNumbersToZero));
  5861. }
  5862. var complex = { test: test, parse: parse, createTransformer: createTransformer, getAnimatableNone: getAnimatableNone };
  5863. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/inc.js
  5864. var zeroPoint = {
  5865. x: 0,
  5866. y: 0,
  5867. z: 0
  5868. };
  5869. var isNum = function (v) { return typeof v === 'number'; };
  5870. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-complex.js
  5871. function getMixer(origin, target) {
  5872. if (isNum(origin)) {
  5873. return function (v) { return mix(origin, target, v); };
  5874. }
  5875. else if (color.test(origin)) {
  5876. return mixColor(origin, target);
  5877. }
  5878. else {
  5879. return mixComplex(origin, target);
  5880. }
  5881. }
  5882. var mixArray = function (from, to) {
  5883. var output = tslib_tslib_es6_spreadArray([], from);
  5884. var numValues = output.length;
  5885. var blendValue = from.map(function (fromThis, i) { return getMixer(fromThis, to[i]); });
  5886. return function (v) {
  5887. for (var i = 0; i < numValues; i++) {
  5888. output[i] = blendValue[i](v);
  5889. }
  5890. return output;
  5891. };
  5892. };
  5893. var mixObject = function (origin, target) {
  5894. var output = tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, origin), target);
  5895. var blendValue = {};
  5896. for (var key in output) {
  5897. if (origin[key] !== undefined && target[key] !== undefined) {
  5898. blendValue[key] = getMixer(origin[key], target[key]);
  5899. }
  5900. }
  5901. return function (v) {
  5902. for (var key in blendValue) {
  5903. output[key] = blendValue[key](v);
  5904. }
  5905. return output;
  5906. };
  5907. };
  5908. function mix_complex_analyse(value) {
  5909. var parsed = complex.parse(value);
  5910. var numValues = parsed.length;
  5911. var numNumbers = 0;
  5912. var numRGB = 0;
  5913. var numHSL = 0;
  5914. for (var i = 0; i < numValues; i++) {
  5915. if (numNumbers || typeof parsed[i] === "number") {
  5916. numNumbers++;
  5917. }
  5918. else {
  5919. if (parsed[i].hue !== undefined) {
  5920. numHSL++;
  5921. }
  5922. else {
  5923. numRGB++;
  5924. }
  5925. }
  5926. }
  5927. return { parsed: parsed, numNumbers: numNumbers, numRGB: numRGB, numHSL: numHSL };
  5928. }
  5929. var mixComplex = function (origin, target) {
  5930. var template = complex.createTransformer(target);
  5931. var originStats = mix_complex_analyse(origin);
  5932. var targetStats = mix_complex_analyse(target);
  5933. invariant(originStats.numHSL === targetStats.numHSL &&
  5934. originStats.numRGB === targetStats.numRGB &&
  5935. originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
  5936. return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
  5937. };
  5938. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/interpolate.js
  5939. var mixNumber = function (from, to) { return function (p) { return mix(from, to, p); }; };
  5940. function detectMixerFactory(v) {
  5941. if (typeof v === 'number') {
  5942. return mixNumber;
  5943. }
  5944. else if (typeof v === 'string') {
  5945. if (color.test(v)) {
  5946. return mixColor;
  5947. }
  5948. else {
  5949. return mixComplex;
  5950. }
  5951. }
  5952. else if (Array.isArray(v)) {
  5953. return mixArray;
  5954. }
  5955. else if (typeof v === 'object') {
  5956. return mixObject;
  5957. }
  5958. }
  5959. function createMixers(output, ease, customMixer) {
  5960. var mixers = [];
  5961. var mixerFactory = customMixer || detectMixerFactory(output[0]);
  5962. var numMixers = output.length - 1;
  5963. for (var i = 0; i < numMixers; i++) {
  5964. var mixer = mixerFactory(output[i], output[i + 1]);
  5965. if (ease) {
  5966. var easingFunction = Array.isArray(ease) ? ease[i] : ease;
  5967. mixer = pipe(easingFunction, mixer);
  5968. }
  5969. mixers.push(mixer);
  5970. }
  5971. return mixers;
  5972. }
  5973. function fastInterpolate(_a, _b) {
  5974. var from = _a[0], to = _a[1];
  5975. var mixer = _b[0];
  5976. return function (v) { return mixer(progress_progress(from, to, v)); };
  5977. }
  5978. function slowInterpolate(input, mixers) {
  5979. var inputLength = input.length;
  5980. var lastInputIndex = inputLength - 1;
  5981. return function (v) {
  5982. var mixerIndex = 0;
  5983. var foundMixerIndex = false;
  5984. if (v <= input[0]) {
  5985. foundMixerIndex = true;
  5986. }
  5987. else if (v >= input[lastInputIndex]) {
  5988. mixerIndex = lastInputIndex - 1;
  5989. foundMixerIndex = true;
  5990. }
  5991. if (!foundMixerIndex) {
  5992. var i = 1;
  5993. for (; i < inputLength; i++) {
  5994. if (input[i] > v || i === lastInputIndex) {
  5995. break;
  5996. }
  5997. }
  5998. mixerIndex = i - 1;
  5999. }
  6000. var progressInRange = progress_progress(input[mixerIndex], input[mixerIndex + 1], v);
  6001. return mixers[mixerIndex](progressInRange);
  6002. };
  6003. }
  6004. function interpolate(input, output, _a) {
  6005. var _b = _a === void 0 ? {} : _a, _c = _b.clamp, isClamp = _c === void 0 ? true : _c, ease = _b.ease, mixer = _b.mixer;
  6006. var inputLength = input.length;
  6007. invariant(inputLength === output.length, 'Both input and output ranges must be the same length');
  6008. invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.');
  6009. if (input[0] > input[inputLength - 1]) {
  6010. input = [].concat(input);
  6011. output = [].concat(output);
  6012. input.reverse();
  6013. output.reverse();
  6014. }
  6015. var mixers = createMixers(output, ease, mixer);
  6016. var interpolator = inputLength === 2
  6017. ? fastInterpolate(input, mixers)
  6018. : slowInterpolate(input, mixers);
  6019. return isClamp
  6020. ? function (v) { return interpolator(clamp_clamp(input[0], input[inputLength - 1], v)); }
  6021. : interpolator;
  6022. }
  6023. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/utils.js
  6024. var reverseEasing = function (easing) { return function (p) { return 1 - easing(1 - p); }; };
  6025. var mirrorEasing = function (easing) { return function (p) {
  6026. return p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
  6027. }; };
  6028. var createExpoIn = function (power) { return function (p) { return Math.pow(p, power); }; };
  6029. var createBackIn = function (power) { return function (p) {
  6030. return p * p * ((power + 1) * p - power);
  6031. }; };
  6032. var createAnticipate = function (power) {
  6033. var backEasing = createBackIn(power);
  6034. return function (p) {
  6035. return (p *= 2) < 1
  6036. ? 0.5 * backEasing(p)
  6037. : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
  6038. };
  6039. };
  6040. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/index.js
  6041. var DEFAULT_OVERSHOOT_STRENGTH = 1.525;
  6042. var BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0;
  6043. var BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0;
  6044. var BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0;
  6045. var linear = function (p) { return p; };
  6046. var easeIn = createExpoIn(2);
  6047. var easeOut = reverseEasing(easeIn);
  6048. var easeInOut = mirrorEasing(easeIn);
  6049. var circIn = function (p) { return 1 - Math.sin(Math.acos(p)); };
  6050. var circOut = reverseEasing(circIn);
  6051. var circInOut = mirrorEasing(circOut);
  6052. var backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH);
  6053. var backOut = reverseEasing(backIn);
  6054. var backInOut = mirrorEasing(backIn);
  6055. var anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH);
  6056. var ca = 4356.0 / 361.0;
  6057. var cb = 35442.0 / 1805.0;
  6058. var cc = 16061.0 / 1805.0;
  6059. var bounceOut = function (p) {
  6060. if (p === 1 || p === 0)
  6061. return p;
  6062. var p2 = p * p;
  6063. return p < BOUNCE_FIRST_THRESHOLD
  6064. ? 7.5625 * p2
  6065. : p < BOUNCE_SECOND_THRESHOLD
  6066. ? 9.075 * p2 - 9.9 * p + 3.4
  6067. : p < BOUNCE_THIRD_THRESHOLD
  6068. ? ca * p2 - cb * p + cc
  6069. : 10.8 * p * p - 20.52 * p + 10.72;
  6070. };
  6071. var bounceIn = reverseEasing(bounceOut);
  6072. var bounceInOut = function (p) {
  6073. return p < 0.5
  6074. ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0))
  6075. : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5;
  6076. };
  6077. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/keyframes.js
  6078. function defaultEasing(values, easing) {
  6079. return values.map(function () { return easing || easeInOut; }).splice(0, values.length - 1);
  6080. }
  6081. function defaultOffset(values) {
  6082. var numValues = values.length;
  6083. return values.map(function (_value, i) {
  6084. return i !== 0 ? i / (numValues - 1) : 0;
  6085. });
  6086. }
  6087. function convertOffsetToTimes(offset, duration) {
  6088. return offset.map(function (o) { return o * duration; });
  6089. }
  6090. function keyframes(_a) {
  6091. var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.to, to = _c === void 0 ? 1 : _c, ease = _a.ease, offset = _a.offset, _d = _a.duration, duration = _d === void 0 ? 300 : _d;
  6092. var state = { done: false, value: from };
  6093. var values = Array.isArray(to) ? to : [from, to];
  6094. var times = convertOffsetToTimes(offset && offset.length === values.length
  6095. ? offset
  6096. : defaultOffset(values), duration);
  6097. function createInterpolator() {
  6098. return interpolate(times, values, {
  6099. ease: Array.isArray(ease) ? ease : defaultEasing(values, ease),
  6100. });
  6101. }
  6102. var interpolator = createInterpolator();
  6103. return {
  6104. next: function (t) {
  6105. state.value = interpolator(t);
  6106. state.done = t >= duration;
  6107. return state;
  6108. },
  6109. flipTarget: function () {
  6110. values.reverse();
  6111. interpolator = createInterpolator();
  6112. },
  6113. };
  6114. }
  6115. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/decay.js
  6116. function decay(_a) {
  6117. var _b = _a.velocity, velocity = _b === void 0 ? 0 : _b, _c = _a.from, from = _c === void 0 ? 0 : _c, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 350 : _e, _f = _a.restDelta, restDelta = _f === void 0 ? 0.5 : _f, modifyTarget = _a.modifyTarget;
  6118. var state = { done: false, value: from };
  6119. var amplitude = power * velocity;
  6120. var ideal = from + amplitude;
  6121. var target = modifyTarget === undefined ? ideal : modifyTarget(ideal);
  6122. if (target !== ideal)
  6123. amplitude = target - from;
  6124. return {
  6125. next: function (t) {
  6126. var delta = -amplitude * Math.exp(-t / timeConstant);
  6127. state.done = !(delta > restDelta || delta < -restDelta);
  6128. state.value = state.done ? target : target + delta;
  6129. return state;
  6130. },
  6131. flipTarget: function () { },
  6132. };
  6133. }
  6134. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js
  6135. var types = { keyframes: keyframes, spring: spring, decay: decay };
  6136. function detectAnimationFromOptions(config) {
  6137. if (Array.isArray(config.to)) {
  6138. return keyframes;
  6139. }
  6140. else if (types[config.type]) {
  6141. return types[config.type];
  6142. }
  6143. var keys = new Set(Object.keys(config));
  6144. if (keys.has("ease") ||
  6145. (keys.has("duration") && !keys.has("dampingRatio"))) {
  6146. return keyframes;
  6147. }
  6148. else if (keys.has("dampingRatio") ||
  6149. keys.has("stiffness") ||
  6150. keys.has("mass") ||
  6151. keys.has("damping") ||
  6152. keys.has("restSpeed") ||
  6153. keys.has("restDelta")) {
  6154. return spring;
  6155. }
  6156. return keyframes;
  6157. }
  6158. // CONCATENATED MODULE: ./node_modules/framesync/dist/es/on-next-frame.js
  6159. var defaultTimestep = (1 / 60) * 1000;
  6160. var getCurrentTime = typeof performance !== "undefined"
  6161. ? function () { return performance.now(); }
  6162. : function () { return Date.now(); };
  6163. var onNextFrame = typeof window !== "undefined"
  6164. ? function (callback) {
  6165. return window.requestAnimationFrame(callback);
  6166. }
  6167. : function (callback) {
  6168. return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep);
  6169. };
  6170. // CONCATENATED MODULE: ./node_modules/framesync/dist/es/create-render-step.js
  6171. function createRenderStep(runNextFrame) {
  6172. var toRun = [];
  6173. var toRunNextFrame = [];
  6174. var numToRun = 0;
  6175. var isProcessing = false;
  6176. var toKeepAlive = new WeakSet();
  6177. var step = {
  6178. schedule: function (callback, keepAlive, immediate) {
  6179. if (keepAlive === void 0) { keepAlive = false; }
  6180. if (immediate === void 0) { immediate = false; }
  6181. var addToCurrentFrame = immediate && isProcessing;
  6182. var buffer = addToCurrentFrame ? toRun : toRunNextFrame;
  6183. if (keepAlive)
  6184. toKeepAlive.add(callback);
  6185. if (buffer.indexOf(callback) === -1) {
  6186. buffer.push(callback);
  6187. if (addToCurrentFrame && isProcessing)
  6188. numToRun = toRun.length;
  6189. }
  6190. return callback;
  6191. },
  6192. cancel: function (callback) {
  6193. var index = toRunNextFrame.indexOf(callback);
  6194. if (index !== -1)
  6195. toRunNextFrame.splice(index, 1);
  6196. toKeepAlive.delete(callback);
  6197. },
  6198. process: function (frameData) {
  6199. var _a;
  6200. isProcessing = true;
  6201. _a = [toRunNextFrame, toRun], toRun = _a[0], toRunNextFrame = _a[1];
  6202. toRunNextFrame.length = 0;
  6203. numToRun = toRun.length;
  6204. if (numToRun) {
  6205. for (var i = 0; i < numToRun; i++) {
  6206. var callback = toRun[i];
  6207. callback(frameData);
  6208. if (toKeepAlive.has(callback)) {
  6209. step.schedule(callback);
  6210. runNextFrame();
  6211. }
  6212. }
  6213. }
  6214. isProcessing = false;
  6215. },
  6216. };
  6217. return step;
  6218. }
  6219. // CONCATENATED MODULE: ./node_modules/framesync/dist/es/index.js
  6220. var maxElapsed = 40;
  6221. var useDefaultElapsed = true;
  6222. var runNextFrame = false;
  6223. var isProcessing = false;
  6224. var es_frame = {
  6225. delta: 0,
  6226. timestamp: 0
  6227. };
  6228. var stepsOrder = ["read", "update", "preRender", "render", "postRender"];
  6229. var steps = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
  6230. acc[key] = createRenderStep(function () {
  6231. return runNextFrame = true;
  6232. });
  6233. return acc;
  6234. }, {});
  6235. var sync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
  6236. var step = steps[key];
  6237. acc[key] = function (process, keepAlive, immediate) {
  6238. if (keepAlive === void 0) {
  6239. keepAlive = false;
  6240. }
  6241. if (immediate === void 0) {
  6242. immediate = false;
  6243. }
  6244. if (!runNextFrame) startLoop();
  6245. return step.schedule(process, keepAlive, immediate);
  6246. };
  6247. return acc;
  6248. }, {});
  6249. var cancelSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
  6250. acc[key] = steps[key].cancel;
  6251. return acc;
  6252. }, {});
  6253. var flushSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
  6254. acc[key] = function () {
  6255. return steps[key].process(es_frame);
  6256. };
  6257. return acc;
  6258. }, {});
  6259. var processStep = function (stepId) {
  6260. return steps[stepId].process(es_frame);
  6261. };
  6262. var processFrame = function (timestamp) {
  6263. runNextFrame = false;
  6264. es_frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - es_frame.timestamp, maxElapsed), 1);
  6265. es_frame.timestamp = timestamp;
  6266. isProcessing = true;
  6267. stepsOrder.forEach(processStep);
  6268. isProcessing = false;
  6269. if (runNextFrame) {
  6270. useDefaultElapsed = false;
  6271. onNextFrame(processFrame);
  6272. }
  6273. };
  6274. var startLoop = function () {
  6275. runNextFrame = true;
  6276. useDefaultElapsed = true;
  6277. if (!isProcessing) onNextFrame(processFrame);
  6278. };
  6279. var getFrameData = function () {
  6280. return es_frame;
  6281. };
  6282. /* harmony default export */ var es = (sync);
  6283. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/elapsed.js
  6284. function loopElapsed(elapsed, duration, delay) {
  6285. if (delay === void 0) { delay = 0; }
  6286. return elapsed - duration - delay;
  6287. }
  6288. function reverseElapsed(elapsed, duration, delay, isForwardPlayback) {
  6289. if (delay === void 0) { delay = 0; }
  6290. if (isForwardPlayback === void 0) { isForwardPlayback = true; }
  6291. return isForwardPlayback
  6292. ? loopElapsed(duration + -elapsed, duration, delay)
  6293. : duration - (elapsed - duration) + delay;
  6294. }
  6295. function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) {
  6296. return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay;
  6297. }
  6298. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/index.js
  6299. var framesync = function (update) {
  6300. var passTimestamp = function (_a) {
  6301. var delta = _a.delta;
  6302. return update(delta);
  6303. };
  6304. return {
  6305. start: function () { return es.update(passTimestamp, true); },
  6306. stop: function () { return cancelSync.update(passTimestamp); },
  6307. };
  6308. };
  6309. function animations_animate(_a) {
  6310. var _b, _c;
  6311. var from = _a.from, _d = _a.autoplay, autoplay = _d === void 0 ? true : _d, _e = _a.driver, driver = _e === void 0 ? framesync : _e, _f = _a.elapsed, elapsed = _f === void 0 ? 0 : _f, _g = _a.repeat, repeatMax = _g === void 0 ? 0 : _g, _h = _a.repeatType, repeatType = _h === void 0 ? "loop" : _h, _j = _a.repeatDelay, repeatDelay = _j === void 0 ? 0 : _j, onPlay = _a.onPlay, onStop = _a.onStop, onComplete = _a.onComplete, onRepeat = _a.onRepeat, onUpdate = _a.onUpdate, options = tslib_tslib_es6_rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]);
  6312. var to = options.to;
  6313. var driverControls;
  6314. var repeatCount = 0;
  6315. var computedDuration = options.duration;
  6316. var latest;
  6317. var isComplete = false;
  6318. var isForwardPlayback = true;
  6319. var interpolateFromNumber;
  6320. var animator = detectAnimationFromOptions(options);
  6321. if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) {
  6322. interpolateFromNumber = interpolate([0, 100], [from, to], {
  6323. clamp: false,
  6324. });
  6325. from = 0;
  6326. to = 100;
  6327. }
  6328. var animation = animator(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, options), { from: from, to: to }));
  6329. function repeat() {
  6330. repeatCount++;
  6331. if (repeatType === "reverse") {
  6332. isForwardPlayback = repeatCount % 2 === 0;
  6333. elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback);
  6334. }
  6335. else {
  6336. elapsed = loopElapsed(elapsed, computedDuration, repeatDelay);
  6337. if (repeatType === "mirror")
  6338. animation.flipTarget();
  6339. }
  6340. isComplete = false;
  6341. onRepeat && onRepeat();
  6342. }
  6343. function complete() {
  6344. driverControls.stop();
  6345. onComplete && onComplete();
  6346. }
  6347. function update(delta) {
  6348. if (!isForwardPlayback)
  6349. delta = -delta;
  6350. elapsed += delta;
  6351. if (!isComplete) {
  6352. var state = animation.next(Math.max(0, elapsed));
  6353. latest = state.value;
  6354. if (interpolateFromNumber)
  6355. latest = interpolateFromNumber(latest);
  6356. isComplete = isForwardPlayback ? state.done : elapsed <= 0;
  6357. }
  6358. onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest);
  6359. if (isComplete) {
  6360. if (repeatCount === 0)
  6361. computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed);
  6362. if (repeatCount < repeatMax) {
  6363. hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat();
  6364. }
  6365. else {
  6366. complete();
  6367. }
  6368. }
  6369. }
  6370. function play() {
  6371. onPlay === null || onPlay === void 0 ? void 0 : onPlay();
  6372. driverControls = driver(update);
  6373. driverControls.start();
  6374. }
  6375. autoplay && play();
  6376. return {
  6377. stop: function () {
  6378. onStop === null || onStop === void 0 ? void 0 : onStop();
  6379. driverControls.stop();
  6380. },
  6381. };
  6382. }
  6383. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/velocity-per-second.js
  6384. function velocityPerSecond(velocity, frameDuration) {
  6385. return frameDuration ? velocity * (1000 / frameDuration) : 0;
  6386. }
  6387. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/inertia.js
  6388. function inertia_inertia(_a) {
  6389. var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.velocity, velocity = _c === void 0 ? 0 : _c, min = _a.min, max = _a.max, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 750 : _e, _f = _a.bounceStiffness, bounceStiffness = _f === void 0 ? 500 : _f, _g = _a.bounceDamping, bounceDamping = _g === void 0 ? 10 : _g, _h = _a.restDelta, restDelta = _h === void 0 ? 1 : _h, modifyTarget = _a.modifyTarget, driver = _a.driver, onUpdate = _a.onUpdate, onComplete = _a.onComplete;
  6390. var currentAnimation;
  6391. function isOutOfBounds(v) {
  6392. return (min !== undefined && v < min) || (max !== undefined && v > max);
  6393. }
  6394. function boundaryNearest(v) {
  6395. if (min === undefined)
  6396. return max;
  6397. if (max === undefined)
  6398. return min;
  6399. return Math.abs(min - v) < Math.abs(max - v) ? min : max;
  6400. }
  6401. function startAnimation(options) {
  6402. currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop();
  6403. currentAnimation = animations_animate(tslib_tslib_es6_assign(tslib_tslib_es6_assign({}, options), { driver: driver, onUpdate: function (v) {
  6404. var _a;
  6405. onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v);
  6406. (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v);
  6407. }, onComplete: onComplete }));
  6408. }
  6409. function startSpring(options) {
  6410. startAnimation(tslib_tslib_es6_assign({ type: "spring", stiffness: bounceStiffness, damping: bounceDamping, restDelta: restDelta }, options));
  6411. }
  6412. if (isOutOfBounds(from)) {
  6413. startSpring({ from: from, velocity: velocity, to: boundaryNearest(from) });
  6414. }
  6415. else {
  6416. var target = power * velocity + from;
  6417. if (typeof modifyTarget !== "undefined")
  6418. target = modifyTarget(target);
  6419. var boundary_1 = boundaryNearest(target);
  6420. var heading_1 = boundary_1 === min ? -1 : 1;
  6421. var prev_1;
  6422. var current_1;
  6423. var checkBoundary = function (v) {
  6424. prev_1 = current_1;
  6425. current_1 = v;
  6426. velocity = velocityPerSecond(v - prev_1, getFrameData().delta);
  6427. if ((heading_1 === 1 && v > boundary_1) ||
  6428. (heading_1 === -1 && v < boundary_1)) {
  6429. startSpring({ from: v, to: boundary_1, velocity: velocity });
  6430. }
  6431. };
  6432. startAnimation({
  6433. type: "decay",
  6434. from: from,
  6435. velocity: velocity,
  6436. timeConstant: timeConstant,
  6437. power: power,
  6438. restDelta: restDelta,
  6439. modifyTarget: modifyTarget,
  6440. onUpdate: isOutOfBounds(target) ? checkBoundary : undefined,
  6441. });
  6442. }
  6443. return {
  6444. stop: function () { return currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); },
  6445. };
  6446. }
  6447. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/time-conversion.js
  6448. /**
  6449. * Converts seconds to milliseconds
  6450. *
  6451. * @param seconds - Time in seconds.
  6452. * @return milliseconds - Converted time in milliseconds.
  6453. */
  6454. var secondsToMilliseconds = function (seconds) { return seconds * 1000; };
  6455. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/cubic-bezier.js
  6456. var cubic_bezier_a = function (a1, a2) { return 1.0 - 3.0 * a2 + 3.0 * a1; };
  6457. var cubic_bezier_b = function (a1, a2) { return 3.0 * a2 - 6.0 * a1; };
  6458. var cubic_bezier_c = function (a1) { return 3.0 * a1; };
  6459. var calcBezier = function (t, a1, a2) {
  6460. return ((cubic_bezier_a(a1, a2) * t + cubic_bezier_b(a1, a2)) * t + cubic_bezier_c(a1)) * t;
  6461. };
  6462. var getSlope = function (t, a1, a2) {
  6463. return 3.0 * cubic_bezier_a(a1, a2) * t * t + 2.0 * cubic_bezier_b(a1, a2) * t + cubic_bezier_c(a1);
  6464. };
  6465. var subdivisionPrecision = 0.0000001;
  6466. var subdivisionMaxIterations = 10;
  6467. function binarySubdivide(aX, aA, aB, mX1, mX2) {
  6468. var currentX;
  6469. var currentT;
  6470. var i = 0;
  6471. do {
  6472. currentT = aA + (aB - aA) / 2.0;
  6473. currentX = calcBezier(currentT, mX1, mX2) - aX;
  6474. if (currentX > 0.0) {
  6475. aB = currentT;
  6476. }
  6477. else {
  6478. aA = currentT;
  6479. }
  6480. } while (Math.abs(currentX) > subdivisionPrecision &&
  6481. ++i < subdivisionMaxIterations);
  6482. return currentT;
  6483. }
  6484. var newtonIterations = 8;
  6485. var newtonMinSlope = 0.001;
  6486. function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
  6487. for (var i = 0; i < newtonIterations; ++i) {
  6488. var currentSlope = getSlope(aGuessT, mX1, mX2);
  6489. if (currentSlope === 0.0) {
  6490. return aGuessT;
  6491. }
  6492. var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
  6493. aGuessT -= currentX / currentSlope;
  6494. }
  6495. return aGuessT;
  6496. }
  6497. var kSplineTableSize = 11;
  6498. var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
  6499. function cubicBezier(mX1, mY1, mX2, mY2) {
  6500. if (mX1 === mY1 && mX2 === mY2)
  6501. return linear;
  6502. var sampleValues = new Float32Array(kSplineTableSize);
  6503. for (var i = 0; i < kSplineTableSize; ++i) {
  6504. sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
  6505. }
  6506. function getTForX(aX) {
  6507. var intervalStart = 0.0;
  6508. var currentSample = 1;
  6509. var lastSample = kSplineTableSize - 1;
  6510. for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
  6511. intervalStart += kSampleStepSize;
  6512. }
  6513. --currentSample;
  6514. var dist = (aX - sampleValues[currentSample]) /
  6515. (sampleValues[currentSample + 1] - sampleValues[currentSample]);
  6516. var guessForT = intervalStart + dist * kSampleStepSize;
  6517. var initialSlope = getSlope(guessForT, mX1, mX2);
  6518. if (initialSlope >= newtonMinSlope) {
  6519. return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
  6520. }
  6521. else if (initialSlope === 0.0) {
  6522. return guessForT;
  6523. }
  6524. else {
  6525. return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
  6526. }
  6527. }
  6528. return function (t) {
  6529. return t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
  6530. };
  6531. }
  6532. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/easing.js
  6533. var easingLookup = {
  6534. linear: linear,
  6535. easeIn: easeIn,
  6536. easeInOut: easeInOut,
  6537. easeOut: easeOut,
  6538. circIn: circIn,
  6539. circInOut: circInOut,
  6540. circOut: circOut,
  6541. backIn: backIn,
  6542. backInOut: backInOut,
  6543. backOut: backOut,
  6544. anticipate: anticipate,
  6545. bounceIn: bounceIn,
  6546. bounceInOut: bounceInOut,
  6547. bounceOut: bounceOut,
  6548. };
  6549. var easingDefinitionToFunction = function (definition) {
  6550. if (Array.isArray(definition)) {
  6551. // If cubic bezier definition, create bezier curve
  6552. invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values.");
  6553. var _a = __read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3];
  6554. return cubicBezier(x1, y1, x2, y2);
  6555. }
  6556. else if (typeof definition === "string") {
  6557. // Else lookup from table
  6558. invariant(easingLookup[definition] !== undefined, "Invalid easing type '" + definition + "'");
  6559. return easingLookup[definition];
  6560. }
  6561. return definition;
  6562. };
  6563. var isEasingArray = function (ease) {
  6564. return Array.isArray(ease) && typeof ease[0] !== "number";
  6565. };
  6566. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.js
  6567. /**
  6568. * Check if a value is animatable. Examples:
  6569. *
  6570. * ✅: 100, "100px", "#fff"
  6571. * ❌: "block", "url(2.jpg)"
  6572. * @param value
  6573. *
  6574. * @internal
  6575. */
  6576. var isAnimatable = function (key, value) {
  6577. // If the list of keys tat might be non-animatable grows, replace with Set
  6578. if (key === "zIndex")
  6579. return false;
  6580. // If it's a number or a keyframes array, we can animate it. We might at some point
  6581. // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,
  6582. // but for now lets leave it like this for performance reasons
  6583. if (typeof value === "number" || Array.isArray(value))
  6584. return true;
  6585. if (typeof value === "string" && // It's animatable if we have a string
  6586. complex.test(value) && // And it contains numbers and/or colors
  6587. !value.startsWith("url(") // Unless it starts with "url("
  6588. ) {
  6589. return true;
  6590. }
  6591. return false;
  6592. };
  6593. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.js
  6594. var underDampedSpring = function () { return ({
  6595. type: "spring",
  6596. stiffness: 500,
  6597. damping: 25,
  6598. restDelta: 0.5,
  6599. restSpeed: 10,
  6600. }); };
  6601. var criticallyDampedSpring = function (to) { return ({
  6602. type: "spring",
  6603. stiffness: 550,
  6604. damping: to === 0 ? 2 * Math.sqrt(550) : 30,
  6605. restDelta: 0.01,
  6606. restSpeed: 10,
  6607. }); };
  6608. var linearTween = function () { return ({
  6609. type: "keyframes",
  6610. ease: "linear",
  6611. duration: 0.3,
  6612. }); };
  6613. var default_transitions_keyframes = function (values) { return ({
  6614. type: "keyframes",
  6615. duration: 0.8,
  6616. values: values,
  6617. }); };
  6618. var defaultTransitions = {
  6619. x: underDampedSpring,
  6620. y: underDampedSpring,
  6621. z: underDampedSpring,
  6622. rotate: underDampedSpring,
  6623. rotateX: underDampedSpring,
  6624. rotateY: underDampedSpring,
  6625. rotateZ: underDampedSpring,
  6626. scaleX: criticallyDampedSpring,
  6627. scaleY: criticallyDampedSpring,
  6628. scale: criticallyDampedSpring,
  6629. opacity: linearTween,
  6630. backgroundColor: linearTween,
  6631. color: linearTween,
  6632. default: criticallyDampedSpring,
  6633. };
  6634. var getDefaultTransition = function (valueKey, to) {
  6635. var transitionFactory;
  6636. if (isKeyframesTarget(to)) {
  6637. transitionFactory = default_transitions_keyframes;
  6638. }
  6639. else {
  6640. transitionFactory =
  6641. defaultTransitions[valueKey] || defaultTransitions.default;
  6642. }
  6643. return __assign({ to: to }, transitionFactory(to));
  6644. };
  6645. // CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/filter.js
  6646. var maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']);
  6647. function applyDefaultFilter(v) {
  6648. var _a = v.slice(0, -1).split('('), name = _a[0], value = _a[1];
  6649. if (name === 'drop-shadow')
  6650. return v;
  6651. var number = (value.match(floatRegex) || [])[0];
  6652. if (!number)
  6653. return v;
  6654. var unit = value.replace(number, '');
  6655. var defaultValue = maxDefaults.has(name) ? 1 : 0;
  6656. if (number !== value)
  6657. defaultValue *= 100;
  6658. return name + '(' + defaultValue + unit + ')';
  6659. }
  6660. var functionRegex = /([a-z-]*)\(.*?\)/g;
  6661. var filter = tslib_es6_assign(tslib_es6_assign({}, complex), { getAnimatableNone: function (v) {
  6662. var functions = v.match(functionRegex);
  6663. return functions ? functions.map(applyDefaultFilter).join(' ') : v;
  6664. } });
  6665. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js
  6666. /**
  6667. * A map of default value types for common values
  6668. */
  6669. var defaultValueTypes = __assign(__assign({}, numberValueTypes), {
  6670. // Color props
  6671. color: color, backgroundColor: color, outlineColor: color, fill: color, stroke: color,
  6672. // Border props
  6673. borderColor: color, borderTopColor: color, borderRightColor: color, borderBottomColor: color, borderLeftColor: color, filter: filter, WebkitFilter: filter });
  6674. /**
  6675. * Gets the default ValueType for the provided value key
  6676. */
  6677. var getDefaultValueType = function (key) { return defaultValueTypes[key]; };
  6678. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js
  6679. function animatable_none_getAnimatableNone(key, value) {
  6680. var _a;
  6681. var defaultValueType = getDefaultValueType(key);
  6682. if (defaultValueType !== filter)
  6683. defaultValueType = complex;
  6684. // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
  6685. return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value);
  6686. }
  6687. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/transitions.js
  6688. /**
  6689. * Decide whether a transition is defined on a given Transition.
  6690. * This filters out orchestration options and returns true
  6691. * if any options are left.
  6692. */
  6693. function isTransitionDefined(_a) {
  6694. _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]);
  6695. return !!Object.keys(transition).length;
  6696. }
  6697. var legacyRepeatWarning = false;
  6698. /**
  6699. * Convert Framer Motion's Transition type into Popmotion-compatible options.
  6700. */
  6701. function convertTransitionToAnimationOptions(_a) {
  6702. var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]);
  6703. var options = __assign({}, transition);
  6704. if (times)
  6705. options["offset"] = times;
  6706. /**
  6707. * Convert any existing durations from seconds to milliseconds
  6708. */
  6709. if (transition.duration)
  6710. options["duration"] = secondsToMilliseconds(transition.duration);
  6711. if (transition.repeatDelay)
  6712. options.repeatDelay = secondsToMilliseconds(transition.repeatDelay);
  6713. /**
  6714. * Map easing names to Popmotion's easing functions
  6715. */
  6716. if (ease) {
  6717. options["ease"] = isEasingArray(ease)
  6718. ? ease.map(easingDefinitionToFunction)
  6719. : easingDefinitionToFunction(ease);
  6720. }
  6721. /**
  6722. * Support legacy transition API
  6723. */
  6724. if (transition.type === "tween")
  6725. options.type = "keyframes";
  6726. /**
  6727. * TODO: These options are officially removed from the API.
  6728. */
  6729. if (yoyo || loop || flip) {
  6730. warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options.");
  6731. legacyRepeatWarning = true;
  6732. if (yoyo) {
  6733. options.repeatType = "reverse";
  6734. }
  6735. else if (loop) {
  6736. options.repeatType = "loop";
  6737. }
  6738. else if (flip) {
  6739. options.repeatType = "mirror";
  6740. }
  6741. options.repeat = loop || yoyo || flip || transition.repeat;
  6742. }
  6743. /**
  6744. * TODO: Popmotion 9 has the ability to automatically detect whether to use
  6745. * a keyframes or spring animation, but does so by detecting velocity and other spring options.
  6746. * It'd be good to introduce a similar thing here.
  6747. */
  6748. if (transition.type !== "spring")
  6749. options.type = "keyframes";
  6750. return options;
  6751. }
  6752. /**
  6753. * Get the delay for a value by checking Transition with decreasing specificity.
  6754. */
  6755. function getDelayFromTransition(transition, key) {
  6756. var _a;
  6757. var valueTransition = getValueTransition(transition, key) || {};
  6758. return (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : 0;
  6759. }
  6760. function hydrateKeyframes(options) {
  6761. if (Array.isArray(options.to) && options.to[0] === null) {
  6762. options.to = __spreadArray([], __read(options.to));
  6763. options.to[0] = options.from;
  6764. }
  6765. return options;
  6766. }
  6767. function getPopmotionAnimationOptions(transition, options, key) {
  6768. var _a;
  6769. if (Array.isArray(options.to)) {
  6770. (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8);
  6771. }
  6772. hydrateKeyframes(options);
  6773. /**
  6774. * Get a default transition if none is determined to be defined.
  6775. */
  6776. if (!isTransitionDefined(transition)) {
  6777. transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to));
  6778. }
  6779. return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition));
  6780. }
  6781. /**
  6782. *
  6783. */
  6784. function transitions_getAnimation(key, value, target, transition, onComplete) {
  6785. var _a;
  6786. var valueTransition = getValueTransition(transition, key);
  6787. var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get();
  6788. var isTargetAnimatable = isAnimatable(key, target);
  6789. if (origin === "none" && isTargetAnimatable && typeof target === "string") {
  6790. /**
  6791. * If we're trying to animate from "none", try and get an animatable version
  6792. * of the target. This could be improved to work both ways.
  6793. */
  6794. origin = animatable_none_getAnimatableNone(key, target);
  6795. }
  6796. else if (isZero(origin) && typeof target === "string") {
  6797. origin = getZeroUnit(target);
  6798. }
  6799. else if (!Array.isArray(target) &&
  6800. isZero(target) &&
  6801. typeof origin === "string") {
  6802. target = getZeroUnit(origin);
  6803. }
  6804. var isOriginAnimatable = isAnimatable(key, origin);
  6805. warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate " + key + " from \"" + origin + "\" to \"" + target + "\". " + origin + " is not an animatable value - to enable this animation set " + origin + " to a value animatable to " + target + " via the `style` property.");
  6806. function start() {
  6807. var options = {
  6808. from: origin,
  6809. to: target,
  6810. velocity: value.getVelocity(),
  6811. onComplete: onComplete,
  6812. onUpdate: function (v) { return value.set(v); },
  6813. };
  6814. return valueTransition.type === "inertia" ||
  6815. valueTransition.type === "decay"
  6816. ? inertia_inertia(__assign(__assign({}, options), valueTransition))
  6817. : animations_animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) {
  6818. var _a;
  6819. options.onUpdate(v);
  6820. (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v);
  6821. }, onComplete: function () {
  6822. var _a;
  6823. options.onComplete();
  6824. (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition);
  6825. } }));
  6826. }
  6827. function set() {
  6828. var _a;
  6829. value.set(target);
  6830. onComplete();
  6831. (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition);
  6832. return { stop: function () { } };
  6833. }
  6834. return !isOriginAnimatable ||
  6835. !isTargetAnimatable ||
  6836. valueTransition.type === false
  6837. ? set
  6838. : start;
  6839. }
  6840. function isZero(value) {
  6841. return (value === 0 ||
  6842. (typeof value === "string" &&
  6843. parseFloat(value) === 0 &&
  6844. value.indexOf(" ") === -1));
  6845. }
  6846. function getZeroUnit(potentialUnitType) {
  6847. return typeof potentialUnitType === "number"
  6848. ? 0
  6849. : animatable_none_getAnimatableNone("", potentialUnitType);
  6850. }
  6851. function getValueTransition(transition, key) {
  6852. return transition[key] || transition["default"] || transition;
  6853. }
  6854. /**
  6855. * Start animation on a MotionValue. This function is an interface between
  6856. * Framer Motion and Popmotion
  6857. *
  6858. * @internal
  6859. */
  6860. function transitions_startAnimation(key, value, target, transition) {
  6861. if (transition === void 0) { transition = {}; }
  6862. return value.start(function (onComplete) {
  6863. var delayTimer;
  6864. var controls;
  6865. var animation = transitions_getAnimation(key, value, target, transition, onComplete);
  6866. var delay = getDelayFromTransition(transition, key);
  6867. var start = function () { return (controls = animation()); };
  6868. if (delay) {
  6869. delayTimer = setTimeout(start, secondsToMilliseconds(delay));
  6870. }
  6871. else {
  6872. start();
  6873. }
  6874. return function () {
  6875. clearTimeout(delayTimer);
  6876. controls === null || controls === void 0 ? void 0 : controls.stop();
  6877. };
  6878. });
  6879. }
  6880. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.js
  6881. /**
  6882. * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1"
  6883. */
  6884. var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); };
  6885. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/array.js
  6886. function addUniqueItem(arr, item) {
  6887. arr.indexOf(item) === -1 && arr.push(item);
  6888. }
  6889. function removeItem(arr, item) {
  6890. var index = arr.indexOf(item);
  6891. index > -1 && arr.splice(index, 1);
  6892. }
  6893. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/subscription-manager.js
  6894. var subscription_manager_SubscriptionManager = /** @class */ (function () {
  6895. function SubscriptionManager() {
  6896. this.subscriptions = [];
  6897. }
  6898. SubscriptionManager.prototype.add = function (handler) {
  6899. var _this = this;
  6900. addUniqueItem(this.subscriptions, handler);
  6901. return function () { return removeItem(_this.subscriptions, handler); };
  6902. };
  6903. SubscriptionManager.prototype.notify = function (a, b, c) {
  6904. var numSubscriptions = this.subscriptions.length;
  6905. if (!numSubscriptions)
  6906. return;
  6907. if (numSubscriptions === 1) {
  6908. /**
  6909. * If there's only a single handler we can just call it without invoking a loop.
  6910. */
  6911. this.subscriptions[0](a, b, c);
  6912. }
  6913. else {
  6914. for (var i = 0; i < numSubscriptions; i++) {
  6915. /**
  6916. * Check whether the handler exists before firing as it's possible
  6917. * the subscriptions were modified during this loop running.
  6918. */
  6919. var handler = this.subscriptions[i];
  6920. handler && handler(a, b, c);
  6921. }
  6922. }
  6923. };
  6924. SubscriptionManager.prototype.getSize = function () {
  6925. return this.subscriptions.length;
  6926. };
  6927. SubscriptionManager.prototype.clear = function () {
  6928. this.subscriptions.length = 0;
  6929. };
  6930. return SubscriptionManager;
  6931. }());
  6932. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/index.js
  6933. var isFloat = function (value) {
  6934. return !isNaN(parseFloat(value));
  6935. };
  6936. /**
  6937. * `MotionValue` is used to track the state and velocity of motion values.
  6938. *
  6939. * @public
  6940. */
  6941. var value_MotionValue = /** @class */ (function () {
  6942. /**
  6943. * @param init - The initiating value
  6944. * @param config - Optional configuration options
  6945. *
  6946. * - `transformer`: A function to transform incoming values with.
  6947. *
  6948. * @internal
  6949. */
  6950. function MotionValue(init) {
  6951. var _this = this;
  6952. /**
  6953. * Duration, in milliseconds, since last updating frame.
  6954. *
  6955. * @internal
  6956. */
  6957. this.timeDelta = 0;
  6958. /**
  6959. * Timestamp of the last time this `MotionValue` was updated.
  6960. *
  6961. * @internal
  6962. */
  6963. this.lastUpdated = 0;
  6964. /**
  6965. * Functions to notify when the `MotionValue` updates.
  6966. *
  6967. * @internal
  6968. */
  6969. this.updateSubscribers = new subscription_manager_SubscriptionManager();
  6970. /**
  6971. * Functions to notify when the velocity updates.
  6972. *
  6973. * @internal
  6974. */
  6975. this.velocityUpdateSubscribers = new subscription_manager_SubscriptionManager();
  6976. /**
  6977. * Functions to notify when the `MotionValue` updates and `render` is set to `true`.
  6978. *
  6979. * @internal
  6980. */
  6981. this.renderSubscribers = new subscription_manager_SubscriptionManager();
  6982. /**
  6983. * Tracks whether this value can output a velocity. Currently this is only true
  6984. * if the value is numerical, but we might be able to widen the scope here and support
  6985. * other value types.
  6986. *
  6987. * @internal
  6988. */
  6989. this.canTrackVelocity = false;
  6990. this.updateAndNotify = function (v, render) {
  6991. if (render === void 0) { render = true; }
  6992. _this.prev = _this.current;
  6993. _this.current = v;
  6994. // Update timestamp
  6995. var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp;
  6996. if (_this.lastUpdated !== timestamp) {
  6997. _this.timeDelta = delta;
  6998. _this.lastUpdated = timestamp;
  6999. es.postRender(_this.scheduleVelocityCheck);
  7000. }
  7001. // Update update subscribers
  7002. if (_this.prev !== _this.current) {
  7003. _this.updateSubscribers.notify(_this.current);
  7004. }
  7005. // Update velocity subscribers
  7006. if (_this.velocityUpdateSubscribers.getSize()) {
  7007. _this.velocityUpdateSubscribers.notify(_this.getVelocity());
  7008. }
  7009. // Update render subscribers
  7010. if (render) {
  7011. _this.renderSubscribers.notify(_this.current);
  7012. }
  7013. };
  7014. /**
  7015. * Schedule a velocity check for the next frame.
  7016. *
  7017. * This is an instanced and bound function to prevent generating a new
  7018. * function once per frame.
  7019. *
  7020. * @internal
  7021. */
  7022. this.scheduleVelocityCheck = function () { return es.postRender(_this.velocityCheck); };
  7023. /**
  7024. * Updates `prev` with `current` if the value hasn't been updated this frame.
  7025. * This ensures velocity calculations return `0`.
  7026. *
  7027. * This is an instanced and bound function to prevent generating a new
  7028. * function once per frame.
  7029. *
  7030. * @internal
  7031. */
  7032. this.velocityCheck = function (_a) {
  7033. var timestamp = _a.timestamp;
  7034. if (timestamp !== _this.lastUpdated) {
  7035. _this.prev = _this.current;
  7036. _this.velocityUpdateSubscribers.notify(_this.getVelocity());
  7037. }
  7038. };
  7039. this.hasAnimated = false;
  7040. this.prev = this.current = init;
  7041. this.canTrackVelocity = isFloat(this.current);
  7042. }
  7043. /**
  7044. * Adds a function that will be notified when the `MotionValue` is updated.
  7045. *
  7046. * It returns a function that, when called, will cancel the subscription.
  7047. *
  7048. * When calling `onChange` inside a React component, it should be wrapped with the
  7049. * `useEffect` hook. As it returns an unsubscribe function, this should be returned
  7050. * from the `useEffect` function to ensure you don't add duplicate subscribers..
  7051. *
  7052. * @library
  7053. *
  7054. * ```jsx
  7055. * function MyComponent() {
  7056. * const x = useMotionValue(0)
  7057. * const y = useMotionValue(0)
  7058. * const opacity = useMotionValue(1)
  7059. *
  7060. * useEffect(() => {
  7061. * function updateOpacity() {
  7062. * const maxXY = Math.max(x.get(), y.get())
  7063. * const newOpacity = transform(maxXY, [0, 100], [1, 0])
  7064. * opacity.set(newOpacity)
  7065. * }
  7066. *
  7067. * const unsubscribeX = x.onChange(updateOpacity)
  7068. * const unsubscribeY = y.onChange(updateOpacity)
  7069. *
  7070. * return () => {
  7071. * unsubscribeX()
  7072. * unsubscribeY()
  7073. * }
  7074. * }, [])
  7075. *
  7076. * return <Frame x={x} />
  7077. * }
  7078. * ```
  7079. *
  7080. * @motion
  7081. *
  7082. * ```jsx
  7083. * export const MyComponent = () => {
  7084. * const x = useMotionValue(0)
  7085. * const y = useMotionValue(0)
  7086. * const opacity = useMotionValue(1)
  7087. *
  7088. * useEffect(() => {
  7089. * function updateOpacity() {
  7090. * const maxXY = Math.max(x.get(), y.get())
  7091. * const newOpacity = transform(maxXY, [0, 100], [1, 0])
  7092. * opacity.set(newOpacity)
  7093. * }
  7094. *
  7095. * const unsubscribeX = x.onChange(updateOpacity)
  7096. * const unsubscribeY = y.onChange(updateOpacity)
  7097. *
  7098. * return () => {
  7099. * unsubscribeX()
  7100. * unsubscribeY()
  7101. * }
  7102. * }, [])
  7103. *
  7104. * return <motion.div style={{ x }} />
  7105. * }
  7106. * ```
  7107. *
  7108. * @internalremarks
  7109. *
  7110. * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
  7111. *
  7112. * ```jsx
  7113. * useOnChange(x, () => {})
  7114. * ```
  7115. *
  7116. * @param subscriber - A function that receives the latest value.
  7117. * @returns A function that, when called, will cancel this subscription.
  7118. *
  7119. * @public
  7120. */
  7121. MotionValue.prototype.onChange = function (subscription) {
  7122. return this.updateSubscribers.add(subscription);
  7123. };
  7124. MotionValue.prototype.clearListeners = function () {
  7125. this.updateSubscribers.clear();
  7126. };
  7127. /**
  7128. * Adds a function that will be notified when the `MotionValue` requests a render.
  7129. *
  7130. * @param subscriber - A function that's provided the latest value.
  7131. * @returns A function that, when called, will cancel this subscription.
  7132. *
  7133. * @internal
  7134. */
  7135. MotionValue.prototype.onRenderRequest = function (subscription) {
  7136. // Render immediately
  7137. subscription(this.get());
  7138. return this.renderSubscribers.add(subscription);
  7139. };
  7140. /**
  7141. * Attaches a passive effect to the `MotionValue`.
  7142. *
  7143. * @internal
  7144. */
  7145. MotionValue.prototype.attach = function (passiveEffect) {
  7146. this.passiveEffect = passiveEffect;
  7147. };
  7148. /**
  7149. * Sets the state of the `MotionValue`.
  7150. *
  7151. * @remarks
  7152. *
  7153. * ```jsx
  7154. * const x = useMotionValue(0)
  7155. * x.set(10)
  7156. * ```
  7157. *
  7158. * @param latest - Latest value to set.
  7159. * @param render - Whether to notify render subscribers. Defaults to `true`
  7160. *
  7161. * @public
  7162. */
  7163. MotionValue.prototype.set = function (v, render) {
  7164. if (render === void 0) { render = true; }
  7165. if (!render || !this.passiveEffect) {
  7166. this.updateAndNotify(v, render);
  7167. }
  7168. else {
  7169. this.passiveEffect(v, this.updateAndNotify);
  7170. }
  7171. };
  7172. /**
  7173. * Returns the latest state of `MotionValue`
  7174. *
  7175. * @returns - The latest state of `MotionValue`
  7176. *
  7177. * @public
  7178. */
  7179. MotionValue.prototype.get = function () {
  7180. return this.current;
  7181. };
  7182. /**
  7183. * @public
  7184. */
  7185. MotionValue.prototype.getPrevious = function () {
  7186. return this.prev;
  7187. };
  7188. /**
  7189. * Returns the latest velocity of `MotionValue`
  7190. *
  7191. * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
  7192. *
  7193. * @public
  7194. */
  7195. MotionValue.prototype.getVelocity = function () {
  7196. // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful
  7197. return this.canTrackVelocity
  7198. ? // These casts could be avoided if parseFloat would be typed better
  7199. velocityPerSecond(parseFloat(this.current) -
  7200. parseFloat(this.prev), this.timeDelta)
  7201. : 0;
  7202. };
  7203. /**
  7204. * Registers a new animation to control this `MotionValue`. Only one
  7205. * animation can drive a `MotionValue` at one time.
  7206. *
  7207. * ```jsx
  7208. * value.start()
  7209. * ```
  7210. *
  7211. * @param animation - A function that starts the provided animation
  7212. *
  7213. * @internal
  7214. */
  7215. MotionValue.prototype.start = function (animation) {
  7216. var _this = this;
  7217. this.stop();
  7218. return new Promise(function (resolve) {
  7219. _this.hasAnimated = true;
  7220. _this.stopAnimation = animation(resolve);
  7221. }).then(function () { return _this.clearAnimation(); });
  7222. };
  7223. /**
  7224. * Stop the currently active animation.
  7225. *
  7226. * @public
  7227. */
  7228. MotionValue.prototype.stop = function () {
  7229. if (this.stopAnimation)
  7230. this.stopAnimation();
  7231. this.clearAnimation();
  7232. };
  7233. /**
  7234. * Returns `true` if this value is currently animating.
  7235. *
  7236. * @public
  7237. */
  7238. MotionValue.prototype.isAnimating = function () {
  7239. return !!this.stopAnimation;
  7240. };
  7241. MotionValue.prototype.clearAnimation = function () {
  7242. this.stopAnimation = null;
  7243. };
  7244. /**
  7245. * Destroy and clean up subscribers to this `MotionValue`.
  7246. *
  7247. * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
  7248. * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
  7249. * created a `MotionValue` via the `motionValue` function.
  7250. *
  7251. * @public
  7252. */
  7253. MotionValue.prototype.destroy = function () {
  7254. this.updateSubscribers.clear();
  7255. this.renderSubscribers.clear();
  7256. this.stop();
  7257. };
  7258. return MotionValue;
  7259. }());
  7260. /**
  7261. * @internal
  7262. */
  7263. function motionValue(init) {
  7264. return new value_MotionValue(init);
  7265. }
  7266. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.js
  7267. /**
  7268. * Tests a provided value against a ValueType
  7269. */
  7270. var testValueType = function (v) { return function (type) { return type.test(v); }; };
  7271. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js
  7272. /**
  7273. * ValueType for "auto"
  7274. */
  7275. var auto = {
  7276. test: function (v) { return v === "auto"; },
  7277. parse: function (v) { return v; },
  7278. };
  7279. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js
  7280. /**
  7281. * A list of value types commonly used for dimensions
  7282. */
  7283. var dimensionValueTypes = [numbers_number, px, percent, degrees, vw, vh, auto];
  7284. /**
  7285. * Tests a dimensional value against the list of dimension ValueTypes
  7286. */
  7287. var findDimensionValueType = function (v) {
  7288. return dimensionValueTypes.find(testValueType(v));
  7289. };
  7290. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.js
  7291. /**
  7292. * A list of all ValueTypes
  7293. */
  7294. var valueTypes = __spreadArray(__spreadArray([], __read(dimensionValueTypes)), [color, complex]);
  7295. /**
  7296. * Tests a value against the list of ValueTypes
  7297. */
  7298. var findValueType = function (v) { return valueTypes.find(testValueType(v)); };
  7299. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.js
  7300. /**
  7301. * Set VisualElement's MotionValue, creating a new MotionValue for it if
  7302. * it doesn't exist.
  7303. */
  7304. function setMotionValue(visualElement, key, value) {
  7305. if (visualElement.hasValue(key)) {
  7306. visualElement.getValue(key).set(value);
  7307. }
  7308. else {
  7309. visualElement.addValue(key, motionValue(value));
  7310. }
  7311. }
  7312. function setTarget(visualElement, definition) {
  7313. var resolved = resolveVariant(visualElement, definition);
  7314. var _a = resolved
  7315. ? visualElement.makeTargetAnimatable(resolved, false)
  7316. : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]);
  7317. target = __assign(__assign({}, target), transitionEnd);
  7318. for (var key in target) {
  7319. var value = resolveFinalValueInKeyframes(target[key]);
  7320. setMotionValue(visualElement, key, value);
  7321. }
  7322. }
  7323. function setVariants(visualElement, variantLabels) {
  7324. var reversedLabels = __spreadArray([], __read(variantLabels)).reverse();
  7325. reversedLabels.forEach(function (key) {
  7326. var _a;
  7327. var variant = visualElement.getVariant(key);
  7328. variant && setTarget(visualElement, variant);
  7329. (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
  7330. setVariants(child, variantLabels);
  7331. });
  7332. });
  7333. }
  7334. function setValues(visualElement, definition) {
  7335. if (Array.isArray(definition)) {
  7336. return setVariants(visualElement, definition);
  7337. }
  7338. else if (typeof definition === "string") {
  7339. return setVariants(visualElement, [definition]);
  7340. }
  7341. else {
  7342. setTarget(visualElement, definition);
  7343. }
  7344. }
  7345. function checkTargetForNewValues(visualElement, target, origin) {
  7346. var _a, _b, _c;
  7347. var _d;
  7348. var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); });
  7349. var numNewValues = newValueKeys.length;
  7350. if (!numNewValues)
  7351. return;
  7352. for (var i = 0; i < numNewValues; i++) {
  7353. var key = newValueKeys[i];
  7354. var targetValue = target[key];
  7355. var value = null;
  7356. /**
  7357. * If the target is a series of keyframes, we can use the first value
  7358. * in the array. If this first value is null, we'll still need to read from the DOM.
  7359. */
  7360. if (Array.isArray(targetValue)) {
  7361. value = targetValue[0];
  7362. }
  7363. /**
  7364. * If the target isn't keyframes, or the first keyframe was null, we need to
  7365. * first check if an origin value was explicitly defined in the transition as "from",
  7366. * if not read the value from the DOM. As an absolute fallback, take the defined target value.
  7367. */
  7368. if (value === null) {
  7369. value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];
  7370. }
  7371. /**
  7372. * If value is still undefined or null, ignore it. Preferably this would throw,
  7373. * but this was causing issues in Framer.
  7374. */
  7375. if (value === undefined || value === null)
  7376. continue;
  7377. if (typeof value === "string" && isNumericalString(value)) {
  7378. // If this is a number read as a string, ie "0" or "200", convert it to a number
  7379. value = parseFloat(value);
  7380. }
  7381. else if (!findValueType(value) && complex.test(targetValue)) {
  7382. value = animatable_none_getAnimatableNone(key, targetValue);
  7383. }
  7384. visualElement.addValue(key, motionValue(value));
  7385. (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value);
  7386. visualElement.setBaseTarget(key, value);
  7387. }
  7388. }
  7389. function getOriginFromTransition(key, transition) {
  7390. if (!transition)
  7391. return;
  7392. var valueTransition = transition[key] || transition["default"] || transition;
  7393. return valueTransition.from;
  7394. }
  7395. function getOrigin(target, transition, visualElement) {
  7396. var _a, _b;
  7397. var origin = {};
  7398. for (var key in target) {
  7399. origin[key] =
  7400. (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get();
  7401. }
  7402. return origin;
  7403. }
  7404. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation.js
  7405. /**
  7406. * @internal
  7407. */
  7408. function animateVisualElement(visualElement, definition, options) {
  7409. if (options === void 0) { options = {}; }
  7410. visualElement.notifyAnimationStart();
  7411. var animation;
  7412. if (Array.isArray(definition)) {
  7413. var animations = definition.map(function (variant) {
  7414. return animateVariant(visualElement, variant, options);
  7415. });
  7416. animation = Promise.all(animations);
  7417. }
  7418. else if (typeof definition === "string") {
  7419. animation = animateVariant(visualElement, definition, options);
  7420. }
  7421. else {
  7422. var resolvedDefinition = typeof definition === "function"
  7423. ? resolveVariant(visualElement, definition, options.custom)
  7424. : definition;
  7425. animation = animateTarget(visualElement, resolvedDefinition, options);
  7426. }
  7427. return animation.then(function () {
  7428. return visualElement.notifyAnimationComplete(definition);
  7429. });
  7430. }
  7431. function animateVariant(visualElement, variant, options) {
  7432. var _a;
  7433. if (options === void 0) { options = {}; }
  7434. var resolved = resolveVariant(visualElement, variant, options.custom);
  7435. var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b;
  7436. if (options.transitionOverride) {
  7437. transition = options.transitionOverride;
  7438. }
  7439. /**
  7440. * If we have a variant, create a callback that runs it as an animation.
  7441. * Otherwise, we resolve a Promise immediately for a composable no-op.
  7442. */
  7443. var getAnimation = resolved
  7444. ? function () { return animateTarget(visualElement, resolved, options); }
  7445. : function () { return Promise.resolve(); };
  7446. /**
  7447. * If we have children, create a callback that runs all their animations.
  7448. * Otherwise, we resolve a Promise immediately for a composable no-op.
  7449. */
  7450. var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size)
  7451. ? function (forwardDelay) {
  7452. if (forwardDelay === void 0) { forwardDelay = 0; }
  7453. var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection;
  7454. return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
  7455. }
  7456. : function () { return Promise.resolve(); };
  7457. /**
  7458. * If the transition explicitly defines a "when" option, we need to resolve either
  7459. * this animation or all children animations before playing the other.
  7460. */
  7461. var when = transition.when;
  7462. if (when) {
  7463. var _c = __read(when === "beforeChildren"
  7464. ? [getAnimation, getChildAnimations]
  7465. : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1];
  7466. return first().then(last);
  7467. }
  7468. else {
  7469. return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
  7470. }
  7471. }
  7472. /**
  7473. * @internal
  7474. */
  7475. function animateTarget(visualElement, definition, _a) {
  7476. var _b;
  7477. var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type;
  7478. var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, ["transition", "transitionEnd"]);
  7479. if (transitionOverride)
  7480. transition = transitionOverride;
  7481. var animations = [];
  7482. var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]);
  7483. for (var key in target) {
  7484. var value = visualElement.getValue(key);
  7485. var valueTarget = target[key];
  7486. if (!value ||
  7487. valueTarget === undefined ||
  7488. (animationTypeState &&
  7489. shouldBlockAnimation(animationTypeState, key))) {
  7490. continue;
  7491. }
  7492. var animation = transitions_startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition));
  7493. animations.push(animation);
  7494. }
  7495. return Promise.all(animations).then(function () {
  7496. transitionEnd && setTarget(visualElement, transitionEnd);
  7497. });
  7498. }
  7499. function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) {
  7500. if (delayChildren === void 0) { delayChildren = 0; }
  7501. if (staggerChildren === void 0) { staggerChildren = 0; }
  7502. if (staggerDirection === void 0) { staggerDirection = 1; }
  7503. var animations = [];
  7504. var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
  7505. var generateStaggerDuration = staggerDirection === 1
  7506. ? function (i) {
  7507. if (i === void 0) { i = 0; }
  7508. return i * staggerChildren;
  7509. }
  7510. : function (i) {
  7511. if (i === void 0) { i = 0; }
  7512. return maxStaggerDuration - i * staggerChildren;
  7513. };
  7514. Array.from(visualElement.variantChildren)
  7515. .sort(sortByTreeOrder)
  7516. .forEach(function (child, i) {
  7517. animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));
  7518. });
  7519. return Promise.all(animations);
  7520. }
  7521. function stopAnimation(visualElement) {
  7522. visualElement.forEachValue(function (value) { return value.stop(); });
  7523. }
  7524. function sortByTreeOrder(a, b) {
  7525. return a.sortNodePosition(b);
  7526. }
  7527. /**
  7528. * Decide whether we should block this animation. Previously, we achieved this
  7529. * just by checking whether the key was listed in protectedKeys, but this
  7530. * posed problems if an animation was triggered by afterChildren and protectedKeys
  7531. * had been set to true in the meantime.
  7532. */
  7533. function shouldBlockAnimation(_a, key) {
  7534. var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating;
  7535. var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
  7536. needsAnimating[key] = false;
  7537. return shouldBlock;
  7538. }
  7539. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.js
  7540. var variantPriorityOrder = [
  7541. AnimationType.Animate,
  7542. AnimationType.Hover,
  7543. AnimationType.Tap,
  7544. AnimationType.Drag,
  7545. AnimationType.Focus,
  7546. AnimationType.Exit,
  7547. ];
  7548. var reversePriorityOrder = __spreadArray([], __read(variantPriorityOrder)).reverse();
  7549. var numAnimationTypes = variantPriorityOrder.length;
  7550. function animateList(visualElement) {
  7551. return function (animations) {
  7552. return Promise.all(animations.map(function (_a) {
  7553. var animation = _a.animation, options = _a.options;
  7554. return animateVisualElement(visualElement, animation, options);
  7555. }));
  7556. };
  7557. }
  7558. function createAnimationState(visualElement) {
  7559. var animate = animateList(visualElement);
  7560. var state = createState();
  7561. var allAnimatedKeys = {};
  7562. var isInitialRender = true;
  7563. /**
  7564. * This function will be used to reduce the animation definitions for
  7565. * each active animation type into an object of resolved values for it.
  7566. */
  7567. var buildResolvedTypeValues = function (acc, definition) {
  7568. var resolved = resolveVariant(visualElement, definition);
  7569. if (resolved) {
  7570. resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]);
  7571. acc = __assign(__assign(__assign({}, acc), target), transitionEnd);
  7572. }
  7573. return acc;
  7574. };
  7575. function isAnimated(key) {
  7576. return allAnimatedKeys[key] !== undefined;
  7577. }
  7578. /**
  7579. * This just allows us to inject mocked animation functions
  7580. * @internal
  7581. */
  7582. function setAnimateFunction(makeAnimator) {
  7583. animate = makeAnimator(visualElement);
  7584. }
  7585. /**
  7586. * When we receive new props, we need to:
  7587. * 1. Create a list of protected keys for each type. This is a directory of
  7588. * value keys that are currently being "handled" by types of a higher priority
  7589. * so that whenever an animation is played of a given type, these values are
  7590. * protected from being animated.
  7591. * 2. Determine if an animation type needs animating.
  7592. * 3. Determine if any values have been removed from a type and figure out
  7593. * what to animate those to.
  7594. */
  7595. function animateChanges(options, changedActiveType) {
  7596. var _a;
  7597. var props = visualElement.getProps();
  7598. var context = visualElement.getVariantContext(true) || {};
  7599. /**
  7600. * A list of animations that we'll build into as we iterate through the animation
  7601. * types. This will get executed at the end of the function.
  7602. */
  7603. var animations = [];
  7604. /**
  7605. * Keep track of which values have been removed. Then, as we hit lower priority
  7606. * animation types, we can check if they contain removed values and animate to that.
  7607. */
  7608. var removedKeys = new Set();
  7609. /**
  7610. * A dictionary of all encountered keys. This is an object to let us build into and
  7611. * copy it without iteration. Each time we hit an animation type we set its protected
  7612. * keys - the keys its not allowed to animate - to the latest version of this object.
  7613. */
  7614. var encounteredKeys = {};
  7615. /**
  7616. * If a variant has been removed at a given index, and this component is controlling
  7617. * variant animations, we want to ensure lower-priority variants are forced to animate.
  7618. */
  7619. var removedVariantIndex = Infinity;
  7620. var _loop_1 = function (i) {
  7621. var type = reversePriorityOrder[i];
  7622. var typeState = state[type];
  7623. var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type];
  7624. var propIsVariant = isVariantLabel(prop);
  7625. /**
  7626. * If this type has *just* changed isActive status, set activeDelta
  7627. * to that status. Otherwise set to null.
  7628. */
  7629. var activeDelta = type === changedActiveType ? typeState.isActive : null;
  7630. if (activeDelta === false)
  7631. removedVariantIndex = i;
  7632. /**
  7633. * If this prop is an inherited variant, rather than been set directly on the
  7634. * component itself, we want to make sure we allow the parent to trigger animations.
  7635. *
  7636. * TODO: Can probably change this to a !isControllingVariants check
  7637. */
  7638. var isInherited = prop === context[type] && prop !== props[type] && propIsVariant;
  7639. /**
  7640. *
  7641. */
  7642. if (isInherited &&
  7643. isInitialRender &&
  7644. visualElement.manuallyAnimateOnMount) {
  7645. isInherited = false;
  7646. }
  7647. /**
  7648. * Set all encountered keys so far as the protected keys for this type. This will
  7649. * be any key that has been animated or otherwise handled by active, higher-priortiy types.
  7650. */
  7651. typeState.protectedKeys = __assign({}, encounteredKeys);
  7652. // Check if we can skip analysing this prop early
  7653. if (
  7654. // If it isn't active and hasn't *just* been set as inactive
  7655. (!typeState.isActive && activeDelta === null) ||
  7656. // If we didn't and don't have any defined prop for this animation type
  7657. (!prop && !typeState.prevProp) ||
  7658. // Or if the prop doesn't define an animation
  7659. isAnimationControls(prop) ||
  7660. typeof prop === "boolean") {
  7661. return "continue";
  7662. }
  7663. /**
  7664. * As we go look through the values defined on this type, if we detect
  7665. * a changed value or a value that was removed in a higher priority, we set
  7666. * this to true and add this prop to the animation list.
  7667. */
  7668. var shouldAnimateType = variantsHaveChanged(typeState.prevProp, prop) ||
  7669. // If we're making this variant active, we want to always make it active
  7670. (type === changedActiveType &&
  7671. typeState.isActive &&
  7672. !isInherited &&
  7673. propIsVariant) ||
  7674. // If we removed a higher-priority variant (i is in reverse order)
  7675. (i > removedVariantIndex && propIsVariant);
  7676. /**
  7677. * As animations can be set as variant lists, variants or target objects, we
  7678. * coerce everything to an array if it isn't one already
  7679. */
  7680. var definitionList = Array.isArray(prop) ? prop : [prop];
  7681. /**
  7682. * Build an object of all the resolved values. We'll use this in the subsequent
  7683. * animateChanges calls to determine whether a value has changed.
  7684. */
  7685. var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});
  7686. if (activeDelta === false)
  7687. resolvedValues = {};
  7688. /**
  7689. * Now we need to loop through all the keys in the prev prop and this prop,
  7690. * and decide:
  7691. * 1. If the value has changed, and needs animating
  7692. * 2. If it has been removed, and needs adding to the removedKeys set
  7693. * 3. If it has been removed in a higher priority type and needs animating
  7694. * 4. If it hasn't been removed in a higher priority but hasn't changed, and
  7695. * needs adding to the type's protectedKeys list.
  7696. */
  7697. var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
  7698. var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues);
  7699. var markToAnimate = function (key) {
  7700. shouldAnimateType = true;
  7701. removedKeys.delete(key);
  7702. typeState.needsAnimating[key] = true;
  7703. };
  7704. for (var key in allKeys) {
  7705. var next = resolvedValues[key];
  7706. var prev = prevResolvedValues[key];
  7707. // If we've already handled this we can just skip ahead
  7708. if (encounteredKeys.hasOwnProperty(key))
  7709. continue;
  7710. /**
  7711. * If the value has changed, we probably want to animate it.
  7712. */
  7713. if (next !== prev) {
  7714. /**
  7715. * If both values are keyframes, we need to shallow compare them to
  7716. * detect whether any value has changed. If it has, we animate it.
  7717. */
  7718. if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
  7719. if (!shallowCompare(next, prev)) {
  7720. markToAnimate(key);
  7721. }
  7722. else {
  7723. /**
  7724. * If it hasn't changed, we want to ensure it doesn't animate by
  7725. * adding it to the list of protected keys.
  7726. */
  7727. typeState.protectedKeys[key] = true;
  7728. }
  7729. }
  7730. else if (next !== undefined) {
  7731. // If next is defined and doesn't equal prev, it needs animating
  7732. markToAnimate(key);
  7733. }
  7734. else {
  7735. // If it's undefined, it's been removed.
  7736. removedKeys.add(key);
  7737. }
  7738. }
  7739. else if (next !== undefined && removedKeys.has(key)) {
  7740. /**
  7741. * If next hasn't changed and it isn't undefined, we want to check if it's
  7742. * been removed by a higher priority
  7743. */
  7744. markToAnimate(key);
  7745. }
  7746. else {
  7747. /**
  7748. * If it hasn't changed, we add it to the list of protected values
  7749. * to ensure it doesn't get animated.
  7750. */
  7751. typeState.protectedKeys[key] = true;
  7752. }
  7753. }
  7754. /**
  7755. * Update the typeState so next time animateChanges is called we can compare the
  7756. * latest prop and resolvedValues to these.
  7757. */
  7758. typeState.prevProp = prop;
  7759. typeState.prevResolvedValues = resolvedValues;
  7760. /**
  7761. *
  7762. */
  7763. if (typeState.isActive) {
  7764. encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues);
  7765. }
  7766. if (isInitialRender && visualElement.blockInitialAnimation) {
  7767. shouldAnimateType = false;
  7768. }
  7769. /**
  7770. * If this is an inherited prop we want to hard-block animations
  7771. * TODO: Test as this should probably still handle animations triggered
  7772. * by removed values?
  7773. */
  7774. if (shouldAnimateType && !isInherited) {
  7775. animations.push.apply(animations, __spreadArray([], __read(definitionList.map(function (animation) { return ({
  7776. animation: animation,
  7777. options: __assign({ type: type }, options),
  7778. }); }))));
  7779. }
  7780. };
  7781. /**
  7782. * Iterate through all animation types in reverse priority order. For each, we want to
  7783. * detect which values it's handling and whether or not they've changed (and therefore
  7784. * need to be animated). If any values have been removed, we want to detect those in
  7785. * lower priority props and flag for animation.
  7786. */
  7787. for (var i = 0; i < numAnimationTypes; i++) {
  7788. _loop_1(i);
  7789. }
  7790. allAnimatedKeys = __assign({}, encounteredKeys);
  7791. /**
  7792. * If there are some removed value that haven't been dealt with,
  7793. * we need to create a new animation that falls back either to the value
  7794. * defined in the style prop, or the last read value.
  7795. */
  7796. if (removedKeys.size) {
  7797. var fallbackAnimation_1 = {};
  7798. removedKeys.forEach(function (key) {
  7799. var fallbackTarget = visualElement.getBaseTarget(key);
  7800. if (fallbackTarget !== undefined) {
  7801. fallbackAnimation_1[key] = fallbackTarget;
  7802. }
  7803. });
  7804. animations.push({ animation: fallbackAnimation_1 });
  7805. }
  7806. var shouldAnimate = Boolean(animations.length);
  7807. if (isInitialRender &&
  7808. props.initial === false &&
  7809. !visualElement.manuallyAnimateOnMount) {
  7810. shouldAnimate = false;
  7811. }
  7812. isInitialRender = false;
  7813. return shouldAnimate ? animate(animations) : Promise.resolve();
  7814. }
  7815. /**
  7816. * Change whether a certain animation type is active.
  7817. */
  7818. function setActive(type, isActive, options) {
  7819. var _a;
  7820. // If the active state hasn't changed, we can safely do nothing here
  7821. if (state[type].isActive === isActive)
  7822. return Promise.resolve();
  7823. // Propagate active change to children
  7824. (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
  7825. state[type].isActive = isActive;
  7826. return animateChanges(options, type);
  7827. }
  7828. return {
  7829. isAnimated: isAnimated,
  7830. animateChanges: animateChanges,
  7831. setActive: setActive,
  7832. setAnimateFunction: setAnimateFunction,
  7833. getState: function () { return state; },
  7834. };
  7835. }
  7836. function variantsHaveChanged(prev, next) {
  7837. if (typeof next === "string") {
  7838. return next !== prev;
  7839. }
  7840. else if (isVariantLabels(next)) {
  7841. return !shallowCompare(next, prev);
  7842. }
  7843. return false;
  7844. }
  7845. function createTypeState(isActive) {
  7846. if (isActive === void 0) { isActive = false; }
  7847. return {
  7848. isActive: isActive,
  7849. protectedKeys: {},
  7850. needsAnimating: {},
  7851. prevResolvedValues: {},
  7852. };
  7853. }
  7854. function createState() {
  7855. var _a;
  7856. return _a = {},
  7857. _a[AnimationType.Animate] = createTypeState(true),
  7858. _a[AnimationType.Hover] = createTypeState(),
  7859. _a[AnimationType.Tap] = createTypeState(),
  7860. _a[AnimationType.Drag] = createTypeState(),
  7861. _a[AnimationType.Focus] = createTypeState(),
  7862. _a[AnimationType.Exit] = createTypeState(),
  7863. _a;
  7864. }
  7865. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.js
  7866. var animations_animations = {
  7867. animation: makeRenderlessComponent(function (_a) {
  7868. var visualElement = _a.visualElement, animate = _a.animate;
  7869. /**
  7870. * We dynamically generate the AnimationState manager as it contains a reference
  7871. * to the underlying animation library. We only want to load that if we load this,
  7872. * so people can optionally code split it out using the `m` component.
  7873. */
  7874. visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));
  7875. /**
  7876. * Subscribe any provided AnimationControls to the component's VisualElement
  7877. */
  7878. if (isAnimationControls(animate)) {
  7879. Object(external_React_["useEffect"])(function () { return animate.subscribe(visualElement); }, [animate]);
  7880. }
  7881. }),
  7882. exit: makeRenderlessComponent(function (props) {
  7883. var custom = props.custom, visualElement = props.visualElement;
  7884. var _a = __read(usePresence(), 2), isPresent = _a[0], onExitComplete = _a[1];
  7885. var presenceContext = Object(external_React_["useContext"])(PresenceContext);
  7886. Object(external_React_["useEffect"])(function () {
  7887. var _a, _b;
  7888. var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom });
  7889. !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(onExitComplete));
  7890. }, [isPresent]);
  7891. }),
  7892. };
  7893. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point.js
  7894. var isPoint = function (point) {
  7895. return point.hasOwnProperty('x') && point.hasOwnProperty('y');
  7896. };
  7897. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point-3d.js
  7898. var isPoint3D = function (point) {
  7899. return isPoint(point) && point.hasOwnProperty('z');
  7900. };
  7901. // CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/distance.js
  7902. var distance1D = function (a, b) { return Math.abs(a - b); };
  7903. function distance(a, b) {
  7904. if (isNum(a) && isNum(b)) {
  7905. return distance1D(a, b);
  7906. }
  7907. else if (isPoint(a) && isPoint(b)) {
  7908. var xDelta = distance1D(a.x, b.x);
  7909. var yDelta = distance1D(a.y, b.y);
  7910. var zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0;
  7911. return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2));
  7912. }
  7913. }
  7914. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/PanSession.js
  7915. /**
  7916. * @internal
  7917. */
  7918. var PanSession_PanSession = /** @class */ (function () {
  7919. function PanSession(event, handlers, _a) {
  7920. var _this = this;
  7921. var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint;
  7922. /**
  7923. * @internal
  7924. */
  7925. this.startEvent = null;
  7926. /**
  7927. * @internal
  7928. */
  7929. this.lastMoveEvent = null;
  7930. /**
  7931. * @internal
  7932. */
  7933. this.lastMoveEventInfo = null;
  7934. /**
  7935. * @internal
  7936. */
  7937. this.handlers = {};
  7938. this.updatePoint = function () {
  7939. if (!(_this.lastMoveEvent && _this.lastMoveEventInfo))
  7940. return;
  7941. var info = getPanInfo(_this.lastMoveEventInfo, _this.history);
  7942. var isPanStarted = _this.startEvent !== null;
  7943. // Only start panning if the offset is larger than 3 pixels. If we make it
  7944. // any larger than this we'll want to reset the pointer history
  7945. // on the first update to avoid visual snapping to the cursoe.
  7946. var isDistancePastThreshold = distance(info.offset, { x: 0, y: 0 }) >= 3;
  7947. if (!isPanStarted && !isDistancePastThreshold)
  7948. return;
  7949. var point = info.point;
  7950. var timestamp = getFrameData().timestamp;
  7951. _this.history.push(__assign(__assign({}, point), { timestamp: timestamp }));
  7952. var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove;
  7953. if (!isPanStarted) {
  7954. onStart && onStart(_this.lastMoveEvent, info);
  7955. _this.startEvent = _this.lastMoveEvent;
  7956. }
  7957. onMove && onMove(_this.lastMoveEvent, info);
  7958. };
  7959. this.handlePointerMove = function (event, info) {
  7960. _this.lastMoveEvent = event;
  7961. _this.lastMoveEventInfo = PanSession_transformPoint(info, _this.transformPagePoint);
  7962. // Because Safari doesn't trigger mouseup events when it's above a `<select>`
  7963. if (isMouseEvent(event) && event.buttons === 0) {
  7964. _this.handlePointerUp(event, info);
  7965. return;
  7966. }
  7967. // Throttle mouse move event to once per frame
  7968. es.update(_this.updatePoint, true);
  7969. };
  7970. this.handlePointerUp = function (event, info) {
  7971. _this.end();
  7972. var _a = _this.handlers, onEnd = _a.onEnd, onSessionEnd = _a.onSessionEnd;
  7973. var panInfo = getPanInfo(PanSession_transformPoint(info, _this.transformPagePoint), _this.history);
  7974. if (_this.startEvent && onEnd) {
  7975. onEnd(event, panInfo);
  7976. }
  7977. onSessionEnd && onSessionEnd(event, panInfo);
  7978. };
  7979. // If we have more than one touch, don't start detecting this gesture
  7980. if (isTouchEvent(event) && event.touches.length > 1)
  7981. return;
  7982. this.handlers = handlers;
  7983. this.transformPagePoint = transformPagePoint;
  7984. var info = extractEventInfo(event);
  7985. var initialInfo = PanSession_transformPoint(info, this.transformPagePoint);
  7986. var point = initialInfo.point;
  7987. var timestamp = getFrameData().timestamp;
  7988. this.history = [__assign(__assign({}, point), { timestamp: timestamp })];
  7989. var onSessionStart = handlers.onSessionStart;
  7990. onSessionStart &&
  7991. onSessionStart(event, getPanInfo(initialInfo, this.history));
  7992. this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
  7993. }
  7994. PanSession.prototype.updateHandlers = function (handlers) {
  7995. this.handlers = handlers;
  7996. };
  7997. PanSession.prototype.end = function () {
  7998. this.removeListeners && this.removeListeners();
  7999. cancelSync.update(this.updatePoint);
  8000. };
  8001. return PanSession;
  8002. }());
  8003. function PanSession_transformPoint(info, transformPagePoint) {
  8004. return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
  8005. }
  8006. function subtractPoint(a, b) {
  8007. return { x: a.x - b.x, y: a.y - b.y };
  8008. }
  8009. function getPanInfo(_a, history) {
  8010. var point = _a.point;
  8011. return {
  8012. point: point,
  8013. delta: subtractPoint(point, lastDevicePoint(history)),
  8014. offset: subtractPoint(point, startDevicePoint(history)),
  8015. velocity: PanSession_getVelocity(history, 0.1),
  8016. };
  8017. }
  8018. function startDevicePoint(history) {
  8019. return history[0];
  8020. }
  8021. function lastDevicePoint(history) {
  8022. return history[history.length - 1];
  8023. }
  8024. function PanSession_getVelocity(history, timeDelta) {
  8025. if (history.length < 2) {
  8026. return { x: 0, y: 0 };
  8027. }
  8028. var i = history.length - 1;
  8029. var timestampedPoint = null;
  8030. var lastPoint = lastDevicePoint(history);
  8031. while (i >= 0) {
  8032. timestampedPoint = history[i];
  8033. if (lastPoint.timestamp - timestampedPoint.timestamp >
  8034. secondsToMilliseconds(timeDelta)) {
  8035. break;
  8036. }
  8037. i--;
  8038. }
  8039. if (!timestampedPoint) {
  8040. return { x: 0, y: 0 };
  8041. }
  8042. var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000;
  8043. if (time === 0) {
  8044. return { x: 0, y: 0 };
  8045. }
  8046. var currentVelocity = {
  8047. x: (lastPoint.x - timestampedPoint.x) / time,
  8048. y: (lastPoint.y - timestampedPoint.y) / time,
  8049. };
  8050. if (currentVelocity.x === Infinity) {
  8051. currentVelocity.x = 0;
  8052. }
  8053. if (currentVelocity.y === Infinity) {
  8054. currentVelocity.y = 0;
  8055. }
  8056. return currentVelocity;
  8057. }
  8058. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/noop.js
  8059. function noop(any) {
  8060. return any;
  8061. }
  8062. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/index.js
  8063. /**
  8064. * Bounding boxes tend to be defined as top, left, right, bottom. For various operations
  8065. * it's easier to consider each axis individually. This function returns a bounding box
  8066. * as a map of single-axis min/max values.
  8067. */
  8068. function convertBoundingBoxToAxisBox(_a) {
  8069. var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom;
  8070. return {
  8071. x: { min: left, max: right },
  8072. y: { min: top, max: bottom },
  8073. };
  8074. }
  8075. function convertAxisBoxToBoundingBox(_a) {
  8076. var x = _a.x, y = _a.y;
  8077. return {
  8078. top: y.min,
  8079. bottom: y.max,
  8080. left: x.min,
  8081. right: x.max,
  8082. };
  8083. }
  8084. /**
  8085. * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function
  8086. * provided by Framer to allow measured points to be corrected for device scaling. This is used
  8087. * when measuring DOM elements and DOM event points.
  8088. */
  8089. function transformBoundingBox(_a, transformPoint) {
  8090. var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right;
  8091. if (transformPoint === void 0) { transformPoint = noop; }
  8092. var topLeft = transformPoint({ x: left, y: top });
  8093. var bottomRight = transformPoint({ x: right, y: bottom });
  8094. return {
  8095. top: topLeft.y,
  8096. left: topLeft.x,
  8097. bottom: bottomRight.y,
  8098. right: bottomRight.x,
  8099. };
  8100. }
  8101. /**
  8102. * Create an empty axis box of zero size
  8103. */
  8104. function axisBox() {
  8105. return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };
  8106. }
  8107. function copyAxisBox(box) {
  8108. return {
  8109. x: __assign({}, box.x),
  8110. y: __assign({}, box.y),
  8111. };
  8112. }
  8113. /**
  8114. * Create an empty box delta
  8115. */
  8116. var zeroDelta = {
  8117. translate: 0,
  8118. scale: 1,
  8119. origin: 0,
  8120. originPoint: 0,
  8121. };
  8122. function geometry_delta() {
  8123. return {
  8124. x: __assign({}, zeroDelta),
  8125. y: __assign({}, zeroDelta),
  8126. };
  8127. }
  8128. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/each-axis.js
  8129. // Call a handler once for each axis
  8130. function eachAxis(handler) {
  8131. return [handler("x"), handler("y")];
  8132. }
  8133. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js
  8134. /**
  8135. * Apply constraints to a point. These constraints are both physical along an
  8136. * axis, and an elastic factor that determines how much to constrain the point
  8137. * by if it does lie outside the defined parameters.
  8138. */
  8139. function applyConstraints(point, _a, elastic) {
  8140. var min = _a.min, max = _a.max;
  8141. if (min !== undefined && point < min) {
  8142. // If we have a min point defined, and this is outside of that, constrain
  8143. point = elastic ? mix(min, point, elastic.min) : Math.max(point, min);
  8144. }
  8145. else if (max !== undefined && point > max) {
  8146. // If we have a max point defined, and this is outside of that, constrain
  8147. point = elastic ? mix(max, point, elastic.max) : Math.min(point, max);
  8148. }
  8149. return point;
  8150. }
  8151. /**
  8152. * Calculates a min projection point based on a pointer, pointer progress
  8153. * within the drag target, and constraints.
  8154. *
  8155. * For instance if an element was 100px width, we were dragging from 0.25
  8156. * along this axis, the pointer is at 200px, and there were no constraints,
  8157. * we would calculate a min projection point of 175px.
  8158. */
  8159. function calcConstrainedMinPoint(point, length, progress, constraints, elastic) {
  8160. // Calculate a min point for this axis and apply it to the current pointer
  8161. var min = point - length * progress;
  8162. return constraints ? applyConstraints(min, constraints, elastic) : min;
  8163. }
  8164. /**
  8165. * Calculate constraints in terms of the viewport when defined relatively to the
  8166. * measured axis. This is measured from the nearest edge, so a max constraint of 200
  8167. * on an axis with a max value of 300 would return a constraint of 500 - axis length
  8168. */
  8169. function calcRelativeAxisConstraints(axis, min, max) {
  8170. return {
  8171. min: min !== undefined ? axis.min + min : undefined,
  8172. max: max !== undefined
  8173. ? axis.max + max - (axis.max - axis.min)
  8174. : undefined,
  8175. };
  8176. }
  8177. /**
  8178. * Calculate constraints in terms of the viewport when
  8179. * defined relatively to the measured bounding box.
  8180. */
  8181. function calcRelativeConstraints(layoutBox, _a) {
  8182. var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right;
  8183. return {
  8184. x: calcRelativeAxisConstraints(layoutBox.x, left, right),
  8185. y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
  8186. };
  8187. }
  8188. /**
  8189. * Calculate viewport constraints when defined as another viewport-relative axis
  8190. */
  8191. function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
  8192. var _a;
  8193. var min = constraintsAxis.min - layoutAxis.min;
  8194. var max = constraintsAxis.max - layoutAxis.max;
  8195. // If the constraints axis is actually smaller than the layout axis then we can
  8196. // flip the constraints
  8197. if (constraintsAxis.max - constraintsAxis.min <
  8198. layoutAxis.max - layoutAxis.min) {
  8199. _a = __read([max, min], 2), min = _a[0], max = _a[1];
  8200. }
  8201. return {
  8202. min: layoutAxis.min + min,
  8203. max: layoutAxis.min + max,
  8204. };
  8205. }
  8206. /**
  8207. * Calculate viewport constraints when defined as another viewport-relative box
  8208. */
  8209. function calcViewportConstraints(layoutBox, constraintsBox) {
  8210. return {
  8211. x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
  8212. y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
  8213. };
  8214. }
  8215. /**
  8216. * Calculate the an axis position based on two axes and a progress value.
  8217. */
  8218. function calcPositionFromProgress(axis, constraints, progress) {
  8219. var axisLength = axis.max - axis.min;
  8220. var min = mix(constraints.min, constraints.max - axisLength, progress);
  8221. return { min: min, max: min + axisLength };
  8222. }
  8223. /**
  8224. * Rebase the calculated viewport constraints relative to the layout.min point.
  8225. */
  8226. function rebaseAxisConstraints(layout, constraints) {
  8227. var relativeConstraints = {};
  8228. if (constraints.min !== undefined) {
  8229. relativeConstraints.min = constraints.min - layout.min;
  8230. }
  8231. if (constraints.max !== undefined) {
  8232. relativeConstraints.max = constraints.max - layout.min;
  8233. }
  8234. return relativeConstraints;
  8235. }
  8236. var defaultElastic = 0.35;
  8237. /**
  8238. * Accepts a dragElastic prop and returns resolved elastic values for each axis.
  8239. */
  8240. function resolveDragElastic(dragElastic) {
  8241. if (dragElastic === false) {
  8242. dragElastic = 0;
  8243. }
  8244. else if (dragElastic === true) {
  8245. dragElastic = defaultElastic;
  8246. }
  8247. return {
  8248. x: resolveAxisElastic(dragElastic, "left", "right"),
  8249. y: resolveAxisElastic(dragElastic, "top", "bottom"),
  8250. };
  8251. }
  8252. function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
  8253. return {
  8254. min: resolvePointElastic(dragElastic, minLabel),
  8255. max: resolvePointElastic(dragElastic, maxLabel),
  8256. };
  8257. }
  8258. function resolvePointElastic(dragElastic, label) {
  8259. var _a;
  8260. return typeof dragElastic === "number"
  8261. ? dragElastic
  8262. : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0;
  8263. }
  8264. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/measure.js
  8265. /**
  8266. * Measure and return the element bounding box.
  8267. *
  8268. * We convert the box into an AxisBox2D to make it easier to work with each axis
  8269. * individually and programmatically.
  8270. *
  8271. * This function optionally accepts a transformPagePoint function which allows us to compensate
  8272. * for, for instance, measuring the element within a scaled plane like a Framer devivce preview component.
  8273. */
  8274. function getBoundingBox(element, transformPagePoint) {
  8275. var box = element.getBoundingClientRect();
  8276. return convertBoundingBoxToAxisBox(transformBoundingBox(box, transformPagePoint));
  8277. }
  8278. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-calc.js
  8279. var clampProgress = function (v) { return clamp_clamp(0, 1, v); };
  8280. /**
  8281. * Returns true if the provided value is within maxDistance of the provided target
  8282. */
  8283. function isNear(value, target, maxDistance) {
  8284. if (target === void 0) { target = 0; }
  8285. if (maxDistance === void 0) { maxDistance = 0.01; }
  8286. return distance(value, target) < maxDistance;
  8287. }
  8288. function calcLength(axis) {
  8289. return axis.max - axis.min;
  8290. }
  8291. /**
  8292. * Calculate a transform origin relative to the source axis, between 0-1, that results
  8293. * in an asthetically pleasing scale/transform needed to project from source to target.
  8294. */
  8295. function delta_calc_calcOrigin(source, target) {
  8296. var origin = 0.5;
  8297. var sourceLength = calcLength(source);
  8298. var targetLength = calcLength(target);
  8299. if (targetLength > sourceLength) {
  8300. origin = progress_progress(target.min, target.max - sourceLength, source.min);
  8301. }
  8302. else if (sourceLength > targetLength) {
  8303. origin = progress_progress(source.min, source.max - targetLength, target.min);
  8304. }
  8305. return clampProgress(origin);
  8306. }
  8307. /**
  8308. * Update the AxisDelta with a transform that projects source into target.
  8309. *
  8310. * The transform `origin` is optional. If not provided, it'll be automatically
  8311. * calculated based on the relative positions of the two bounding boxes.
  8312. */
  8313. function updateAxisDelta(delta, source, target, origin) {
  8314. if (origin === void 0) { origin = 0.5; }
  8315. delta.origin = origin;
  8316. delta.originPoint = mix(source.min, source.max, delta.origin);
  8317. delta.scale = calcLength(target) / calcLength(source);
  8318. if (isNear(delta.scale, 1, 0.0001))
  8319. delta.scale = 1;
  8320. delta.translate =
  8321. mix(target.min, target.max, delta.origin) - delta.originPoint;
  8322. if (isNear(delta.translate))
  8323. delta.translate = 0;
  8324. }
  8325. /**
  8326. * Update the BoxDelta with a transform that projects the source into the target.
  8327. *
  8328. * The transform `origin` is optional. If not provided, it'll be automatically
  8329. * calculated based on the relative positions of the two bounding boxes.
  8330. */
  8331. function updateBoxDelta(delta, source, target, origin) {
  8332. updateAxisDelta(delta.x, source.x, target.x, defaultOrigin(origin.originX));
  8333. updateAxisDelta(delta.y, source.y, target.y, defaultOrigin(origin.originY));
  8334. }
  8335. /**
  8336. * Currently this only accepts numerical origins, measured as 0-1, but could
  8337. * accept pixel values by comparing to the target axis.
  8338. */
  8339. function defaultOrigin(origin) {
  8340. return typeof origin === "number" ? origin : 0.5;
  8341. }
  8342. function calcRelativeAxis(target, relative, parent) {
  8343. target.min = parent.min + relative.min;
  8344. target.max = target.min + calcLength(relative);
  8345. }
  8346. function calcRelativeBox(projection, parentProjection) {
  8347. calcRelativeAxis(projection.target.x, projection.relativeTarget.x, parentProjection.target.x);
  8348. calcRelativeAxis(projection.target.y, projection.relativeTarget.y, parentProjection.target.y);
  8349. }
  8350. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js
  8351. var compareByDepth = function (a, b) {
  8352. return a.depth - b.depth;
  8353. };
  8354. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/utils.js
  8355. function isProjecting(visualElement) {
  8356. var isEnabled = visualElement.projection.isEnabled;
  8357. return isEnabled || visualElement.shouldResetTransform();
  8358. }
  8359. function collectProjectingAncestors(visualElement, ancestors) {
  8360. if (ancestors === void 0) { ancestors = []; }
  8361. var parent = visualElement.parent;
  8362. if (parent)
  8363. collectProjectingAncestors(parent, ancestors);
  8364. if (isProjecting(visualElement))
  8365. ancestors.push(visualElement);
  8366. return ancestors;
  8367. }
  8368. function collectProjectingChildren(visualElement) {
  8369. var children = [];
  8370. var addChild = function (child) {
  8371. if (isProjecting(child))
  8372. children.push(child);
  8373. child.children.forEach(addChild);
  8374. };
  8375. visualElement.children.forEach(addChild);
  8376. return children.sort(compareByDepth);
  8377. }
  8378. /**
  8379. * Update the layoutState by measuring the DOM layout. This
  8380. * should be called after resetting any layout-affecting transforms.
  8381. */
  8382. function updateLayoutMeasurement(visualElement) {
  8383. if (visualElement.shouldResetTransform())
  8384. return;
  8385. var layoutState = visualElement.getLayoutState();
  8386. visualElement.notifyBeforeLayoutMeasure(layoutState.layout);
  8387. layoutState.isHydrated = true;
  8388. layoutState.layout = visualElement.measureViewportBox();
  8389. layoutState.layoutCorrected = copyAxisBox(layoutState.layout);
  8390. visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout);
  8391. es.update(function () { return visualElement.rebaseProjectionTarget(); });
  8392. }
  8393. /**
  8394. * Record the viewport box as it was before an expected mutation/re-render
  8395. */
  8396. function snapshotViewportBox(visualElement) {
  8397. if (visualElement.shouldResetTransform())
  8398. return;
  8399. visualElement.prevViewportBox = visualElement.measureViewportBox(false);
  8400. /**
  8401. * Update targetBox to match the prevViewportBox. This is just to ensure
  8402. * that targetBox is affected by scroll in the same way as the measured box
  8403. */
  8404. visualElement.rebaseProjectionTarget(false, visualElement.prevViewportBox);
  8405. }
  8406. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/utils.js
  8407. function tweenAxis(target, prev, next, p) {
  8408. target.min = mix(prev.min, next.min, p);
  8409. target.max = mix(prev.max, next.max, p);
  8410. }
  8411. function calcRelativeOffsetAxis(parent, child) {
  8412. return {
  8413. min: child.min - parent.min,
  8414. max: child.max - parent.min,
  8415. };
  8416. }
  8417. function calcRelativeOffset(parent, child) {
  8418. return {
  8419. x: calcRelativeOffsetAxis(parent.x, child.x),
  8420. y: calcRelativeOffsetAxis(parent.y, child.y),
  8421. };
  8422. }
  8423. function checkIfParentHasChanged(prev, next) {
  8424. var prevId = prev.getLayoutId();
  8425. var nextId = next.getLayoutId();
  8426. return prevId !== nextId || (nextId === undefined && prev !== next);
  8427. }
  8428. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/is-draggable.js
  8429. function isDraggable(visualElement) {
  8430. var _a = visualElement.getProps(), drag = _a.drag, _dragX = _a._dragX;
  8431. return drag && !_dragX;
  8432. }
  8433. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-apply.js
  8434. /**
  8435. * Reset an axis to the provided origin box.
  8436. *
  8437. * This is a mutative operation.
  8438. */
  8439. function resetAxis(axis, originAxis) {
  8440. axis.min = originAxis.min;
  8441. axis.max = originAxis.max;
  8442. }
  8443. /**
  8444. * Reset a box to the provided origin box.
  8445. *
  8446. * This is a mutative operation.
  8447. */
  8448. function resetBox(box, originBox) {
  8449. resetAxis(box.x, originBox.x);
  8450. resetAxis(box.y, originBox.y);
  8451. }
  8452. /**
  8453. * Scales a point based on a factor and an originPoint
  8454. */
  8455. function scalePoint(point, scale, originPoint) {
  8456. var distanceFromOrigin = point - originPoint;
  8457. var scaled = scale * distanceFromOrigin;
  8458. return originPoint + scaled;
  8459. }
  8460. /**
  8461. * Applies a translate/scale delta to a point
  8462. */
  8463. function applyPointDelta(point, translate, scale, originPoint, boxScale) {
  8464. if (boxScale !== undefined) {
  8465. point = scalePoint(point, boxScale, originPoint);
  8466. }
  8467. return scalePoint(point, scale, originPoint) + translate;
  8468. }
  8469. /**
  8470. * Applies a translate/scale delta to an axis
  8471. */
  8472. function applyAxisDelta(axis, translate, scale, originPoint, boxScale) {
  8473. if (translate === void 0) { translate = 0; }
  8474. if (scale === void 0) { scale = 1; }
  8475. axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);
  8476. axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);
  8477. }
  8478. /**
  8479. * Applies a translate/scale delta to a box
  8480. */
  8481. function applyBoxDelta(box, _a) {
  8482. var x = _a.x, y = _a.y;
  8483. applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);
  8484. applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);
  8485. }
  8486. /**
  8487. * Apply a transform to an axis from the latest resolved motion values.
  8488. * This function basically acts as a bridge between a flat motion value map
  8489. * and applyAxisDelta
  8490. */
  8491. function applyAxisTransforms(final, axis, transforms, _a) {
  8492. var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2];
  8493. // Copy the current axis to the final axis before mutation
  8494. final.min = axis.min;
  8495. final.max = axis.max;
  8496. var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;
  8497. var originPoint = mix(axis.min, axis.max, axisOrigin);
  8498. // Apply the axis delta to the final axis
  8499. applyAxisDelta(final, transforms[key], transforms[scaleKey], originPoint, transforms.scale);
  8500. }
  8501. /**
  8502. * The names of the motion values we want to apply as translation, scale and origin.
  8503. */
  8504. var xKeys = ["x", "scaleX", "originX"];
  8505. var yKeys = ["y", "scaleY", "originY"];
  8506. /**
  8507. * Apply a transform to a box from the latest resolved motion values.
  8508. */
  8509. function applyBoxTransforms(finalBox, box, transforms) {
  8510. applyAxisTransforms(finalBox.x, box.x, transforms, xKeys);
  8511. applyAxisTransforms(finalBox.y, box.y, transforms, yKeys);
  8512. }
  8513. /**
  8514. * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse
  8515. */
  8516. function removePointDelta(point, translate, scale, originPoint, boxScale) {
  8517. point -= translate;
  8518. point = scalePoint(point, 1 / scale, originPoint);
  8519. if (boxScale !== undefined) {
  8520. point = scalePoint(point, 1 / boxScale, originPoint);
  8521. }
  8522. return point;
  8523. }
  8524. /**
  8525. * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse
  8526. */
  8527. function removeAxisDelta(axis, translate, scale, origin, boxScale) {
  8528. if (translate === void 0) { translate = 0; }
  8529. if (scale === void 0) { scale = 1; }
  8530. if (origin === void 0) { origin = 0.5; }
  8531. var originPoint = mix(axis.min, axis.max, origin) - translate;
  8532. axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);
  8533. axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);
  8534. }
  8535. /**
  8536. * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
  8537. * and acts as a bridge between motion values and removeAxisDelta
  8538. */
  8539. function removeAxisTransforms(axis, transforms, _a) {
  8540. var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2];
  8541. removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale);
  8542. }
  8543. /**
  8544. * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
  8545. * and acts as a bridge between motion values and removeAxisDelta
  8546. */
  8547. function removeBoxTransforms(box, transforms) {
  8548. removeAxisTransforms(box.x, transforms, xKeys);
  8549. removeAxisTransforms(box.y, transforms, yKeys);
  8550. }
  8551. /**
  8552. * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms
  8553. * in a tree upon our box before then calculating how to project it into our desired viewport-relative box
  8554. *
  8555. * This is the final nested loop within updateLayoutDelta for future refactoring
  8556. */
  8557. function applyTreeDeltas(box, treeScale, treePath) {
  8558. var treeLength = treePath.length;
  8559. if (!treeLength)
  8560. return;
  8561. // Reset the treeScale
  8562. treeScale.x = treeScale.y = 1;
  8563. var node;
  8564. var delta;
  8565. for (var i = 0; i < treeLength; i++) {
  8566. node = treePath[i];
  8567. delta = node.getLayoutState().delta;
  8568. // Incoporate each ancestor's scale into a culmulative treeScale for this component
  8569. treeScale.x *= delta.x.scale;
  8570. treeScale.y *= delta.y.scale;
  8571. // Apply each ancestor's calculated delta into this component's recorded layout box
  8572. applyBoxDelta(box, delta);
  8573. // If this is a draggable ancestor, also incorporate the node's transform to the layout box
  8574. if (isDraggable(node)) {
  8575. applyBoxTransforms(box, box, node.getLatestValues());
  8576. }
  8577. }
  8578. }
  8579. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/convert-to-relative.js
  8580. /**
  8581. * Returns a boolean stating whether or not we converted the projection
  8582. * to relative projection.
  8583. */
  8584. function convertToRelativeProjection(visualElement, isLayoutDrag) {
  8585. if (isLayoutDrag === void 0) { isLayoutDrag = true; }
  8586. var projectionParent = visualElement.getProjectionParent();
  8587. if (!projectionParent)
  8588. return false;
  8589. var offset;
  8590. if (isLayoutDrag) {
  8591. offset = calcRelativeOffset(projectionParent.projection.target, visualElement.projection.target);
  8592. removeBoxTransforms(offset, projectionParent.getLatestValues());
  8593. }
  8594. else {
  8595. offset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout);
  8596. }
  8597. eachAxis(function (axis) {
  8598. return visualElement.setProjectionTargetAxis(axis, offset[axis].min, offset[axis].max, true);
  8599. });
  8600. return true;
  8601. }
  8602. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/batch-layout.js
  8603. var unresolvedJobs = new Set();
  8604. function pushJob(stack, job, pointer) {
  8605. if (!stack[pointer])
  8606. stack[pointer] = [];
  8607. stack[pointer].push(job);
  8608. }
  8609. function batchLayout(callback) {
  8610. unresolvedJobs.add(callback);
  8611. return function () { return unresolvedJobs.delete(callback); };
  8612. }
  8613. function flushLayout() {
  8614. if (!unresolvedJobs.size)
  8615. return;
  8616. var pointer = 0;
  8617. var reads = [[]];
  8618. var writes = [];
  8619. var setRead = function (job) { return pushJob(reads, job, pointer); };
  8620. var setWrite = function (job) {
  8621. pushJob(writes, job, pointer);
  8622. pointer++;
  8623. };
  8624. /**
  8625. * Resolve jobs into their array stacks
  8626. */
  8627. unresolvedJobs.forEach(function (callback) {
  8628. callback(setRead, setWrite);
  8629. pointer = 0;
  8630. });
  8631. unresolvedJobs.clear();
  8632. /**
  8633. * Execute jobs
  8634. */
  8635. var numStacks = writes.length;
  8636. for (var i = 0; i <= numStacks; i++) {
  8637. reads[i] && reads[i].forEach(executeJob);
  8638. writes[i] && writes[i].forEach(executeJob);
  8639. }
  8640. }
  8641. var executeJob = function (job) { return job(); };
  8642. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js
  8643. var elementDragControls = new WeakMap();
  8644. /**
  8645. *
  8646. */
  8647. var lastPointerEvent;
  8648. var VisualElementDragControls_VisualElementDragControls = /** @class */ (function () {
  8649. function VisualElementDragControls(_a) {
  8650. var visualElement = _a.visualElement;
  8651. /**
  8652. * Track whether we're currently dragging.
  8653. *
  8654. * @internal
  8655. */
  8656. this.isDragging = false;
  8657. /**
  8658. * The current direction of drag, or `null` if both.
  8659. *
  8660. * @internal
  8661. */
  8662. this.currentDirection = null;
  8663. /**
  8664. * The permitted boundaries of travel, in pixels.
  8665. *
  8666. * @internal
  8667. */
  8668. this.constraints = false;
  8669. /**
  8670. * The per-axis resolved elastic values.
  8671. *
  8672. * @internal
  8673. */
  8674. this.elastic = axisBox();
  8675. /**
  8676. * A reference to the host component's latest props.
  8677. *
  8678. * @internal
  8679. */
  8680. this.props = {};
  8681. /**
  8682. * @internal
  8683. */
  8684. this.hasMutatedConstraints = false;
  8685. /**
  8686. * Track the initial position of the cursor relative to the dragging element
  8687. * when dragging starts as a value of 0-1 on each axis. We then use this to calculate
  8688. * an ideal bounding box for the VisualElement renderer to project into every frame.
  8689. *
  8690. * @internal
  8691. */
  8692. this.cursorProgress = {
  8693. x: 0.5,
  8694. y: 0.5,
  8695. };
  8696. // When updating _dragX, or _dragY instead of the VisualElement,
  8697. // persist their values between drag gestures.
  8698. this.originPoint = {};
  8699. // This is a reference to the global drag gesture lock, ensuring only one component
  8700. // can "capture" the drag of one or both axes.
  8701. // TODO: Look into moving this into pansession?
  8702. this.openGlobalLock = null;
  8703. /**
  8704. * @internal
  8705. */
  8706. this.panSession = null;
  8707. this.visualElement = visualElement;
  8708. this.visualElement.enableLayoutProjection();
  8709. elementDragControls.set(visualElement, this);
  8710. }
  8711. /**
  8712. * Instantiate a PanSession for the drag gesture
  8713. *
  8714. * @public
  8715. */
  8716. VisualElementDragControls.prototype.start = function (originEvent, _a) {
  8717. var _this = this;
  8718. var _b = _a === void 0 ? {} : _a, _c = _b.snapToCursor, snapToCursor = _c === void 0 ? false : _c, cursorProgress = _b.cursorProgress;
  8719. var onSessionStart = function (event) {
  8720. var _a;
  8721. // Stop any animations on both axis values immediately. This allows the user to throw and catch
  8722. // the component.
  8723. _this.stopMotion();
  8724. /**
  8725. * Save the initial point. We'll use this to calculate the pointer's position rather
  8726. * than the one we receive when the gesture actually starts. By then, the pointer will
  8727. * have already moved, and the perception will be of the pointer "slipping" across the element
  8728. */
  8729. var initialPoint = getViewportPointFromEvent(event).point;
  8730. (_a = _this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(_this);
  8731. _this.cancelLayout = batchLayout(function (read, write) {
  8732. var ancestors = collectProjectingAncestors(_this.visualElement);
  8733. var children = collectProjectingChildren(_this.visualElement);
  8734. var tree = __spreadArray(__spreadArray([], __read(ancestors)), __read(children));
  8735. var hasManuallySetCursorOrigin = false;
  8736. /**
  8737. * Apply a simple lock to the projection target. This ensures no animations
  8738. * can run on the projection box while this lock is active.
  8739. */
  8740. _this.isLayoutDrag() && _this.visualElement.lockProjectionTarget();
  8741. write(function () {
  8742. tree.forEach(function (element) { return element.resetTransform(); });
  8743. });
  8744. read(function () {
  8745. updateLayoutMeasurement(_this.visualElement);
  8746. children.forEach(updateLayoutMeasurement);
  8747. });
  8748. write(function () {
  8749. tree.forEach(function (element) { return element.restoreTransform(); });
  8750. if (snapToCursor) {
  8751. hasManuallySetCursorOrigin = _this.snapToCursor(initialPoint);
  8752. }
  8753. });
  8754. read(function () {
  8755. var isRelativeDrag = Boolean(_this.getAxisMotionValue("x") && !_this.isExternalDrag());
  8756. if (!isRelativeDrag) {
  8757. _this.visualElement.rebaseProjectionTarget(true, _this.visualElement.measureViewportBox(false));
  8758. }
  8759. _this.visualElement.scheduleUpdateLayoutProjection();
  8760. /**
  8761. * When dragging starts, we want to find where the cursor is relative to the bounding box
  8762. * of the element. Every frame, we calculate a new bounding box using this relative position
  8763. * and let the visualElement renderer figure out how to reproject the element into this bounding
  8764. * box.
  8765. *
  8766. * By doing it this way, rather than applying an x/y transform directly to the element,
  8767. * we can ensure the component always visually sticks to the cursor as we'd expect, even
  8768. * if the DOM element itself changes layout as a result of React updates the user might
  8769. * make based on the drag position.
  8770. */
  8771. var projection = _this.visualElement.projection;
  8772. eachAxis(function (axis) {
  8773. if (!hasManuallySetCursorOrigin) {
  8774. var _a = projection.target[axis], min = _a.min, max = _a.max;
  8775. _this.cursorProgress[axis] = cursorProgress
  8776. ? cursorProgress[axis]
  8777. : progress_progress(min, max, initialPoint[axis]);
  8778. }
  8779. /**
  8780. * If we have external drag MotionValues, record their origin point. On pointermove
  8781. * we'll apply the pan gesture offset directly to this value.
  8782. */
  8783. var axisValue = _this.getAxisMotionValue(axis);
  8784. if (axisValue) {
  8785. _this.originPoint[axis] = axisValue.get();
  8786. }
  8787. });
  8788. });
  8789. write(function () {
  8790. flushSync.update();
  8791. flushSync.preRender();
  8792. flushSync.render();
  8793. flushSync.postRender();
  8794. });
  8795. read(function () { return _this.resolveDragConstraints(); });
  8796. });
  8797. };
  8798. var onStart = function (event, info) {
  8799. var _a, _b, _c;
  8800. // Attempt to grab the global drag gesture lock - maybe make this part of PanSession
  8801. var _d = _this.props, drag = _d.drag, dragPropagation = _d.dragPropagation;
  8802. if (drag && !dragPropagation) {
  8803. if (_this.openGlobalLock)
  8804. _this.openGlobalLock();
  8805. _this.openGlobalLock = getGlobalLock(drag);
  8806. // If we don 't have the lock, don't start dragging
  8807. if (!_this.openGlobalLock)
  8808. return;
  8809. }
  8810. flushLayout();
  8811. // Set current drag status
  8812. _this.isDragging = true;
  8813. _this.currentDirection = null;
  8814. // Fire onDragStart event
  8815. (_b = (_a = _this.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, event, info);
  8816. (_c = _this.visualElement.animationState) === null || _c === void 0 ? void 0 : _c.setActive(AnimationType.Drag, true);
  8817. };
  8818. var onMove = function (event, info) {
  8819. var _a, _b, _c, _d;
  8820. var _e = _this.props, dragPropagation = _e.dragPropagation, dragDirectionLock = _e.dragDirectionLock;
  8821. // If we didn't successfully receive the gesture lock, early return.
  8822. if (!dragPropagation && !_this.openGlobalLock)
  8823. return;
  8824. var offset = info.offset;
  8825. // Attempt to detect drag direction if directionLock is true
  8826. if (dragDirectionLock && _this.currentDirection === null) {
  8827. _this.currentDirection = getCurrentDirection(offset);
  8828. // If we've successfully set a direction, notify listener
  8829. if (_this.currentDirection !== null) {
  8830. (_b = (_a = _this.props).onDirectionLock) === null || _b === void 0 ? void 0 : _b.call(_a, _this.currentDirection);
  8831. }
  8832. return;
  8833. }
  8834. // Update each point with the latest position
  8835. _this.updateAxis("x", info.point, offset);
  8836. _this.updateAxis("y", info.point, offset);
  8837. // Fire onDrag event
  8838. (_d = (_c = _this.props).onDrag) === null || _d === void 0 ? void 0 : _d.call(_c, event, info);
  8839. // Update the last pointer event
  8840. lastPointerEvent = event;
  8841. };
  8842. var onSessionEnd = function (event, info) {
  8843. return _this.stop(event, info);
  8844. };
  8845. var transformPagePoint = this.props.transformPagePoint;
  8846. this.panSession = new PanSession_PanSession(originEvent, {
  8847. onSessionStart: onSessionStart,
  8848. onStart: onStart,
  8849. onMove: onMove,
  8850. onSessionEnd: onSessionEnd,
  8851. }, { transformPagePoint: transformPagePoint });
  8852. };
  8853. VisualElementDragControls.prototype.resolveDragConstraints = function () {
  8854. var _this = this;
  8855. var _a = this.props, dragConstraints = _a.dragConstraints, dragElastic = _a.dragElastic;
  8856. var layout = this.visualElement.getLayoutState().layoutCorrected;
  8857. if (dragConstraints) {
  8858. this.constraints = isRefObject(dragConstraints)
  8859. ? this.resolveRefConstraints(layout, dragConstraints)
  8860. : calcRelativeConstraints(layout, dragConstraints);
  8861. }
  8862. else {
  8863. this.constraints = false;
  8864. }
  8865. this.elastic = resolveDragElastic(dragElastic);
  8866. /**
  8867. * If we're outputting to external MotionValues, we want to rebase the measured constraints
  8868. * from viewport-relative to component-relative.
  8869. */
  8870. if (this.constraints && !this.hasMutatedConstraints) {
  8871. eachAxis(function (axis) {
  8872. if (_this.getAxisMotionValue(axis)) {
  8873. _this.constraints[axis] = rebaseAxisConstraints(layout[axis], _this.constraints[axis]);
  8874. }
  8875. });
  8876. }
  8877. };
  8878. VisualElementDragControls.prototype.resolveRefConstraints = function (layoutBox, constraints) {
  8879. var _a = this.props, onMeasureDragConstraints = _a.onMeasureDragConstraints, transformPagePoint = _a.transformPagePoint;
  8880. var constraintsElement = constraints.current;
  8881. invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
  8882. this.constraintsBox = getBoundingBox(constraintsElement, transformPagePoint);
  8883. var measuredConstraints = calcViewportConstraints(layoutBox, this.constraintsBox);
  8884. /**
  8885. * If there's an onMeasureDragConstraints listener we call it and
  8886. * if different constraints are returned, set constraints to that
  8887. */
  8888. if (onMeasureDragConstraints) {
  8889. var userConstraints = onMeasureDragConstraints(convertAxisBoxToBoundingBox(measuredConstraints));
  8890. this.hasMutatedConstraints = !!userConstraints;
  8891. if (userConstraints) {
  8892. measuredConstraints = convertBoundingBoxToAxisBox(userConstraints);
  8893. }
  8894. }
  8895. return measuredConstraints;
  8896. };
  8897. VisualElementDragControls.prototype.cancelDrag = function () {
  8898. var _a, _b;
  8899. this.visualElement.unlockProjectionTarget();
  8900. (_a = this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(this);
  8901. this.isDragging = false;
  8902. this.panSession && this.panSession.end();
  8903. this.panSession = null;
  8904. if (!this.props.dragPropagation && this.openGlobalLock) {
  8905. this.openGlobalLock();
  8906. this.openGlobalLock = null;
  8907. }
  8908. (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(AnimationType.Drag, false);
  8909. };
  8910. VisualElementDragControls.prototype.stop = function (event, info) {
  8911. var _a, _b, _c;
  8912. (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end();
  8913. this.panSession = null;
  8914. var isDragging = this.isDragging;
  8915. this.cancelDrag();
  8916. if (!isDragging)
  8917. return;
  8918. var velocity = info.velocity;
  8919. this.animateDragEnd(velocity);
  8920. (_c = (_b = this.props).onDragEnd) === null || _c === void 0 ? void 0 : _c.call(_b, event, info);
  8921. };
  8922. VisualElementDragControls.prototype.snapToCursor = function (point) {
  8923. var _this = this;
  8924. return eachAxis(function (axis) {
  8925. var drag = _this.props.drag;
  8926. // If we're not dragging this axis, do an early return.
  8927. if (!shouldDrag(axis, drag, _this.currentDirection))
  8928. return;
  8929. var axisValue = _this.getAxisMotionValue(axis);
  8930. if (axisValue) {
  8931. var box = _this.visualElement.getLayoutState().layout;
  8932. var length_1 = box[axis].max - box[axis].min;
  8933. var center = box[axis].min + length_1 / 2;
  8934. var offset = point[axis] - center;
  8935. _this.originPoint[axis] = point[axis];
  8936. axisValue.set(offset);
  8937. }
  8938. else {
  8939. _this.cursorProgress[axis] = 0.5;
  8940. return true;
  8941. }
  8942. }).includes(true);
  8943. };
  8944. /**
  8945. * Update the specified axis with the latest pointer information.
  8946. */
  8947. VisualElementDragControls.prototype.updateAxis = function (axis, point, offset) {
  8948. var drag = this.props.drag;
  8949. // If we're not dragging this axis, do an early return.
  8950. if (!shouldDrag(axis, drag, this.currentDirection))
  8951. return;
  8952. return this.getAxisMotionValue(axis)
  8953. ? this.updateAxisMotionValue(axis, offset)
  8954. : this.updateVisualElementAxis(axis, point);
  8955. };
  8956. VisualElementDragControls.prototype.updateAxisMotionValue = function (axis, offset) {
  8957. var axisValue = this.getAxisMotionValue(axis);
  8958. if (!offset || !axisValue)
  8959. return;
  8960. var nextValue = this.originPoint[axis] + offset[axis];
  8961. var update = this.constraints
  8962. ? applyConstraints(nextValue, this.constraints[axis], this.elastic[axis])
  8963. : nextValue;
  8964. axisValue.set(update);
  8965. };
  8966. VisualElementDragControls.prototype.updateVisualElementAxis = function (axis, point) {
  8967. var _a;
  8968. // Get the actual layout bounding box of the element
  8969. var axisLayout = this.visualElement.getLayoutState().layout[axis];
  8970. // Calculate its current length. In the future we might want to lerp this to animate
  8971. // between lengths if the layout changes as we change the DOM
  8972. var axisLength = axisLayout.max - axisLayout.min;
  8973. // Get the initial progress that the pointer sat on this axis on gesture start.
  8974. var axisProgress = this.cursorProgress[axis];
  8975. // Calculate a new min point based on the latest pointer position, constraints and elastic
  8976. var min = calcConstrainedMinPoint(point[axis], axisLength, axisProgress, (_a = this.constraints) === null || _a === void 0 ? void 0 : _a[axis], this.elastic[axis]);
  8977. // Update the axis viewport target with this new min and the length
  8978. this.visualElement.setProjectionTargetAxis(axis, min, min + axisLength);
  8979. };
  8980. VisualElementDragControls.prototype.setProps = function (_a) {
  8981. var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? defaultElastic : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest(_a, ["drag", "dragDirectionLock", "dragPropagation", "dragConstraints", "dragElastic", "dragMomentum"]);
  8982. this.props = __assign({ drag: drag,
  8983. dragDirectionLock: dragDirectionLock,
  8984. dragPropagation: dragPropagation,
  8985. dragConstraints: dragConstraints,
  8986. dragElastic: dragElastic,
  8987. dragMomentum: dragMomentum }, remainingProps);
  8988. };
  8989. /**
  8990. * Drag works differently depending on which props are provided.
  8991. *
  8992. * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
  8993. * - If the component will perform layout animations, we output the gesture to the component's
  8994. * visual bounding box
  8995. * - Otherwise, we apply the delta to the x/y motion values.
  8996. */
  8997. VisualElementDragControls.prototype.getAxisMotionValue = function (axis) {
  8998. var _a = this.props, layout = _a.layout, layoutId = _a.layoutId;
  8999. var dragKey = "_drag" + axis.toUpperCase();
  9000. if (this.props[dragKey]) {
  9001. return this.props[dragKey];
  9002. }
  9003. else if (!layout && layoutId === undefined) {
  9004. return this.visualElement.getValue(axis, 0);
  9005. }
  9006. };
  9007. VisualElementDragControls.prototype.isLayoutDrag = function () {
  9008. return !this.getAxisMotionValue("x");
  9009. };
  9010. VisualElementDragControls.prototype.isExternalDrag = function () {
  9011. var _a = this.props, _dragX = _a._dragX, _dragY = _a._dragY;
  9012. return _dragX || _dragY;
  9013. };
  9014. VisualElementDragControls.prototype.animateDragEnd = function (velocity) {
  9015. var _this = this;
  9016. var _a = this.props, drag = _a.drag, dragMomentum = _a.dragMomentum, dragElastic = _a.dragElastic, dragTransition = _a.dragTransition;
  9017. /**
  9018. * Everything beyond the drag gesture should be performed with
  9019. * relative projection so children stay in sync with their parent element.
  9020. */
  9021. var isRelative = convertToRelativeProjection(this.visualElement, this.isLayoutDrag() && !this.isExternalDrag());
  9022. /**
  9023. * If we had previously resolved constraints relative to the viewport,
  9024. * we need to also convert those to a relative coordinate space for the animation
  9025. */
  9026. var constraints = this.constraints || {};
  9027. if (isRelative &&
  9028. Object.keys(constraints).length &&
  9029. this.isLayoutDrag()) {
  9030. var projectionParent = this.visualElement.getProjectionParent();
  9031. if (projectionParent) {
  9032. var relativeConstraints_1 = calcRelativeOffset(projectionParent.projection.targetFinal, constraints);
  9033. eachAxis(function (axis) {
  9034. var _a = relativeConstraints_1[axis], min = _a.min, max = _a.max;
  9035. constraints[axis] = {
  9036. min: isNaN(min) ? undefined : min,
  9037. max: isNaN(max) ? undefined : max,
  9038. };
  9039. });
  9040. }
  9041. }
  9042. var momentumAnimations = eachAxis(function (axis) {
  9043. var _a;
  9044. if (!shouldDrag(axis, drag, _this.currentDirection)) {
  9045. return;
  9046. }
  9047. var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {};
  9048. /**
  9049. * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
  9050. * of spring animations so we should look into adding a disable spring option to `inertia`.
  9051. * We could do something here where we affect the `bounceStiffness` and `bounceDamping`
  9052. * using the value of `dragElastic`.
  9053. */
  9054. var bounceStiffness = dragElastic ? 200 : 1000000;
  9055. var bounceDamping = dragElastic ? 40 : 10000000;
  9056. var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
  9057. bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
  9058. // If we're not animating on an externally-provided `MotionValue` we can use the
  9059. // component's animation controls which will handle interactions with whileHover (etc),
  9060. // otherwise we just have to animate the `MotionValue` itself.
  9061. return _this.getAxisMotionValue(axis)
  9062. ? _this.startAxisValueAnimation(axis, inertia)
  9063. : _this.visualElement.startLayoutAnimation(axis, inertia, isRelative);
  9064. });
  9065. // Run all animations and then resolve the new drag constraints.
  9066. return Promise.all(momentumAnimations).then(function () {
  9067. var _a, _b;
  9068. (_b = (_a = _this.props).onDragTransitionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
  9069. });
  9070. };
  9071. VisualElementDragControls.prototype.stopMotion = function () {
  9072. var _this = this;
  9073. eachAxis(function (axis) {
  9074. var axisValue = _this.getAxisMotionValue(axis);
  9075. axisValue
  9076. ? axisValue.stop()
  9077. : _this.visualElement.stopLayoutAnimation();
  9078. });
  9079. };
  9080. VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) {
  9081. var axisValue = this.getAxisMotionValue(axis);
  9082. if (!axisValue)
  9083. return;
  9084. var currentValue = axisValue.get();
  9085. axisValue.set(currentValue);
  9086. axisValue.set(currentValue); // Set twice to hard-reset velocity
  9087. return transitions_startAnimation(axis, axisValue, 0, transition);
  9088. };
  9089. VisualElementDragControls.prototype.scalePoint = function () {
  9090. var _this = this;
  9091. var _a = this.props, drag = _a.drag, dragConstraints = _a.dragConstraints;
  9092. if (!isRefObject(dragConstraints) || !this.constraintsBox)
  9093. return;
  9094. // Stop any current animations as there can be some visual glitching if we resize mid animation
  9095. this.stopMotion();
  9096. // Record the relative progress of the targetBox relative to the constraintsBox
  9097. var boxProgress = { x: 0, y: 0 };
  9098. eachAxis(function (axis) {
  9099. boxProgress[axis] = delta_calc_calcOrigin(_this.visualElement.projection.target[axis], _this.constraintsBox[axis]);
  9100. });
  9101. /**
  9102. * For each axis, calculate the current progress of the layout axis within the constraints.
  9103. * Then, using the latest layout and constraints measurements, reposition the new layout axis
  9104. * proportionally within the constraints.
  9105. */
  9106. this.updateConstraints(function () {
  9107. eachAxis(function (axis) {
  9108. if (!shouldDrag(axis, drag, null))
  9109. return;
  9110. // Calculate the position of the targetBox relative to the constraintsBox using the
  9111. // previously calculated progress
  9112. var _a = calcPositionFromProgress(_this.visualElement.projection.target[axis], _this.constraintsBox[axis], boxProgress[axis]), min = _a.min, max = _a.max;
  9113. _this.visualElement.setProjectionTargetAxis(axis, min, max);
  9114. });
  9115. });
  9116. /**
  9117. * If any other draggable components are queuing the same tasks synchronously
  9118. * this will wait until they've all been scheduled before flushing.
  9119. */
  9120. setTimeout(flushLayout, 1);
  9121. };
  9122. VisualElementDragControls.prototype.updateConstraints = function (onReady) {
  9123. var _this = this;
  9124. this.cancelLayout = batchLayout(function (read, write) {
  9125. var ancestors = collectProjectingAncestors(_this.visualElement);
  9126. write(function () {
  9127. return ancestors.forEach(function (element) { return element.resetTransform(); });
  9128. });
  9129. read(function () { return updateLayoutMeasurement(_this.visualElement); });
  9130. write(function () {
  9131. return ancestors.forEach(function (element) { return element.restoreTransform(); });
  9132. });
  9133. read(function () {
  9134. _this.resolveDragConstraints();
  9135. });
  9136. if (onReady)
  9137. write(onReady);
  9138. });
  9139. };
  9140. VisualElementDragControls.prototype.mount = function (visualElement) {
  9141. var _this = this;
  9142. var element = visualElement.getInstance();
  9143. /**
  9144. * Attach a pointerdown event listener on this DOM element to initiate drag tracking.
  9145. */
  9146. var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) {
  9147. var _a = _this.props, drag = _a.drag, _b = _a.dragListener, dragListener = _b === void 0 ? true : _b;
  9148. drag && dragListener && _this.start(event);
  9149. });
  9150. /**
  9151. * Attach a window resize listener to scale the draggable target within its defined
  9152. * constraints as the window resizes.
  9153. */
  9154. var stopResizeListener = addDomEvent(window, "resize", function () {
  9155. _this.scalePoint();
  9156. });
  9157. /**
  9158. * Ensure drag constraints are resolved correctly relative to the dragging element
  9159. * whenever its layout changes.
  9160. */
  9161. var stopLayoutUpdateListener = visualElement.onLayoutUpdate(function () {
  9162. if (_this.isDragging) {
  9163. _this.resolveDragConstraints();
  9164. }
  9165. });
  9166. /**
  9167. * If the previous component with this same layoutId was dragging at the time
  9168. * it was unmounted, we want to continue the same gesture on this component.
  9169. */
  9170. var prevDragCursor = visualElement.prevDragCursor;
  9171. if (prevDragCursor) {
  9172. this.start(lastPointerEvent, { cursorProgress: prevDragCursor });
  9173. }
  9174. /**
  9175. * Return a function that will teardown the drag gesture
  9176. */
  9177. return function () {
  9178. stopPointerListener === null || stopPointerListener === void 0 ? void 0 : stopPointerListener();
  9179. stopResizeListener === null || stopResizeListener === void 0 ? void 0 : stopResizeListener();
  9180. stopLayoutUpdateListener === null || stopLayoutUpdateListener === void 0 ? void 0 : stopLayoutUpdateListener();
  9181. _this.cancelDrag();
  9182. };
  9183. };
  9184. return VisualElementDragControls;
  9185. }());
  9186. function shouldDrag(direction, drag, currentDirection) {
  9187. return ((drag === true || drag === direction) &&
  9188. (currentDirection === null || currentDirection === direction));
  9189. }
  9190. /**
  9191. * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
  9192. * than the provided threshold, return `null`.
  9193. *
  9194. * @param offset - The x/y offset from origin.
  9195. * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
  9196. */
  9197. function getCurrentDirection(offset, lockThreshold) {
  9198. if (lockThreshold === void 0) { lockThreshold = 10; }
  9199. var direction = null;
  9200. if (Math.abs(offset.y) > lockThreshold) {
  9201. direction = "y";
  9202. }
  9203. else if (Math.abs(offset.x) > lockThreshold) {
  9204. direction = "x";
  9205. }
  9206. return direction;
  9207. }
  9208. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/use-drag.js
  9209. /**
  9210. * A hook that allows an element to be dragged.
  9211. *
  9212. * @internal
  9213. */
  9214. function useDrag(props) {
  9215. var groupDragControls = props.dragControls, visualElement = props.visualElement;
  9216. var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint;
  9217. var dragControls = useConstant(function () {
  9218. return new VisualElementDragControls_VisualElementDragControls({
  9219. visualElement: visualElement,
  9220. });
  9221. });
  9222. dragControls.setProps(__assign(__assign({}, props), { transformPagePoint: transformPagePoint }));
  9223. // If we've been provided a DragControls for manual control over the drag gesture,
  9224. // subscribe this component to it on mount.
  9225. Object(external_React_["useEffect"])(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls]);
  9226. // Mount the drag controls with the visualElement
  9227. Object(external_React_["useEffect"])(function () { return dragControls.mount(visualElement); }, []);
  9228. }
  9229. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-pan-gesture.js
  9230. /**
  9231. *
  9232. * @param handlers -
  9233. * @param ref -
  9234. *
  9235. * @internalremarks
  9236. * Currently this sets new pan gesture functions every render. The memo route has been explored
  9237. * in the past but ultimately we're still creating new functions every render. An optimisation
  9238. * to explore is creating the pan gestures and loading them into a `ref`.
  9239. *
  9240. * @internal
  9241. */
  9242. function usePanGesture(_a) {
  9243. var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart, visualElement = _a.visualElement;
  9244. var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart;
  9245. var panSession = Object(external_React_["useRef"])(null);
  9246. var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint;
  9247. var handlers = {
  9248. onSessionStart: onPanSessionStart,
  9249. onStart: onPanStart,
  9250. onMove: onPan,
  9251. onEnd: function (event, info) {
  9252. panSession.current = null;
  9253. onPanEnd && onPanEnd(event, info);
  9254. },
  9255. };
  9256. Object(external_React_["useEffect"])(function () {
  9257. if (panSession.current !== null) {
  9258. panSession.current.updateHandlers(handlers);
  9259. }
  9260. });
  9261. function onPointerDown(event) {
  9262. panSession.current = new PanSession_PanSession(event, handlers, {
  9263. transformPagePoint: transformPagePoint,
  9264. });
  9265. }
  9266. usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown);
  9267. useUnmountEffect(function () { return panSession.current && panSession.current.end(); });
  9268. }
  9269. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.js
  9270. var drag_drag = {
  9271. pan: makeRenderlessComponent(usePanGesture),
  9272. drag: makeRenderlessComponent(useDrag),
  9273. };
  9274. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/types.js
  9275. /**
  9276. * @public
  9277. */
  9278. var Presence;
  9279. (function (Presence) {
  9280. Presence[Presence["Entering"] = 0] = "Entering";
  9281. Presence[Presence["Present"] = 1] = "Present";
  9282. Presence[Presence["Exiting"] = 2] = "Exiting";
  9283. })(Presence || (Presence = {}));
  9284. /**
  9285. * @public
  9286. */
  9287. var VisibilityAction;
  9288. (function (VisibilityAction) {
  9289. VisibilityAction[VisibilityAction["Hide"] = 0] = "Hide";
  9290. VisibilityAction[VisibilityAction["Show"] = 1] = "Show";
  9291. })(VisibilityAction || (VisibilityAction = {}));
  9292. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js
  9293. function css_variables_conversion_isCSSVariable(value) {
  9294. return typeof value === "string" && value.startsWith("var(--");
  9295. }
  9296. /**
  9297. * Parse Framer's special CSS variable format into a CSS token and a fallback.
  9298. *
  9299. * ```
  9300. * `var(--foo, #fff)` => [`--foo`, '#fff']
  9301. * ```
  9302. *
  9303. * @param current
  9304. */
  9305. var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
  9306. function parseCSSVariable(current) {
  9307. var match = cssVariableRegex.exec(current);
  9308. if (!match)
  9309. return [,];
  9310. var _a = __read(match, 3), token = _a[1], fallback = _a[2];
  9311. return [token, fallback];
  9312. }
  9313. var maxDepth = 4;
  9314. function getVariableValue(current, element, depth) {
  9315. if (depth === void 0) { depth = 1; }
  9316. invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"" + current + "\". This may indicate a circular fallback dependency.");
  9317. var _a = __read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1];
  9318. // No CSS variable detected
  9319. if (!token)
  9320. return;
  9321. // Attempt to read this CSS variable off the element
  9322. var resolved = window.getComputedStyle(element).getPropertyValue(token);
  9323. if (resolved) {
  9324. return resolved.trim();
  9325. }
  9326. else if (css_variables_conversion_isCSSVariable(fallback)) {
  9327. // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.
  9328. return getVariableValue(fallback, element, depth + 1);
  9329. }
  9330. else {
  9331. return fallback;
  9332. }
  9333. }
  9334. /**
  9335. * Resolve CSS variables from
  9336. *
  9337. * @internal
  9338. */
  9339. function resolveCSSVariables(visualElement, _a, transitionEnd) {
  9340. var _b;
  9341. var target = __rest(_a, []);
  9342. var element = visualElement.getInstance();
  9343. if (!(element instanceof HTMLElement))
  9344. return { target: target, transitionEnd: transitionEnd };
  9345. // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`
  9346. // only if they change but I think this reads clearer and this isn't a performance-critical path.
  9347. if (transitionEnd) {
  9348. transitionEnd = __assign({}, transitionEnd);
  9349. }
  9350. // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved
  9351. visualElement.forEachValue(function (value) {
  9352. var current = value.get();
  9353. if (!css_variables_conversion_isCSSVariable(current))
  9354. return;
  9355. var resolved = getVariableValue(current, element);
  9356. if (resolved)
  9357. value.set(resolved);
  9358. });
  9359. // Cycle through every target property and resolve CSS variables. Currently
  9360. // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`
  9361. for (var key in target) {
  9362. var current = target[key];
  9363. if (!css_variables_conversion_isCSSVariable(current))
  9364. continue;
  9365. var resolved = getVariableValue(current, element);
  9366. if (!resolved)
  9367. continue;
  9368. // Clone target if it hasn't already been
  9369. target[key] = resolved;
  9370. // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved
  9371. // CSS variable. This will ensure that after the animation the component will reflect
  9372. // changes in the value of the CSS variable.
  9373. if (transitionEnd)
  9374. (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current);
  9375. }
  9376. return { target: target, transitionEnd: transitionEnd };
  9377. }
  9378. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/default-scale-correctors.js
  9379. function pixelsToPercent(pixels, axis) {
  9380. return (pixels / (axis.max - axis.min)) * 100;
  9381. }
  9382. /**
  9383. * We always correct borderRadius as a percentage rather than pixels to reduce paints.
  9384. * For example, if you are projecting a box that is 100px wide with a 10px borderRadius
  9385. * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
  9386. * borderRadius in both states. If we animate between the two in pixels that will trigger
  9387. * a paint each time. If we animate between the two in percentage we'll avoid a paint.
  9388. */
  9389. function correctBorderRadius(latest, _layoutState, _a) {
  9390. var target = _a.target;
  9391. /**
  9392. * If latest is a string, if it's a percentage we can return immediately as it's
  9393. * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.
  9394. */
  9395. if (typeof latest === "string") {
  9396. if (px.test(latest)) {
  9397. latest = parseFloat(latest);
  9398. }
  9399. else {
  9400. return latest;
  9401. }
  9402. }
  9403. /**
  9404. * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
  9405. * pixel value as a percentage of each axis
  9406. */
  9407. var x = pixelsToPercent(latest, target.x);
  9408. var y = pixelsToPercent(latest, target.y);
  9409. return x + "% " + y + "%";
  9410. }
  9411. var varToken = "_$css";
  9412. function correctBoxShadow(latest, _a) {
  9413. var delta = _a.delta, treeScale = _a.treeScale;
  9414. var original = latest;
  9415. /**
  9416. * We need to first strip and store CSS variables from the string.
  9417. */
  9418. var containsCSSVariables = latest.includes("var(");
  9419. var cssVariables = [];
  9420. if (containsCSSVariables) {
  9421. latest = latest.replace(cssVariableRegex, function (match) {
  9422. cssVariables.push(match);
  9423. return varToken;
  9424. });
  9425. }
  9426. var shadow = complex.parse(latest);
  9427. // TODO: Doesn't support multiple shadows
  9428. if (shadow.length > 5)
  9429. return original;
  9430. var template = complex.createTransformer(latest);
  9431. var offset = typeof shadow[0] !== "number" ? 1 : 0;
  9432. // Calculate the overall context scale
  9433. var xScale = delta.x.scale * treeScale.x;
  9434. var yScale = delta.y.scale * treeScale.y;
  9435. shadow[0 + offset] /= xScale;
  9436. shadow[1 + offset] /= yScale;
  9437. /**
  9438. * Ideally we'd correct x and y scales individually, but because blur and
  9439. * spread apply to both we have to take a scale average and apply that instead.
  9440. * We could potentially improve the outcome of this by incorporating the ratio between
  9441. * the two scales.
  9442. */
  9443. var averageScale = mix(xScale, yScale, 0.5);
  9444. // Blur
  9445. if (typeof shadow[2 + offset] === "number")
  9446. shadow[2 + offset] /= averageScale;
  9447. // Spread
  9448. if (typeof shadow[3 + offset] === "number")
  9449. shadow[3 + offset] /= averageScale;
  9450. var output = template(shadow);
  9451. if (containsCSSVariables) {
  9452. var i_1 = 0;
  9453. output = output.replace(varToken, function () {
  9454. var cssVariable = cssVariables[i_1];
  9455. i_1++;
  9456. return cssVariable;
  9457. });
  9458. }
  9459. return output;
  9460. }
  9461. var borderCorrectionDefinition = {
  9462. process: correctBorderRadius,
  9463. };
  9464. var defaultScaleCorrectors = {
  9465. borderRadius: __assign(__assign({}, borderCorrectionDefinition), { applyTo: [
  9466. "borderTopLeftRadius",
  9467. "borderTopRightRadius",
  9468. "borderBottomLeftRadius",
  9469. "borderBottomRightRadius",
  9470. ] }),
  9471. borderTopLeftRadius: borderCorrectionDefinition,
  9472. borderTopRightRadius: borderCorrectionDefinition,
  9473. borderBottomLeftRadius: borderCorrectionDefinition,
  9474. borderBottomRightRadius: borderCorrectionDefinition,
  9475. boxShadow: {
  9476. process: correctBoxShadow,
  9477. },
  9478. };
  9479. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Animate.js
  9480. var progressTarget = 1000;
  9481. var Animate_Animate = /** @class */ (function (_super) {
  9482. __extends(Animate, _super);
  9483. function Animate() {
  9484. var _this = _super !== null && _super.apply(this, arguments) || this;
  9485. /**
  9486. * A mutable object that tracks the target viewport box
  9487. * for the current animation frame.
  9488. */
  9489. _this.frameTarget = axisBox();
  9490. /**
  9491. * The current animation target, we use this to check whether to start
  9492. * a new animation or continue the existing one.
  9493. */
  9494. _this.currentAnimationTarget = axisBox();
  9495. /**
  9496. * Track whether we're animating this axis.
  9497. */
  9498. _this.isAnimating = {
  9499. x: false,
  9500. y: false,
  9501. };
  9502. _this.stopAxisAnimation = {
  9503. x: undefined,
  9504. y: undefined,
  9505. };
  9506. _this.isAnimatingTree = false;
  9507. _this.animate = function (target, origin, _a) {
  9508. if (_a === void 0) { _a = {}; }
  9509. var originBox = _a.originBox, targetBox = _a.targetBox, visibilityAction = _a.visibilityAction, shouldStackAnimate = _a.shouldStackAnimate, onComplete = _a.onComplete, prevParent = _a.prevParent, config = __rest(_a, ["originBox", "targetBox", "visibilityAction", "shouldStackAnimate", "onComplete", "prevParent"]);
  9510. var _b = _this.props, visualElement = _b.visualElement, layout = _b.layout;
  9511. /**
  9512. * Early return if we've been instructed not to animate this render.
  9513. */
  9514. if (shouldStackAnimate === false) {
  9515. _this.isAnimatingTree = false;
  9516. return _this.safeToRemove();
  9517. }
  9518. /**
  9519. * Prioritise tree animations
  9520. */
  9521. if (_this.isAnimatingTree && shouldStackAnimate !== true) {
  9522. return;
  9523. }
  9524. else if (shouldStackAnimate) {
  9525. _this.isAnimatingTree = true;
  9526. }
  9527. /**
  9528. * Allow the measured origin (prev bounding box) and target (actual layout) to be
  9529. * overridden by the provided config.
  9530. */
  9531. origin = originBox || origin;
  9532. target = targetBox || target;
  9533. /**
  9534. * If this element has a projecting parent, there's an opportunity to animate
  9535. * it relatively to that parent rather than relatively to the viewport. This
  9536. * allows us to add orchestrated animations.
  9537. */
  9538. var isRelative = false;
  9539. var projectionParent = visualElement.getProjectionParent();
  9540. if (projectionParent) {
  9541. var prevParentViewportBox = projectionParent.prevViewportBox;
  9542. var parentLayout = projectionParent.getLayoutState().layout;
  9543. /**
  9544. * If we're being provided a previous parent VisualElement by AnimateSharedLayout
  9545. */
  9546. if (prevParent) {
  9547. /**
  9548. * If we've been provided an explicit target box it means we're animating back
  9549. * to this previous parent. So we can make a relative box by comparing to the previous
  9550. * parent's layout
  9551. */
  9552. if (targetBox) {
  9553. parentLayout = prevParent.getLayoutState().layout;
  9554. }
  9555. /**
  9556. * Likewise if we've been provided an explicit origin box it means we're
  9557. * animating out from a different element. So we should figure out where that was
  9558. * on screen relative to the new parent element.
  9559. */
  9560. if (originBox &&
  9561. !checkIfParentHasChanged(prevParent, projectionParent) &&
  9562. prevParent.prevViewportBox) {
  9563. prevParentViewportBox = prevParent.prevViewportBox;
  9564. }
  9565. }
  9566. if (prevParentViewportBox &&
  9567. isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox)) {
  9568. isRelative = true;
  9569. origin = calcRelativeOffset(prevParentViewportBox, origin);
  9570. target = calcRelativeOffset(parentLayout, target);
  9571. }
  9572. }
  9573. var boxHasMoved = hasMoved(origin, target);
  9574. var animations = eachAxis(function (axis) {
  9575. var _a, _b;
  9576. /**
  9577. * If layout is set to "position", we can resize the origin box based on the target
  9578. * box and only animate its position.
  9579. */
  9580. if (layout === "position") {
  9581. var targetLength = target[axis].max - target[axis].min;
  9582. origin[axis].max = origin[axis].min + targetLength;
  9583. }
  9584. if (visualElement.projection.isTargetLocked) {
  9585. return;
  9586. }
  9587. else if (visibilityAction !== undefined) {
  9588. visualElement.setVisibility(visibilityAction === VisibilityAction.Show);
  9589. }
  9590. else if (boxHasMoved) {
  9591. // If the box has moved, animate between it's current visual state and its
  9592. // final state
  9593. return _this.animateAxis(axis, target[axis], origin[axis], __assign(__assign({}, config), { isRelative: isRelative }));
  9594. }
  9595. else {
  9596. (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a);
  9597. // If the box has remained in the same place, immediately set the axis target
  9598. // to the final desired state
  9599. return visualElement.setProjectionTargetAxis(axis, target[axis].min, target[axis].max, isRelative);
  9600. }
  9601. });
  9602. // Force a render to ensure there's no flash of uncorrected bounding box.
  9603. visualElement.syncRender();
  9604. /**
  9605. * If this visualElement isn't present (ie it's been removed from the tree by the user but
  9606. * kept in by the tree by AnimatePresence) then call safeToRemove when all axis animations
  9607. * have successfully finished.
  9608. */
  9609. return Promise.all(animations).then(function () {
  9610. _this.isAnimatingTree = false;
  9611. onComplete && onComplete();
  9612. visualElement.notifyLayoutAnimationComplete();
  9613. });
  9614. };
  9615. return _this;
  9616. }
  9617. Animate.prototype.componentDidMount = function () {
  9618. var _this = this;
  9619. var visualElement = this.props.visualElement;
  9620. visualElement.animateMotionValue = transitions_startAnimation;
  9621. visualElement.enableLayoutProjection();
  9622. this.unsubLayoutReady = visualElement.onLayoutUpdate(this.animate);
  9623. visualElement.layoutSafeToRemove = function () { return _this.safeToRemove(); };
  9624. addScaleCorrection(defaultScaleCorrectors);
  9625. };
  9626. Animate.prototype.componentWillUnmount = function () {
  9627. var _this = this;
  9628. this.unsubLayoutReady();
  9629. eachAxis(function (axis) { var _a, _b; return (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a); });
  9630. };
  9631. /**
  9632. * TODO: This manually performs animations on the visualElement's layout progress
  9633. * values. It'd be preferable to amend the startLayoutAxisAnimation
  9634. * API to accept more custom animations like this.
  9635. */
  9636. Animate.prototype.animateAxis = function (axis, target, origin, _a) {
  9637. var _this = this;
  9638. var _b, _c;
  9639. var _d = _a === void 0 ? {} : _a, transition = _d.transition, isRelative = _d.isRelative;
  9640. /**
  9641. * If we're not animating to a new target, don't run this animation
  9642. */
  9643. if (this.isAnimating[axis] &&
  9644. axisIsEqual(target, this.currentAnimationTarget[axis])) {
  9645. return;
  9646. }
  9647. (_c = (_b = this.stopAxisAnimation)[axis]) === null || _c === void 0 ? void 0 : _c.call(_b);
  9648. this.isAnimating[axis] = true;
  9649. var visualElement = this.props.visualElement;
  9650. var frameTarget = this.frameTarget[axis];
  9651. var layoutProgress = visualElement.getProjectionAnimationProgress()[axis];
  9652. /**
  9653. * Set layout progress back to 0. We set it twice to hard-reset any velocity that might
  9654. * be re-incoporated into a subsequent spring animation.
  9655. */
  9656. layoutProgress.clearListeners();
  9657. layoutProgress.set(0);
  9658. layoutProgress.set(0);
  9659. /**
  9660. * Create an animation function to run once per frame. This will tween the visual bounding box from
  9661. * origin to target using the latest progress value.
  9662. */
  9663. var frame = function () {
  9664. // Convert the latest layoutProgress, which is a value from 0-1000, into a 0-1 progress
  9665. var p = layoutProgress.get() / progressTarget;
  9666. // Tween the axis and update the visualElement with the latest values
  9667. tweenAxis(frameTarget, origin, target, p);
  9668. visualElement.setProjectionTargetAxis(axis, frameTarget.min, frameTarget.max, isRelative);
  9669. };
  9670. // Synchronously run a frame to ensure there's no flash of the uncorrected bounding box.
  9671. frame();
  9672. // Create a function to stop animation on this specific axis
  9673. var unsubscribeProgress = layoutProgress.onChange(frame);
  9674. this.stopAxisAnimation[axis] = function () {
  9675. _this.isAnimating[axis] = false;
  9676. layoutProgress.stop();
  9677. unsubscribeProgress();
  9678. };
  9679. this.currentAnimationTarget[axis] = target;
  9680. var layoutTransition = transition ||
  9681. visualElement.getDefaultTransition() ||
  9682. defaultLayoutTransition;
  9683. // Start the animation on this axis
  9684. var animation = transitions_startAnimation(axis === "x" ? "layoutX" : "layoutY", layoutProgress, progressTarget, layoutTransition && getValueTransition(layoutTransition, "layout")).then(this.stopAxisAnimation[axis]);
  9685. return animation;
  9686. };
  9687. Animate.prototype.safeToRemove = function () {
  9688. var _a, _b;
  9689. (_b = (_a = this.props).safeToRemove) === null || _b === void 0 ? void 0 : _b.call(_a);
  9690. };
  9691. Animate.prototype.render = function () {
  9692. return null;
  9693. };
  9694. return Animate;
  9695. }(external_React_["Component"]));
  9696. function AnimateLayoutContextProvider(props) {
  9697. var _a = __read(usePresence(), 2), safeToRemove = _a[1];
  9698. return external_React_["createElement"](Animate_Animate, __assign({}, props, { safeToRemove: safeToRemove }));
  9699. }
  9700. function hasMoved(a, b) {
  9701. return (!isZeroBox(a) &&
  9702. !isZeroBox(b) &&
  9703. (!axisIsEqual(a.x, b.x) || !axisIsEqual(a.y, b.y)));
  9704. }
  9705. var zeroAxis = { min: 0, max: 0 };
  9706. function isZeroBox(a) {
  9707. return axisIsEqual(a.x, zeroAxis) && axisIsEqual(a.y, zeroAxis);
  9708. }
  9709. function axisIsEqual(a, b) {
  9710. return a.min === b.min && a.max === b.max;
  9711. }
  9712. var defaultLayoutTransition = {
  9713. duration: 0.45,
  9714. ease: [0.4, 0, 0.1, 1],
  9715. };
  9716. function isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox) {
  9717. return prevParent || (!prevParent && !(originBox || targetBox));
  9718. }
  9719. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js
  9720. /**
  9721. * Default handlers for batching VisualElements
  9722. */
  9723. var defaultHandler = {
  9724. layoutReady: function (child) { return child.notifyLayoutReady(); },
  9725. };
  9726. /**
  9727. * Create a batcher to process VisualElements
  9728. */
  9729. function createBatcher() {
  9730. var queue = new Set();
  9731. return {
  9732. add: function (child) { return queue.add(child); },
  9733. flush: function (_a) {
  9734. var _b = _a === void 0 ? defaultHandler : _a, layoutReady = _b.layoutReady, parent = _b.parent;
  9735. batchLayout(function (read, write) {
  9736. var order = Array.from(queue).sort(compareByDepth);
  9737. var ancestors = parent
  9738. ? collectProjectingAncestors(parent)
  9739. : [];
  9740. write(function () {
  9741. var allElements = __spreadArray(__spreadArray([], __read(ancestors)), __read(order));
  9742. allElements.forEach(function (element) { return element.resetTransform(); });
  9743. });
  9744. read(function () {
  9745. order.forEach(updateLayoutMeasurement);
  9746. });
  9747. write(function () {
  9748. ancestors.forEach(function (element) { return element.restoreTransform(); });
  9749. order.forEach(layoutReady);
  9750. });
  9751. read(function () {
  9752. /**
  9753. * After all children have started animating, ensure any Entering components are set to Present.
  9754. * If we add deferred animations (set up all animations and then start them in two loops) this
  9755. * could be moved to the start loop. But it needs to happen after all the animations configs
  9756. * are generated in AnimateSharedLayout as this relies on presence data
  9757. */
  9758. order.forEach(function (child) {
  9759. if (child.isPresent)
  9760. child.presence = Presence.Present;
  9761. });
  9762. });
  9763. write(function () {
  9764. /**
  9765. * Starting these animations will have queued jobs on the frame loop. In some situations,
  9766. * like when removing an element, these will be processed too late after the DOM is manipulated,
  9767. * leaving a flash of incorrectly-projected content. By manually flushing these jobs
  9768. * we ensure there's no flash.
  9769. */
  9770. flushSync.preRender();
  9771. flushSync.render();
  9772. });
  9773. read(function () {
  9774. /**
  9775. * Schedule a callback at the end of the following frame to assign the latest projection
  9776. * box to the prevViewportBox snapshot. Once global batching is in place this could be run
  9777. * synchronously. But for now it ensures that if any nested `AnimateSharedLayout` top-level
  9778. * child attempts to calculate its previous relative position against a prevViewportBox
  9779. * it will be against its latest projection box instead, as the snapshot is useless beyond this
  9780. * render.
  9781. */
  9782. es.postRender(function () {
  9783. return order.forEach(assignProjectionToSnapshot);
  9784. });
  9785. queue.clear();
  9786. });
  9787. });
  9788. // TODO: Need to find a layout-synchronous way of flushing this
  9789. flushLayout();
  9790. },
  9791. };
  9792. }
  9793. function assignProjectionToSnapshot(child) {
  9794. child.prevViewportBox = child.projection.target;
  9795. }
  9796. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SharedLayoutContext.js
  9797. var SharedLayoutContext = Object(external_React_["createContext"])(createBatcher());
  9798. /**
  9799. * @internal
  9800. */
  9801. var FramerTreeLayoutContext = Object(external_React_["createContext"])(createBatcher());
  9802. function isSharedLayout(context) {
  9803. return !!context.forceUpdate;
  9804. }
  9805. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Measure.js
  9806. /**
  9807. * This component is responsible for scheduling the measuring of the motion component
  9808. */
  9809. var Measure_Measure = /** @class */ (function (_super) {
  9810. __extends(Measure, _super);
  9811. function Measure() {
  9812. return _super !== null && _super.apply(this, arguments) || this;
  9813. }
  9814. /**
  9815. * If this is a child of a SyncContext, register the VisualElement with it on mount.
  9816. */
  9817. Measure.prototype.componentDidMount = function () {
  9818. var _a = this.props, syncLayout = _a.syncLayout, framerSyncLayout = _a.framerSyncLayout, visualElement = _a.visualElement;
  9819. isSharedLayout(syncLayout) && syncLayout.register(visualElement);
  9820. isSharedLayout(framerSyncLayout) &&
  9821. framerSyncLayout.register(visualElement);
  9822. visualElement.onUnmount(function () {
  9823. if (isSharedLayout(syncLayout)) {
  9824. syncLayout.remove(visualElement);
  9825. }
  9826. if (isSharedLayout(framerSyncLayout)) {
  9827. framerSyncLayout.remove(visualElement);
  9828. }
  9829. });
  9830. };
  9831. /**
  9832. * If this is a child of a SyncContext, notify it that it needs to re-render. It will then
  9833. * handle the snapshotting.
  9834. *
  9835. * If it is stand-alone component, add it to the batcher.
  9836. */
  9837. Measure.prototype.getSnapshotBeforeUpdate = function () {
  9838. var _a = this.props, syncLayout = _a.syncLayout, visualElement = _a.visualElement;
  9839. if (isSharedLayout(syncLayout)) {
  9840. syncLayout.syncUpdate();
  9841. }
  9842. else {
  9843. snapshotViewportBox(visualElement);
  9844. syncLayout.add(visualElement);
  9845. }
  9846. return null;
  9847. };
  9848. Measure.prototype.componentDidUpdate = function () {
  9849. var syncLayout = this.props.syncLayout;
  9850. if (!isSharedLayout(syncLayout))
  9851. syncLayout.flush();
  9852. };
  9853. Measure.prototype.render = function () {
  9854. return null;
  9855. };
  9856. return Measure;
  9857. }(external_React_default.a.Component));
  9858. function MeasureContextProvider(props) {
  9859. var syncLayout = Object(external_React_["useContext"])(SharedLayoutContext);
  9860. var framerSyncLayout = Object(external_React_["useContext"])(FramerTreeLayoutContext);
  9861. return (external_React_default.a.createElement(Measure_Measure, __assign({}, props, { syncLayout: syncLayout, framerSyncLayout: framerSyncLayout })));
  9862. }
  9863. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/index.js
  9864. var layoutAnimations = {
  9865. measureLayout: MeasureContextProvider,
  9866. layoutAnimation: AnimateLayoutContextProvider,
  9867. };
  9868. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/state.js
  9869. var createProjectionState = function () { return ({
  9870. isEnabled: false,
  9871. isHydrated: false,
  9872. isTargetLocked: false,
  9873. target: axisBox(),
  9874. targetFinal: axisBox(),
  9875. }); };
  9876. function createLayoutState() {
  9877. return {
  9878. isHydrated: false,
  9879. layout: axisBox(),
  9880. layoutCorrected: axisBox(),
  9881. treeScale: { x: 1, y: 1 },
  9882. delta: geometry_delta(),
  9883. deltaFinal: geometry_delta(),
  9884. deltaTransform: "",
  9885. };
  9886. }
  9887. var zeroLayout = createLayoutState();
  9888. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-projection-transform.js
  9889. /**
  9890. * Build a transform style that takes a calculated delta between the element's current
  9891. * space on screen and projects it into the desired space.
  9892. */
  9893. function buildLayoutProjectionTransform(_a, treeScale, latestTransform) {
  9894. var x = _a.x, y = _a.y;
  9895. /**
  9896. * The translations we use to calculate are always relative to the viewport coordinate space.
  9897. * But when we apply scales, we also scale the coordinate space of an element and its children.
  9898. * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need
  9899. * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.
  9900. */
  9901. var xTranslate = x.translate / treeScale.x;
  9902. var yTranslate = y.translate / treeScale.y;
  9903. var transform = "translate3d(" + xTranslate + "px, " + yTranslate + "px, 0) ";
  9904. if (latestTransform) {
  9905. var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY;
  9906. if (rotate)
  9907. transform += "rotate(" + rotate + ") ";
  9908. if (rotateX)
  9909. transform += "rotateX(" + rotateX + ") ";
  9910. if (rotateY)
  9911. transform += "rotateY(" + rotateY + ") ";
  9912. }
  9913. transform += "scale(" + x.scale + ", " + y.scale + ")";
  9914. return !latestTransform && transform === identityProjection ? "" : transform;
  9915. }
  9916. /**
  9917. * Take the calculated delta origin and apply it as a transform string.
  9918. */
  9919. function buildLayoutProjectionTransformOrigin(_a) {
  9920. var deltaFinal = _a.deltaFinal;
  9921. return deltaFinal.x.origin * 100 + "% " + deltaFinal.y.origin * 100 + "% 0";
  9922. }
  9923. var identityProjection = buildLayoutProjectionTransform(zeroLayout.delta, zeroLayout.treeScale, { x: 1, y: 1 });
  9924. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/lifecycles.js
  9925. var names = [
  9926. "LayoutMeasure",
  9927. "BeforeLayoutMeasure",
  9928. "LayoutUpdate",
  9929. "ViewportBoxUpdate",
  9930. "Update",
  9931. "Render",
  9932. "AnimationComplete",
  9933. "LayoutAnimationComplete",
  9934. "AnimationStart",
  9935. "SetAxisTarget",
  9936. "Unmount",
  9937. ];
  9938. function createLifecycles() {
  9939. var managers = names.map(function () { return new subscription_manager_SubscriptionManager(); });
  9940. var propSubscriptions = {};
  9941. var lifecycles = {
  9942. clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); },
  9943. updatePropListeners: function (props) {
  9944. return names.forEach(function (name) {
  9945. var _a;
  9946. (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions);
  9947. var on = "on" + name;
  9948. var propListener = props[on];
  9949. if (propListener) {
  9950. propSubscriptions[name] = lifecycles[on](propListener);
  9951. }
  9952. });
  9953. },
  9954. };
  9955. managers.forEach(function (manager, i) {
  9956. lifecycles["on" + names[i]] = function (handler) { return manager.add(handler); };
  9957. lifecycles["notify" + names[i]] = function () {
  9958. var args = [];
  9959. for (var _i = 0; _i < arguments.length; _i++) {
  9960. args[_i] = arguments[_i];
  9961. }
  9962. return manager.notify.apply(manager, __spreadArray([], __read(args)));
  9963. };
  9964. });
  9965. return lifecycles;
  9966. }
  9967. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.js
  9968. function updateMotionValuesFromProps(element, next, prev) {
  9969. var _a;
  9970. for (var key in next) {
  9971. var nextValue = next[key];
  9972. var prevValue = prev[key];
  9973. if (isMotionValue(nextValue)) {
  9974. /**
  9975. * If this is a motion value found in props or style, we want to add it
  9976. * to our visual element's motion value map.
  9977. */
  9978. element.addValue(key, nextValue);
  9979. }
  9980. else if (isMotionValue(prevValue)) {
  9981. /**
  9982. * If we're swapping to a new motion value, create a new motion value
  9983. * from that
  9984. */
  9985. element.addValue(key, motionValue(nextValue));
  9986. }
  9987. else if (prevValue !== nextValue) {
  9988. /**
  9989. * If this is a flat value that has changed, update the motion value
  9990. * or create one if it doesn't exist. We only want to do this if we're
  9991. * not handling the value with our animation state.
  9992. */
  9993. if (element.hasValue(key)) {
  9994. var existingValue = element.getValue(key);
  9995. // TODO: Only update values that aren't being animated or even looked at
  9996. !existingValue.hasAnimated && existingValue.set(nextValue);
  9997. }
  9998. else {
  9999. element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue));
  10000. }
  10001. }
  10002. }
  10003. // Handle removed values
  10004. for (var key in prev) {
  10005. if (next[key] === undefined)
  10006. element.removeValue(key);
  10007. }
  10008. return next;
  10009. }
  10010. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/projection.js
  10011. function updateLayoutDeltas(_a, _b, treePath, transformOrigin) {
  10012. var delta = _a.delta, layout = _a.layout, layoutCorrected = _a.layoutCorrected, treeScale = _a.treeScale;
  10013. var target = _b.target;
  10014. /**
  10015. * Reset the corrected box with the latest values from box, as we're then going
  10016. * to perform mutative operations on it.
  10017. */
  10018. resetBox(layoutCorrected, layout);
  10019. /**
  10020. * Apply all the parent deltas to this box to produce the corrected box. This
  10021. * is the layout box, as it will appear on screen as a result of the transforms of its parents.
  10022. */
  10023. applyTreeDeltas(layoutCorrected, treeScale, treePath);
  10024. /**
  10025. * Update the delta between the corrected box and the target box before user-set transforms were applied.
  10026. * This will allow us to calculate the corrected borderRadius and boxShadow to compensate
  10027. * for our layout reprojection, but still allow them to be scaled correctly by the user.
  10028. * It might be that to simplify this we may want to accept that user-set scale is also corrected
  10029. * and we wouldn't have to keep and calc both deltas, OR we could support a user setting
  10030. * to allow people to choose whether these styles are corrected based on just the
  10031. * layout reprojection or the final bounding box.
  10032. */
  10033. updateBoxDelta(delta, layoutCorrected, target, transformOrigin);
  10034. }
  10035. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.js
  10036. var flat_tree_FlatTree = /** @class */ (function () {
  10037. function FlatTree() {
  10038. this.children = [];
  10039. this.isDirty = false;
  10040. }
  10041. FlatTree.prototype.add = function (child) {
  10042. addUniqueItem(this.children, child);
  10043. this.isDirty = true;
  10044. };
  10045. FlatTree.prototype.remove = function (child) {
  10046. removeItem(this.children, child);
  10047. this.isDirty = true;
  10048. };
  10049. FlatTree.prototype.forEach = function (callback) {
  10050. this.isDirty && this.children.sort(compareByDepth);
  10051. this.isDirty = false;
  10052. this.children.forEach(callback);
  10053. };
  10054. return FlatTree;
  10055. }());
  10056. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/relative-set.js
  10057. function setCurrentViewportBox(visualElement) {
  10058. var projectionParent = visualElement.getProjectionParent();
  10059. if (!projectionParent) {
  10060. visualElement.rebaseProjectionTarget();
  10061. return;
  10062. }
  10063. var relativeOffset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout);
  10064. eachAxis(function (axis) {
  10065. visualElement.setProjectionTargetAxis(axis, relativeOffset[axis].min, relativeOffset[axis].max, true);
  10066. });
  10067. }
  10068. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/index.js
  10069. var render_visualElement = function (_a) {
  10070. var _b = _a.treeType, treeType = _b === void 0 ? "" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, resetTransform = _a.resetTransform, restoreTransform = _a.restoreTransform, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps;
  10071. return function (_a, options) {
  10072. var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState;
  10073. if (options === void 0) { options = {}; }
  10074. var latestValues = visualState.latestValues, renderState = visualState.renderState;
  10075. /**
  10076. * The instance of the render-specific node that will be hydrated by the
  10077. * exposed React ref. So for example, this visual element can host a
  10078. * HTMLElement, plain object, or Three.js object. The functions provided
  10079. * in VisualElementConfig allow us to interface with this instance.
  10080. */
  10081. var instance;
  10082. /**
  10083. * Manages the subscriptions for a visual element's lifecycle, for instance
  10084. * onRender and onViewportBoxUpdate.
  10085. */
  10086. var lifecycles = createLifecycles();
  10087. /**
  10088. *
  10089. */
  10090. var projection = createProjectionState();
  10091. /**
  10092. * A reference to the nearest projecting parent. This is either
  10093. * undefined if we haven't looked for the nearest projecting parent,
  10094. * false if there is no parent performing layout projection, or a reference
  10095. * to the projecting parent.
  10096. */
  10097. var projectionParent;
  10098. /**
  10099. * This is a reference to the visual state of the "lead" visual element.
  10100. * Usually, this will be this visual element. But if it shares a layoutId
  10101. * with other visual elements, only one of them will be designated lead by
  10102. * AnimateSharedLayout. All the other visual elements will take on the visual
  10103. * appearance of the lead while they crossfade to it.
  10104. */
  10105. var leadProjection = projection;
  10106. var leadLatestValues = latestValues;
  10107. var unsubscribeFromLeadVisualElement;
  10108. /**
  10109. * The latest layout measurements and calculated projections. This
  10110. * is seperate from the target projection data in visualState as
  10111. * many visual elements might point to the same piece of visualState as
  10112. * a target, whereas they might each have different layouts and thus
  10113. * projection calculations needed to project into the same viewport box.
  10114. */
  10115. var layoutState = createLayoutState();
  10116. /**
  10117. *
  10118. */
  10119. var crossfader;
  10120. /**
  10121. * Keep track of whether the viewport box has been updated since the
  10122. * last time the layout projection was re-calculated.
  10123. */
  10124. var hasViewportBoxUpdated = false;
  10125. /**
  10126. * A map of all motion values attached to this visual element. Motion
  10127. * values are source of truth for any given animated value. A motion
  10128. * value might be provided externally by the component via props.
  10129. */
  10130. var values = new Map();
  10131. /**
  10132. * A map of every subscription that binds the provided or generated
  10133. * motion values onChange listeners to this visual element.
  10134. */
  10135. var valueSubscriptions = new Map();
  10136. /**
  10137. * A reference to the previously-provided motion values as returned
  10138. * from scrapeMotionValuesFromProps. We use the keys in here to determine
  10139. * if any motion values need to be removed after props are updated.
  10140. */
  10141. var prevMotionValues = {};
  10142. /**
  10143. * x/y motion values that track the progress of initiated layout
  10144. * animations.
  10145. *
  10146. * TODO: Target for removal
  10147. */
  10148. var projectionTargetProgress;
  10149. /**
  10150. * When values are removed from all animation props we need to search
  10151. * for a fallback value to animate to. These values are tracked in baseTarget.
  10152. */
  10153. var baseTarget = __assign({}, latestValues);
  10154. // Internal methods ========================
  10155. /**
  10156. * On mount, this will be hydrated with a callback to disconnect
  10157. * this visual element from its parent on unmount.
  10158. */
  10159. var removeFromVariantTree;
  10160. /**
  10161. *
  10162. */
  10163. function render() {
  10164. if (!instance)
  10165. return;
  10166. if (element.isProjectionReady()) {
  10167. /**
  10168. * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.
  10169. * This is the final box that we will then project into by calculating a transform delta and
  10170. * applying it to the corrected box.
  10171. */
  10172. applyBoxTransforms(leadProjection.targetFinal, leadProjection.target, leadLatestValues);
  10173. /**
  10174. * Update the delta between the corrected box and the final target box, after
  10175. * user-set transforms are applied to it. This will be used by the renderer to
  10176. * create a transform style that will reproject the element from its actual layout
  10177. * into the desired bounding box.
  10178. */
  10179. updateBoxDelta(layoutState.deltaFinal, layoutState.layoutCorrected, leadProjection.targetFinal, latestValues);
  10180. }
  10181. triggerBuild();
  10182. renderInstance(instance, renderState);
  10183. }
  10184. function triggerBuild() {
  10185. var valuesToRender = latestValues;
  10186. if (crossfader && crossfader.isActive()) {
  10187. var crossfadedValues = crossfader.getCrossfadeState(element);
  10188. if (crossfadedValues)
  10189. valuesToRender = crossfadedValues;
  10190. }
  10191. build(element, renderState, valuesToRender, leadProjection, layoutState, options, props);
  10192. }
  10193. function update() {
  10194. lifecycles.notifyUpdate(latestValues);
  10195. }
  10196. function updateLayoutProjection() {
  10197. if (!element.isProjectionReady())
  10198. return;
  10199. var delta = layoutState.delta, treeScale = layoutState.treeScale;
  10200. var prevTreeScaleX = treeScale.x;
  10201. var prevTreeScaleY = treeScale.y;
  10202. var prevDeltaTransform = layoutState.deltaTransform;
  10203. updateLayoutDeltas(layoutState, leadProjection, element.path, latestValues);
  10204. hasViewportBoxUpdated &&
  10205. element.notifyViewportBoxUpdate(leadProjection.target, delta);
  10206. hasViewportBoxUpdated = false;
  10207. var deltaTransform = buildLayoutProjectionTransform(delta, treeScale);
  10208. if (deltaTransform !== prevDeltaTransform ||
  10209. // Also compare calculated treeScale, for values that rely on this only for scale correction
  10210. prevTreeScaleX !== treeScale.x ||
  10211. prevTreeScaleY !== treeScale.y) {
  10212. element.scheduleRender();
  10213. }
  10214. layoutState.deltaTransform = deltaTransform;
  10215. }
  10216. function updateTreeLayoutProjection() {
  10217. element.layoutTree.forEach(fireUpdateLayoutProjection);
  10218. }
  10219. /**
  10220. *
  10221. */
  10222. function bindToMotionValue(key, value) {
  10223. var removeOnChange = value.onChange(function (latestValue) {
  10224. latestValues[key] = latestValue;
  10225. props.onUpdate && es.update(update, false, true);
  10226. });
  10227. var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender);
  10228. valueSubscriptions.set(key, function () {
  10229. removeOnChange();
  10230. removeOnRenderRequest();
  10231. });
  10232. }
  10233. /**
  10234. * Any motion values that are provided to the element when created
  10235. * aren't yet bound to the element, as this would technically be impure.
  10236. * However, we iterate through the motion values and set them to the
  10237. * initial values for this component.
  10238. *
  10239. * TODO: This is impure and we should look at changing this to run on mount.
  10240. * Doing so will break some tests but this isn't neccessarily a breaking change,
  10241. * more a reflection of the test.
  10242. */
  10243. var initialMotionValues = scrapeMotionValuesFromProps(props);
  10244. for (var key in initialMotionValues) {
  10245. var value = initialMotionValues[key];
  10246. if (latestValues[key] !== undefined && isMotionValue(value)) {
  10247. value.set(latestValues[key], false);
  10248. }
  10249. }
  10250. /**
  10251. * Determine what role this visual element should take in the variant tree.
  10252. */
  10253. var isControllingVariants = checkIfControllingVariants(props);
  10254. var isVariantNode = checkIfVariantNode(props);
  10255. var element = __assign(__assign({ treeType: treeType,
  10256. /**
  10257. * This is a mirror of the internal instance prop, which keeps
  10258. * VisualElement type-compatible with React's RefObject.
  10259. */
  10260. current: null,
  10261. /**
  10262. * The depth of this visual element within the visual element tree.
  10263. */
  10264. depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(),
  10265. /**
  10266. * An ancestor path back to the root visual element. This is used
  10267. * by layout projection to quickly recurse back up the tree.
  10268. */
  10269. path: parent ? __spreadArray(__spreadArray([], __read(parent.path)), [parent]) : [], layoutTree: parent ? parent.layoutTree : new flat_tree_FlatTree(),
  10270. /**
  10271. *
  10272. */
  10273. presenceId: presenceId,
  10274. projection: projection,
  10275. /**
  10276. * If this component is part of the variant tree, it should track
  10277. * any children that are also part of the tree. This is essentially
  10278. * a shadow tree to simplify logic around how to stagger over children.
  10279. */
  10280. variantChildren: isVariantNode ? new Set() : undefined,
  10281. /**
  10282. * Whether this instance is visible. This can be changed imperatively
  10283. * by AnimateSharedLayout, is analogous to CSS's visibility in that
  10284. * hidden elements should take up layout, and needs enacting by the configured
  10285. * render function.
  10286. */
  10287. isVisible: undefined,
  10288. /**
  10289. * Normally, if a component is controlled by a parent's variants, it can
  10290. * rely on that ancestor to trigger animations further down the tree.
  10291. * However, if a component is created after its parent is mounted, the parent
  10292. * won't trigger that mount animation so the child needs to.
  10293. *
  10294. * TODO: This might be better replaced with a method isParentMounted
  10295. */
  10296. manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()),
  10297. /**
  10298. * This can be set by AnimatePresence to force components that mount
  10299. * at the same time as it to mount as if they have initial={false} set.
  10300. */
  10301. blockInitialAnimation: blockInitialAnimation,
  10302. /**
  10303. * Determine whether this component has mounted yet. This is mostly used
  10304. * by variant children to determine whether they need to trigger their
  10305. * own animations on mount.
  10306. */
  10307. isMounted: function () { return Boolean(instance); }, mount: function (newInstance) {
  10308. instance = element.current = newInstance;
  10309. element.pointTo(element);
  10310. if (isVariantNode && parent && !isControllingVariants) {
  10311. removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element);
  10312. }
  10313. parent === null || parent === void 0 ? void 0 : parent.children.add(element);
  10314. },
  10315. /**
  10316. *
  10317. */
  10318. unmount: function () {
  10319. cancelSync.update(update);
  10320. cancelSync.render(render);
  10321. cancelSync.preRender(element.updateLayoutProjection);
  10322. valueSubscriptions.forEach(function (remove) { return remove(); });
  10323. element.stopLayoutAnimation();
  10324. element.layoutTree.remove(element);
  10325. removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree();
  10326. parent === null || parent === void 0 ? void 0 : parent.children.delete(element);
  10327. unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement();
  10328. lifecycles.clearAllListeners();
  10329. },
  10330. /**
  10331. * Add a child visual element to our set of children.
  10332. */
  10333. addVariantChild: function (child) {
  10334. var _a;
  10335. var closestVariantNode = element.getClosestVariantNode();
  10336. if (closestVariantNode) {
  10337. (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child);
  10338. return function () { return closestVariantNode.variantChildren.delete(child); };
  10339. }
  10340. },
  10341. sortNodePosition: function (other) {
  10342. /**
  10343. * If these nodes aren't even of the same type we can't compare their depth.
  10344. */
  10345. if (!sortNodePosition || treeType !== other.treeType)
  10346. return 0;
  10347. return sortNodePosition(element.getInstance(), other.getInstance());
  10348. },
  10349. /**
  10350. * Returns the closest variant node in the tree starting from
  10351. * this visual element.
  10352. */
  10353. getClosestVariantNode: function () {
  10354. return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode();
  10355. },
  10356. /**
  10357. * A method that schedules an update to layout projections throughout
  10358. * the tree. We inherit from the parent so there's only ever one
  10359. * job scheduled on the next frame - that of the root visual element.
  10360. */
  10361. scheduleUpdateLayoutProjection: parent
  10362. ? parent.scheduleUpdateLayoutProjection
  10363. : function () {
  10364. return es.preRender(element.updateTreeLayoutProjection, false, true);
  10365. },
  10366. /**
  10367. * Expose the latest layoutId prop.
  10368. */
  10369. getLayoutId: function () { return props.layoutId; },
  10370. /**
  10371. * Returns the current instance.
  10372. */
  10373. getInstance: function () { return instance; },
  10374. /**
  10375. * Get/set the latest static values.
  10376. */
  10377. getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); },
  10378. /**
  10379. * Returns the latest motion value state. Currently only used to take
  10380. * a snapshot of the visual element - perhaps this can return the whole
  10381. * visual state
  10382. */
  10383. getLatestValues: function () { return latestValues; },
  10384. /**
  10385. * Set the visiblity of the visual element. If it's changed, schedule
  10386. * a render to reflect these changes.
  10387. */
  10388. setVisibility: function (visibility) {
  10389. if (element.isVisible === visibility)
  10390. return;
  10391. element.isVisible = visibility;
  10392. element.scheduleRender();
  10393. },
  10394. /**
  10395. * Make a target animatable by Popmotion. For instance, if we're
  10396. * trying to animate width from 100px to 100vw we need to measure 100vw
  10397. * in pixels to determine what we really need to animate to. This is also
  10398. * pluggable to support Framer's custom value types like Color,
  10399. * and CSS variables.
  10400. */
  10401. makeTargetAnimatable: function (target, canMutate) {
  10402. if (canMutate === void 0) { canMutate = true; }
  10403. return makeTargetAnimatable(element, target, props, canMutate);
  10404. },
  10405. // Motion values ========================
  10406. /**
  10407. * Add a motion value and bind it to this visual element.
  10408. */
  10409. addValue: function (key, value) {
  10410. // Remove existing value if it exists
  10411. if (element.hasValue(key))
  10412. element.removeValue(key);
  10413. values.set(key, value);
  10414. latestValues[key] = value.get();
  10415. bindToMotionValue(key, value);
  10416. },
  10417. /**
  10418. * Remove a motion value and unbind any active subscriptions.
  10419. */
  10420. removeValue: function (key) {
  10421. var _a;
  10422. values.delete(key);
  10423. (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a();
  10424. valueSubscriptions.delete(key);
  10425. delete latestValues[key];
  10426. removeValueFromRenderState(key, renderState);
  10427. },
  10428. /**
  10429. * Check whether we have a motion value for this key
  10430. */
  10431. hasValue: function (key) { return values.has(key); },
  10432. /**
  10433. * Get a motion value for this key. If called with a default
  10434. * value, we'll create one if none exists.
  10435. */
  10436. getValue: function (key, defaultValue) {
  10437. var value = values.get(key);
  10438. if (value === undefined && defaultValue !== undefined) {
  10439. value = motionValue(defaultValue);
  10440. element.addValue(key, value);
  10441. }
  10442. return value;
  10443. },
  10444. /**
  10445. * Iterate over our motion values.
  10446. */
  10447. forEachValue: function (callback) { return values.forEach(callback); },
  10448. /**
  10449. * If we're trying to animate to a previously unencountered value,
  10450. * we need to check for it in our state and as a last resort read it
  10451. * directly from the instance (which might have performance implications).
  10452. */
  10453. readValue: function (key) { var _a; return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options); },
  10454. /**
  10455. * Set the base target to later animate back to. This is currently
  10456. * only hydrated on creation and when we first read a value.
  10457. */
  10458. setBaseTarget: function (key, value) {
  10459. baseTarget[key] = value;
  10460. },
  10461. /**
  10462. * Find the base target for a value thats been removed from all animation
  10463. * props.
  10464. */
  10465. getBaseTarget: function (key) {
  10466. if (getBaseTarget) {
  10467. var target = getBaseTarget(props, key);
  10468. if (target !== undefined && !isMotionValue(target))
  10469. return target;
  10470. }
  10471. return baseTarget[key];
  10472. } }, lifecycles), {
  10473. /**
  10474. * Build the renderer state based on the latest visual state.
  10475. */
  10476. build: function () {
  10477. triggerBuild();
  10478. return renderState;
  10479. },
  10480. /**
  10481. * Schedule a render on the next animation frame.
  10482. */
  10483. scheduleRender: function () {
  10484. es.render(render, false, true);
  10485. },
  10486. /**
  10487. * Synchronously fire render. It's prefered that we batch renders but
  10488. * in many circumstances, like layout measurement, we need to run this
  10489. * synchronously. However in those instances other measures should be taken
  10490. * to batch reads/writes.
  10491. */
  10492. syncRender: render,
  10493. /**
  10494. * Update the provided props. Ensure any newly-added motion values are
  10495. * added to our map, old ones removed, and listeners updated.
  10496. */
  10497. setProps: function (newProps) {
  10498. props = newProps;
  10499. lifecycles.updatePropListeners(newProps);
  10500. prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues);
  10501. }, getProps: function () { return props; },
  10502. // Variants ==============================
  10503. /**
  10504. * Returns the variant definition with a given name.
  10505. */
  10506. getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; },
  10507. /**
  10508. * Returns the defined default transition on this component.
  10509. */
  10510. getDefaultTransition: function () { return props.transition; },
  10511. /**
  10512. * Used by child variant nodes to get the closest ancestor variant props.
  10513. */
  10514. getVariantContext: function (startAtParent) {
  10515. if (startAtParent === void 0) { startAtParent = false; }
  10516. if (startAtParent)
  10517. return parent === null || parent === void 0 ? void 0 : parent.getVariantContext();
  10518. if (!isControllingVariants) {
  10519. var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {};
  10520. if (props.initial !== undefined) {
  10521. context_1.initial = props.initial;
  10522. }
  10523. return context_1;
  10524. }
  10525. var context = {};
  10526. for (var i = 0; i < numVariantProps; i++) {
  10527. var name_1 = variantProps[i];
  10528. var prop = props[name_1];
  10529. if (isVariantLabel(prop) || prop === false) {
  10530. context[name_1] = prop;
  10531. }
  10532. }
  10533. return context;
  10534. },
  10535. // Layout projection ==============================
  10536. /**
  10537. * Enable layout projection for this visual element. Won't actually
  10538. * occur until we also have hydrated layout measurements.
  10539. */
  10540. enableLayoutProjection: function () {
  10541. projection.isEnabled = true;
  10542. element.layoutTree.add(element);
  10543. },
  10544. /**
  10545. * Lock the projection target, for instance when dragging, so
  10546. * nothing else can try and animate it.
  10547. */
  10548. lockProjectionTarget: function () {
  10549. projection.isTargetLocked = true;
  10550. },
  10551. unlockProjectionTarget: function () {
  10552. element.stopLayoutAnimation();
  10553. projection.isTargetLocked = false;
  10554. }, getLayoutState: function () { return layoutState; }, setCrossfader: function (newCrossfader) {
  10555. crossfader = newCrossfader;
  10556. }, isProjectionReady: function () {
  10557. return projection.isEnabled &&
  10558. projection.isHydrated &&
  10559. layoutState.isHydrated;
  10560. },
  10561. /**
  10562. * Start a layout animation on a given axis.
  10563. */
  10564. startLayoutAnimation: function (axis, transition, isRelative) {
  10565. if (isRelative === void 0) { isRelative = false; }
  10566. var progress = element.getProjectionAnimationProgress()[axis];
  10567. var _a = isRelative
  10568. ? projection.relativeTarget[axis]
  10569. : projection.target[axis], min = _a.min, max = _a.max;
  10570. var length = max - min;
  10571. progress.clearListeners();
  10572. progress.set(min);
  10573. progress.set(min); // Set twice to hard-reset velocity
  10574. progress.onChange(function (v) {
  10575. element.setProjectionTargetAxis(axis, v, v + length, isRelative);
  10576. });
  10577. return element.animateMotionValue(axis, progress, 0, transition);
  10578. },
  10579. /**
  10580. * Stop layout animations.
  10581. */
  10582. stopLayoutAnimation: function () {
  10583. eachAxis(function (axis) {
  10584. return element.getProjectionAnimationProgress()[axis].stop();
  10585. });
  10586. },
  10587. /**
  10588. * Measure the current viewport box with or without transforms.
  10589. * Only measures axis-aligned boxes, rotate and skew must be manually
  10590. * removed with a re-render to work.
  10591. */
  10592. measureViewportBox: function (withTransform) {
  10593. if (withTransform === void 0) { withTransform = true; }
  10594. var viewportBox = measureViewportBox(instance, options);
  10595. if (!withTransform)
  10596. removeBoxTransforms(viewportBox, latestValues);
  10597. return viewportBox;
  10598. },
  10599. /**
  10600. * Get the motion values tracking the layout animations on each
  10601. * axis. Lazy init if not already created.
  10602. */
  10603. getProjectionAnimationProgress: function () {
  10604. projectionTargetProgress || (projectionTargetProgress = {
  10605. x: motionValue(0),
  10606. y: motionValue(0),
  10607. });
  10608. return projectionTargetProgress;
  10609. },
  10610. /**
  10611. * Update the projection of a single axis. Schedule an update to
  10612. * the tree layout projection.
  10613. */
  10614. setProjectionTargetAxis: function (axis, min, max, isRelative) {
  10615. if (isRelative === void 0) { isRelative = false; }
  10616. var target;
  10617. if (isRelative) {
  10618. if (!projection.relativeTarget) {
  10619. projection.relativeTarget = axisBox();
  10620. }
  10621. target = projection.relativeTarget[axis];
  10622. }
  10623. else {
  10624. projection.relativeTarget = undefined;
  10625. target = projection.target[axis];
  10626. }
  10627. projection.isHydrated = true;
  10628. target.min = min;
  10629. target.max = max;
  10630. // Flag that we want to fire the onViewportBoxUpdate event handler
  10631. hasViewportBoxUpdated = true;
  10632. lifecycles.notifySetAxisTarget();
  10633. },
  10634. /**
  10635. * Rebase the projection target on top of the provided viewport box
  10636. * or the measured layout. This ensures that non-animating elements
  10637. * don't fall out of sync differences in measurements vs projections
  10638. * after a page scroll or other relayout.
  10639. */
  10640. rebaseProjectionTarget: function (force, box) {
  10641. if (box === void 0) { box = layoutState.layout; }
  10642. var _a = element.getProjectionAnimationProgress(), x = _a.x, y = _a.y;
  10643. var shouldRebase = !projection.relativeTarget &&
  10644. !projection.isTargetLocked &&
  10645. !x.isAnimating() &&
  10646. !y.isAnimating();
  10647. if (force || shouldRebase) {
  10648. eachAxis(function (axis) {
  10649. var _a = box[axis], min = _a.min, max = _a.max;
  10650. element.setProjectionTargetAxis(axis, min, max);
  10651. });
  10652. }
  10653. },
  10654. /**
  10655. * Notify the visual element that its layout is up-to-date.
  10656. * Currently Animate.tsx uses this to check whether a layout animation
  10657. * needs to be performed.
  10658. */
  10659. notifyLayoutReady: function (config) {
  10660. setCurrentViewportBox(element);
  10661. element.notifyLayoutUpdate(layoutState.layout, element.prevViewportBox || layoutState.layout, config);
  10662. },
  10663. /**
  10664. * Temporarily reset the transform of the instance.
  10665. */
  10666. resetTransform: function () { return resetTransform(element, instance, props); }, restoreTransform: function () { return restoreTransform(instance, renderState); }, updateLayoutProjection: updateLayoutProjection,
  10667. updateTreeLayoutProjection: function () {
  10668. element.layoutTree.forEach(fireResolveRelativeTargetBox);
  10669. /**
  10670. * Schedule the projection updates at the end of the current preRender
  10671. * step. This will ensure that all layout trees will first resolve
  10672. * relative projection boxes into viewport boxes, and *then*
  10673. * update projections.
  10674. */
  10675. es.preRender(updateTreeLayoutProjection, false, true);
  10676. // sync.postRender(() => element.scheduleUpdateLayoutProjection())
  10677. },
  10678. getProjectionParent: function () {
  10679. if (projectionParent === undefined) {
  10680. var foundParent = false;
  10681. // Search backwards through the tree path
  10682. for (var i = element.path.length - 1; i >= 0; i--) {
  10683. var ancestor = element.path[i];
  10684. if (ancestor.projection.isEnabled) {
  10685. foundParent = ancestor;
  10686. break;
  10687. }
  10688. }
  10689. projectionParent = foundParent;
  10690. }
  10691. return projectionParent;
  10692. },
  10693. resolveRelativeTargetBox: function () {
  10694. var relativeParent = element.getProjectionParent();
  10695. if (!projection.relativeTarget || !relativeParent)
  10696. return;
  10697. calcRelativeBox(projection, relativeParent.projection);
  10698. if (isDraggable(relativeParent)) {
  10699. var target = projection.target;
  10700. applyBoxTransforms(target, target, relativeParent.getLatestValues());
  10701. }
  10702. },
  10703. shouldResetTransform: function () {
  10704. return Boolean(props._layoutResetTransform);
  10705. },
  10706. /**
  10707. *
  10708. */
  10709. pointTo: function (newLead) {
  10710. leadProjection = newLead.projection;
  10711. leadLatestValues = newLead.getLatestValues();
  10712. /**
  10713. * Subscribe to lead component's layout animations
  10714. */
  10715. unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement();
  10716. unsubscribeFromLeadVisualElement = pipe(newLead.onSetAxisTarget(element.scheduleUpdateLayoutProjection), newLead.onLayoutAnimationComplete(function () {
  10717. var _a;
  10718. if (element.isPresent) {
  10719. element.presence = Presence.Present;
  10720. }
  10721. else {
  10722. (_a = element.layoutSafeToRemove) === null || _a === void 0 ? void 0 : _a.call(element);
  10723. }
  10724. }));
  10725. },
  10726. // TODO: Clean this up
  10727. isPresent: true, presence: Presence.Entering });
  10728. return element;
  10729. };
  10730. };
  10731. function fireResolveRelativeTargetBox(child) {
  10732. child.resolveRelativeTargetBox();
  10733. }
  10734. function fireUpdateLayoutProjection(child) {
  10735. child.updateLayoutProjection();
  10736. }
  10737. var variantProps = __spreadArray(["initial"], __read(variantPriorityOrder));
  10738. var numVariantProps = variantProps.length;
  10739. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js
  10740. var positionalKeys = new Set([
  10741. "width",
  10742. "height",
  10743. "top",
  10744. "left",
  10745. "right",
  10746. "bottom",
  10747. "x",
  10748. "y",
  10749. ]);
  10750. var isPositionalKey = function (key) { return positionalKeys.has(key); };
  10751. var hasPositionalKey = function (target) {
  10752. return Object.keys(target).some(isPositionalKey);
  10753. };
  10754. var setAndResetVelocity = function (value, to) {
  10755. // Looks odd but setting it twice doesn't render, it'll just
  10756. // set both prev and current to the latest value
  10757. value.set(to, false);
  10758. value.set(to);
  10759. };
  10760. var isNumOrPxType = function (v) {
  10761. return v === numbers_number || v === px;
  10762. };
  10763. var BoundingBoxDimension;
  10764. (function (BoundingBoxDimension) {
  10765. BoundingBoxDimension["width"] = "width";
  10766. BoundingBoxDimension["height"] = "height";
  10767. BoundingBoxDimension["left"] = "left";
  10768. BoundingBoxDimension["right"] = "right";
  10769. BoundingBoxDimension["top"] = "top";
  10770. BoundingBoxDimension["bottom"] = "bottom";
  10771. })(BoundingBoxDimension || (BoundingBoxDimension = {}));
  10772. var getPosFromMatrix = function (matrix, pos) {
  10773. return parseFloat(matrix.split(", ")[pos]);
  10774. };
  10775. var getTranslateFromMatrix = function (pos2, pos3) { return function (_bbox, _a) {
  10776. var transform = _a.transform;
  10777. if (transform === "none" || !transform)
  10778. return 0;
  10779. var matrix3d = transform.match(/^matrix3d\((.+)\)$/);
  10780. if (matrix3d) {
  10781. return getPosFromMatrix(matrix3d[1], pos3);
  10782. }
  10783. else {
  10784. var matrix = transform.match(/^matrix\((.+)\)$/);
  10785. if (matrix) {
  10786. return getPosFromMatrix(matrix[1], pos2);
  10787. }
  10788. else {
  10789. return 0;
  10790. }
  10791. }
  10792. }; };
  10793. var unit_conversion_transformKeys = new Set(["x", "y", "z"]);
  10794. var nonTranslationalTransformKeys = transformProps.filter(function (key) { return !unit_conversion_transformKeys.has(key); });
  10795. function removeNonTranslationalTransform(visualElement) {
  10796. var removedTransforms = [];
  10797. nonTranslationalTransformKeys.forEach(function (key) {
  10798. var value = visualElement.getValue(key);
  10799. if (value !== undefined) {
  10800. removedTransforms.push([key, value.get()]);
  10801. value.set(key.startsWith("scale") ? 1 : 0);
  10802. }
  10803. });
  10804. // Apply changes to element before measurement
  10805. if (removedTransforms.length)
  10806. visualElement.syncRender();
  10807. return removedTransforms;
  10808. }
  10809. var positionalValues = {
  10810. // Dimensions
  10811. width: function (_a) {
  10812. var x = _a.x;
  10813. return x.max - x.min;
  10814. },
  10815. height: function (_a) {
  10816. var y = _a.y;
  10817. return y.max - y.min;
  10818. },
  10819. top: function (_bbox, _a) {
  10820. var top = _a.top;
  10821. return parseFloat(top);
  10822. },
  10823. left: function (_bbox, _a) {
  10824. var left = _a.left;
  10825. return parseFloat(left);
  10826. },
  10827. bottom: function (_a, _b) {
  10828. var y = _a.y;
  10829. var top = _b.top;
  10830. return parseFloat(top) + (y.max - y.min);
  10831. },
  10832. right: function (_a, _b) {
  10833. var x = _a.x;
  10834. var left = _b.left;
  10835. return parseFloat(left) + (x.max - x.min);
  10836. },
  10837. // Transform
  10838. x: getTranslateFromMatrix(4, 13),
  10839. y: getTranslateFromMatrix(5, 14),
  10840. };
  10841. var convertChangedValueTypes = function (target, visualElement, changedKeys) {
  10842. var originBbox = visualElement.measureViewportBox();
  10843. var element = visualElement.getInstance();
  10844. var elementComputedStyle = getComputedStyle(element);
  10845. var display = elementComputedStyle.display, top = elementComputedStyle.top, left = elementComputedStyle.left, bottom = elementComputedStyle.bottom, right = elementComputedStyle.right, transform = elementComputedStyle.transform;
  10846. var originComputedStyle = { top: top, left: left, bottom: bottom, right: right, transform: transform };
  10847. // If the element is currently set to display: "none", make it visible before
  10848. // measuring the target bounding box
  10849. if (display === "none") {
  10850. visualElement.setStaticValue("display", target.display || "block");
  10851. }
  10852. // Apply the latest values (as set in checkAndConvertChangedValueTypes)
  10853. visualElement.syncRender();
  10854. var targetBbox = visualElement.measureViewportBox();
  10855. changedKeys.forEach(function (key) {
  10856. // Restore styles to their **calculated computed style**, not their actual
  10857. // originally set style. This allows us to animate between equivalent pixel units.
  10858. var value = visualElement.getValue(key);
  10859. setAndResetVelocity(value, positionalValues[key](originBbox, originComputedStyle));
  10860. target[key] = positionalValues[key](targetBbox, elementComputedStyle);
  10861. });
  10862. return target;
  10863. };
  10864. var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) {
  10865. if (origin === void 0) { origin = {}; }
  10866. if (transitionEnd === void 0) { transitionEnd = {}; }
  10867. target = __assign({}, target);
  10868. transitionEnd = __assign({}, transitionEnd);
  10869. var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
  10870. // We want to remove any transform values that could affect the element's bounding box before
  10871. // it's measured. We'll reapply these later.
  10872. var removedTransformValues = [];
  10873. var hasAttemptedToRemoveTransformValues = false;
  10874. var changedValueTypeKeys = [];
  10875. targetPositionalKeys.forEach(function (key) {
  10876. var value = visualElement.getValue(key);
  10877. if (!visualElement.hasValue(key))
  10878. return;
  10879. var from = origin[key];
  10880. var to = target[key];
  10881. var fromType = findDimensionValueType(from);
  10882. var toType;
  10883. // TODO: The current implementation of this basically throws an error
  10884. // if you try and do value conversion via keyframes. There's probably
  10885. // a way of doing this but the performance implications would need greater scrutiny,
  10886. // as it'd be doing multiple resize-remeasure operations.
  10887. if (isKeyframesTarget(to)) {
  10888. var numKeyframes = to.length;
  10889. for (var i = to[0] === null ? 1 : 0; i < numKeyframes; i++) {
  10890. if (!toType) {
  10891. toType = findDimensionValueType(to[i]);
  10892. invariant(toType === fromType ||
  10893. (isNumOrPxType(fromType) && isNumOrPxType(toType)), "Keyframes must be of the same dimension as the current value");
  10894. }
  10895. else {
  10896. invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type");
  10897. }
  10898. }
  10899. }
  10900. else {
  10901. toType = findDimensionValueType(to);
  10902. }
  10903. if (fromType !== toType) {
  10904. // If they're both just number or px, convert them both to numbers rather than
  10905. // relying on resize/remeasure to convert (which is wasteful in this situation)
  10906. if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {
  10907. var current = value.get();
  10908. if (typeof current === "string") {
  10909. value.set(parseFloat(current));
  10910. }
  10911. if (typeof to === "string") {
  10912. target[key] = parseFloat(to);
  10913. }
  10914. else if (Array.isArray(to) && toType === px) {
  10915. target[key] = to.map(parseFloat);
  10916. }
  10917. }
  10918. else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&
  10919. (toType === null || toType === void 0 ? void 0 : toType.transform) &&
  10920. (from === 0 || to === 0)) {
  10921. // If one or the other value is 0, it's safe to coerce it to the
  10922. // type of the other without measurement
  10923. if (from === 0) {
  10924. value.set(toType.transform(from));
  10925. }
  10926. else {
  10927. target[key] = fromType.transform(to);
  10928. }
  10929. }
  10930. else {
  10931. // If we're going to do value conversion via DOM measurements, we first
  10932. // need to remove non-positional transform values that could affect the bbox measurements.
  10933. if (!hasAttemptedToRemoveTransformValues) {
  10934. removedTransformValues = removeNonTranslationalTransform(visualElement);
  10935. hasAttemptedToRemoveTransformValues = true;
  10936. }
  10937. changedValueTypeKeys.push(key);
  10938. transitionEnd[key] =
  10939. transitionEnd[key] !== undefined
  10940. ? transitionEnd[key]
  10941. : target[key];
  10942. setAndResetVelocity(value, to);
  10943. }
  10944. }
  10945. });
  10946. if (changedValueTypeKeys.length) {
  10947. var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
  10948. // If we removed transform values, reapply them before the next render
  10949. if (removedTransformValues.length) {
  10950. removedTransformValues.forEach(function (_a) {
  10951. var _b = __read(_a, 2), key = _b[0], value = _b[1];
  10952. visualElement.getValue(key).set(value);
  10953. });
  10954. }
  10955. // Reapply original values
  10956. visualElement.syncRender();
  10957. return { target: convertedTarget, transitionEnd: transitionEnd };
  10958. }
  10959. else {
  10960. return { target: target, transitionEnd: transitionEnd };
  10961. }
  10962. };
  10963. /**
  10964. * Convert value types for x/y/width/height/top/left/bottom/right
  10965. *
  10966. * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`
  10967. *
  10968. * @internal
  10969. */
  10970. function unitConversion(visualElement, target, origin, transitionEnd) {
  10971. return hasPositionalKey(target)
  10972. ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)
  10973. : { target: target, transitionEnd: transitionEnd };
  10974. }
  10975. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js
  10976. /**
  10977. * Parse a DOM variant to make it animatable. This involves resolving CSS variables
  10978. * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels.
  10979. */
  10980. var parseDomVariant = function (visualElement, target, origin, transitionEnd) {
  10981. var resolved = resolveCSSVariables(visualElement, target, transitionEnd);
  10982. target = resolved.target;
  10983. transitionEnd = resolved.transitionEnd;
  10984. return unitConversion(visualElement, target, origin, transitionEnd);
  10985. };
  10986. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/visual-element.js
  10987. function visual_element_getComputedStyle(element) {
  10988. return window.getComputedStyle(element);
  10989. }
  10990. var htmlConfig = {
  10991. treeType: "dom",
  10992. readValueFromInstance: function (domElement, key) {
  10993. if (isTransformProp(key)) {
  10994. var defaultType = getDefaultValueType(key);
  10995. return defaultType ? defaultType.default || 0 : 0;
  10996. }
  10997. else {
  10998. var computedStyle = visual_element_getComputedStyle(domElement);
  10999. return ((isCSSVariable(key)
  11000. ? computedStyle.getPropertyValue(key)
  11001. : computedStyle[key]) || 0);
  11002. }
  11003. },
  11004. sortNodePosition: function (a, b) {
  11005. /**
  11006. * compareDocumentPosition returns a bitmask, by using the bitwise &
  11007. * we're returning true if 2 in that bitmask is set to true. 2 is set
  11008. * to true if b preceeds a.
  11009. */
  11010. return a.compareDocumentPosition(b) & 2 ? 1 : -1;
  11011. },
  11012. getBaseTarget: function (props, key) {
  11013. var _a;
  11014. return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key];
  11015. },
  11016. measureViewportBox: function (element, _a) {
  11017. var transformPagePoint = _a.transformPagePoint;
  11018. return getBoundingBox(element, transformPagePoint);
  11019. },
  11020. /**
  11021. * Reset the transform on the current Element. This is called as part
  11022. * of a batched process across the entire layout tree. To remove this write
  11023. * cycle it'd be interesting to see if it's possible to "undo" all the current
  11024. * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms
  11025. * works
  11026. */
  11027. resetTransform: function (element, domElement, props) {
  11028. var transformTemplate = props.transformTemplate;
  11029. domElement.style.transform = transformTemplate
  11030. ? transformTemplate({}, "")
  11031. : "none";
  11032. // Ensure that whatever happens next, we restore our transform on the next frame
  11033. element.scheduleRender();
  11034. },
  11035. restoreTransform: function (instance, mutableState) {
  11036. instance.style.transform = mutableState.style.transform;
  11037. },
  11038. removeValueFromRenderState: function (key, _a) {
  11039. var vars = _a.vars, style = _a.style;
  11040. delete vars[key];
  11041. delete style[key];
  11042. },
  11043. /**
  11044. * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color`
  11045. * can be animated by Motion.
  11046. */
  11047. makeTargetAnimatable: function (element, _a, _b, isMounted) {
  11048. var transformValues = _b.transformValues;
  11049. if (isMounted === void 0) { isMounted = true; }
  11050. var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]);
  11051. var origin = getOrigin(target, transition || {}, element);
  11052. /**
  11053. * If Framer has provided a function to convert `Color` etc value types, convert them
  11054. */
  11055. if (transformValues) {
  11056. if (transitionEnd)
  11057. transitionEnd = transformValues(transitionEnd);
  11058. if (target)
  11059. target = transformValues(target);
  11060. if (origin)
  11061. origin = transformValues(origin);
  11062. }
  11063. if (isMounted) {
  11064. checkTargetForNewValues(element, target, origin);
  11065. var parsed = parseDomVariant(element, target, origin, transitionEnd);
  11066. transitionEnd = parsed.transitionEnd;
  11067. target = parsed.target;
  11068. }
  11069. return __assign({ transition: transition,
  11070. transitionEnd: transitionEnd }, target);
  11071. },
  11072. scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
  11073. build: function (element, renderState, latestValues, projection, layoutState, options, props) {
  11074. if (element.isVisible !== undefined) {
  11075. renderState.style.visibility = element.isVisible
  11076. ? "visible"
  11077. : "hidden";
  11078. }
  11079. var isProjectionTranform = projection.isEnabled && layoutState.isHydrated;
  11080. buildHTMLStyles(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform
  11081. ? buildLayoutProjectionTransformOrigin
  11082. : undefined);
  11083. },
  11084. render: renderHTML,
  11085. };
  11086. var htmlVisualElement = render_visualElement(htmlConfig);
  11087. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/visual-element.js
  11088. var svgVisualElement = render_visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) {
  11089. return props[key];
  11090. },
  11091. readValueFromInstance: function (domElement, key) {
  11092. var _a;
  11093. if (isTransformProp(key)) {
  11094. return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0;
  11095. }
  11096. key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
  11097. return domElement.getAttribute(key);
  11098. },
  11099. scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps,
  11100. build: function (_element, renderState, latestValues, projection, layoutState, options, props) {
  11101. var isProjectionTranform = projection.isEnabled && layoutState.isHydrated;
  11102. buildSVGAttrs(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform
  11103. ? buildLayoutProjectionTransformOrigin
  11104. : undefined);
  11105. }, render: renderSVG }));
  11106. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.js
  11107. var createDomVisualElement = function (Component, options) {
  11108. return isSVGComponent(Component)
  11109. ? svgVisualElement(options, { enableHardwareAcceleration: false })
  11110. : htmlVisualElement(options, { enableHardwareAcceleration: true });
  11111. };
  11112. // CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion.js
  11113. var featureBundle = __assign(__assign(__assign(__assign({}, animations_animations), gestureAnimations), drag_drag), layoutAnimations);
  11114. /**
  11115. * HTML & SVG components, optimised for use with gestures and animation. These can be used as
  11116. * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.
  11117. *
  11118. * @public
  11119. */
  11120. var motion = /*@__PURE__*/ createMotionProxy(function (Component, config) {
  11121. return createDomMotionConfig(Component, config, featureBundle, createDomVisualElement);
  11122. });
  11123. /**
  11124. * Create a DOM `motion` component with the provided string. This is primarily intended
  11125. * as a full alternative to `motion` for consumers who have to support environments that don't
  11126. * support `Proxy`.
  11127. *
  11128. * ```javascript
  11129. * import { createDomMotionComponent } from "framer-motion"
  11130. *
  11131. * const motion = {
  11132. * div: createDomMotionComponent('div')
  11133. * }
  11134. * ```
  11135. *
  11136. * @public
  11137. */
  11138. function createDomMotionComponent(key) {
  11139. return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, featureBundle, createDomVisualElement));
  11140. }
  11141. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js
  11142. var arrow_left = __webpack_require__("cjQ8");
  11143. // EXTERNAL MODULE: external ["wp","a11y"]
  11144. var external_wp_a11y_ = __webpack_require__("gdqT");
  11145. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/block-inspector-button.js
  11146. /**
  11147. * External dependencies
  11148. */
  11149. /**
  11150. * WordPress dependencies
  11151. */
  11152. /**
  11153. * Internal dependencies
  11154. */
  11155. function BlockInspectorButton({
  11156. onClick = external_lodash_["noop"],
  11157. small = false
  11158. }) {
  11159. const {
  11160. shortcut,
  11161. areAdvancedSettingsOpened
  11162. } = Object(external_wp_data_["useSelect"])(select => ({
  11163. shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar'),
  11164. areAdvancedSettingsOpened: select(store["a" /* store */]).getActiveGeneralSidebarName() === 'edit-post/block'
  11165. }), []);
  11166. const {
  11167. openGeneralSidebar,
  11168. closeGeneralSidebar
  11169. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  11170. const speakMessage = () => {
  11171. if (areAdvancedSettingsOpened) {
  11172. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Block settings closed'));
  11173. } else {
  11174. Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Additional settings are now available in the Editor block settings sidebar'));
  11175. }
  11176. };
  11177. const label = areAdvancedSettingsOpened ? Object(external_wp_i18n_["__"])('Hide more settings') : Object(external_wp_i18n_["__"])('Show more settings');
  11178. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  11179. onClick: () => {
  11180. if (areAdvancedSettingsOpened) {
  11181. closeGeneralSidebar();
  11182. } else {
  11183. openGeneralSidebar('edit-post/block');
  11184. speakMessage();
  11185. onClick();
  11186. }
  11187. },
  11188. shortcut: shortcut
  11189. }, !small && label);
  11190. }
  11191. /* harmony default export */ var block_inspector_button = (BlockInspectorButton);
  11192. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/visual-editor/index.js
  11193. /**
  11194. * External dependencies
  11195. */
  11196. /**
  11197. * WordPress dependencies
  11198. */
  11199. /**
  11200. * Internal dependencies
  11201. */
  11202. function MaybeIframe({
  11203. children,
  11204. contentRef,
  11205. isTemplateMode,
  11206. styles,
  11207. style
  11208. }) {
  11209. const ref = Object(external_wp_blockEditor_["__unstableUseMouseMoveTypingReset"])();
  11210. if (!isTemplateMode) {
  11211. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableEditorStyles"], {
  11212. styles: styles
  11213. }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], {
  11214. ref: contentRef,
  11215. className: "editor-styles-wrapper",
  11216. style: {
  11217. flex: '1',
  11218. ...style
  11219. },
  11220. tabIndex: -1
  11221. }, children));
  11222. }
  11223. return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableIframe"], {
  11224. head: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableEditorStyles"], {
  11225. styles: styles
  11226. }),
  11227. ref: ref,
  11228. contentRef: contentRef,
  11229. style: {
  11230. width: '100%',
  11231. height: '100%',
  11232. display: 'block'
  11233. }
  11234. }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, children));
  11235. }
  11236. function VisualEditor({
  11237. styles
  11238. }) {
  11239. const {
  11240. deviceType,
  11241. isTemplateMode,
  11242. wrapperBlockName,
  11243. wrapperUniqueId
  11244. } = Object(external_wp_data_["useSelect"])(select => {
  11245. const {
  11246. isEditingTemplate,
  11247. __experimentalGetPreviewDeviceType
  11248. } = select(store["a" /* store */]);
  11249. const {
  11250. getCurrentPostId,
  11251. getCurrentPostType
  11252. } = select(external_wp_editor_["store"]);
  11253. const _isTemplateMode = isEditingTemplate();
  11254. let _wrapperBlockName;
  11255. if (getCurrentPostType() === 'wp_block') {
  11256. _wrapperBlockName = 'core/block';
  11257. } else if (!_isTemplateMode) {
  11258. _wrapperBlockName = 'core/post-content';
  11259. }
  11260. return {
  11261. deviceType: __experimentalGetPreviewDeviceType(),
  11262. isTemplateMode: _isTemplateMode,
  11263. wrapperBlockName: _wrapperBlockName,
  11264. wrapperUniqueId: getCurrentPostId()
  11265. };
  11266. }, []);
  11267. const hasMetaBoxes = Object(external_wp_data_["useSelect"])(select => select(store["a" /* store */]).hasMetaBoxes(), []);
  11268. const themeSupportsLayout = Object(external_wp_data_["useSelect"])(select => {
  11269. const {
  11270. getSettings
  11271. } = select(external_wp_blockEditor_["store"]);
  11272. return getSettings().supportsLayout;
  11273. }, []);
  11274. const {
  11275. clearSelectedBlock
  11276. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  11277. const {
  11278. setIsEditingTemplate
  11279. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  11280. const desktopCanvasStyles = {
  11281. height: '100%',
  11282. width: '100%',
  11283. margin: 0,
  11284. display: 'flex',
  11285. flexFlow: 'column',
  11286. // Default background color so that grey
  11287. // .edit-post-editor-regions__content color doesn't show through.
  11288. background: 'white'
  11289. };
  11290. const templateModeStyles = { ...desktopCanvasStyles,
  11291. borderRadius: '2px 2px 0 0',
  11292. border: '1px solid #ddd',
  11293. borderBottom: 0
  11294. };
  11295. const resizedCanvasStyles = Object(external_wp_blockEditor_["__experimentalUseResizeCanvas"])(deviceType, isTemplateMode);
  11296. const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout');
  11297. const {
  11298. contentSize,
  11299. wideSize
  11300. } = defaultLayout || {};
  11301. let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles;
  11302. if (resizedCanvasStyles) {
  11303. animatedStyles = resizedCanvasStyles;
  11304. }
  11305. let paddingBottom; // Add a constant padding for the typewritter effect. When typing at the
  11306. // bottom, there needs to be room to scroll up.
  11307. if (!hasMetaBoxes && !resizedCanvasStyles && !isTemplateMode) {
  11308. paddingBottom = '40vh';
  11309. }
  11310. const ref = Object(external_wp_element_["useRef"])();
  11311. const contentRef = Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_blockEditor_["__unstableUseClipboardHandler"])(), Object(external_wp_blockEditor_["__unstableUseCanvasClickRedirect"])(), Object(external_wp_blockEditor_["__unstableUseTypewriter"])(), Object(external_wp_blockEditor_["__unstableUseTypingObserver"])(), Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])()]);
  11312. const blockSelectionClearerRef = Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])();
  11313. const [, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(wrapperUniqueId, wrapperBlockName);
  11314. const layout = Object(external_wp_element_["useMemo"])(() => {
  11315. if (isTemplateMode) {
  11316. return {
  11317. type: 'default'
  11318. };
  11319. }
  11320. if (themeSupportsLayout) {
  11321. const alignments = contentSize || wideSize ? ['wide', 'full', 'left', 'center', 'right'] : ['left', 'center', 'right'];
  11322. return {
  11323. type: 'default',
  11324. // Find a way to inject this in the support flag code (hooks).
  11325. alignments
  11326. };
  11327. }
  11328. return undefined;
  11329. }, [isTemplateMode, themeSupportsLayout, contentSize, wideSize]);
  11330. return Object(external_wp_element_["createElement"])("div", {
  11331. className: classnames_default()('edit-post-visual-editor', {
  11332. 'is-template-mode': isTemplateMode
  11333. })
  11334. }, Object(external_wp_element_["createElement"])(external_wp_editor_["VisualEditorGlobalKeyboardShortcuts"], null), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], {
  11335. __unstableContentRef: ref
  11336. }, Object(external_wp_element_["createElement"])(motion.div, {
  11337. className: "edit-post-visual-editor__content-area",
  11338. animate: {
  11339. padding: isTemplateMode ? '48px 48px 0' : '0'
  11340. },
  11341. ref: blockSelectionClearerRef
  11342. }, isTemplateMode && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  11343. className: "edit-post-visual-editor__exit-template-mode",
  11344. icon: arrow_left["a" /* default */],
  11345. onClick: () => {
  11346. clearSelectedBlock();
  11347. setIsEditingTemplate(false);
  11348. }
  11349. }, Object(external_wp_i18n_["__"])('Back')), Object(external_wp_element_["createElement"])(motion.div, {
  11350. animate: animatedStyles,
  11351. initial: desktopCanvasStyles
  11352. }, Object(external_wp_element_["createElement"])(MaybeIframe, {
  11353. isTemplateMode: isTemplateMode,
  11354. contentRef: contentRef,
  11355. styles: styles,
  11356. style: {
  11357. paddingBottom
  11358. }
  11359. }, themeSupportsLayout && !isTemplateMode && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLayoutStyle"], {
  11360. selector: ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",
  11361. layout: defaultLayout
  11362. }), !isTemplateMode && Object(external_wp_element_["createElement"])("div", {
  11363. className: "edit-post-visual-editor__post-title-wrapper"
  11364. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null)), Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], {
  11365. __experimentalLayout: layout
  11366. })))))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, ({
  11367. onClose
  11368. }) => Object(external_wp_element_["createElement"])(block_inspector_button, {
  11369. onClick: onClose
  11370. })));
  11371. }
  11372. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js
  11373. /**
  11374. * WordPress dependencies
  11375. */
  11376. /**
  11377. * Internal dependencies
  11378. */
  11379. function KeyboardShortcuts() {
  11380. const {
  11381. getBlockSelectionStart
  11382. } = Object(external_wp_data_["useSelect"])(external_wp_blockEditor_["store"]);
  11383. const {
  11384. getEditorMode,
  11385. isEditorSidebarOpened,
  11386. isListViewOpened
  11387. } = Object(external_wp_data_["useSelect"])(store["a" /* store */]);
  11388. const isModeToggleDisabled = Object(external_wp_data_["useSelect"])(select => {
  11389. const {
  11390. richEditingEnabled,
  11391. codeEditingEnabled
  11392. } = select(external_wp_editor_["store"]).getEditorSettings();
  11393. return !richEditingEnabled || !codeEditingEnabled;
  11394. }, []);
  11395. const {
  11396. switchEditorMode,
  11397. openGeneralSidebar,
  11398. closeGeneralSidebar,
  11399. toggleFeature,
  11400. setIsListViewOpened
  11401. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  11402. const {
  11403. registerShortcut
  11404. } = Object(external_wp_data_["useDispatch"])(external_wp_keyboardShortcuts_["store"]);
  11405. Object(external_wp_element_["useEffect"])(() => {
  11406. registerShortcut({
  11407. name: 'core/edit-post/toggle-mode',
  11408. category: 'global',
  11409. description: Object(external_wp_i18n_["__"])('Switch between visual editor and code editor.'),
  11410. keyCombination: {
  11411. modifier: 'secondary',
  11412. character: 'm'
  11413. }
  11414. });
  11415. registerShortcut({
  11416. name: 'core/edit-post/toggle-fullscreen',
  11417. category: 'global',
  11418. description: Object(external_wp_i18n_["__"])('Toggle fullscreen mode.'),
  11419. keyCombination: {
  11420. modifier: 'secondary',
  11421. character: 'f'
  11422. }
  11423. });
  11424. registerShortcut({
  11425. name: 'core/edit-post/toggle-block-navigation',
  11426. category: 'global',
  11427. description: Object(external_wp_i18n_["__"])('Open the block list view.'),
  11428. keyCombination: {
  11429. modifier: 'access',
  11430. character: 'o'
  11431. }
  11432. });
  11433. registerShortcut({
  11434. name: 'core/edit-post/toggle-sidebar',
  11435. category: 'global',
  11436. description: Object(external_wp_i18n_["__"])('Show or hide the settings sidebar.'),
  11437. keyCombination: {
  11438. modifier: 'primaryShift',
  11439. character: ','
  11440. }
  11441. });
  11442. registerShortcut({
  11443. name: 'core/edit-post/next-region',
  11444. category: 'global',
  11445. description: Object(external_wp_i18n_["__"])('Navigate to the next part of the editor.'),
  11446. keyCombination: {
  11447. modifier: 'ctrl',
  11448. character: '`'
  11449. },
  11450. aliases: [{
  11451. modifier: 'access',
  11452. character: 'n'
  11453. }]
  11454. });
  11455. registerShortcut({
  11456. name: 'core/edit-post/previous-region',
  11457. category: 'global',
  11458. description: Object(external_wp_i18n_["__"])('Navigate to the previous part of the editor.'),
  11459. keyCombination: {
  11460. modifier: 'ctrlShift',
  11461. character: '`'
  11462. },
  11463. aliases: [{
  11464. modifier: 'access',
  11465. character: 'p'
  11466. }]
  11467. });
  11468. registerShortcut({
  11469. name: 'core/edit-post/keyboard-shortcuts',
  11470. category: 'main',
  11471. description: Object(external_wp_i18n_["__"])('Display these keyboard shortcuts.'),
  11472. keyCombination: {
  11473. modifier: 'access',
  11474. character: 'h'
  11475. }
  11476. });
  11477. }, []);
  11478. Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-mode', () => {
  11479. switchEditorMode(getEditorMode() === 'visual' ? 'text' : 'visual');
  11480. }, {
  11481. bindGlobal: true,
  11482. isDisabled: isModeToggleDisabled
  11483. });
  11484. Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-fullscreen', () => {
  11485. toggleFeature('fullscreenMode');
  11486. }, {
  11487. bindGlobal: true
  11488. });
  11489. Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-sidebar', event => {
  11490. // This shortcut has no known clashes, but use preventDefault to prevent any
  11491. // obscure shortcuts from triggering.
  11492. event.preventDefault();
  11493. if (isEditorSidebarOpened()) {
  11494. closeGeneralSidebar();
  11495. } else {
  11496. const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
  11497. openGeneralSidebar(sidebarToOpen);
  11498. }
  11499. }, {
  11500. bindGlobal: true
  11501. });
  11502. Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/toggle-block-navigation', () => setIsListViewOpened(!isListViewOpened()), {
  11503. bindGlobal: true
  11504. });
  11505. return null;
  11506. }
  11507. /* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
  11508. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/config.js
  11509. /**
  11510. * WordPress dependencies
  11511. */
  11512. const textFormattingShortcuts = [{
  11513. keyCombination: {
  11514. modifier: 'primary',
  11515. character: 'b'
  11516. },
  11517. description: Object(external_wp_i18n_["__"])('Make the selected text bold.')
  11518. }, {
  11519. keyCombination: {
  11520. modifier: 'primary',
  11521. character: 'i'
  11522. },
  11523. description: Object(external_wp_i18n_["__"])('Make the selected text italic.')
  11524. }, {
  11525. keyCombination: {
  11526. modifier: 'primary',
  11527. character: 'k'
  11528. },
  11529. description: Object(external_wp_i18n_["__"])('Convert the selected text into a link.')
  11530. }, {
  11531. keyCombination: {
  11532. modifier: 'primaryShift',
  11533. character: 'k'
  11534. },
  11535. description: Object(external_wp_i18n_["__"])('Remove a link.')
  11536. }, {
  11537. keyCombination: {
  11538. modifier: 'primary',
  11539. character: 'u'
  11540. },
  11541. description: Object(external_wp_i18n_["__"])('Underline the selected text.')
  11542. }];
  11543. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/shortcut.js
  11544. /**
  11545. * External dependencies
  11546. */
  11547. /**
  11548. * WordPress dependencies
  11549. */
  11550. function KeyCombination({
  11551. keyCombination,
  11552. forceAriaLabel
  11553. }) {
  11554. const shortcut = keyCombination.modifier ? external_wp_keycodes_["displayShortcutList"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
  11555. const ariaLabel = keyCombination.modifier ? external_wp_keycodes_["shortcutAriaLabel"][keyCombination.modifier](keyCombination.character) : keyCombination.character;
  11556. return Object(external_wp_element_["createElement"])("kbd", {
  11557. className: "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination",
  11558. "aria-label": forceAriaLabel || ariaLabel
  11559. }, Object(external_lodash_["castArray"])(shortcut).map((character, index) => {
  11560. if (character === '+') {
  11561. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], {
  11562. key: index
  11563. }, character);
  11564. }
  11565. return Object(external_wp_element_["createElement"])("kbd", {
  11566. key: index,
  11567. className: "edit-post-keyboard-shortcut-help-modal__shortcut-key"
  11568. }, character);
  11569. }));
  11570. }
  11571. function Shortcut({
  11572. description,
  11573. keyCombination,
  11574. aliases = [],
  11575. ariaLabel
  11576. }) {
  11577. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
  11578. className: "edit-post-keyboard-shortcut-help-modal__shortcut-description"
  11579. }, description), Object(external_wp_element_["createElement"])("div", {
  11580. className: "edit-post-keyboard-shortcut-help-modal__shortcut-term"
  11581. }, Object(external_wp_element_["createElement"])(KeyCombination, {
  11582. keyCombination: keyCombination,
  11583. forceAriaLabel: ariaLabel
  11584. }), aliases.map((alias, index) => Object(external_wp_element_["createElement"])(KeyCombination, {
  11585. keyCombination: alias,
  11586. forceAriaLabel: ariaLabel,
  11587. key: index
  11588. }))));
  11589. }
  11590. /* harmony default export */ var keyboard_shortcut_help_modal_shortcut = (Shortcut);
  11591. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
  11592. /**
  11593. * WordPress dependencies
  11594. */
  11595. /**
  11596. * Internal dependencies
  11597. */
  11598. function DynamicShortcut({
  11599. name
  11600. }) {
  11601. const {
  11602. keyCombination,
  11603. description,
  11604. aliases
  11605. } = Object(external_wp_data_["useSelect"])(select => {
  11606. const {
  11607. getShortcutKeyCombination,
  11608. getShortcutDescription,
  11609. getShortcutAliases
  11610. } = select(external_wp_keyboardShortcuts_["store"]);
  11611. return {
  11612. keyCombination: getShortcutKeyCombination(name),
  11613. aliases: getShortcutAliases(name),
  11614. description: getShortcutDescription(name)
  11615. };
  11616. });
  11617. if (!keyCombination) {
  11618. return null;
  11619. }
  11620. return Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, {
  11621. keyCombination: keyCombination,
  11622. description: description,
  11623. aliases: aliases
  11624. });
  11625. }
  11626. /* harmony default export */ var dynamic_shortcut = (DynamicShortcut);
  11627. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcut-help-modal/index.js
  11628. /**
  11629. * External dependencies
  11630. */
  11631. /**
  11632. * WordPress dependencies
  11633. */
  11634. /**
  11635. * Internal dependencies
  11636. */
  11637. const MODAL_NAME = 'edit-post/keyboard-shortcut-help';
  11638. const ShortcutList = ({
  11639. shortcuts
  11640. }) =>
  11641. /*
  11642. * Disable reason: The `list` ARIA role is redundant but
  11643. * Safari+VoiceOver won't announce the list otherwise.
  11644. */
  11645. /* eslint-disable jsx-a11y/no-redundant-roles */
  11646. Object(external_wp_element_["createElement"])("ul", {
  11647. className: "edit-post-keyboard-shortcut-help-modal__shortcut-list",
  11648. role: "list"
  11649. }, shortcuts.map((shortcut, index) => Object(external_wp_element_["createElement"])("li", {
  11650. className: "edit-post-keyboard-shortcut-help-modal__shortcut",
  11651. key: index
  11652. }, Object(external_lodash_["isString"])(shortcut) ? Object(external_wp_element_["createElement"])(dynamic_shortcut, {
  11653. name: shortcut
  11654. }) : Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal_shortcut, shortcut))))
  11655. /* eslint-enable jsx-a11y/no-redundant-roles */
  11656. ;
  11657. const ShortcutSection = ({
  11658. title,
  11659. shortcuts,
  11660. className
  11661. }) => Object(external_wp_element_["createElement"])("section", {
  11662. className: classnames_default()('edit-post-keyboard-shortcut-help-modal__section', className)
  11663. }, !!title && Object(external_wp_element_["createElement"])("h2", {
  11664. className: "edit-post-keyboard-shortcut-help-modal__section-title"
  11665. }, title), Object(external_wp_element_["createElement"])(ShortcutList, {
  11666. shortcuts: shortcuts
  11667. }));
  11668. const ShortcutCategorySection = ({
  11669. title,
  11670. categoryName,
  11671. additionalShortcuts = []
  11672. }) => {
  11673. const categoryShortcuts = Object(external_wp_data_["useSelect"])(select => {
  11674. return select(external_wp_keyboardShortcuts_["store"]).getCategoryShortcuts(categoryName);
  11675. }, [categoryName]);
  11676. return Object(external_wp_element_["createElement"])(ShortcutSection, {
  11677. title: title,
  11678. shortcuts: categoryShortcuts.concat(additionalShortcuts)
  11679. });
  11680. };
  11681. function KeyboardShortcutHelpModal({
  11682. isModalActive,
  11683. toggleModal
  11684. }) {
  11685. Object(external_wp_keyboardShortcuts_["useShortcut"])('core/edit-post/keyboard-shortcuts', toggleModal, {
  11686. bindGlobal: true
  11687. });
  11688. if (!isModalActive) {
  11689. return null;
  11690. }
  11691. return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
  11692. className: "edit-post-keyboard-shortcut-help-modal",
  11693. title: Object(external_wp_i18n_["__"])('Keyboard shortcuts'),
  11694. closeLabel: Object(external_wp_i18n_["__"])('Close'),
  11695. onRequestClose: toggleModal
  11696. }, Object(external_wp_element_["createElement"])(ShortcutSection, {
  11697. className: "edit-post-keyboard-shortcut-help-modal__main-shortcuts",
  11698. shortcuts: ['core/edit-post/keyboard-shortcuts']
  11699. }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, {
  11700. title: Object(external_wp_i18n_["__"])('Global shortcuts'),
  11701. categoryName: "global"
  11702. }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, {
  11703. title: Object(external_wp_i18n_["__"])('Selection shortcuts'),
  11704. categoryName: "selection"
  11705. }), Object(external_wp_element_["createElement"])(ShortcutCategorySection, {
  11706. title: Object(external_wp_i18n_["__"])('Block shortcuts'),
  11707. categoryName: "block",
  11708. additionalShortcuts: [{
  11709. keyCombination: {
  11710. character: '/'
  11711. },
  11712. description: Object(external_wp_i18n_["__"])('Change the block type after adding a new paragraph.'),
  11713. /* translators: The forward-slash character. e.g. '/'. */
  11714. ariaLabel: Object(external_wp_i18n_["__"])('Forward-slash')
  11715. }]
  11716. }), Object(external_wp_element_["createElement"])(ShortcutSection, {
  11717. title: Object(external_wp_i18n_["__"])('Text formatting'),
  11718. shortcuts: textFormattingShortcuts
  11719. }));
  11720. }
  11721. /* harmony default export */ var keyboard_shortcut_help_modal = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => ({
  11722. isModalActive: select(store["a" /* store */]).isModalActive(MODAL_NAME)
  11723. })), Object(external_wp_data_["withDispatch"])((dispatch, {
  11724. isModalActive
  11725. }) => {
  11726. const {
  11727. openModal,
  11728. closeModal
  11729. } = dispatch(store["a" /* store */]);
  11730. return {
  11731. toggleModal: () => isModalActive ? closeModal() : openModal(MODAL_NAME)
  11732. };
  11733. })])(KeyboardShortcutHelpModal));
  11734. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/checklist.js
  11735. /**
  11736. * External dependencies
  11737. */
  11738. /**
  11739. * WordPress dependencies
  11740. */
  11741. function BlockTypesChecklist({
  11742. blockTypes,
  11743. value,
  11744. onItemChange
  11745. }) {
  11746. return Object(external_wp_element_["createElement"])("ul", {
  11747. className: "edit-post-manage-blocks-modal__checklist"
  11748. }, blockTypes.map(blockType => Object(external_wp_element_["createElement"])("li", {
  11749. key: blockType.name,
  11750. className: "edit-post-manage-blocks-modal__checklist-item"
  11751. }, Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], {
  11752. label: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, blockType.title, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
  11753. icon: blockType.icon
  11754. })),
  11755. checked: value.includes(blockType.name),
  11756. onChange: Object(external_lodash_["partial"])(onItemChange, blockType.name)
  11757. }))));
  11758. }
  11759. /* harmony default export */ var checklist = (BlockTypesChecklist);
  11760. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/edit-post-settings/index.js
  11761. /**
  11762. * WordPress dependencies
  11763. */
  11764. const EditPostSettings = Object(external_wp_element_["createContext"])({});
  11765. /* harmony default export */ var edit_post_settings = (EditPostSettings);
  11766. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/category.js
  11767. /**
  11768. * External dependencies
  11769. */
  11770. /**
  11771. * WordPress dependencies
  11772. */
  11773. /**
  11774. * Internal dependencies
  11775. */
  11776. function BlockManagerCategory({
  11777. instanceId,
  11778. title,
  11779. blockTypes,
  11780. hiddenBlockTypes,
  11781. toggleVisible,
  11782. toggleAllVisible
  11783. }) {
  11784. const settings = Object(external_wp_element_["useContext"])(edit_post_settings);
  11785. const {
  11786. allowedBlockTypes
  11787. } = settings;
  11788. const filteredBlockTypes = Object(external_wp_element_["useMemo"])(() => {
  11789. if (allowedBlockTypes === true) {
  11790. return blockTypes;
  11791. }
  11792. return blockTypes.filter(({
  11793. name
  11794. }) => {
  11795. return Object(external_lodash_["includes"])(allowedBlockTypes || [], name);
  11796. });
  11797. }, [allowedBlockTypes, blockTypes]);
  11798. if (!filteredBlockTypes.length) {
  11799. return null;
  11800. }
  11801. const checkedBlockNames = Object(external_lodash_["without"])(Object(external_lodash_["map"])(filteredBlockTypes, 'name'), ...hiddenBlockTypes);
  11802. const titleId = 'edit-post-manage-blocks-modal__category-title-' + instanceId;
  11803. const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;
  11804. let ariaChecked;
  11805. if (isAllChecked) {
  11806. ariaChecked = 'true';
  11807. } else if (checkedBlockNames.length > 0) {
  11808. ariaChecked = 'mixed';
  11809. } else {
  11810. ariaChecked = 'false';
  11811. }
  11812. return Object(external_wp_element_["createElement"])("div", {
  11813. role: "group",
  11814. "aria-labelledby": titleId,
  11815. className: "edit-post-manage-blocks-modal__category"
  11816. }, Object(external_wp_element_["createElement"])(external_wp_components_["CheckboxControl"], {
  11817. checked: isAllChecked,
  11818. onChange: toggleAllVisible,
  11819. className: "edit-post-manage-blocks-modal__category-title",
  11820. "aria-checked": ariaChecked,
  11821. label: Object(external_wp_element_["createElement"])("span", {
  11822. id: titleId
  11823. }, title)
  11824. }), Object(external_wp_element_["createElement"])(checklist, {
  11825. blockTypes: filteredBlockTypes,
  11826. value: checkedBlockNames,
  11827. onItemChange: toggleVisible
  11828. }));
  11829. }
  11830. /* harmony default export */ var manage_blocks_modal_category = (Object(external_wp_compose_["compose"])([external_wp_compose_["withInstanceId"], Object(external_wp_data_["withSelect"])(select => {
  11831. const {
  11832. getPreference
  11833. } = select(store["a" /* store */]);
  11834. return {
  11835. hiddenBlockTypes: getPreference('hiddenBlockTypes')
  11836. };
  11837. }), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => {
  11838. const {
  11839. showBlockTypes,
  11840. hideBlockTypes
  11841. } = dispatch(store["a" /* store */]);
  11842. return {
  11843. toggleVisible(blockName, nextIsChecked) {
  11844. if (nextIsChecked) {
  11845. showBlockTypes(blockName);
  11846. } else {
  11847. hideBlockTypes(blockName);
  11848. }
  11849. },
  11850. toggleAllVisible(nextIsChecked) {
  11851. const blockNames = Object(external_lodash_["map"])(ownProps.blockTypes, 'name');
  11852. if (nextIsChecked) {
  11853. showBlockTypes(blockNames);
  11854. } else {
  11855. hideBlockTypes(blockNames);
  11856. }
  11857. }
  11858. };
  11859. })])(BlockManagerCategory));
  11860. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/manager.js
  11861. /**
  11862. * External dependencies
  11863. */
  11864. /**
  11865. * WordPress dependencies
  11866. */
  11867. /**
  11868. * Internal dependencies
  11869. */
  11870. function BlockManager({
  11871. search,
  11872. setState,
  11873. blockTypes,
  11874. categories,
  11875. hasBlockSupport,
  11876. isMatchingSearchTerm,
  11877. numberOfHiddenBlocks
  11878. }) {
  11879. // Filtering occurs here (as opposed to `withSelect`) to avoid
  11880. // wasted renders by consequence of `Array#filter` producing
  11881. // a new value reference on each call.
  11882. blockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || Object(external_lodash_["includes"])(blockType.parent, 'core/post-content')));
  11883. return Object(external_wp_element_["createElement"])("div", {
  11884. className: "edit-post-manage-blocks-modal__content"
  11885. }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
  11886. type: "search",
  11887. label: Object(external_wp_i18n_["__"])('Search for a block'),
  11888. value: search,
  11889. onChange: nextSearch => setState({
  11890. search: nextSearch
  11891. }),
  11892. className: "edit-post-manage-blocks-modal__search"
  11893. }), !!numberOfHiddenBlocks && Object(external_wp_element_["createElement"])("div", {
  11894. className: "edit-post-manage-blocks-modal__disabled-blocks-count"
  11895. }, Object(external_wp_i18n_["sprintf"])(
  11896. /* translators: %d: number of blocks. */
  11897. Object(external_wp_i18n_["_n"])('%d block is disabled.', '%d blocks are disabled.', numberOfHiddenBlocks), numberOfHiddenBlocks)), Object(external_wp_element_["createElement"])("div", {
  11898. tabIndex: "0",
  11899. role: "region",
  11900. "aria-label": Object(external_wp_i18n_["__"])('Available block types'),
  11901. className: "edit-post-manage-blocks-modal__results"
  11902. }, blockTypes.length === 0 && Object(external_wp_element_["createElement"])("p", {
  11903. className: "edit-post-manage-blocks-modal__no-results"
  11904. }, Object(external_wp_i18n_["__"])('No blocks found.')), categories.map(category => Object(external_wp_element_["createElement"])(manage_blocks_modal_category, {
  11905. key: category.slug,
  11906. title: category.title,
  11907. blockTypes: Object(external_lodash_["filter"])(blockTypes, {
  11908. category: category.slug
  11909. })
  11910. })), Object(external_wp_element_["createElement"])(manage_blocks_modal_category, {
  11911. title: Object(external_wp_i18n_["__"])('Uncategorized'),
  11912. blockTypes: Object(external_lodash_["filter"])(blockTypes, ({
  11913. category
  11914. }) => !category)
  11915. })));
  11916. }
  11917. /* harmony default export */ var manage_blocks_modal_manager = (Object(external_wp_compose_["compose"])([Object(external_wp_compose_["withState"])({
  11918. search: ''
  11919. }), Object(external_wp_data_["withSelect"])(select => {
  11920. const {
  11921. getBlockTypes,
  11922. getCategories,
  11923. hasBlockSupport,
  11924. isMatchingSearchTerm
  11925. } = select(external_wp_blocks_["store"]);
  11926. const {
  11927. getPreference
  11928. } = select(store["a" /* store */]);
  11929. const hiddenBlockTypes = getPreference('hiddenBlockTypes');
  11930. const numberOfHiddenBlocks = Object(external_lodash_["isArray"])(hiddenBlockTypes) && hiddenBlockTypes.length;
  11931. return {
  11932. blockTypes: getBlockTypes(),
  11933. categories: getCategories(),
  11934. hasBlockSupport,
  11935. isMatchingSearchTerm,
  11936. numberOfHiddenBlocks
  11937. };
  11938. })])(BlockManager));
  11939. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/manage-blocks-modal/index.js
  11940. /**
  11941. * WordPress dependencies
  11942. */
  11943. /**
  11944. * Internal dependencies
  11945. */
  11946. /**
  11947. * Unique identifier for Manage Blocks modal.
  11948. *
  11949. * @type {string}
  11950. */
  11951. const manage_blocks_modal_MODAL_NAME = 'edit-post/manage-blocks';
  11952. function ManageBlocksModal({
  11953. isActive,
  11954. closeModal
  11955. }) {
  11956. if (!isActive) {
  11957. return null;
  11958. }
  11959. return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
  11960. className: "edit-post-manage-blocks-modal",
  11961. title: Object(external_wp_i18n_["__"])('Block Manager'),
  11962. closeLabel: Object(external_wp_i18n_["__"])('Close'),
  11963. onRequestClose: closeModal
  11964. }, Object(external_wp_element_["createElement"])(manage_blocks_modal_manager, null));
  11965. }
  11966. /* harmony default export */ var manage_blocks_modal = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => {
  11967. const {
  11968. isModalActive
  11969. } = select(store["a" /* store */]);
  11970. return {
  11971. isActive: isModalActive(manage_blocks_modal_MODAL_NAME)
  11972. };
  11973. }), Object(external_wp_data_["withDispatch"])(dispatch => {
  11974. const {
  11975. closeModal
  11976. } = dispatch(store["a" /* store */]);
  11977. return {
  11978. closeModal
  11979. };
  11980. })])(ManageBlocksModal));
  11981. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/section.js
  11982. const Section = ({
  11983. description,
  11984. title,
  11985. children
  11986. }) => Object(external_wp_element_["createElement"])("section", {
  11987. className: "edit-post-preferences-modal__section"
  11988. }, Object(external_wp_element_["createElement"])("h2", {
  11989. className: "edit-post-preferences-modal__section-title"
  11990. }, title), description && Object(external_wp_element_["createElement"])("p", {
  11991. className: "edit-post-preferences-modal__section-description"
  11992. }, description), children);
  11993. /* harmony default export */ var preferences_modal_section = (Section);
  11994. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/options/index.js + 6 modules
  11995. var preferences_modal_options = __webpack_require__("Y5n4");
  11996. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js
  11997. /**
  11998. * External dependencies
  11999. */
  12000. /**
  12001. * WordPress dependencies
  12002. */
  12003. /**
  12004. * Internal dependencies
  12005. */
  12006. function MetaBoxesSection({
  12007. areCustomFieldsRegistered,
  12008. metaBoxes,
  12009. ...sectionProps
  12010. }) {
  12011. // The 'Custom Fields' meta box is a special case that we handle separately.
  12012. const thirdPartyMetaBoxes = Object(external_lodash_["filter"])(metaBoxes, ({
  12013. id
  12014. }) => id !== 'postcustom');
  12015. if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
  12016. return null;
  12017. }
  12018. return Object(external_wp_element_["createElement"])(preferences_modal_section, sectionProps, areCustomFieldsRegistered && Object(external_wp_element_["createElement"])(preferences_modal_options["a" /* EnableCustomFieldsOption */], {
  12019. label: Object(external_wp_i18n_["__"])('Custom fields')
  12020. }), Object(external_lodash_["map"])(thirdPartyMetaBoxes, ({
  12021. id,
  12022. title
  12023. }) => Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12024. key: id,
  12025. label: title,
  12026. panelName: `meta-box-${id}`
  12027. })));
  12028. }
  12029. /* harmony default export */ var meta_boxes_section = (Object(external_wp_data_["withSelect"])(select => {
  12030. const {
  12031. getEditorSettings
  12032. } = select('core/editor');
  12033. const {
  12034. getAllMetaBoxes
  12035. } = select(store["a" /* store */]);
  12036. return {
  12037. // This setting should not live in the block editor's store.
  12038. areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined,
  12039. metaBoxes: getAllMetaBoxes()
  12040. };
  12041. })(MetaBoxesSection));
  12042. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js
  12043. /**
  12044. * External dependencies
  12045. */
  12046. /**
  12047. * WordPress dependencies
  12048. */
  12049. /**
  12050. * Internal dependencies
  12051. */
  12052. const preferences_modal_MODAL_NAME = 'edit-post/preferences';
  12053. const PREFERENCES_MENU = 'preferences-menu';
  12054. function PreferencesModal() {
  12055. const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
  12056. const {
  12057. closeModal
  12058. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12059. const {
  12060. isModalActive,
  12061. isViewable
  12062. } = Object(external_wp_data_["useSelect"])(select => {
  12063. const {
  12064. getEditedPostAttribute
  12065. } = select(external_wp_editor_["store"]);
  12066. const {
  12067. getPostType
  12068. } = select(external_wp_coreData_["store"]);
  12069. const postType = getPostType(getEditedPostAttribute('type'));
  12070. return {
  12071. isModalActive: select(store["a" /* store */]).isModalActive(preferences_modal_MODAL_NAME),
  12072. isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false)
  12073. };
  12074. }, []);
  12075. const showBlockBreadcrumbsOption = Object(external_wp_data_["useSelect"])(select => {
  12076. const {
  12077. getEditorSettings
  12078. } = select(external_wp_editor_["store"]);
  12079. const {
  12080. getEditorMode,
  12081. isFeatureActive
  12082. } = select(store["a" /* store */]);
  12083. const mode = getEditorMode();
  12084. const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
  12085. const hasReducedUI = isFeatureActive('reducedUI');
  12086. return !hasReducedUI && isLargeViewport && isRichEditingEnabled && mode === 'visual';
  12087. }, [isLargeViewport]);
  12088. const sections = Object(external_wp_element_["useMemo"])(() => [{
  12089. name: 'general',
  12090. tabLabel: Object(external_wp_i18n_["__"])('General'),
  12091. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isLargeViewport && Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12092. title: Object(external_wp_i18n_["__"])('Choose your own experience')
  12093. }, Object(external_wp_element_["createElement"])(preferences_modal_options["e" /* EnablePublishSidebarOption */], {
  12094. help: Object(external_wp_i18n_["__"])('Review settings such as categories and tags.'),
  12095. label: Object(external_wp_i18n_["__"])('Include pre-publish checklist')
  12096. })), Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12097. title: Object(external_wp_i18n_["__"])('Decide what to focus on')
  12098. }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12099. featureName: "reducedUI",
  12100. help: Object(external_wp_i18n_["__"])('Compacts options and outlines in the toolbar.'),
  12101. label: Object(external_wp_i18n_["__"])('Reduce the interface')
  12102. }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12103. featureName: "focusMode",
  12104. help: Object(external_wp_i18n_["__"])('Highlights the current block and fades other content.'),
  12105. label: Object(external_wp_i18n_["__"])('Spotlight mode')
  12106. }), showBlockBreadcrumbsOption && Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12107. featureName: "showBlockBreadcrumbs",
  12108. help: Object(external_wp_i18n_["__"])('Shows block breadcrumbs at the bottom of the editor.'),
  12109. label: Object(external_wp_i18n_["__"])('Display block breadcrumbs')
  12110. })))
  12111. }, {
  12112. name: 'appearance',
  12113. tabLabel: Object(external_wp_i18n_["__"])('Appearance'),
  12114. content: Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12115. title: Object(external_wp_i18n_["__"])('Choose the way it looks')
  12116. }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12117. featureName: "showIconLabels",
  12118. help: Object(external_wp_i18n_["__"])('Shows text instead of icons in toolbar.'),
  12119. label: Object(external_wp_i18n_["__"])('Display button labels')
  12120. }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12121. featureName: "themeStyles",
  12122. help: Object(external_wp_i18n_["__"])('Make the editor look like your theme.'),
  12123. label: Object(external_wp_i18n_["__"])('Use theme styles')
  12124. }))
  12125. }, {
  12126. name: 'blocks',
  12127. tabLabel: Object(external_wp_i18n_["__"])('Blocks'),
  12128. content: Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12129. title: Object(external_wp_i18n_["__"])('Choose how you interact with blocks')
  12130. }, Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12131. featureName: "mostUsedBlocks",
  12132. help: Object(external_wp_i18n_["__"])('Places the most frequent blocks in the block library.'),
  12133. label: Object(external_wp_i18n_["__"])('Show most used blocks')
  12134. }), Object(external_wp_element_["createElement"])(preferences_modal_options["b" /* EnableFeature */], {
  12135. featureName: "keepCaretInsideBlock",
  12136. help: Object(external_wp_i18n_["__"])('Aids screen readers by stopping text caret from leaving blocks.'),
  12137. label: Object(external_wp_i18n_["__"])('Contain text cursor inside block')
  12138. }))
  12139. }, {
  12140. name: 'panels',
  12141. tabLabel: Object(external_wp_i18n_["__"])('Panels'),
  12142. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12143. title: Object(external_wp_i18n_["__"])('Document settings'),
  12144. description: Object(external_wp_i18n_["__"])('Choose what displays in the panel.')
  12145. }, Object(external_wp_element_["createElement"])(preferences_modal_options["d" /* EnablePluginDocumentSettingPanelOption */].Slot, null), isViewable && Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12146. label: Object(external_wp_i18n_["__"])('Permalink'),
  12147. panelName: "post-link"
  12148. }), isViewable && Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12149. label: Object(external_wp_i18n_["__"])('Template'),
  12150. panelName: "template"
  12151. }), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomies"], {
  12152. taxonomyWrapper: (content, taxonomy) => Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12153. label: Object(external_lodash_["get"])(taxonomy, ['labels', 'menu_name']),
  12154. panelName: `taxonomy-panel-${taxonomy.slug}`
  12155. })
  12156. }), Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImageCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12157. label: Object(external_wp_i18n_["__"])('Featured image'),
  12158. panelName: "featured-image"
  12159. })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerptCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12160. label: Object(external_wp_i18n_["__"])('Excerpt'),
  12161. panelName: "post-excerpt"
  12162. })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], {
  12163. supportKeys: ['comments', 'trackbacks']
  12164. }, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12165. label: Object(external_wp_i18n_["__"])('Discussion'),
  12166. panelName: "discussion-panel"
  12167. })), Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesCheck"], null, Object(external_wp_element_["createElement"])(preferences_modal_options["c" /* EnablePanelOption */], {
  12168. label: Object(external_wp_i18n_["__"])('Page attributes'),
  12169. panelName: "page-attributes"
  12170. }))), Object(external_wp_element_["createElement"])(preferences_modal_section, {
  12171. title: Object(external_wp_i18n_["__"])('Additional'),
  12172. description: Object(external_wp_i18n_["__"])('Add extra areas to the editor.')
  12173. }, Object(external_wp_element_["createElement"])(meta_boxes_section, null)))
  12174. }], [isViewable, isLargeViewport, showBlockBreadcrumbsOption]); // This is also used to sync the two different rendered components
  12175. // between small and large viewports.
  12176. const [activeMenu, setActiveMenu] = Object(external_wp_element_["useState"])(PREFERENCES_MENU);
  12177. /**
  12178. * Create helper objects from `sections` for easier data handling.
  12179. * `tabs` is used for creating the `TabPanel` and `sectionsContentMap`
  12180. * is used for easier access to active tab's content.
  12181. */
  12182. const {
  12183. tabs,
  12184. sectionsContentMap
  12185. } = Object(external_wp_element_["useMemo"])(() => sections.reduce((accumulator, {
  12186. name,
  12187. tabLabel: title,
  12188. content
  12189. }) => {
  12190. accumulator.tabs.push({
  12191. name,
  12192. title
  12193. });
  12194. accumulator.sectionsContentMap[name] = content;
  12195. return accumulator;
  12196. }, {
  12197. tabs: [],
  12198. sectionsContentMap: {}
  12199. }), [sections]);
  12200. const getCurrentTab = Object(external_wp_element_["useCallback"])(tab => sectionsContentMap[tab.name] || null, [sectionsContentMap]);
  12201. if (!isModalActive) {
  12202. return null;
  12203. }
  12204. let modalContent; // We render different components based on the viewport size.
  12205. if (isLargeViewport) {
  12206. modalContent = Object(external_wp_element_["createElement"])(external_wp_components_["TabPanel"], {
  12207. className: "edit-post-preferences__tabs",
  12208. tabs: tabs,
  12209. initialTabName: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
  12210. onSelect: setActiveMenu,
  12211. orientation: "vertical"
  12212. }, getCurrentTab);
  12213. } else {
  12214. modalContent = Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigation"], {
  12215. activeMenu: activeMenu,
  12216. onActivateMenu: setActiveMenu
  12217. }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationMenu"], {
  12218. menu: PREFERENCES_MENU
  12219. }, tabs.map(tab => {
  12220. return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationItem"], {
  12221. key: tab.name,
  12222. title: tab.title,
  12223. navigateToMenu: tab.name
  12224. });
  12225. })), sections.map(section => {
  12226. return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationMenu"], {
  12227. key: `${section.name}-menu`,
  12228. menu: section.name,
  12229. title: section.tabLabel,
  12230. parentMenu: PREFERENCES_MENU
  12231. }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNavigationItem"], null, section.content));
  12232. }));
  12233. }
  12234. return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
  12235. className: "edit-post-preferences-modal",
  12236. title: Object(external_wp_i18n_["__"])('Preferences'),
  12237. closeLabel: Object(external_wp_i18n_["__"])('Close'),
  12238. onRequestClose: closeModal
  12239. }, modalContent);
  12240. }
  12241. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js
  12242. /**
  12243. * WordPress dependencies
  12244. */
  12245. /**
  12246. * Returns the Post's Edit URL.
  12247. *
  12248. * @param {number} postId Post ID.
  12249. *
  12250. * @return {string} Post edit URL.
  12251. */
  12252. function getPostEditURL(postId) {
  12253. return Object(external_wp_url_["addQueryArgs"])('post.php', {
  12254. post: postId,
  12255. action: 'edit'
  12256. });
  12257. }
  12258. /**
  12259. * Returns the Post's Trashed URL.
  12260. *
  12261. * @param {number} postId Post ID.
  12262. * @param {string} postType Post Type.
  12263. *
  12264. * @return {string} Post trashed URL.
  12265. */
  12266. function getPostTrashedURL(postId, postType) {
  12267. return Object(external_wp_url_["addQueryArgs"])('edit.php', {
  12268. trashed: 1,
  12269. post_type: postType,
  12270. ids: postId
  12271. });
  12272. }
  12273. class browser_url_BrowserURL extends external_wp_element_["Component"] {
  12274. constructor() {
  12275. super(...arguments);
  12276. this.state = {
  12277. historyId: null
  12278. };
  12279. }
  12280. componentDidUpdate(prevProps) {
  12281. const {
  12282. postId,
  12283. postStatus,
  12284. postType,
  12285. isSavingPost
  12286. } = this.props;
  12287. const {
  12288. historyId
  12289. } = this.state; // Posts are still dirty while saving so wait for saving to finish
  12290. // to avoid the unsaved changes warning when trashing posts.
  12291. if (postStatus === 'trash' && !isSavingPost) {
  12292. this.setTrashURL(postId, postType);
  12293. return;
  12294. }
  12295. if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) {
  12296. this.setBrowserURL(postId);
  12297. }
  12298. }
  12299. /**
  12300. * Navigates the browser to the post trashed URL to show a notice about the trashed post.
  12301. *
  12302. * @param {number} postId Post ID.
  12303. * @param {string} postType Post Type.
  12304. */
  12305. setTrashURL(postId, postType) {
  12306. window.location.href = getPostTrashedURL(postId, postType);
  12307. }
  12308. /**
  12309. * Replaces the browser URL with a post editor link for the given post ID.
  12310. *
  12311. * Note it is important that, since this function may be called when the
  12312. * editor first loads, the result generated `getPostEditURL` matches that
  12313. * produced by the server. Otherwise, the URL will change unexpectedly.
  12314. *
  12315. * @param {number} postId Post ID for which to generate post editor URL.
  12316. */
  12317. setBrowserURL(postId) {
  12318. window.history.replaceState({
  12319. id: postId
  12320. }, 'Post ' + postId, getPostEditURL(postId));
  12321. this.setState(() => ({
  12322. historyId: postId
  12323. }));
  12324. }
  12325. render() {
  12326. return null;
  12327. }
  12328. }
  12329. /* harmony default export */ var browser_url = (Object(external_wp_data_["withSelect"])(select => {
  12330. const {
  12331. getCurrentPost,
  12332. isSavingPost
  12333. } = select('core/editor');
  12334. const post = getCurrentPost();
  12335. let {
  12336. id,
  12337. status,
  12338. type
  12339. } = post;
  12340. const isTemplate = ['wp_template', 'wp_template_part'].includes(type);
  12341. if (isTemplate) {
  12342. id = post.wp_id;
  12343. }
  12344. return {
  12345. postId: id,
  12346. postStatus: status,
  12347. postType: type,
  12348. isSavingPost: isSavingPost()
  12349. };
  12350. })(browser_url_BrowserURL));
  12351. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
  12352. var wordpress = __webpack_require__("wduq");
  12353. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/fullscreen-mode-close/index.js
  12354. /**
  12355. * External dependencies
  12356. */
  12357. /**
  12358. * WordPress dependencies
  12359. */
  12360. /**
  12361. * Internal dependencies
  12362. */
  12363. function FullscreenModeClose({
  12364. showTooltip,
  12365. icon,
  12366. href
  12367. }) {
  12368. const {
  12369. isActive,
  12370. isRequestingSiteIcon,
  12371. postType,
  12372. siteIconUrl
  12373. } = Object(external_wp_data_["useSelect"])(select => {
  12374. const {
  12375. getCurrentPostType
  12376. } = select('core/editor');
  12377. const {
  12378. isFeatureActive
  12379. } = select(store["a" /* store */]);
  12380. const {
  12381. isResolving
  12382. } = select('core/data');
  12383. const {
  12384. getEntityRecord,
  12385. getPostType
  12386. } = select('core');
  12387. const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
  12388. return {
  12389. isActive: isFeatureActive('fullscreenMode'),
  12390. isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
  12391. postType: getPostType(getCurrentPostType()),
  12392. siteIconUrl: siteData.site_icon_url
  12393. };
  12394. }, []);
  12395. if (!isActive || !postType) {
  12396. return null;
  12397. }
  12398. let buttonIcon = Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], {
  12399. size: "36px",
  12400. icon: wordpress["a" /* default */]
  12401. });
  12402. if (siteIconUrl) {
  12403. buttonIcon = Object(external_wp_element_["createElement"])("img", {
  12404. alt: Object(external_wp_i18n_["__"])('Site Icon'),
  12405. className: "edit-post-fullscreen-mode-close_site-icon",
  12406. src: siteIconUrl
  12407. });
  12408. }
  12409. if (isRequestingSiteIcon) {
  12410. buttonIcon = null;
  12411. } // Override default icon if custom icon is provided via props.
  12412. if (icon) {
  12413. buttonIcon = Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], {
  12414. size: "36px",
  12415. icon: icon
  12416. });
  12417. }
  12418. return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  12419. className: "edit-post-fullscreen-mode-close has-icon",
  12420. href: href !== null && href !== void 0 ? href : Object(external_wp_url_["addQueryArgs"])('edit.php', {
  12421. post_type: postType.slug
  12422. }),
  12423. label: Object(external_lodash_["get"])(postType, ['labels', 'view_items'], Object(external_wp_i18n_["__"])('Back')),
  12424. showTooltip: showTooltip
  12425. }, buttonIcon);
  12426. }
  12427. /* harmony default export */ var fullscreen_mode_close = (FullscreenModeClose);
  12428. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
  12429. var list_view = __webpack_require__("OzlF");
  12430. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
  12431. var plus = __webpack_require__("Q4Sy");
  12432. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/header-toolbar/index.js
  12433. /**
  12434. * WordPress dependencies
  12435. */
  12436. /**
  12437. * Internal dependencies
  12438. */
  12439. function HeaderToolbar() {
  12440. const inserterButton = Object(external_wp_element_["useRef"])();
  12441. const {
  12442. setIsInserterOpened,
  12443. setIsListViewOpened
  12444. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12445. const {
  12446. isInserterEnabled,
  12447. isInserterOpened,
  12448. isTextModeEnabled,
  12449. showIconLabels,
  12450. isListViewOpen,
  12451. listViewShortcut
  12452. } = Object(external_wp_data_["useSelect"])(select => {
  12453. const {
  12454. hasInserterItems,
  12455. getBlockRootClientId,
  12456. getBlockSelectionEnd
  12457. } = select(external_wp_blockEditor_["store"]);
  12458. const {
  12459. getEditorSettings
  12460. } = select(external_wp_editor_["store"]);
  12461. const {
  12462. getEditorMode,
  12463. isFeatureActive,
  12464. isListViewOpened
  12465. } = select(store["a" /* store */]);
  12466. const {
  12467. getShortcutRepresentation
  12468. } = select(external_wp_keyboardShortcuts_["store"]);
  12469. return {
  12470. // This setting (richEditingEnabled) should not live in the block editor's setting.
  12471. isInserterEnabled: getEditorMode() === 'visual' && getEditorSettings().richEditingEnabled && hasInserterItems(getBlockRootClientId(getBlockSelectionEnd())),
  12472. isInserterOpened: select(store["a" /* store */]).isInserterOpened(),
  12473. isTextModeEnabled: getEditorMode() === 'text',
  12474. showIconLabels: isFeatureActive('showIconLabels'),
  12475. isListViewOpen: isListViewOpened(),
  12476. listViewShortcut: getShortcutRepresentation('core/edit-post/toggle-block-navigation')
  12477. };
  12478. }, []);
  12479. const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
  12480. const isWideViewport = Object(external_wp_compose_["useViewportMatch"])('wide');
  12481. /* translators: accessibility text for the editor toolbar */
  12482. const toolbarAriaLabel = Object(external_wp_i18n_["__"])('Document tools');
  12483. const overflowItems = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12484. as: external_wp_editor_["TableOfContents"],
  12485. hasOutlineItemsDisabled: isTextModeEnabled,
  12486. repositionDropdown: showIconLabels && !isWideViewport,
  12487. showTooltip: !showIconLabels,
  12488. isTertiary: showIconLabels
  12489. }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12490. as: external_wp_components_["Button"],
  12491. className: "edit-post-header-toolbar__list-view-toggle",
  12492. icon: list_view["a" /* default */],
  12493. disabled: isTextModeEnabled,
  12494. isPressed: isListViewOpen
  12495. /* translators: button label text should, if possible, be under 16 characters. */
  12496. ,
  12497. label: Object(external_wp_i18n_["__"])('List View'),
  12498. onClick: () => setIsListViewOpened(!isListViewOpen),
  12499. shortcut: listViewShortcut,
  12500. showTooltip: !showIconLabels
  12501. }));
  12502. return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["NavigableToolbar"], {
  12503. className: "edit-post-header-toolbar",
  12504. "aria-label": toolbarAriaLabel
  12505. }, Object(external_wp_element_["createElement"])("div", {
  12506. className: "edit-post-header-toolbar__left"
  12507. }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12508. ref: inserterButton,
  12509. as: external_wp_components_["Button"],
  12510. className: "edit-post-header-toolbar__inserter-toggle",
  12511. isPrimary: true,
  12512. isPressed: isInserterOpened,
  12513. onMouseDown: event => {
  12514. event.preventDefault();
  12515. },
  12516. onClick: () => {
  12517. if (isInserterOpened) {
  12518. // Focusing the inserter button closes the inserter popover
  12519. inserterButton.current.focus();
  12520. } else {
  12521. setIsInserterOpened(true);
  12522. }
  12523. },
  12524. disabled: !isInserterEnabled,
  12525. icon: plus["a" /* default */]
  12526. /* translators: button label text should, if possible, be under 16
  12527. characters. */
  12528. ,
  12529. label: Object(external_wp_i18n_["_x"])('Toggle block inserter', 'Generic label for block inserter button'),
  12530. showTooltip: !showIconLabels
  12531. }, showIconLabels && Object(external_wp_i18n_["__"])('Add')), (isWideViewport || !showIconLabels) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isLargeViewport && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12532. as: external_wp_blockEditor_["ToolSelector"],
  12533. showTooltip: !showIconLabels,
  12534. isTertiary: showIconLabels,
  12535. disabled: isTextModeEnabled
  12536. }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12537. as: external_wp_editor_["EditorHistoryUndo"],
  12538. showTooltip: !showIconLabels,
  12539. isTertiary: showIconLabels
  12540. }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarItem"], {
  12541. as: external_wp_editor_["EditorHistoryRedo"],
  12542. showTooltip: !showIconLabels,
  12543. isTertiary: showIconLabels
  12544. }), overflowItems)));
  12545. }
  12546. /* harmony default export */ var header_toolbar = (HeaderToolbar);
  12547. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
  12548. var more_vertical = __webpack_require__("VKE3");
  12549. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/mode-switcher/index.js
  12550. /**
  12551. * WordPress dependencies
  12552. */
  12553. /**
  12554. * Internal dependencies
  12555. */
  12556. /**
  12557. * Set of available mode options.
  12558. *
  12559. * @type {Array}
  12560. */
  12561. const MODES = [{
  12562. value: 'visual',
  12563. label: Object(external_wp_i18n_["__"])('Visual editor')
  12564. }, {
  12565. value: 'text',
  12566. label: Object(external_wp_i18n_["__"])('Code editor')
  12567. }];
  12568. function ModeSwitcher() {
  12569. const {
  12570. shortcut,
  12571. isRichEditingEnabled,
  12572. isCodeEditingEnabled,
  12573. mode
  12574. } = Object(external_wp_data_["useSelect"])(select => ({
  12575. shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-mode'),
  12576. isRichEditingEnabled: select('core/editor').getEditorSettings().richEditingEnabled,
  12577. isCodeEditingEnabled: select('core/editor').getEditorSettings().codeEditingEnabled,
  12578. mode: select(store["a" /* store */]).getEditorMode()
  12579. }), []);
  12580. const {
  12581. switchEditorMode
  12582. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12583. if (!isRichEditingEnabled || !isCodeEditingEnabled) {
  12584. return null;
  12585. }
  12586. const choices = MODES.map(choice => {
  12587. if (choice.value !== mode) {
  12588. return { ...choice,
  12589. shortcut
  12590. };
  12591. }
  12592. return choice;
  12593. });
  12594. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
  12595. label: Object(external_wp_i18n_["__"])('Editor')
  12596. }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItemsChoice"], {
  12597. choices: choices,
  12598. value: mode,
  12599. onSelect: switchEditorMode
  12600. }));
  12601. }
  12602. /* harmony default export */ var mode_switcher = (ModeSwitcher);
  12603. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/preferences-menu-item/index.js
  12604. /**
  12605. * WordPress dependencies
  12606. */
  12607. /**
  12608. * Internal dependencies
  12609. */
  12610. function PreferencesMenuItem() {
  12611. const {
  12612. openModal
  12613. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12614. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  12615. onClick: () => {
  12616. openModal('edit-post/preferences');
  12617. }
  12618. }, Object(external_wp_i18n_["__"])('Preferences'));
  12619. }
  12620. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  12621. var check = __webpack_require__("RMJe");
  12622. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/feature-toggle/index.js
  12623. /**
  12624. * External dependencies
  12625. */
  12626. /**
  12627. * WordPress dependencies
  12628. */
  12629. /**
  12630. * Internal dependencies
  12631. */
  12632. function FeatureToggle({
  12633. onToggle,
  12634. isActive,
  12635. label,
  12636. info,
  12637. messageActivated,
  12638. messageDeactivated,
  12639. shortcut
  12640. }) {
  12641. const speakMessage = () => {
  12642. if (isActive) {
  12643. Object(external_wp_a11y_["speak"])(messageDeactivated || Object(external_wp_i18n_["__"])('Feature deactivated'));
  12644. } else {
  12645. Object(external_wp_a11y_["speak"])(messageActivated || Object(external_wp_i18n_["__"])('Feature activated'));
  12646. }
  12647. };
  12648. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  12649. icon: isActive && check["a" /* default */],
  12650. isSelected: isActive,
  12651. onClick: Object(external_lodash_["flow"])(onToggle, speakMessage),
  12652. role: "menuitemcheckbox",
  12653. info: info,
  12654. shortcut: shortcut
  12655. }, label);
  12656. }
  12657. /* harmony default export */ var feature_toggle = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, {
  12658. feature
  12659. }) => ({
  12660. isActive: select(store["a" /* store */]).isFeatureActive(feature)
  12661. })), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => ({
  12662. onToggle() {
  12663. dispatch(store["a" /* store */]).toggleFeature(ownProps.feature);
  12664. }
  12665. }))])(FeatureToggle));
  12666. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/writing-menu/index.js
  12667. /**
  12668. * WordPress dependencies
  12669. */
  12670. /**
  12671. * Internal dependencies
  12672. */
  12673. function WritingMenu() {
  12674. const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
  12675. if (!isLargeViewport) {
  12676. return null;
  12677. }
  12678. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
  12679. label: Object(external_wp_i18n_["_x"])('View', 'noun')
  12680. }, Object(external_wp_element_["createElement"])(feature_toggle, {
  12681. feature: "fixedToolbar",
  12682. label: Object(external_wp_i18n_["__"])('Top toolbar'),
  12683. info: Object(external_wp_i18n_["__"])('Access all block and document tools in a single place'),
  12684. messageActivated: Object(external_wp_i18n_["__"])('Top toolbar activated'),
  12685. messageDeactivated: Object(external_wp_i18n_["__"])('Top toolbar deactivated')
  12686. }), Object(external_wp_element_["createElement"])(feature_toggle, {
  12687. feature: "focusMode",
  12688. label: Object(external_wp_i18n_["__"])('Spotlight mode'),
  12689. info: Object(external_wp_i18n_["__"])('Focus on one block at a time'),
  12690. messageActivated: Object(external_wp_i18n_["__"])('Spotlight mode activated'),
  12691. messageDeactivated: Object(external_wp_i18n_["__"])('Spotlight mode deactivated')
  12692. }), Object(external_wp_element_["createElement"])(feature_toggle, {
  12693. feature: "fullscreenMode",
  12694. label: Object(external_wp_i18n_["__"])('Fullscreen mode'),
  12695. info: Object(external_wp_i18n_["__"])('Work without distraction'),
  12696. messageActivated: Object(external_wp_i18n_["__"])('Fullscreen mode activated'),
  12697. messageDeactivated: Object(external_wp_i18n_["__"])('Fullscreen mode deactivated'),
  12698. shortcut: external_wp_keycodes_["displayShortcut"].secondary('f')
  12699. }));
  12700. }
  12701. /* harmony default export */ var writing_menu = (WritingMenu);
  12702. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/more-menu/index.js
  12703. /**
  12704. * WordPress dependencies
  12705. */
  12706. /**
  12707. * Internal dependencies
  12708. */
  12709. const POPOVER_PROPS = {
  12710. className: 'edit-post-more-menu__content',
  12711. position: 'bottom left'
  12712. };
  12713. const TOGGLE_PROPS = {
  12714. tooltipPosition: 'bottom'
  12715. };
  12716. const MoreMenu = ({
  12717. showIconLabels
  12718. }) => {
  12719. const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('large');
  12720. return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], {
  12721. className: "edit-post-more-menu",
  12722. icon: more_vertical["a" /* default */]
  12723. /* translators: button label text should, if possible, be under 16 characters. */
  12724. ,
  12725. label: Object(external_wp_i18n_["__"])('Options'),
  12726. popoverProps: POPOVER_PROPS,
  12727. toggleProps: {
  12728. showTooltip: !showIconLabels,
  12729. isTertiary: showIconLabels,
  12730. ...TOGGLE_PROPS
  12731. }
  12732. }, ({
  12733. onClose
  12734. }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, showIconLabels && !isLargeViewport && Object(external_wp_element_["createElement"])(build_module["f" /* PinnedItems */].Slot, {
  12735. className: showIconLabels && 'show-icon-labels',
  12736. scope: "core/edit-post"
  12737. }), Object(external_wp_element_["createElement"])(writing_menu, null), Object(external_wp_element_["createElement"])(mode_switcher, null), Object(external_wp_element_["createElement"])(build_module["a" /* ActionItem */].Slot, {
  12738. name: "core/edit-post/plugin-more-menu",
  12739. label: Object(external_wp_i18n_["__"])('Plugins'),
  12740. as: external_wp_components_["MenuGroup"],
  12741. fillProps: {
  12742. onClick: onClose
  12743. }
  12744. }), Object(external_wp_element_["createElement"])(tools_more_menu_group.Slot, {
  12745. fillProps: {
  12746. onClose
  12747. }
  12748. }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(PreferencesMenuItem, null))));
  12749. };
  12750. /* harmony default export */ var more_menu = (MoreMenu);
  12751. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/post-publish-button-or-toggle.js
  12752. /**
  12753. * External dependencies
  12754. */
  12755. /**
  12756. * WordPress dependencies
  12757. */
  12758. /**
  12759. * Internal dependencies
  12760. */
  12761. function PostPublishButtonOrToggle({
  12762. forceIsDirty,
  12763. forceIsSaving,
  12764. hasPublishAction,
  12765. isBeingScheduled,
  12766. isPending,
  12767. isPublished,
  12768. isPublishSidebarEnabled,
  12769. isPublishSidebarOpened,
  12770. isScheduled,
  12771. togglePublishSidebar,
  12772. setEntitiesSavedStatesCallback
  12773. }) {
  12774. const IS_TOGGLE = 'toggle';
  12775. const IS_BUTTON = 'button';
  12776. const isSmallerThanMediumViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
  12777. let component;
  12778. /**
  12779. * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
  12780. *
  12781. * 1) We want to show a BUTTON when the post status is at the _final stage_
  12782. * for a particular role (see https://wordpress.org/support/article/post-status/):
  12783. *
  12784. * - is published
  12785. * - is scheduled to be published
  12786. * - is pending and can't be published (but only for viewports >= medium).
  12787. * Originally, we considered showing a button for pending posts that couldn't be published
  12788. * (for example, for an author with the contributor role). Some languages can have
  12789. * long translations for "Submit for review", so given the lack of UI real estate available
  12790. * we decided to take into account the viewport in that case.
  12791. * See: https://github.com/WordPress/gutenberg/issues/10475
  12792. *
  12793. * 2) Then, in small viewports, we'll show a TOGGLE.
  12794. *
  12795. * 3) Finally, we'll use the publish sidebar status to decide:
  12796. *
  12797. * - if it is enabled, we show a TOGGLE
  12798. * - if it is disabled, we show a BUTTON
  12799. */
  12800. if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
  12801. component = IS_BUTTON;
  12802. } else if (isSmallerThanMediumViewport) {
  12803. component = IS_TOGGLE;
  12804. } else if (isPublishSidebarEnabled) {
  12805. component = IS_TOGGLE;
  12806. } else {
  12807. component = IS_BUTTON;
  12808. }
  12809. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostPublishButton"], {
  12810. forceIsDirty: forceIsDirty,
  12811. forceIsSaving: forceIsSaving,
  12812. isOpen: isPublishSidebarOpened,
  12813. isToggle: component === IS_TOGGLE,
  12814. onToggle: togglePublishSidebar,
  12815. setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
  12816. });
  12817. }
  12818. /* harmony default export */ var post_publish_button_or_toggle = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(select => ({
  12819. hasPublishAction: Object(external_lodash_["get"])(select('core/editor').getCurrentPost(), ['_links', 'wp:action-publish'], false),
  12820. isBeingScheduled: select('core/editor').isEditedPostBeingScheduled(),
  12821. isPending: select('core/editor').isCurrentPostPending(),
  12822. isPublished: select('core/editor').isCurrentPostPublished(),
  12823. isPublishSidebarEnabled: select('core/editor').isPublishSidebarEnabled(),
  12824. isPublishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(),
  12825. isScheduled: select('core/editor').isCurrentPostScheduled()
  12826. })), Object(external_wp_data_["withDispatch"])(dispatch => {
  12827. const {
  12828. togglePublishSidebar
  12829. } = dispatch(store["a" /* store */]);
  12830. return {
  12831. togglePublishSidebar
  12832. };
  12833. }))(PostPublishButtonOrToggle));
  12834. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/device-preview/index.js
  12835. /**
  12836. * WordPress dependencies
  12837. */
  12838. /**
  12839. * Internal dependencies
  12840. */
  12841. function DevicePreview() {
  12842. const {
  12843. hasActiveMetaboxes,
  12844. isPostSaveable,
  12845. isSaving,
  12846. deviceType
  12847. } = Object(external_wp_data_["useSelect"])(select => ({
  12848. hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(),
  12849. isSaving: select(store["a" /* store */]).isSavingMetaBoxes(),
  12850. isPostSaveable: select('core/editor').isEditedPostSaveable(),
  12851. deviceType: select(store["a" /* store */]).__experimentalGetPreviewDeviceType()
  12852. }), []);
  12853. const {
  12854. __experimentalSetPreviewDeviceType: setPreviewDeviceType
  12855. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12856. return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalPreviewOptions"], {
  12857. isEnabled: isPostSaveable,
  12858. className: "edit-post-post-preview-dropdown",
  12859. deviceType: deviceType,
  12860. setDeviceType: setPreviewDeviceType
  12861. }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])("div", {
  12862. className: "edit-post-header-preview__grouping-external"
  12863. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPreviewButton"], {
  12864. className: 'edit-post-header-preview__button-external',
  12865. role: "menuitem",
  12866. forceIsAutosaveable: hasActiveMetaboxes,
  12867. forcePreviewLink: isSaving ? null : undefined,
  12868. textContent: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_i18n_["__"])('Preview in new tab'), Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], {
  12869. icon: external["a" /* default */]
  12870. }))
  12871. }))));
  12872. }
  12873. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/main-dashboard-button/index.js
  12874. /**
  12875. * WordPress dependencies
  12876. */
  12877. const slotName = '__experimentalMainDashboardButton';
  12878. const {
  12879. Fill,
  12880. Slot: MainDashboardButtonSlot
  12881. } = Object(external_wp_components_["createSlotFill"])(slotName);
  12882. const MainDashboardButton = Fill;
  12883. const main_dashboard_button_Slot = ({
  12884. children
  12885. }) => {
  12886. const slot = Object(external_wp_components_["__experimentalUseSlot"])(slotName);
  12887. const hasFills = Boolean(slot.fills && slot.fills.length);
  12888. if (!hasFills) {
  12889. return children;
  12890. }
  12891. return Object(external_wp_element_["createElement"])(MainDashboardButtonSlot, {
  12892. bubblesVirtually: true
  12893. });
  12894. };
  12895. MainDashboardButton.Slot = main_dashboard_button_Slot;
  12896. /* harmony default export */ var main_dashboard_button = (MainDashboardButton);
  12897. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
  12898. var chevron_down = __webpack_require__("NWDH");
  12899. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/delete-template.js
  12900. /**
  12901. * External dependencies
  12902. */
  12903. /**
  12904. * WordPress dependencies
  12905. */
  12906. /**
  12907. * Internal dependencies
  12908. */
  12909. function DeleteTemplate() {
  12910. const {
  12911. clearSelectedBlock
  12912. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  12913. const {
  12914. setIsEditingTemplate
  12915. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  12916. const {
  12917. getEditorSettings
  12918. } = Object(external_wp_data_["useSelect"])(external_wp_editor_["store"]);
  12919. const {
  12920. updateEditorSettings,
  12921. editPost
  12922. } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]);
  12923. const {
  12924. deleteEntityRecord
  12925. } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
  12926. const {
  12927. template
  12928. } = Object(external_wp_data_["useSelect"])(select => {
  12929. const {
  12930. isEditingTemplate,
  12931. getEditedPostTemplate
  12932. } = select(store["a" /* store */]);
  12933. const _isEditing = isEditingTemplate();
  12934. return {
  12935. template: _isEditing ? getEditedPostTemplate() : null
  12936. };
  12937. }, []);
  12938. if (!template || !template.wp_id) {
  12939. return null;
  12940. }
  12941. let templateTitle = template.slug;
  12942. if (template !== null && template !== void 0 && template.title) {
  12943. templateTitle = template.title;
  12944. }
  12945. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
  12946. className: "edit-post-template-top-area__second-menu-group"
  12947. }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  12948. className: "edit-post-template-top-area__delete-template-button",
  12949. isDestructive: true,
  12950. isSecondary: true,
  12951. "aria-label": Object(external_wp_i18n_["__"])('Delete template'),
  12952. onClick: () => {
  12953. if ( // eslint-disable-next-line no-alert
  12954. window.confirm(Object(external_wp_i18n_["sprintf"])(
  12955. /* translators: %s: template name */
  12956. Object(external_wp_i18n_["__"])('Are you sure you want to delete the %s template? It may be used by other pages or posts.'), templateTitle))) {
  12957. clearSelectedBlock();
  12958. setIsEditingTemplate(false);
  12959. editPost({
  12960. template: ''
  12961. });
  12962. const settings = getEditorSettings();
  12963. const newAvailableTemplates = Object(external_lodash_["pickBy"])(settings.availableTemplates, (_title, id) => {
  12964. return id !== template.slug;
  12965. });
  12966. updateEditorSettings({ ...settings,
  12967. availableTemplates: newAvailableTemplates
  12968. });
  12969. deleteEntityRecord('postType', 'wp_template', template.id);
  12970. }
  12971. }
  12972. }, Object(external_wp_i18n_["__"])('Delete template')));
  12973. }
  12974. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/edit-template-title.js
  12975. /**
  12976. * External dependencies
  12977. */
  12978. /**
  12979. * WordPress dependencies
  12980. */
  12981. /**
  12982. * Internal dependencies
  12983. */
  12984. function EditTemplateTitle() {
  12985. const {
  12986. template
  12987. } = Object(external_wp_data_["useSelect"])(select => {
  12988. const {
  12989. getEditedPostTemplate
  12990. } = select(store["a" /* store */]);
  12991. return {
  12992. template: getEditedPostTemplate()
  12993. };
  12994. }, []);
  12995. const {
  12996. editEntityRecord
  12997. } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
  12998. const {
  12999. getEditorSettings
  13000. } = Object(external_wp_data_["useSelect"])(external_wp_editor_["store"]);
  13001. const {
  13002. updateEditorSettings
  13003. } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]);
  13004. let templateTitle = Object(external_wp_i18n_["__"])('Default');
  13005. if (template !== null && template !== void 0 && template.title) {
  13006. templateTitle = template.title;
  13007. } else if (!!template) {
  13008. templateTitle = template.slug;
  13009. }
  13010. return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
  13011. label: Object(external_wp_i18n_["__"])('Title'),
  13012. value: templateTitle,
  13013. help: Object(external_wp_i18n_["__"])('Give the template a title that indicates its purpose, e.g. "Full Width".'),
  13014. onChange: newTitle => {
  13015. const settings = getEditorSettings();
  13016. const newAvailableTemplates = Object(external_lodash_["mapValues"])(settings.availableTemplates, (existingTitle, id) => {
  13017. if (id !== template.slug) {
  13018. return existingTitle;
  13019. }
  13020. return newTitle;
  13021. });
  13022. updateEditorSettings({ ...settings,
  13023. availableTemplates: newAvailableTemplates
  13024. });
  13025. editEntityRecord('postType', 'wp_template', template.id, {
  13026. title: newTitle
  13027. });
  13028. }
  13029. });
  13030. }
  13031. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/template-description.js
  13032. /**
  13033. * WordPress dependencies
  13034. */
  13035. /**
  13036. * Internal dependencies
  13037. */
  13038. function TemplateDescription() {
  13039. const {
  13040. description
  13041. } = Object(external_wp_data_["useSelect"])(select => {
  13042. const {
  13043. getEditedPostTemplate
  13044. } = select(store["a" /* store */]);
  13045. return {
  13046. description: getEditedPostTemplate().description
  13047. };
  13048. }, []);
  13049. if (!description) {
  13050. return null;
  13051. }
  13052. return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalText"], {
  13053. size: "body"
  13054. }, description);
  13055. }
  13056. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/template-title/index.js
  13057. /**
  13058. * WordPress dependencies
  13059. */
  13060. /**
  13061. * Internal dependencies
  13062. */
  13063. function TemplateTitle() {
  13064. const {
  13065. template,
  13066. isEditing,
  13067. title
  13068. } = Object(external_wp_data_["useSelect"])(select => {
  13069. const {
  13070. isEditingTemplate,
  13071. getEditedPostTemplate
  13072. } = select(store["a" /* store */]);
  13073. const {
  13074. getEditedPostAttribute
  13075. } = select(external_wp_editor_["store"]);
  13076. const _isEditing = isEditingTemplate();
  13077. return {
  13078. template: _isEditing ? getEditedPostTemplate() : null,
  13079. isEditing: _isEditing,
  13080. title: getEditedPostAttribute('title')
  13081. };
  13082. }, []);
  13083. const {
  13084. clearSelectedBlock
  13085. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  13086. const {
  13087. setIsEditingTemplate
  13088. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  13089. if (!isEditing || !template) {
  13090. return null;
  13091. }
  13092. let templateTitle = Object(external_wp_i18n_["__"])('Default');
  13093. if (template !== null && template !== void 0 && template.title) {
  13094. templateTitle = template.title;
  13095. } else if (!!template) {
  13096. templateTitle = template.slug;
  13097. }
  13098. return Object(external_wp_element_["createElement"])("div", {
  13099. className: "edit-post-template-top-area"
  13100. }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13101. className: "edit-post-template-post-title",
  13102. isLink: true,
  13103. showTooltip: true,
  13104. label: Object(external_wp_i18n_["sprintf"])(
  13105. /* translators: %s: Title of the referring post, e.g: "Hello World!" */
  13106. Object(external_wp_i18n_["__"])('Edit %s'), title),
  13107. onClick: () => {
  13108. clearSelectedBlock();
  13109. setIsEditingTemplate(false);
  13110. }
  13111. }, title), Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
  13112. position: "bottom center",
  13113. contentClassName: "edit-post-template-top-area__popover",
  13114. renderToggle: ({
  13115. onToggle
  13116. }) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13117. className: "edit-post-template-title",
  13118. isLink: true,
  13119. icon: chevron_down["a" /* default */],
  13120. showTooltip: true,
  13121. onClick: onToggle,
  13122. label: Object(external_wp_i18n_["__"])('Template Options')
  13123. }, templateTitle),
  13124. renderContent: () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, template.has_theme_file ? Object(external_wp_element_["createElement"])(TemplateDescription, null) : Object(external_wp_element_["createElement"])(EditTemplateTitle, null), Object(external_wp_element_["createElement"])(DeleteTemplate, null))
  13125. }));
  13126. }
  13127. /* harmony default export */ var template_title = (TemplateTitle);
  13128. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/index.js
  13129. /**
  13130. * External dependencies
  13131. */
  13132. /**
  13133. * WordPress dependencies
  13134. */
  13135. /**
  13136. * Internal dependencies
  13137. */
  13138. function Header({
  13139. setEntitiesSavedStatesCallback
  13140. }) {
  13141. const {
  13142. hasActiveMetaboxes,
  13143. isPublishSidebarOpened,
  13144. isSaving,
  13145. showIconLabels,
  13146. hasReducedUI
  13147. } = Object(external_wp_data_["useSelect"])(select => ({
  13148. hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(),
  13149. isPublishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(),
  13150. isSaving: select(store["a" /* store */]).isSavingMetaBoxes(),
  13151. showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels'),
  13152. hasReducedUI: select(store["a" /* store */]).isFeatureActive('reducedUI')
  13153. }), []);
  13154. const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('large');
  13155. const classes = classnames_default()('edit-post-header', {
  13156. 'has-reduced-ui': hasReducedUI
  13157. });
  13158. return Object(external_wp_element_["createElement"])("div", {
  13159. className: classes
  13160. }, Object(external_wp_element_["createElement"])(main_dashboard_button.Slot, null, Object(external_wp_element_["createElement"])(fullscreen_mode_close, null)), Object(external_wp_element_["createElement"])("div", {
  13161. className: "edit-post-header__toolbar"
  13162. }, Object(external_wp_element_["createElement"])(header_toolbar, null), Object(external_wp_element_["createElement"])(template_title, null)), Object(external_wp_element_["createElement"])("div", {
  13163. className: "edit-post-header__settings"
  13164. }, !isPublishSidebarOpened && // This button isn't completely hidden by the publish sidebar.
  13165. // We can't hide the whole toolbar when the publish sidebar is open because
  13166. // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
  13167. // We track that DOM node to return focus to the PostPublishButtonOrToggle
  13168. // when the publish sidebar has been closed.
  13169. Object(external_wp_element_["createElement"])(external_wp_editor_["PostSavedState"], {
  13170. forceIsDirty: hasActiveMetaboxes,
  13171. forceIsSaving: isSaving,
  13172. showIconLabels: showIconLabels
  13173. }), Object(external_wp_element_["createElement"])(DevicePreview, null), Object(external_wp_element_["createElement"])(external_wp_editor_["PostPreviewButton"], {
  13174. forceIsAutosaveable: hasActiveMetaboxes,
  13175. forcePreviewLink: isSaving ? null : undefined
  13176. }), Object(external_wp_element_["createElement"])(post_publish_button_or_toggle, {
  13177. forceIsDirty: hasActiveMetaboxes,
  13178. forceIsSaving: isSaving,
  13179. setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
  13180. }), (isLargeViewport || !showIconLabels) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module["f" /* PinnedItems */].Slot, {
  13181. scope: "core/edit-post"
  13182. }), Object(external_wp_element_["createElement"])(more_menu, {
  13183. showIconLabels: showIconLabels
  13184. })), showIconLabels && !isLargeViewport && Object(external_wp_element_["createElement"])(more_menu, {
  13185. showIconLabels: showIconLabels
  13186. })));
  13187. }
  13188. /* harmony default export */ var header = (Header);
  13189. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  13190. var library_close = __webpack_require__("w95h");
  13191. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/inserter-sidebar.js
  13192. /**
  13193. * WordPress dependencies
  13194. */
  13195. /**
  13196. * Internal dependencies
  13197. */
  13198. function InserterSidebar() {
  13199. const {
  13200. insertionPoint,
  13201. showMostUsedBlocks
  13202. } = Object(external_wp_data_["useSelect"])(select => {
  13203. const {
  13204. isFeatureActive,
  13205. __experimentalGetInsertionPoint
  13206. } = select(store["a" /* store */]);
  13207. return {
  13208. insertionPoint: __experimentalGetInsertionPoint(),
  13209. showMostUsedBlocks: isFeatureActive('mostUsedBlocks')
  13210. };
  13211. }, []);
  13212. const {
  13213. setIsInserterOpened
  13214. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  13215. const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
  13216. const [inserterDialogRef, inserterDialogProps] = Object(external_wp_compose_["__experimentalUseDialog"])({
  13217. onClose: () => setIsInserterOpened(false)
  13218. });
  13219. return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
  13220. ref: inserterDialogRef
  13221. }, inserterDialogProps, {
  13222. className: "edit-post-editor__inserter-panel"
  13223. }), Object(external_wp_element_["createElement"])("div", {
  13224. className: "edit-post-editor__inserter-panel-header"
  13225. }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13226. icon: library_close["a" /* default */],
  13227. onClick: () => setIsInserterOpened(false)
  13228. })), Object(external_wp_element_["createElement"])("div", {
  13229. className: "edit-post-editor__inserter-panel-content"
  13230. }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLibrary"], {
  13231. showMostUsedBlocks: showMostUsedBlocks,
  13232. showInserterHelpPanel: true,
  13233. shouldFocusBlock: isMobileViewport,
  13234. rootClientId: insertionPoint.rootClientId,
  13235. __experimentalInsertionIndex: insertionPoint.insertionIndex
  13236. })));
  13237. }
  13238. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  13239. var close_small = __webpack_require__("bWcr");
  13240. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/secondary-sidebar/list-view-sidebar.js
  13241. /**
  13242. * WordPress dependencies
  13243. */
  13244. /**
  13245. * Internal dependencies
  13246. */
  13247. function ListViewSidebar() {
  13248. const {
  13249. setIsListViewOpened
  13250. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  13251. const {
  13252. clearSelectedBlock,
  13253. selectBlock
  13254. } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
  13255. async function selectEditorBlock(clientId) {
  13256. await clearSelectedBlock();
  13257. selectBlock(clientId, -1);
  13258. }
  13259. const focusOnMountRef = Object(external_wp_compose_["useFocusOnMount"])('firstElement');
  13260. const focusReturnRef = Object(external_wp_compose_["useFocusReturn"])();
  13261. function closeOnEscape(event) {
  13262. if (event.keyCode === external_wp_keycodes_["ESCAPE"]) {
  13263. event.stopPropagation();
  13264. setIsListViewOpened(false);
  13265. }
  13266. }
  13267. const instanceId = Object(external_wp_compose_["useInstanceId"])(ListViewSidebar);
  13268. const labelId = `edit-post-editor__list-view-panel-label-${instanceId}`;
  13269. return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
  13270. Object(external_wp_element_["createElement"])("div", {
  13271. "aria-labelledby": labelId,
  13272. className: "edit-post-editor__list-view-panel",
  13273. onKeyDown: closeOnEscape
  13274. }, Object(external_wp_element_["createElement"])("div", {
  13275. className: "edit-post-editor__list-view-panel-header"
  13276. }, Object(external_wp_element_["createElement"])("strong", {
  13277. id: labelId
  13278. }, Object(external_wp_i18n_["__"])('List view')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13279. icon: close_small["a" /* default */],
  13280. label: Object(external_wp_i18n_["__"])('Close list view sidebar'),
  13281. onClick: () => setIsListViewOpened(false)
  13282. })), Object(external_wp_element_["createElement"])("div", {
  13283. className: "edit-post-editor__list-view-panel-content",
  13284. ref: Object(external_wp_compose_["useMergeRefs"])([focusReturnRef, focusOnMountRef])
  13285. }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockNavigationTree"], {
  13286. onSelect: selectEditorBlock,
  13287. showNestedBlocks: true,
  13288. __experimentalPersistentListViewFeatures: true
  13289. })))
  13290. );
  13291. }
  13292. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/cog.js
  13293. var cog = __webpack_require__("Cg8A");
  13294. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-header/index.js
  13295. /**
  13296. * WordPress dependencies
  13297. */
  13298. /**
  13299. * Internal dependencies
  13300. */
  13301. const SettingsHeader = ({
  13302. sidebarName
  13303. }) => {
  13304. const {
  13305. openGeneralSidebar
  13306. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  13307. const openDocumentSettings = () => openGeneralSidebar('edit-post/document');
  13308. const openBlockSettings = () => openGeneralSidebar('edit-post/block');
  13309. const {
  13310. documentLabel,
  13311. isTemplateMode
  13312. } = Object(external_wp_data_["useSelect"])(select => {
  13313. var _postType$labels$sing, _postType$labels;
  13314. const currentPostType = select('core/editor').getCurrentPostType();
  13315. const postType = select('core').getPostType(currentPostType);
  13316. return {
  13317. documentLabel: // Disable reason: Post type labels object is shaped like this.
  13318. // eslint-disable-next-line camelcase
  13319. (_postType$labels$sing = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.singular_name) !== null && _postType$labels$sing !== void 0 ? _postType$labels$sing : // translators: Default label for the Document sidebar tab, not selected.
  13320. Object(external_wp_i18n_["__"])('Document'),
  13321. isTemplateMode: select(store["a" /* store */]).isEditingTemplate()
  13322. };
  13323. }, []);
  13324. const [documentAriaLabel, documentActiveClass] = sidebarName === 'edit-post/document' ? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
  13325. [Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('%s (selected)'), documentLabel), 'is-active'] : [documentLabel, ''];
  13326. const [blockAriaLabel, blockActiveClass] = sidebarName === 'edit-post/block' ? // translators: ARIA label for the Block Settings Sidebar tab, selected.
  13327. [Object(external_wp_i18n_["__"])('Block (selected)'), 'is-active'] : // translators: ARIA label for the Block Settings Sidebar tab, not selected.
  13328. [Object(external_wp_i18n_["__"])('Block'), ''];
  13329. const [templateAriaLabel, templateActiveClass] = sidebarName === 'edit-post/document' ? [Object(external_wp_i18n_["__"])('Template (selected)'), 'is-active'] : [Object(external_wp_i18n_["__"])('Template'), ''];
  13330. /* Use a list so screen readers will announce how many tabs there are. */
  13331. return Object(external_wp_element_["createElement"])("ul", null, !isTemplateMode && Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13332. onClick: openDocumentSettings,
  13333. className: `edit-post-sidebar__panel-tab ${documentActiveClass}`,
  13334. "aria-label": documentAriaLabel,
  13335. "data-label": documentLabel
  13336. }, documentLabel)), isTemplateMode && Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13337. onClick: openDocumentSettings,
  13338. className: `edit-post-sidebar__panel-tab ${templateActiveClass}`,
  13339. "aria-label": templateAriaLabel,
  13340. "data-label": Object(external_wp_i18n_["__"])('Template')
  13341. }, Object(external_wp_i18n_["__"])('Template'))), Object(external_wp_element_["createElement"])("li", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13342. onClick: openBlockSettings,
  13343. className: `edit-post-sidebar__panel-tab ${blockActiveClass}`,
  13344. "aria-label": blockAriaLabel // translators: Data label for the Block Settings Sidebar tab.
  13345. ,
  13346. "data-label": Object(external_wp_i18n_["__"])('Block')
  13347. }, // translators: Text label for the Block Settings Sidebar tab.
  13348. Object(external_wp_i18n_["__"])('Block'))));
  13349. };
  13350. /* harmony default export */ var settings_header = (SettingsHeader);
  13351. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-visibility/index.js
  13352. /**
  13353. * WordPress dependencies
  13354. */
  13355. function PostVisibility() {
  13356. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityCheck"], {
  13357. render: ({
  13358. canEdit
  13359. }) => Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], {
  13360. className: "edit-post-post-visibility"
  13361. }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Visibility')), !canEdit && Object(external_wp_element_["createElement"])("span", null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityLabel"], null)), canEdit && Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
  13362. position: "bottom left",
  13363. contentClassName: "edit-post-post-visibility__dialog",
  13364. renderToggle: ({
  13365. isOpen,
  13366. onToggle
  13367. }) => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13368. "aria-expanded": isOpen,
  13369. className: "edit-post-post-visibility__toggle",
  13370. onClick: onToggle,
  13371. isTertiary: true
  13372. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibilityLabel"], null)),
  13373. renderContent: () => Object(external_wp_element_["createElement"])(external_wp_editor_["PostVisibility"], null)
  13374. }))
  13375. });
  13376. }
  13377. /* harmony default export */ var post_visibility = (PostVisibility);
  13378. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-trash/index.js
  13379. /**
  13380. * WordPress dependencies
  13381. */
  13382. function PostTrash() {
  13383. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTrashCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTrash"], null)));
  13384. }
  13385. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-schedule/index.js
  13386. /**
  13387. * WordPress dependencies
  13388. */
  13389. function PostSchedule() {
  13390. const anchorRef = Object(external_wp_element_["useRef"])();
  13391. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostScheduleCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], {
  13392. className: "edit-post-post-schedule",
  13393. ref: anchorRef
  13394. }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Publish')), Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
  13395. popoverProps: {
  13396. anchorRef: anchorRef.current
  13397. },
  13398. position: "bottom left",
  13399. contentClassName: "edit-post-post-schedule__dialog",
  13400. renderToggle: ({
  13401. onToggle,
  13402. isOpen
  13403. }) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  13404. className: "edit-post-post-schedule__toggle",
  13405. onClick: onToggle,
  13406. "aria-expanded": isOpen,
  13407. isTertiary: true
  13408. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostScheduleLabel"], null))),
  13409. renderContent: () => Object(external_wp_element_["createElement"])(external_wp_editor_["PostSchedule"], null)
  13410. })));
  13411. }
  13412. /* harmony default export */ var post_schedule = (PostSchedule);
  13413. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-sticky/index.js
  13414. /**
  13415. * WordPress dependencies
  13416. */
  13417. function PostSticky() {
  13418. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostStickyCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostSticky"], null)));
  13419. }
  13420. /* harmony default export */ var post_sticky = (PostSticky);
  13421. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-author/index.js
  13422. /**
  13423. * WordPress dependencies
  13424. */
  13425. function PostAuthor() {
  13426. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostAuthorCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostAuthor"], null)));
  13427. }
  13428. /* harmony default export */ var post_author = (PostAuthor);
  13429. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-slug/index.js
  13430. /**
  13431. * WordPress dependencies
  13432. */
  13433. function PostSlug() {
  13434. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostSlugCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostSlug"], null)));
  13435. }
  13436. /* harmony default export */ var post_slug = (PostSlug);
  13437. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-format/index.js
  13438. /**
  13439. * WordPress dependencies
  13440. */
  13441. function PostFormat() {
  13442. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostFormatCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostFormat"], null)));
  13443. }
  13444. /* harmony default export */ var post_format = (PostFormat);
  13445. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-pending-status/index.js
  13446. /**
  13447. * WordPress dependencies
  13448. */
  13449. function PostPendingStatus() {
  13450. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostPendingStatusCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPendingStatus"], null)));
  13451. }
  13452. /* harmony default export */ var post_pending_status = (PostPendingStatus);
  13453. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-status-info/index.js
  13454. /**
  13455. * Defines as extensibility slot for the Status & visibility panel.
  13456. */
  13457. /**
  13458. * WordPress dependencies
  13459. */
  13460. const {
  13461. Fill: plugin_post_status_info_Fill,
  13462. Slot: plugin_post_status_info_Slot
  13463. } = Object(external_wp_components_["createSlotFill"])('PluginPostStatusInfo');
  13464. /**
  13465. * Renders a row in the Status & visibility panel of the Document sidebar.
  13466. * It should be noted that this is named and implemented around the function it serves
  13467. * and not its location, which may change in future iterations.
  13468. *
  13469. * @param {Object} props Component properties.
  13470. * @param {string} [props.className] An optional class name added to the row.
  13471. * @param {WPElement} props.children Children to be rendered.
  13472. *
  13473. * @example
  13474. * ```js
  13475. * // Using ES5 syntax
  13476. * var __ = wp.i18n.__;
  13477. * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
  13478. *
  13479. * function MyPluginPostStatusInfo() {
  13480. * return wp.element.createElement(
  13481. * PluginPostStatusInfo,
  13482. * {
  13483. * className: 'my-plugin-post-status-info',
  13484. * },
  13485. * __( 'My post status info' )
  13486. * )
  13487. * }
  13488. * ```
  13489. *
  13490. * @example
  13491. * ```jsx
  13492. * // Using ESNext syntax
  13493. * import { __ } from '@wordpress/i18n';
  13494. * import { PluginPostStatusInfo } from '@wordpress/edit-post';
  13495. *
  13496. * const MyPluginPostStatusInfo = () => (
  13497. * <PluginPostStatusInfo
  13498. * className="my-plugin-post-status-info"
  13499. * >
  13500. * { __( 'My post status info' ) }
  13501. * </PluginPostStatusInfo>
  13502. * );
  13503. * ```
  13504. *
  13505. * @return {WPComponent} The component to be rendered.
  13506. */
  13507. const PluginPostStatusInfo = ({
  13508. children,
  13509. className
  13510. }) => Object(external_wp_element_["createElement"])(plugin_post_status_info_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], {
  13511. className: className
  13512. }, children));
  13513. PluginPostStatusInfo.Slot = plugin_post_status_info_Slot;
  13514. /* harmony default export */ var plugin_post_status_info = (PluginPostStatusInfo);
  13515. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-status/index.js
  13516. /**
  13517. * WordPress dependencies
  13518. */
  13519. /**
  13520. * Internal dependencies
  13521. */
  13522. /**
  13523. * Module Constants
  13524. */
  13525. const PANEL_NAME = 'post-status';
  13526. function PostStatus({
  13527. isOpened,
  13528. onTogglePanel
  13529. }) {
  13530. return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13531. className: "edit-post-post-status",
  13532. title: Object(external_wp_i18n_["__"])('Status & visibility'),
  13533. opened: isOpened,
  13534. onToggle: onTogglePanel
  13535. }, Object(external_wp_element_["createElement"])(plugin_post_status_info.Slot, null, fills => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_visibility, null), Object(external_wp_element_["createElement"])(post_schedule, null), Object(external_wp_element_["createElement"])(post_format, null), Object(external_wp_element_["createElement"])(post_sticky, null), Object(external_wp_element_["createElement"])(post_pending_status, null), Object(external_wp_element_["createElement"])(post_slug, null), Object(external_wp_element_["createElement"])(post_author, null), fills, Object(external_wp_element_["createElement"])(PostTrash, null))));
  13536. }
  13537. /* harmony default export */ var post_status = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => {
  13538. // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
  13539. // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
  13540. const {
  13541. isEditorPanelRemoved,
  13542. isEditorPanelOpened
  13543. } = select(store["a" /* store */]);
  13544. return {
  13545. isRemoved: isEditorPanelRemoved(PANEL_NAME),
  13546. isOpened: isEditorPanelOpened(PANEL_NAME)
  13547. };
  13548. }), Object(external_wp_compose_["ifCondition"])(({
  13549. isRemoved
  13550. }) => !isRemoved), Object(external_wp_data_["withDispatch"])(dispatch => ({
  13551. onTogglePanel() {
  13552. return dispatch(store["a" /* store */]).toggleEditorPanelOpened(PANEL_NAME);
  13553. }
  13554. }))])(PostStatus));
  13555. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/last-revision/index.js
  13556. /**
  13557. * WordPress dependencies
  13558. */
  13559. function LastRevision() {
  13560. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostLastRevisionCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13561. className: "edit-post-last-revision__panel"
  13562. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostLastRevision"], null)));
  13563. }
  13564. /* harmony default export */ var last_revision = (LastRevision);
  13565. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js
  13566. /**
  13567. * External dependencies
  13568. */
  13569. /**
  13570. * WordPress dependencies
  13571. */
  13572. /**
  13573. * Internal dependencies
  13574. */
  13575. function TaxonomyPanel({
  13576. isEnabled,
  13577. taxonomy,
  13578. isOpened,
  13579. onTogglePanel,
  13580. children
  13581. }) {
  13582. if (!isEnabled) {
  13583. return null;
  13584. }
  13585. const taxonomyMenuName = Object(external_lodash_["get"])(taxonomy, ['labels', 'menu_name']);
  13586. if (!taxonomyMenuName) {
  13587. return null;
  13588. }
  13589. return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13590. title: taxonomyMenuName,
  13591. opened: isOpened,
  13592. onToggle: onTogglePanel
  13593. }, children);
  13594. }
  13595. /* harmony default export */ var taxonomy_panel = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, ownProps) => {
  13596. const slug = Object(external_lodash_["get"])(ownProps.taxonomy, ['slug']);
  13597. const panelName = slug ? `taxonomy-panel-${slug}` : '';
  13598. return {
  13599. panelName,
  13600. isEnabled: slug ? select(store["a" /* store */]).isEditorPanelEnabled(panelName) : false,
  13601. isOpened: slug ? select(store["a" /* store */]).isEditorPanelOpened(panelName) : false
  13602. };
  13603. }), Object(external_wp_data_["withDispatch"])((dispatch, ownProps) => ({
  13604. onTogglePanel: () => {
  13605. dispatch(store["a" /* store */]).toggleEditorPanelOpened(ownProps.panelName);
  13606. }
  13607. })))(TaxonomyPanel));
  13608. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-taxonomies/index.js
  13609. /**
  13610. * WordPress dependencies
  13611. */
  13612. /**
  13613. * Internal dependencies
  13614. */
  13615. function PostTaxonomies() {
  13616. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomiesCheck"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTaxonomies"], {
  13617. taxonomyWrapper: (content, taxonomy) => {
  13618. return Object(external_wp_element_["createElement"])(taxonomy_panel, {
  13619. taxonomy: taxonomy
  13620. }, content);
  13621. }
  13622. }));
  13623. }
  13624. /* harmony default export */ var post_taxonomies = (PostTaxonomies);
  13625. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/featured-image/index.js
  13626. /**
  13627. * External dependencies
  13628. */
  13629. /**
  13630. * WordPress dependencies
  13631. */
  13632. /**
  13633. * Internal dependencies
  13634. */
  13635. /**
  13636. * Module Constants
  13637. */
  13638. const featured_image_PANEL_NAME = 'featured-image';
  13639. function FeaturedImage({
  13640. isEnabled,
  13641. isOpened,
  13642. postType,
  13643. onTogglePanel
  13644. }) {
  13645. if (!isEnabled) {
  13646. return null;
  13647. }
  13648. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImageCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13649. title: Object(external_lodash_["get"])(postType, ['labels', 'featured_image'], Object(external_wp_i18n_["__"])('Featured image')),
  13650. opened: isOpened,
  13651. onToggle: onTogglePanel
  13652. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostFeaturedImage"], null)));
  13653. }
  13654. const applyWithSelect = Object(external_wp_data_["withSelect"])(select => {
  13655. const {
  13656. getEditedPostAttribute
  13657. } = select('core/editor');
  13658. const {
  13659. getPostType
  13660. } = select('core');
  13661. const {
  13662. isEditorPanelEnabled,
  13663. isEditorPanelOpened
  13664. } = select(store["a" /* store */]);
  13665. return {
  13666. postType: getPostType(getEditedPostAttribute('type')),
  13667. isEnabled: isEditorPanelEnabled(featured_image_PANEL_NAME),
  13668. isOpened: isEditorPanelOpened(featured_image_PANEL_NAME)
  13669. };
  13670. });
  13671. const applyWithDispatch = Object(external_wp_data_["withDispatch"])(dispatch => {
  13672. const {
  13673. toggleEditorPanelOpened
  13674. } = dispatch(store["a" /* store */]);
  13675. return {
  13676. onTogglePanel: Object(external_lodash_["partial"])(toggleEditorPanelOpened, featured_image_PANEL_NAME)
  13677. };
  13678. });
  13679. /* harmony default export */ var featured_image = (Object(external_wp_compose_["compose"])(applyWithSelect, applyWithDispatch)(FeaturedImage));
  13680. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-excerpt/index.js
  13681. /**
  13682. * WordPress dependencies
  13683. */
  13684. /**
  13685. * Internal dependencies
  13686. */
  13687. /**
  13688. * Module Constants
  13689. */
  13690. const post_excerpt_PANEL_NAME = 'post-excerpt';
  13691. function PostExcerpt({
  13692. isEnabled,
  13693. isOpened,
  13694. onTogglePanel
  13695. }) {
  13696. if (!isEnabled) {
  13697. return null;
  13698. }
  13699. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerptCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13700. title: Object(external_wp_i18n_["__"])('Excerpt'),
  13701. opened: isOpened,
  13702. onToggle: onTogglePanel
  13703. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostExcerpt"], null)));
  13704. }
  13705. /* harmony default export */ var post_excerpt = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => {
  13706. return {
  13707. isEnabled: select(store["a" /* store */]).isEditorPanelEnabled(post_excerpt_PANEL_NAME),
  13708. isOpened: select(store["a" /* store */]).isEditorPanelOpened(post_excerpt_PANEL_NAME)
  13709. };
  13710. }), Object(external_wp_data_["withDispatch"])(dispatch => ({
  13711. onTogglePanel() {
  13712. return dispatch(store["a" /* store */]).toggleEditorPanelOpened(post_excerpt_PANEL_NAME);
  13713. }
  13714. }))])(PostExcerpt));
  13715. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/post-link/index.js
  13716. /**
  13717. * External dependencies
  13718. */
  13719. /**
  13720. * WordPress dependencies
  13721. */
  13722. /**
  13723. * Internal dependencies
  13724. */
  13725. /**
  13726. * Module Constants
  13727. */
  13728. const post_link_PANEL_NAME = 'post-link';
  13729. function PostLink({
  13730. isOpened,
  13731. onTogglePanel,
  13732. isEditable,
  13733. postLink,
  13734. permalinkPrefix,
  13735. permalinkSuffix,
  13736. editPermalink,
  13737. forceEmptyField,
  13738. setState,
  13739. postSlug,
  13740. postTypeLabel
  13741. }) {
  13742. let prefixElement, postNameElement, suffixElement;
  13743. if (isEditable) {
  13744. prefixElement = permalinkPrefix && Object(external_wp_element_["createElement"])("span", {
  13745. className: "edit-post-post-link__link-prefix"
  13746. }, permalinkPrefix);
  13747. postNameElement = postSlug && Object(external_wp_element_["createElement"])("span", {
  13748. className: "edit-post-post-link__link-post-name"
  13749. }, postSlug);
  13750. suffixElement = permalinkSuffix && Object(external_wp_element_["createElement"])("span", {
  13751. className: "edit-post-post-link__link-suffix"
  13752. }, permalinkSuffix);
  13753. }
  13754. return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13755. title: Object(external_wp_i18n_["__"])('Permalink'),
  13756. opened: isOpened,
  13757. onToggle: onTogglePanel
  13758. }, isEditable && Object(external_wp_element_["createElement"])("div", {
  13759. className: "editor-post-link"
  13760. }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
  13761. label: Object(external_wp_i18n_["__"])('URL Slug'),
  13762. value: forceEmptyField ? '' : postSlug,
  13763. onChange: newValue => {
  13764. editPermalink(newValue); // When we delete the field the permalink gets
  13765. // reverted to the original value.
  13766. // The forceEmptyField logic allows the user to have
  13767. // the field temporarily empty while typing.
  13768. if (!newValue) {
  13769. if (!forceEmptyField) {
  13770. setState({
  13771. forceEmptyField: true
  13772. });
  13773. }
  13774. return;
  13775. }
  13776. if (forceEmptyField) {
  13777. setState({
  13778. forceEmptyField: false
  13779. });
  13780. }
  13781. },
  13782. onBlur: event => {
  13783. editPermalink(Object(external_wp_editor_["cleanForSlug"])(event.target.value));
  13784. if (forceEmptyField) {
  13785. setState({
  13786. forceEmptyField: false
  13787. });
  13788. }
  13789. }
  13790. }), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('The last part of the URL.'), ' ', Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], {
  13791. href: "https://wordpress.org/support/article/writing-posts/#post-field-descriptions"
  13792. }, Object(external_wp_i18n_["__"])('Read about permalinks')))), Object(external_wp_element_["createElement"])("h3", {
  13793. className: "edit-post-post-link__preview-label"
  13794. }, postTypeLabel || Object(external_wp_i18n_["__"])('View post')), Object(external_wp_element_["createElement"])("div", {
  13795. className: "edit-post-post-link__preview-link-container"
  13796. }, Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], {
  13797. className: "edit-post-post-link__link",
  13798. href: postLink,
  13799. target: "_blank"
  13800. }, isEditable ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, prefixElement, postNameElement, suffixElement) : postLink)));
  13801. }
  13802. /* harmony default export */ var post_link = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => {
  13803. const {
  13804. isPermalinkEditable,
  13805. getCurrentPost,
  13806. isCurrentPostPublished,
  13807. getPermalinkParts,
  13808. getEditedPostAttribute,
  13809. getEditedPostSlug
  13810. } = select('core/editor');
  13811. const {
  13812. isEditorPanelEnabled,
  13813. isEditorPanelOpened
  13814. } = select(store["a" /* store */]);
  13815. const {
  13816. getPostType
  13817. } = select('core');
  13818. const {
  13819. link
  13820. } = getCurrentPost();
  13821. const postTypeName = getEditedPostAttribute('type');
  13822. const postType = getPostType(postTypeName);
  13823. const permalinkParts = getPermalinkParts();
  13824. return {
  13825. postLink: link,
  13826. isEditable: isPermalinkEditable(),
  13827. isPublished: isCurrentPostPublished(),
  13828. isOpened: isEditorPanelOpened(post_link_PANEL_NAME),
  13829. isEnabled: isEditorPanelEnabled(post_link_PANEL_NAME),
  13830. isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false),
  13831. postSlug: Object(external_wp_url_["safeDecodeURIComponent"])(getEditedPostSlug()),
  13832. postTypeLabel: Object(external_lodash_["get"])(postType, ['labels', 'view_item']),
  13833. hasPermalinkParts: !!permalinkParts,
  13834. permalinkPrefix: permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts.prefix,
  13835. permalinkSuffix: permalinkParts === null || permalinkParts === void 0 ? void 0 : permalinkParts.suffix
  13836. };
  13837. }), Object(external_wp_compose_["ifCondition"])(({
  13838. isEnabled,
  13839. postLink,
  13840. isViewable,
  13841. hasPermalinkParts
  13842. }) => {
  13843. return isEnabled && postLink && isViewable && hasPermalinkParts;
  13844. }), Object(external_wp_data_["withDispatch"])(dispatch => {
  13845. const {
  13846. toggleEditorPanelOpened
  13847. } = dispatch(store["a" /* store */]);
  13848. const {
  13849. editPost
  13850. } = dispatch('core/editor');
  13851. return {
  13852. onTogglePanel: () => toggleEditorPanelOpened(post_link_PANEL_NAME),
  13853. editPermalink: newSlug => {
  13854. editPost({
  13855. slug: newSlug
  13856. });
  13857. }
  13858. };
  13859. }), Object(external_wp_compose_["withState"])({
  13860. forceEmptyField: false
  13861. })])(PostLink));
  13862. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/discussion-panel/index.js
  13863. /**
  13864. * WordPress dependencies
  13865. */
  13866. /**
  13867. * Internal dependencies
  13868. */
  13869. /**
  13870. * Module Constants
  13871. */
  13872. const discussion_panel_PANEL_NAME = 'discussion-panel';
  13873. function DiscussionPanel({
  13874. isEnabled,
  13875. isOpened,
  13876. onTogglePanel
  13877. }) {
  13878. if (!isEnabled) {
  13879. return null;
  13880. }
  13881. return Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], {
  13882. supportKeys: ['comments', 'trackbacks']
  13883. }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13884. title: Object(external_wp_i18n_["__"])('Discussion'),
  13885. opened: isOpened,
  13886. onToggle: onTogglePanel
  13887. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], {
  13888. supportKeys: "comments"
  13889. }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostComments"], null))), Object(external_wp_element_["createElement"])(external_wp_editor_["PostTypeSupportCheck"], {
  13890. supportKeys: "trackbacks"
  13891. }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PostPingbacks"], null)))));
  13892. }
  13893. /* harmony default export */ var discussion_panel = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])(select => {
  13894. return {
  13895. isEnabled: select(store["a" /* store */]).isEditorPanelEnabled(discussion_panel_PANEL_NAME),
  13896. isOpened: select(store["a" /* store */]).isEditorPanelOpened(discussion_panel_PANEL_NAME)
  13897. };
  13898. }), Object(external_wp_data_["withDispatch"])(dispatch => ({
  13899. onTogglePanel() {
  13900. return dispatch(store["a" /* store */]).toggleEditorPanelOpened(discussion_panel_PANEL_NAME);
  13901. }
  13902. }))])(DiscussionPanel));
  13903. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/page-attributes/index.js
  13904. /**
  13905. * External dependencies
  13906. */
  13907. /**
  13908. * WordPress dependencies
  13909. */
  13910. /**
  13911. * Internal dependencies
  13912. */
  13913. /**
  13914. * Module Constants
  13915. */
  13916. const page_attributes_PANEL_NAME = 'page-attributes';
  13917. function PageAttributes() {
  13918. const {
  13919. isEnabled,
  13920. isOpened,
  13921. postType
  13922. } = Object(external_wp_data_["useSelect"])(select => {
  13923. const {
  13924. getEditedPostAttribute
  13925. } = select(external_wp_editor_["store"]);
  13926. const {
  13927. isEditorPanelEnabled,
  13928. isEditorPanelOpened
  13929. } = select(store["a" /* store */]);
  13930. const {
  13931. getPostType
  13932. } = select(external_wp_coreData_["store"]);
  13933. return {
  13934. isEnabled: isEditorPanelEnabled(page_attributes_PANEL_NAME),
  13935. isOpened: isEditorPanelOpened(page_attributes_PANEL_NAME),
  13936. postType: getPostType(getEditedPostAttribute('type'))
  13937. };
  13938. }, []);
  13939. const {
  13940. toggleEditorPanelOpened
  13941. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  13942. if (!isEnabled || !postType) {
  13943. return null;
  13944. }
  13945. const onTogglePanel = Object(external_lodash_["partial"])(toggleEditorPanelOpened, page_attributes_PANEL_NAME);
  13946. return Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  13947. title: Object(external_lodash_["get"])(postType, ['labels', 'attributes'], Object(external_wp_i18n_["__"])('Page attributes')),
  13948. opened: isOpened,
  13949. onToggle: onTogglePanel
  13950. }, Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesParent"], null), Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["PageAttributesOrder"], null))));
  13951. }
  13952. /* harmony default export */ var page_attributes = (PageAttributes);
  13953. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js
  13954. /**
  13955. * External dependencies
  13956. */
  13957. /**
  13958. * WordPress dependencies
  13959. */
  13960. /**
  13961. * Internal dependencies
  13962. */
  13963. class meta_boxes_area_MetaBoxesArea extends external_wp_element_["Component"] {
  13964. /**
  13965. * @inheritdoc
  13966. */
  13967. constructor() {
  13968. super(...arguments);
  13969. this.bindContainerNode = this.bindContainerNode.bind(this);
  13970. }
  13971. /**
  13972. * @inheritdoc
  13973. */
  13974. componentDidMount() {
  13975. this.form = document.querySelector('.metabox-location-' + this.props.location);
  13976. if (this.form) {
  13977. this.container.appendChild(this.form);
  13978. }
  13979. }
  13980. /**
  13981. * Get the meta box location form from the original location.
  13982. */
  13983. componentWillUnmount() {
  13984. if (this.form) {
  13985. document.querySelector('#metaboxes').appendChild(this.form);
  13986. }
  13987. }
  13988. /**
  13989. * Binds the metabox area container node.
  13990. *
  13991. * @param {Element} node DOM Node.
  13992. */
  13993. bindContainerNode(node) {
  13994. this.container = node;
  13995. }
  13996. /**
  13997. * @inheritdoc
  13998. */
  13999. render() {
  14000. const {
  14001. location,
  14002. isSaving
  14003. } = this.props;
  14004. const classes = classnames_default()('edit-post-meta-boxes-area', `is-${location}`, {
  14005. 'is-loading': isSaving
  14006. });
  14007. return Object(external_wp_element_["createElement"])("div", {
  14008. className: classes
  14009. }, isSaving && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_element_["createElement"])("div", {
  14010. className: "edit-post-meta-boxes-area__container",
  14011. ref: this.bindContainerNode
  14012. }), Object(external_wp_element_["createElement"])("div", {
  14013. className: "edit-post-meta-boxes-area__clear"
  14014. }));
  14015. }
  14016. }
  14017. /* harmony default export */ var meta_boxes_area = (Object(external_wp_data_["withSelect"])(select => {
  14018. return {
  14019. isSaving: select(store["a" /* store */]).isSavingMetaBoxes()
  14020. };
  14021. })(meta_boxes_area_MetaBoxesArea));
  14022. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js
  14023. /**
  14024. * WordPress dependencies
  14025. */
  14026. /**
  14027. * Internal dependencies
  14028. */
  14029. class meta_box_visibility_MetaBoxVisibility extends external_wp_element_["Component"] {
  14030. componentDidMount() {
  14031. this.updateDOM();
  14032. }
  14033. componentDidUpdate(prevProps) {
  14034. if (this.props.isVisible !== prevProps.isVisible) {
  14035. this.updateDOM();
  14036. }
  14037. }
  14038. updateDOM() {
  14039. const {
  14040. id,
  14041. isVisible
  14042. } = this.props;
  14043. const element = document.getElementById(id);
  14044. if (!element) {
  14045. return;
  14046. }
  14047. if (isVisible) {
  14048. element.classList.remove('is-hidden');
  14049. } else {
  14050. element.classList.add('is-hidden');
  14051. }
  14052. }
  14053. render() {
  14054. return null;
  14055. }
  14056. }
  14057. /* harmony default export */ var meta_box_visibility = (Object(external_wp_data_["withSelect"])((select, {
  14058. id
  14059. }) => ({
  14060. isVisible: select(store["a" /* store */]).isEditorPanelEnabled(`meta-box-${id}`)
  14061. }))(meta_box_visibility_MetaBoxVisibility));
  14062. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js
  14063. /**
  14064. * External dependencies
  14065. */
  14066. /**
  14067. * WordPress dependencies
  14068. */
  14069. /**
  14070. * Internal dependencies
  14071. */
  14072. function MetaBoxes({
  14073. location
  14074. }) {
  14075. const registry = Object(external_wp_data_["useRegistry"])();
  14076. const {
  14077. metaBoxes,
  14078. isVisible,
  14079. areMetaBoxesInitialized,
  14080. isEditorReady
  14081. } = Object(external_wp_data_["useSelect"])(select => {
  14082. const {
  14083. __unstableIsEditorReady
  14084. } = select(external_wp_editor_["store"]);
  14085. const {
  14086. isMetaBoxLocationVisible,
  14087. getMetaBoxesPerLocation,
  14088. areMetaBoxesInitialized: _areMetaBoxesInitialized
  14089. } = select(store["a" /* store */]);
  14090. return {
  14091. metaBoxes: getMetaBoxesPerLocation(location),
  14092. isVisible: isMetaBoxLocationVisible(location),
  14093. areMetaBoxesInitialized: _areMetaBoxesInitialized(),
  14094. isEditorReady: __unstableIsEditorReady()
  14095. };
  14096. }, [location]); // When editor is ready, initialize postboxes (wp core script) and metabox
  14097. // saving. This initializes all meta box locations, not just this specific
  14098. // one.
  14099. Object(external_wp_element_["useEffect"])(() => {
  14100. if (isEditorReady && !areMetaBoxesInitialized) {
  14101. registry.dispatch(store["a" /* store */]).initializeMetaBoxes();
  14102. }
  14103. }, [isEditorReady, areMetaBoxesInitialized]);
  14104. if (!areMetaBoxesInitialized) {
  14105. return null;
  14106. }
  14107. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["map"])(metaBoxes, ({
  14108. id
  14109. }) => Object(external_wp_element_["createElement"])(meta_box_visibility, {
  14110. key: id,
  14111. id: id
  14112. })), isVisible && Object(external_wp_element_["createElement"])(meta_boxes_area, {
  14113. location: location
  14114. }));
  14115. }
  14116. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-document-setting-panel/index.js
  14117. var plugin_document_setting_panel = __webpack_require__("xrib");
  14118. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-sidebar/index.js
  14119. /**
  14120. * WordPress dependencies
  14121. */
  14122. /**
  14123. * Internal dependencies
  14124. */
  14125. /**
  14126. * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
  14127. * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
  14128. * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
  14129. *
  14130. * ```js
  14131. * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
  14132. * ```
  14133. *
  14134. * @see PluginSidebarMoreMenuItem
  14135. *
  14136. * @param {Object} props Element props.
  14137. * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
  14138. * @param {string} [props.className] An optional class name added to the sidebar body.
  14139. * @param {string} props.title Title displayed at the top of the sidebar.
  14140. * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
  14141. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  14142. *
  14143. * @example
  14144. * ```js
  14145. * // Using ES5 syntax
  14146. * var __ = wp.i18n.__;
  14147. * var el = wp.element.createElement;
  14148. * var PanelBody = wp.components.PanelBody;
  14149. * var PluginSidebar = wp.editPost.PluginSidebar;
  14150. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  14151. *
  14152. * function MyPluginSidebar() {
  14153. * return el(
  14154. * PluginSidebar,
  14155. * {
  14156. * name: 'my-sidebar',
  14157. * title: 'My sidebar title',
  14158. * icon: moreIcon,
  14159. * },
  14160. * el(
  14161. * PanelBody,
  14162. * {},
  14163. * __( 'My sidebar content' )
  14164. * )
  14165. * );
  14166. * }
  14167. * ```
  14168. *
  14169. * @example
  14170. * ```jsx
  14171. * // Using ESNext syntax
  14172. * import { __ } from '@wordpress/i18n';
  14173. * import { PanelBody } from '@wordpress/components';
  14174. * import { PluginSidebar } from '@wordpress/edit-post';
  14175. * import { more } from '@wordpress/icons';
  14176. *
  14177. * const MyPluginSidebar = () => (
  14178. * <PluginSidebar
  14179. * name="my-sidebar"
  14180. * title="My sidebar title"
  14181. * icon={ more }
  14182. * >
  14183. * <PanelBody>
  14184. * { __( 'My sidebar content' ) }
  14185. * </PanelBody>
  14186. * </PluginSidebar>
  14187. * );
  14188. * ```
  14189. */
  14190. function PluginSidebarEditPost({
  14191. className,
  14192. ...props
  14193. }) {
  14194. const {
  14195. postTitle,
  14196. shortcut,
  14197. showIconLabels
  14198. } = Object(external_wp_data_["useSelect"])(select => {
  14199. return {
  14200. postTitle: select('core/editor').getEditedPostAttribute('title'),
  14201. shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar'),
  14202. showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels')
  14203. };
  14204. });
  14205. return Object(external_wp_element_["createElement"])(build_module["b" /* ComplementaryArea */], Object(esm_extends["a" /* default */])({
  14206. panelClassName: className,
  14207. className: "edit-post-sidebar",
  14208. smallScreenTitle: postTitle || Object(external_wp_i18n_["__"])('(no title)'),
  14209. scope: "core/edit-post",
  14210. toggleShortcut: shortcut,
  14211. showIconLabels: showIconLabels
  14212. }, props));
  14213. }
  14214. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/actions.js
  14215. /**
  14216. * External dependencies
  14217. */
  14218. /**
  14219. * WordPress dependencies
  14220. */
  14221. /**
  14222. * Internal dependencies
  14223. */
  14224. function PostTemplateActions() {
  14225. const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false);
  14226. const [title, setTitle] = Object(external_wp_element_["useState"])('');
  14227. const {
  14228. template,
  14229. supportsTemplateMode,
  14230. defaultTemplate
  14231. } = Object(external_wp_data_["useSelect"])(select => {
  14232. var _getPostType$viewable, _getPostType;
  14233. const {
  14234. getCurrentPostType,
  14235. getEditorSettings
  14236. } = select(external_wp_editor_["store"]);
  14237. const {
  14238. getPostType
  14239. } = select(external_wp_coreData_["store"]);
  14240. const {
  14241. getEditedPostTemplate
  14242. } = select(store["a" /* store */]);
  14243. const isViewable = (_getPostType$viewable = (_getPostType = getPostType(getCurrentPostType())) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
  14244. const _supportsTemplateMode = getEditorSettings().supportsTemplateMode && isViewable;
  14245. return {
  14246. template: _supportsTemplateMode && getEditedPostTemplate(),
  14247. supportsTemplateMode: _supportsTemplateMode,
  14248. defaultTemplate: getEditorSettings().defaultBlockTemplate
  14249. };
  14250. }, []);
  14251. const {
  14252. __unstableSwitchToTemplateMode
  14253. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14254. if (!supportsTemplateMode) {
  14255. return null;
  14256. }
  14257. const defaultTitle = Object(external_wp_i18n_["__"])('Custom Template');
  14258. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
  14259. className: "edit-post-template__actions"
  14260. }, !!template && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14261. isLink: true,
  14262. onClick: () => __unstableSwitchToTemplateMode()
  14263. }, Object(external_wp_i18n_["__"])('Edit')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14264. isLink: true,
  14265. onClick: () => setIsModalOpen(true)
  14266. }, Object(external_wp_i18n_["__"])('New'))), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
  14267. title: Object(external_wp_i18n_["__"])('Create custom template'),
  14268. closeLabel: Object(external_wp_i18n_["__"])('Close'),
  14269. onRequestClose: () => {
  14270. setIsModalOpen(false);
  14271. setTitle('');
  14272. },
  14273. overlayClassName: "edit-post-template__modal"
  14274. }, Object(external_wp_element_["createElement"])("form", {
  14275. onSubmit: event => {
  14276. event.preventDefault();
  14277. const newTemplateContent = defaultTemplate !== null && defaultTemplate !== void 0 ? defaultTemplate : Object(external_wp_blocks_["serialize"])([Object(external_wp_blocks_["createBlock"])('core/group', {
  14278. tagName: 'header',
  14279. layout: {
  14280. inherit: true
  14281. }
  14282. }, [Object(external_wp_blocks_["createBlock"])('core/site-title'), Object(external_wp_blocks_["createBlock"])('core/site-tagline')]), Object(external_wp_blocks_["createBlock"])('core/separator'), Object(external_wp_blocks_["createBlock"])('core/group', {
  14283. tagName: 'main'
  14284. }, [Object(external_wp_blocks_["createBlock"])('core/group', {
  14285. layout: {
  14286. inherit: true
  14287. }
  14288. }, [Object(external_wp_blocks_["createBlock"])('core/post-title')]), Object(external_wp_blocks_["createBlock"])('core/post-content', {
  14289. layout: {
  14290. inherit: true
  14291. }
  14292. })])]);
  14293. __unstableSwitchToTemplateMode({
  14294. slug: 'wp-custom-template-' + Object(external_lodash_["kebabCase"])(title || defaultTitle),
  14295. content: newTemplateContent,
  14296. title: title || defaultTitle
  14297. });
  14298. setIsModalOpen(false);
  14299. }
  14300. }, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
  14301. align: "flex-start",
  14302. gap: 8
  14303. }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
  14304. label: Object(external_wp_i18n_["__"])('Name'),
  14305. value: title,
  14306. onChange: setTitle,
  14307. placeholder: defaultTitle,
  14308. help: Object(external_wp_i18n_["__"])('Describe the purpose of the template, e.g. "Full Width". Custom templates can be applied to any post or page.')
  14309. }))), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
  14310. className: "edit-post-template__modal-actions",
  14311. justify: "flex-end",
  14312. expanded: false
  14313. }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14314. isTertiary: true,
  14315. onClick: () => {
  14316. setIsModalOpen(false);
  14317. setTitle('');
  14318. }
  14319. }, Object(external_wp_i18n_["__"])('Cancel'))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14320. isPrimary: true,
  14321. type: "submit"
  14322. }, Object(external_wp_i18n_["__"])('Create')))))));
  14323. }
  14324. /* harmony default export */ var actions = (PostTemplateActions);
  14325. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template/index.js
  14326. /**
  14327. * External dependencies
  14328. */
  14329. /**
  14330. * WordPress dependencies
  14331. */
  14332. /**
  14333. * Internal dependencies
  14334. */
  14335. /**
  14336. * Module Constants
  14337. */
  14338. const template_PANEL_NAME = 'template';
  14339. function TemplatePanel() {
  14340. const {
  14341. isEnabled,
  14342. isOpened,
  14343. selectedTemplate,
  14344. availableTemplates,
  14345. fetchedTemplates,
  14346. isViewable,
  14347. template,
  14348. supportsTemplateMode
  14349. } = Object(external_wp_data_["useSelect"])(select => {
  14350. var _getPostType$viewable, _getPostType;
  14351. const {
  14352. isEditorPanelEnabled,
  14353. isEditorPanelOpened,
  14354. getEditedPostTemplate
  14355. } = select(store["a" /* store */]);
  14356. const {
  14357. getEditedPostAttribute,
  14358. getEditorSettings,
  14359. getCurrentPostType
  14360. } = select(external_wp_editor_["store"]);
  14361. const {
  14362. getPostType,
  14363. getEntityRecords
  14364. } = select(external_wp_coreData_["store"]);
  14365. const _isViewable = (_getPostType$viewable = (_getPostType = getPostType(getCurrentPostType())) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
  14366. const _supportsTemplateMode = select(external_wp_editor_["store"]).getEditorSettings().supportsTemplateMode && _isViewable;
  14367. const wpTemplates = getEntityRecords('postType', 'wp_template', {
  14368. per_page: -1
  14369. });
  14370. const newAvailableTemplates = Object(external_lodash_["fromPairs"])((wpTemplates || []).map(({
  14371. slug,
  14372. title
  14373. }) => [slug, title.rendered]));
  14374. return {
  14375. isEnabled: isEditorPanelEnabled(template_PANEL_NAME),
  14376. isOpened: isEditorPanelOpened(template_PANEL_NAME),
  14377. selectedTemplate: getEditedPostAttribute('template'),
  14378. availableTemplates: getEditorSettings().availableTemplates,
  14379. fetchedTemplates: newAvailableTemplates,
  14380. template: _supportsTemplateMode && getEditedPostTemplate(),
  14381. isViewable: _isViewable,
  14382. supportsTemplateMode: _supportsTemplateMode
  14383. };
  14384. }, []);
  14385. const templates = Object(external_wp_element_["useMemo"])(() => {
  14386. return { ...availableTemplates,
  14387. ...fetchedTemplates
  14388. };
  14389. }, [availableTemplates, fetchedTemplates]);
  14390. const {
  14391. toggleEditorPanelOpened
  14392. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14393. const {
  14394. editPost
  14395. } = Object(external_wp_data_["useDispatch"])(external_wp_editor_["store"]);
  14396. if (!isEnabled || !isViewable || Object(external_lodash_["isEmpty"])(availableTemplates) && !supportsTemplateMode) {
  14397. return null;
  14398. }
  14399. const onTogglePanel = Object(external_lodash_["partial"])(toggleEditorPanelOpened, template_PANEL_NAME);
  14400. let panelTitle = Object(external_wp_i18n_["__"])('Template');
  14401. if (!!template) {
  14402. var _template$title;
  14403. panelTitle = Object(external_wp_i18n_["sprintf"])(
  14404. /* translators: %s: template title */
  14405. Object(external_wp_i18n_["__"])('Template: %s'), (_template$title = template === null || template === void 0 ? void 0 : template.title) !== null && _template$title !== void 0 ? _template$title : template.slug);
  14406. }
  14407. return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  14408. title: panelTitle,
  14409. opened: isOpened,
  14410. onToggle: onTogglePanel
  14411. }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
  14412. hideLabelFromVision: true,
  14413. label: Object(external_wp_i18n_["__"])('Template:'),
  14414. value: Object.keys(templates).includes(selectedTemplate) ? selectedTemplate : '',
  14415. onChange: templateSlug => {
  14416. editPost({
  14417. template: templateSlug || ''
  14418. });
  14419. },
  14420. options: Object(external_lodash_["map"])(templates, (templateName, templateSlug) => ({
  14421. value: templateSlug,
  14422. label: templateName
  14423. }))
  14424. }), Object(external_wp_element_["createElement"])(actions, null));
  14425. }
  14426. /* harmony default export */ var sidebar_template = (TemplatePanel);
  14427. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  14428. var build_module_icon = __webpack_require__("iClF");
  14429. // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
  14430. var library_layout = __webpack_require__("Civd");
  14431. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/template-summary/index.js
  14432. /**
  14433. * WordPress dependencies
  14434. */
  14435. /**
  14436. * Internal dependencies
  14437. */
  14438. function TemplateSummary() {
  14439. const template = Object(external_wp_data_["useSelect"])(select => {
  14440. const {
  14441. getEditedPostTemplate
  14442. } = select(store["a" /* store */]);
  14443. return getEditedPostTemplate();
  14444. }, []);
  14445. if (!template) {
  14446. return null;
  14447. }
  14448. return Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
  14449. align: "flex-start"
  14450. }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
  14451. icon: library_layout["a" /* default */]
  14452. })), Object(external_wp_element_["createElement"])(external_wp_components_["FlexBlock"], null, Object(external_wp_element_["createElement"])("h2", {
  14453. className: "edit-post-template-summary__title"
  14454. }, (template === null || template === void 0 ? void 0 : template.title) || (template === null || template === void 0 ? void 0 : template.slug)), Object(external_wp_element_["createElement"])("p", null, template === null || template === void 0 ? void 0 : template.description))));
  14455. }
  14456. /* harmony default export */ var template_summary = (TemplateSummary);
  14457. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/settings-sidebar/index.js
  14458. /**
  14459. * WordPress dependencies
  14460. */
  14461. /**
  14462. * Internal dependencies
  14463. */
  14464. const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_["Platform"].select({
  14465. web: true,
  14466. native: false
  14467. });
  14468. const SettingsSidebar = () => {
  14469. const {
  14470. sidebarName,
  14471. keyboardShortcut,
  14472. isTemplateMode
  14473. } = Object(external_wp_data_["useSelect"])(select => {
  14474. // The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
  14475. // sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
  14476. // If one of the two sidebars is active the component will contain the content of that sidebar.
  14477. // When neither of the the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
  14478. // component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName
  14479. // should contain the sidebar that will be active when the toggle button is pressed. If a block
  14480. // is selected, that should be edit-post/block otherwise it's edit-post/document.
  14481. let sidebar = select(build_module["g" /* store */]).getActiveComplementaryArea(store["a" /* store */].name);
  14482. if (!['edit-post/document', 'edit-post/block'].includes(sidebar)) {
  14483. if (select(external_wp_blockEditor_["store"]).getBlockSelectionStart()) {
  14484. sidebar = 'edit-post/block';
  14485. }
  14486. sidebar = 'edit-post/document';
  14487. }
  14488. const shortcut = select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-sidebar');
  14489. return {
  14490. sidebarName: sidebar,
  14491. keyboardShortcut: shortcut,
  14492. isTemplateMode: select(store["a" /* store */]).isEditingTemplate()
  14493. };
  14494. }, []);
  14495. return Object(external_wp_element_["createElement"])(PluginSidebarEditPost, {
  14496. identifier: sidebarName,
  14497. header: Object(external_wp_element_["createElement"])(settings_header, {
  14498. sidebarName: sidebarName
  14499. }),
  14500. closeLabel: Object(external_wp_i18n_["__"])('Close settings'),
  14501. headerClassName: "edit-post-sidebar__panel-tabs"
  14502. /* translators: button label text should, if possible, be under 16 characters. */
  14503. ,
  14504. title: Object(external_wp_i18n_["__"])('Settings'),
  14505. toggleShortcut: keyboardShortcut,
  14506. icon: cog["a" /* default */],
  14507. isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
  14508. }, !isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(post_status, null), Object(external_wp_element_["createElement"])(sidebar_template, null), Object(external_wp_element_["createElement"])(plugin_document_setting_panel["a" /* default */].Slot, null), Object(external_wp_element_["createElement"])(last_revision, null), Object(external_wp_element_["createElement"])(post_link, null), Object(external_wp_element_["createElement"])(post_taxonomies, null), Object(external_wp_element_["createElement"])(featured_image, null), Object(external_wp_element_["createElement"])(post_excerpt, null), Object(external_wp_element_["createElement"])(discussion_panel, null), Object(external_wp_element_["createElement"])(page_attributes, null), Object(external_wp_element_["createElement"])(MetaBoxes, {
  14509. location: "side"
  14510. })), isTemplateMode && sidebarName === 'edit-post/document' && Object(external_wp_element_["createElement"])(template_summary, null), sidebarName === 'edit-post/block' && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockInspector"], null));
  14511. };
  14512. /* harmony default export */ var settings_sidebar = (SettingsSidebar);
  14513. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js
  14514. function WelcomeGuideImage({
  14515. nonAnimatedSrc,
  14516. animatedSrc
  14517. }) {
  14518. return Object(external_wp_element_["createElement"])("picture", {
  14519. className: "edit-post-welcome-guide__image"
  14520. }, Object(external_wp_element_["createElement"])("source", {
  14521. srcSet: nonAnimatedSrc,
  14522. media: "(prefers-reduced-motion: reduce)"
  14523. }), Object(external_wp_element_["createElement"])("img", {
  14524. src: animatedSrc,
  14525. width: "312",
  14526. height: "240",
  14527. alt: ""
  14528. }));
  14529. }
  14530. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js
  14531. /**
  14532. * WordPress dependencies
  14533. */
  14534. /**
  14535. * Internal dependencies
  14536. */
  14537. function WelcomeGuideDefault() {
  14538. const {
  14539. toggleFeature
  14540. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14541. return Object(external_wp_element_["createElement"])(external_wp_components_["Guide"], {
  14542. className: "edit-post-welcome-guide",
  14543. contentLabel: Object(external_wp_i18n_["__"])('Welcome to the block editor'),
  14544. finishButtonText: Object(external_wp_i18n_["__"])('Get started'),
  14545. onFinish: () => toggleFeature('welcomeGuide'),
  14546. pages: [{
  14547. image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, {
  14548. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
  14549. animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
  14550. }),
  14551. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", {
  14552. className: "edit-post-welcome-guide__heading"
  14553. }, Object(external_wp_i18n_["__"])('Welcome to the block editor')), Object(external_wp_element_["createElement"])("p", {
  14554. className: "edit-post-welcome-guide__text"
  14555. }, Object(external_wp_i18n_["__"])('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.')))
  14556. }, {
  14557. image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, {
  14558. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
  14559. animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
  14560. }),
  14561. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", {
  14562. className: "edit-post-welcome-guide__heading"
  14563. }, Object(external_wp_i18n_["__"])('Make each block your own')), Object(external_wp_element_["createElement"])("p", {
  14564. className: "edit-post-welcome-guide__text"
  14565. }, Object(external_wp_i18n_["__"])('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')))
  14566. }, {
  14567. image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, {
  14568. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
  14569. animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
  14570. }),
  14571. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", {
  14572. className: "edit-post-welcome-guide__heading"
  14573. }, Object(external_wp_i18n_["__"])('Get to know the block library')), Object(external_wp_element_["createElement"])("p", {
  14574. className: "edit-post-welcome-guide__text"
  14575. }, Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
  14576. InserterIconImage: Object(external_wp_element_["createElement"])("img", {
  14577. alt: Object(external_wp_i18n_["__"])('inserter'),
  14578. src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
  14579. })
  14580. })))
  14581. }, {
  14582. image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, {
  14583. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
  14584. animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
  14585. }),
  14586. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", {
  14587. className: "edit-post-welcome-guide__heading"
  14588. }, Object(external_wp_i18n_["__"])('Learn how to use the block editor')), Object(external_wp_element_["createElement"])("p", {
  14589. className: "edit-post-welcome-guide__text"
  14590. }, Object(external_wp_i18n_["__"])('New to the block editor? Want to learn more about using it? '), Object(external_wp_element_["createElement"])(external_wp_components_["ExternalLink"], {
  14591. href: Object(external_wp_i18n_["__"])('https://wordpress.org/support/article/wordpress-editor/')
  14592. }, Object(external_wp_i18n_["__"])("Here's a detailed guide."))))
  14593. }]
  14594. });
  14595. }
  14596. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js
  14597. /**
  14598. * WordPress dependencies
  14599. */
  14600. /**
  14601. * Internal dependencies
  14602. */
  14603. function WelcomeGuideTemplate() {
  14604. const {
  14605. toggleFeature
  14606. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14607. return Object(external_wp_element_["createElement"])(external_wp_components_["Guide"], {
  14608. className: "edit-post-welcome-guide",
  14609. contentLabel: Object(external_wp_i18n_["__"])('Welcome to the template editor'),
  14610. finishButtonText: Object(external_wp_i18n_["__"])('Get started'),
  14611. onFinish: () => toggleFeature('welcomeGuideTemplate'),
  14612. pages: [{
  14613. image: Object(external_wp_element_["createElement"])(WelcomeGuideImage, {
  14614. nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg",
  14615. animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif"
  14616. }),
  14617. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("h1", {
  14618. className: "edit-post-welcome-guide__heading"
  14619. }, Object(external_wp_i18n_["__"])('Welcome to the template editor')), Object(external_wp_element_["createElement"])("p", {
  14620. className: "edit-post-welcome-guide__text"
  14621. }, Object(external_wp_i18n_["__"])('Templates express the layout of the site. Customize all aspects of your posts and pages using the tools of blocks and patterns.')))
  14622. }]
  14623. });
  14624. }
  14625. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js
  14626. /**
  14627. * WordPress dependencies
  14628. */
  14629. /**
  14630. * Internal dependencies
  14631. */
  14632. function WelcomeGuide() {
  14633. const {
  14634. isActive,
  14635. isTemplateMode
  14636. } = Object(external_wp_data_["useSelect"])(select => {
  14637. const {
  14638. isFeatureActive,
  14639. isEditingTemplate
  14640. } = select(store["a" /* store */]);
  14641. const _isTemplateMode = isEditingTemplate();
  14642. const feature = _isTemplateMode ? 'welcomeGuideTemplate' : 'welcomeGuide';
  14643. return {
  14644. isActive: isFeatureActive(feature),
  14645. isTemplateMode: _isTemplateMode
  14646. };
  14647. }, []);
  14648. if (!isActive) {
  14649. return null;
  14650. }
  14651. return isTemplateMode ? Object(external_wp_element_["createElement"])(WelcomeGuideTemplate, null) : Object(external_wp_element_["createElement"])(WelcomeGuideDefault, null);
  14652. }
  14653. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-post-publish-panel/index.js
  14654. /**
  14655. * WordPress dependencies
  14656. */
  14657. const {
  14658. Fill: plugin_post_publish_panel_Fill,
  14659. Slot: plugin_post_publish_panel_Slot
  14660. } = Object(external_wp_components_["createSlotFill"])('PluginPostPublishPanel');
  14661. const PluginPostPublishPanelFill = ({
  14662. children,
  14663. className,
  14664. title,
  14665. initialOpen = false,
  14666. icon
  14667. }) => Object(external_wp_element_["createElement"])(plugin_post_publish_panel_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  14668. className: className,
  14669. initialOpen: initialOpen || !title,
  14670. title: title,
  14671. icon: icon
  14672. }, children));
  14673. /**
  14674. * Renders provided content to the post-publish panel in the publish flow
  14675. * (side panel that opens after a user publishes the post).
  14676. *
  14677. * @param {Object} props Component properties.
  14678. * @param {string} [props.className] An optional class name added to the panel.
  14679. * @param {string} [props.title] Title displayed at the top of the panel.
  14680. * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
  14681. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  14682. *
  14683. * @example
  14684. * ```js
  14685. * // Using ES5 syntax
  14686. * var __ = wp.i18n.__;
  14687. * var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
  14688. *
  14689. * function MyPluginPostPublishPanel() {
  14690. * return wp.element.createElement(
  14691. * PluginPostPublishPanel,
  14692. * {
  14693. * className: 'my-plugin-post-publish-panel',
  14694. * title: __( 'My panel title' ),
  14695. * initialOpen: true,
  14696. * },
  14697. * __( 'My panel content' )
  14698. * );
  14699. * }
  14700. * ```
  14701. *
  14702. * @example
  14703. * ```jsx
  14704. * // Using ESNext syntax
  14705. * import { __ } from '@wordpress/i18n';
  14706. * import { PluginPostPublishPanel } from '@wordpress/edit-post';
  14707. *
  14708. * const MyPluginPostPublishPanel = () => (
  14709. * <PluginPostPublishPanel
  14710. * className="my-plugin-post-publish-panel"
  14711. * title={ __( 'My panel title' ) }
  14712. * initialOpen={ true }
  14713. * >
  14714. * { __( 'My panel content' ) }
  14715. * </PluginPostPublishPanel>
  14716. * );
  14717. * ```
  14718. *
  14719. * @return {WPComponent} The component to be rendered.
  14720. */
  14721. const PluginPostPublishPanel = Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => {
  14722. return {
  14723. icon: ownProps.icon || context.icon
  14724. };
  14725. }))(PluginPostPublishPanelFill);
  14726. PluginPostPublishPanel.Slot = plugin_post_publish_panel_Slot;
  14727. /* harmony default export */ var plugin_post_publish_panel = (PluginPostPublishPanel);
  14728. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/sidebar/plugin-pre-publish-panel/index.js
  14729. /**
  14730. * WordPress dependencies
  14731. */
  14732. const {
  14733. Fill: plugin_pre_publish_panel_Fill,
  14734. Slot: plugin_pre_publish_panel_Slot
  14735. } = Object(external_wp_components_["createSlotFill"])('PluginPrePublishPanel');
  14736. const PluginPrePublishPanelFill = ({
  14737. children,
  14738. className,
  14739. title,
  14740. initialOpen = false,
  14741. icon
  14742. }) => Object(external_wp_element_["createElement"])(plugin_pre_publish_panel_Fill, null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
  14743. className: className,
  14744. initialOpen: initialOpen || !title,
  14745. title: title,
  14746. icon: icon
  14747. }, children));
  14748. /**
  14749. * Renders provided content to the pre-publish side panel in the publish flow
  14750. * (side panel that opens when a user first pushes "Publish" from the main editor).
  14751. *
  14752. * @param {Object} props Component props.
  14753. * @param {string} [props.className] An optional class name added to the panel.
  14754. * @param {string} [props.title] Title displayed at the top of the panel.
  14755. * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.
  14756. * When no title is provided it is always opened.
  14757. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)
  14758. * icon slug string, or an SVG WP element, to be rendered when
  14759. * the sidebar is pinned to toolbar.
  14760. *
  14761. * @example
  14762. * ```js
  14763. * // Using ES5 syntax
  14764. * var __ = wp.i18n.__;
  14765. * var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
  14766. *
  14767. * function MyPluginPrePublishPanel() {
  14768. * return wp.element.createElement(
  14769. * PluginPrePublishPanel,
  14770. * {
  14771. * className: 'my-plugin-pre-publish-panel',
  14772. * title: __( 'My panel title' ),
  14773. * initialOpen: true,
  14774. * },
  14775. * __( 'My panel content' )
  14776. * );
  14777. * }
  14778. * ```
  14779. *
  14780. * @example
  14781. * ```jsx
  14782. * // Using ESNext syntax
  14783. * import { __ } from '@wordpress/i18n';
  14784. * import { PluginPrePublishPanel } from '@wordpress/edit-post';
  14785. *
  14786. * const MyPluginPrePublishPanel = () => (
  14787. * <PluginPrePublishPanel
  14788. * className="my-plugin-pre-publish-panel"
  14789. * title={ __( 'My panel title' ) }
  14790. * initialOpen={ true }
  14791. * >
  14792. * { __( 'My panel content' ) }
  14793. * </PluginPrePublishPanel>
  14794. * );
  14795. * ```
  14796. *
  14797. * @return {WPComponent} The component to be rendered.
  14798. */
  14799. const PluginPrePublishPanel = Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => {
  14800. return {
  14801. icon: ownProps.icon || context.icon
  14802. };
  14803. }))(PluginPrePublishPanelFill);
  14804. PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot;
  14805. /* harmony default export */ var plugin_pre_publish_panel = (PluginPrePublishPanel);
  14806. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/actions-panel.js
  14807. /**
  14808. * WordPress dependencies
  14809. */
  14810. /**
  14811. * Internal dependencies
  14812. */
  14813. const {
  14814. Fill: actions_panel_Fill,
  14815. Slot: actions_panel_Slot
  14816. } = Object(external_wp_components_["createSlotFill"])('ActionsPanel');
  14817. const ActionsPanelFill = actions_panel_Fill;
  14818. function ActionsPanel({
  14819. setEntitiesSavedStatesCallback,
  14820. closeEntitiesSavedStates,
  14821. isEntitiesSavedStatesOpen
  14822. }) {
  14823. const {
  14824. closePublishSidebar,
  14825. togglePublishSidebar
  14826. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14827. const {
  14828. publishSidebarOpened,
  14829. hasActiveMetaboxes,
  14830. isSavingMetaBoxes,
  14831. hasNonPostEntityChanges
  14832. } = Object(external_wp_data_["useSelect"])(select => {
  14833. return {
  14834. publishSidebarOpened: select(store["a" /* store */]).isPublishSidebarOpened(),
  14835. hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(),
  14836. isSavingMetaBoxes: select(store["a" /* store */]).isSavingMetaBoxes(),
  14837. hasNonPostEntityChanges: select('core/editor').hasNonPostEntityChanges()
  14838. };
  14839. }, []);
  14840. const openEntitiesSavedStates = Object(external_wp_element_["useCallback"])(() => setEntitiesSavedStatesCallback(true), []); // It is ok for these components to be unmounted when not in visual use.
  14841. // We don't want more than one present at a time, decide which to render.
  14842. let unmountableContent;
  14843. if (publishSidebarOpened) {
  14844. unmountableContent = Object(external_wp_element_["createElement"])(external_wp_editor_["PostPublishPanel"], {
  14845. onClose: closePublishSidebar,
  14846. forceIsDirty: hasActiveMetaboxes,
  14847. forceIsSaving: isSavingMetaBoxes,
  14848. PrePublishExtension: plugin_pre_publish_panel.Slot,
  14849. PostPublishExtension: plugin_post_publish_panel.Slot
  14850. });
  14851. } else if (hasNonPostEntityChanges) {
  14852. unmountableContent = Object(external_wp_element_["createElement"])("div", {
  14853. className: "edit-post-layout__toggle-entities-saved-states-panel"
  14854. }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14855. isSecondary: true,
  14856. className: "edit-post-layout__toggle-entities-saved-states-panel-button",
  14857. onClick: openEntitiesSavedStates,
  14858. "aria-expanded": false
  14859. }, Object(external_wp_i18n_["__"])('Open save panel')));
  14860. } else {
  14861. unmountableContent = Object(external_wp_element_["createElement"])("div", {
  14862. className: "edit-post-layout__toggle-publish-panel"
  14863. }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14864. isSecondary: true,
  14865. className: "edit-post-layout__toggle-publish-panel-button",
  14866. onClick: togglePublishSidebar,
  14867. "aria-expanded": false
  14868. }, Object(external_wp_i18n_["__"])('Open publish panel')));
  14869. } // Since EntitiesSavedStates controls its own panel, we can keep it
  14870. // always mounted to retain its own component state (such as checkboxes).
  14871. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, isEntitiesSavedStatesOpen && Object(external_wp_element_["createElement"])(external_wp_editor_["EntitiesSavedStates"], {
  14872. close: closeEntitiesSavedStates
  14873. }), Object(external_wp_element_["createElement"])(actions_panel_Slot, {
  14874. bubblesVirtually: true
  14875. }), !isEntitiesSavedStatesOpen && unmountableContent);
  14876. }
  14877. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
  14878. /**
  14879. * External dependencies
  14880. */
  14881. /**
  14882. * WordPress dependencies
  14883. */
  14884. /**
  14885. * Internal dependencies
  14886. */
  14887. const interfaceLabels = {
  14888. secondarySidebar: Object(external_wp_i18n_["__"])('Block library'),
  14889. /* translators: accessibility text for the editor top bar landmark region. */
  14890. header: Object(external_wp_i18n_["__"])('Editor top bar'),
  14891. /* translators: accessibility text for the editor content landmark region. */
  14892. body: Object(external_wp_i18n_["__"])('Editor content'),
  14893. /* translators: accessibility text for the editor settings landmark region. */
  14894. sidebar: Object(external_wp_i18n_["__"])('Editor settings'),
  14895. /* translators: accessibility text for the editor publish landmark region. */
  14896. actions: Object(external_wp_i18n_["__"])('Editor publish'),
  14897. /* translators: accessibility text for the editor footer landmark region. */
  14898. footer: Object(external_wp_i18n_["__"])('Editor footer')
  14899. };
  14900. function Layout({
  14901. styles
  14902. }) {
  14903. const isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<');
  14904. const isHugeViewport = Object(external_wp_compose_["useViewportMatch"])('huge', '>=');
  14905. const {
  14906. openGeneralSidebar,
  14907. closeGeneralSidebar,
  14908. setIsInserterOpened
  14909. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  14910. const {
  14911. mode,
  14912. isFullscreenActive,
  14913. isRichEditingEnabled,
  14914. sidebarIsOpened,
  14915. hasActiveMetaboxes,
  14916. hasFixedToolbar,
  14917. previousShortcut,
  14918. nextShortcut,
  14919. hasBlockSelected,
  14920. isInserterOpened,
  14921. isListViewOpened,
  14922. showIconLabels,
  14923. hasReducedUI,
  14924. showBlockBreadcrumbs,
  14925. isTemplateMode
  14926. } = Object(external_wp_data_["useSelect"])(select => {
  14927. const editorSettings = select(external_wp_editor_["store"]).getEditorSettings();
  14928. return {
  14929. isTemplateMode: select(store["a" /* store */]).isEditingTemplate(),
  14930. hasFixedToolbar: select(store["a" /* store */]).isFeatureActive('fixedToolbar'),
  14931. sidebarIsOpened: !!(select(build_module["g" /* store */]).getActiveComplementaryArea(store["a" /* store */].name) || select(store["a" /* store */]).isPublishSidebarOpened()),
  14932. isFullscreenActive: select(store["a" /* store */]).isFeatureActive('fullscreenMode'),
  14933. isInserterOpened: select(store["a" /* store */]).isInserterOpened(),
  14934. isListViewOpened: select(store["a" /* store */]).isListViewOpened(),
  14935. mode: select(store["a" /* store */]).getEditorMode(),
  14936. isRichEditingEnabled: editorSettings.richEditingEnabled,
  14937. hasActiveMetaboxes: select(store["a" /* store */]).hasMetaBoxes(),
  14938. previousShortcut: select(external_wp_keyboardShortcuts_["store"]).getAllShortcutRawKeyCombinations('core/edit-post/previous-region'),
  14939. nextShortcut: select(external_wp_keyboardShortcuts_["store"]).getAllShortcutRawKeyCombinations('core/edit-post/next-region'),
  14940. showIconLabels: select(store["a" /* store */]).isFeatureActive('showIconLabels'),
  14941. hasReducedUI: select(store["a" /* store */]).isFeatureActive('reducedUI'),
  14942. showBlockBreadcrumbs: select(store["a" /* store */]).isFeatureActive('showBlockBreadcrumbs')
  14943. };
  14944. }, []);
  14945. const className = classnames_default()('edit-post-layout', 'is-mode-' + mode, {
  14946. 'is-sidebar-opened': sidebarIsOpened,
  14947. 'has-fixed-toolbar': hasFixedToolbar,
  14948. 'has-metaboxes': hasActiveMetaboxes,
  14949. 'show-icon-labels': showIconLabels
  14950. });
  14951. const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document'); // Inserter and Sidebars are mutually exclusive
  14952. Object(external_wp_element_["useEffect"])(() => {
  14953. if (sidebarIsOpened && !isHugeViewport) {
  14954. setIsInserterOpened(false);
  14955. }
  14956. }, [sidebarIsOpened, isHugeViewport]);
  14957. Object(external_wp_element_["useEffect"])(() => {
  14958. if (isInserterOpened && !isHugeViewport) {
  14959. closeGeneralSidebar();
  14960. }
  14961. }, [isInserterOpened, isHugeViewport]); // Local state for save panel.
  14962. // Note 'truthy' callback implies an open panel.
  14963. const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = Object(external_wp_element_["useState"])(false);
  14964. const closeEntitiesSavedStates = Object(external_wp_element_["useCallback"])(arg => {
  14965. if (typeof entitiesSavedStatesCallback === 'function') {
  14966. entitiesSavedStatesCallback(arg);
  14967. }
  14968. setEntitiesSavedStatesCallback(false);
  14969. }, [entitiesSavedStatesCallback]);
  14970. const secondarySidebar = () => {
  14971. if (mode === 'visual' && isInserterOpened) {
  14972. return Object(external_wp_element_["createElement"])(InserterSidebar, null);
  14973. }
  14974. if (mode === 'visual' && isListViewOpened) {
  14975. return Object(external_wp_element_["createElement"])(external_wp_data_["AsyncModeProvider"], {
  14976. value: "true"
  14977. }, Object(external_wp_element_["createElement"])(ListViewSidebar, null));
  14978. }
  14979. return null;
  14980. };
  14981. return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(build_module["d" /* FullscreenMode */], {
  14982. isActive: isFullscreenActive
  14983. }), Object(external_wp_element_["createElement"])(browser_url, null), Object(external_wp_element_["createElement"])(external_wp_editor_["UnsavedChangesWarning"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["AutosaveMonitor"], null), Object(external_wp_element_["createElement"])(external_wp_editor_["LocalAutosaveMonitor"], null), Object(external_wp_element_["createElement"])(keyboard_shortcuts, null), Object(external_wp_element_["createElement"])(external_wp_editor_["EditorKeyboardShortcutsRegister"], null), Object(external_wp_element_["createElement"])(settings_sidebar, null), Object(external_wp_element_["createElement"])(build_module["e" /* InterfaceSkeleton */], {
  14984. className: className,
  14985. labels: interfaceLabels,
  14986. header: Object(external_wp_element_["createElement"])(header, {
  14987. setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
  14988. }),
  14989. secondarySidebar: secondarySidebar(),
  14990. sidebar: (!isMobileViewport || sidebarIsOpened) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !isMobileViewport && !sidebarIsOpened && Object(external_wp_element_["createElement"])("div", {
  14991. className: "edit-post-layout__toggle-sidebar-panel"
  14992. }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
  14993. isSecondary: true,
  14994. className: "edit-post-layout__toggle-sidebar-panel-button",
  14995. onClick: openSidebarPanel,
  14996. "aria-expanded": false
  14997. }, hasBlockSelected ? Object(external_wp_i18n_["__"])('Open block settings') : Object(external_wp_i18n_["__"])('Open document settings'))), Object(external_wp_element_["createElement"])(build_module["b" /* ComplementaryArea */].Slot, {
  14998. scope: "core/edit-post"
  14999. })),
  15000. notices: Object(external_wp_element_["createElement"])(external_wp_editor_["EditorSnackbars"], null),
  15001. content: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["EditorNotices"], null), (mode === 'text' || !isRichEditingEnabled) && Object(external_wp_element_["createElement"])(text_editor, null), isRichEditingEnabled && mode === 'visual' && Object(external_wp_element_["createElement"])(VisualEditor, {
  15002. styles: styles
  15003. }), !isTemplateMode && Object(external_wp_element_["createElement"])("div", {
  15004. className: "edit-post-layout__metaboxes"
  15005. }, Object(external_wp_element_["createElement"])(MetaBoxes, {
  15006. location: "normal"
  15007. }), Object(external_wp_element_["createElement"])(MetaBoxes, {
  15008. location: "advanced"
  15009. })), isMobileViewport && sidebarIsOpened && Object(external_wp_element_["createElement"])(external_wp_components_["ScrollLock"], null)),
  15010. footer: !hasReducedUI && showBlockBreadcrumbs && !isMobileViewport && isRichEditingEnabled && mode === 'visual' && Object(external_wp_element_["createElement"])("div", {
  15011. className: "edit-post-layout__footer"
  15012. }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockBreadcrumb"], null)),
  15013. actions: Object(external_wp_element_["createElement"])(ActionsPanel, {
  15014. closeEntitiesSavedStates: closeEntitiesSavedStates,
  15015. isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
  15016. setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
  15017. }),
  15018. shortcuts: {
  15019. previous: previousShortcut,
  15020. next: nextShortcut
  15021. }
  15022. }), Object(external_wp_element_["createElement"])(manage_blocks_modal, null), Object(external_wp_element_["createElement"])(PreferencesModal, null), Object(external_wp_element_["createElement"])(keyboard_shortcut_help_modal, null), Object(external_wp_element_["createElement"])(WelcomeGuide, null), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"].Slot, null), Object(external_wp_element_["createElement"])(external_wp_plugins_["PluginArea"], null));
  15023. }
  15024. /* harmony default export */ var components_layout = (Layout);
  15025. // EXTERNAL MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js
  15026. var constants = __webpack_require__("0dt7");
  15027. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
  15028. /**
  15029. * WordPress dependencies
  15030. */
  15031. /**
  15032. * Internal dependencies
  15033. */
  15034. /**
  15035. * This listener hook monitors for block selection and triggers the appropriate
  15036. * sidebar state.
  15037. *
  15038. * @param {number} postId The current post id.
  15039. */
  15040. const useBlockSelectionListener = postId => {
  15041. const {
  15042. hasBlockSelection,
  15043. isEditorSidebarOpened
  15044. } = Object(external_wp_data_["useSelect"])(select => ({
  15045. hasBlockSelection: !!select('core/block-editor').getBlockSelectionStart(),
  15046. isEditorSidebarOpened: select(constants["a" /* STORE_NAME */]).isEditorSidebarOpened()
  15047. }), [postId]);
  15048. const {
  15049. openGeneralSidebar
  15050. } = Object(external_wp_data_["useDispatch"])(constants["a" /* STORE_NAME */]);
  15051. Object(external_wp_element_["useEffect"])(() => {
  15052. if (!isEditorSidebarOpened) {
  15053. return;
  15054. }
  15055. if (hasBlockSelection) {
  15056. openGeneralSidebar('edit-post/block');
  15057. } else {
  15058. openGeneralSidebar('edit-post/document');
  15059. }
  15060. }, [hasBlockSelection, isEditorSidebarOpened]);
  15061. };
  15062. /**
  15063. * This listener hook monitors any change in permalink and updates the view
  15064. * post link in the admin bar.
  15065. *
  15066. * @param {number} postId
  15067. */
  15068. const useUpdatePostLinkListener = postId => {
  15069. const {
  15070. newPermalink
  15071. } = Object(external_wp_data_["useSelect"])(select => ({
  15072. newPermalink: select('core/editor').getCurrentPost().link
  15073. }), [postId]);
  15074. const nodeToUpdate = Object(external_wp_element_["useRef"])();
  15075. Object(external_wp_element_["useEffect"])(() => {
  15076. nodeToUpdate.current = document.querySelector(constants["c" /* VIEW_AS_PREVIEW_LINK_SELECTOR */]) || document.querySelector(constants["b" /* VIEW_AS_LINK_SELECTOR */]);
  15077. }, [postId]);
  15078. Object(external_wp_element_["useEffect"])(() => {
  15079. if (!newPermalink || !nodeToUpdate.current) {
  15080. return;
  15081. }
  15082. nodeToUpdate.current.setAttribute('href', newPermalink);
  15083. }, [newPermalink]);
  15084. };
  15085. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
  15086. /**
  15087. * Internal dependencies
  15088. */
  15089. /**
  15090. * Data component used for initializing the editor and re-initializes
  15091. * when postId changes or on unmount.
  15092. *
  15093. * @param {number} postId The id of the post.
  15094. * @return {null} This is a data component so does not render any ui.
  15095. */
  15096. function EditorInitialization({
  15097. postId
  15098. }) {
  15099. useBlockSelectionListener(postId);
  15100. useUpdatePostLinkListener(postId);
  15101. return null;
  15102. }
  15103. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js
  15104. /**
  15105. * External dependencies
  15106. */
  15107. /**
  15108. * WordPress dependencies
  15109. */
  15110. /**
  15111. * Internal dependencies
  15112. */
  15113. function Editor({
  15114. postId,
  15115. postType,
  15116. settings,
  15117. initialEdits,
  15118. onError,
  15119. ...props
  15120. }) {
  15121. const {
  15122. hasFixedToolbar,
  15123. focusMode,
  15124. hasReducedUI,
  15125. hasThemeStyles,
  15126. post,
  15127. preferredStyleVariations,
  15128. hiddenBlockTypes,
  15129. blockTypes,
  15130. __experimentalLocalAutosaveInterval,
  15131. keepCaretInsideBlock,
  15132. isTemplateMode,
  15133. template
  15134. } = Object(external_wp_data_["useSelect"])(select => {
  15135. var _getPostType$viewable, _getPostType;
  15136. const {
  15137. isFeatureActive,
  15138. getPreference,
  15139. __experimentalGetPreviewDeviceType,
  15140. isEditingTemplate,
  15141. getEditedPostTemplate
  15142. } = select(store["a" /* store */]);
  15143. const {
  15144. getEntityRecord,
  15145. getPostType,
  15146. getEntityRecords
  15147. } = select('core');
  15148. const {
  15149. getEditorSettings
  15150. } = select('core/editor');
  15151. const {
  15152. getBlockTypes
  15153. } = select(external_wp_blocks_["store"]);
  15154. const isTemplate = ['wp_template', 'wp_template_part'].includes(postType); // Ideally the initializeEditor function should be called using the ID of the REST endpoint.
  15155. // to avoid the special case.
  15156. let postObject;
  15157. if (isTemplate) {
  15158. const posts = getEntityRecords('postType', postType, {
  15159. wp_id: postId
  15160. });
  15161. postObject = posts === null || posts === void 0 ? void 0 : posts[0];
  15162. } else {
  15163. postObject = getEntityRecord('postType', postType, postId);
  15164. }
  15165. const supportsTemplateMode = getEditorSettings().supportsTemplateMode;
  15166. const isViewable = (_getPostType$viewable = (_getPostType = getPostType(postType)) === null || _getPostType === void 0 ? void 0 : _getPostType.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
  15167. return {
  15168. hasFixedToolbar: isFeatureActive('fixedToolbar') || __experimentalGetPreviewDeviceType() !== 'Desktop',
  15169. focusMode: isFeatureActive('focusMode'),
  15170. hasReducedUI: isFeatureActive('reducedUI'),
  15171. hasThemeStyles: isFeatureActive('themeStyles'),
  15172. preferredStyleVariations: getPreference('preferredStyleVariations'),
  15173. hiddenBlockTypes: getPreference('hiddenBlockTypes'),
  15174. blockTypes: getBlockTypes(),
  15175. __experimentalLocalAutosaveInterval: getPreference('localAutosaveInterval'),
  15176. keepCaretInsideBlock: isFeatureActive('keepCaretInsideBlock'),
  15177. isTemplateMode: isEditingTemplate(),
  15178. template: supportsTemplateMode && isViewable ? getEditedPostTemplate() : null,
  15179. post: postObject
  15180. };
  15181. });
  15182. const {
  15183. updatePreferredStyleVariations,
  15184. setIsInserterOpened
  15185. } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
  15186. const editorSettings = Object(external_wp_element_["useMemo"])(() => {
  15187. const result = { ...Object(external_lodash_["omit"])(settings, ['styles']),
  15188. __experimentalPreferredStyleVariations: {
  15189. value: preferredStyleVariations,
  15190. onChange: updatePreferredStyleVariations
  15191. },
  15192. hasFixedToolbar,
  15193. focusMode,
  15194. hasReducedUI,
  15195. __experimentalLocalAutosaveInterval,
  15196. // This is marked as experimental to give time for the quick inserter to mature.
  15197. __experimentalSetIsInserterOpened: setIsInserterOpened,
  15198. keepCaretInsideBlock
  15199. }; // Omit hidden block types if exists and non-empty.
  15200. if (Object(external_lodash_["size"])(hiddenBlockTypes) > 0) {
  15201. // Defer to passed setting for `allowedBlockTypes` if provided as
  15202. // anything other than `true` (where `true` is equivalent to allow
  15203. // all block types).
  15204. const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? Object(external_lodash_["map"])(blockTypes, 'name') : settings.allowedBlockTypes || [];
  15205. result.allowedBlockTypes = Object(external_lodash_["without"])(defaultAllowedBlockTypes, ...hiddenBlockTypes);
  15206. }
  15207. return result;
  15208. }, [settings, hasFixedToolbar, focusMode, hasReducedUI, hiddenBlockTypes, blockTypes, preferredStyleVariations, __experimentalLocalAutosaveInterval, setIsInserterOpened, updatePreferredStyleVariations, keepCaretInsideBlock]);
  15209. const styles = Object(external_wp_element_["useMemo"])(() => {
  15210. return hasThemeStyles ? settings.styles : [];
  15211. }, [settings, hasThemeStyles]);
  15212. if (!post) {
  15213. return null;
  15214. }
  15215. return Object(external_wp_element_["createElement"])(external_wp_element_["StrictMode"], null, Object(external_wp_element_["createElement"])(edit_post_settings.Provider, {
  15216. value: settings
  15217. }, Object(external_wp_element_["createElement"])(external_wp_components_["SlotFillProvider"], null, Object(external_wp_element_["createElement"])(external_wp_editor_["EditorProvider"], Object(esm_extends["a" /* default */])({
  15218. settings: editorSettings,
  15219. post: post,
  15220. initialEdits: initialEdits,
  15221. useSubRegistry: false,
  15222. __unstableTemplate: isTemplateMode ? template : undefined
  15223. }, props), Object(external_wp_element_["createElement"])(external_wp_editor_["ErrorBoundary"], {
  15224. onError: onError
  15225. }, Object(external_wp_element_["createElement"])(EditorInitialization, {
  15226. postId: postId
  15227. }), Object(external_wp_element_["createElement"])(components_layout, {
  15228. styles: styles
  15229. }), Object(external_wp_element_["createElement"])(external_wp_components_["KeyboardShortcuts"], {
  15230. shortcuts: prevent_event_discovery
  15231. })), Object(external_wp_element_["createElement"])(external_wp_editor_["PostLockedModal"], null)))));
  15232. }
  15233. /* harmony default export */ var editor = (Editor);
  15234. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js
  15235. /**
  15236. * External dependencies
  15237. */
  15238. /**
  15239. * WordPress dependencies
  15240. */
  15241. const isEverySelectedBlockAllowed = (selected, allowed) => Object(external_lodash_["difference"])(selected, allowed).length === 0;
  15242. /**
  15243. * Plugins may want to add an item to the menu either for every block
  15244. * or only for the specific ones provided in the `allowedBlocks` component property.
  15245. *
  15246. * If there are multiple blocks selected the item will be rendered if every block
  15247. * is of one allowed type (not necessarily the same).
  15248. *
  15249. * @param {string[]} selectedBlocks Array containing the names of the blocks selected
  15250. * @param {string[]} allowedBlocks Array containing the names of the blocks allowed
  15251. * @return {boolean} Whether the item will be rendered or not.
  15252. */
  15253. const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks);
  15254. /**
  15255. * Renders a new item in the block settings menu.
  15256. *
  15257. * @param {Object} props Component props.
  15258. * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.
  15259. * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
  15260. * @param {string} props.label The menu item text.
  15261. * @param {Function} props.onClick Callback function to be executed when the user click the menu item.
  15262. * @param {boolean} [props.small] Whether to render the label or not.
  15263. * @param {string} [props.role] The ARIA role for the menu item.
  15264. *
  15265. * @example
  15266. * ```js
  15267. * // Using ES5 syntax
  15268. * var __ = wp.i18n.__;
  15269. * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;
  15270. *
  15271. * function doOnClick(){
  15272. * // To be called when the user clicks the menu item.
  15273. * }
  15274. *
  15275. * function MyPluginBlockSettingsMenuItem() {
  15276. * return wp.element.createElement(
  15277. * PluginBlockSettingsMenuItem,
  15278. * {
  15279. * allowedBlocks: [ 'core/paragraph' ],
  15280. * icon: 'dashicon-name',
  15281. * label: __( 'Menu item text' ),
  15282. * onClick: doOnClick,
  15283. * }
  15284. * );
  15285. * }
  15286. * ```
  15287. *
  15288. * @example
  15289. * ```jsx
  15290. * // Using ESNext syntax
  15291. * import { __ } from '@wordpress/i18n';
  15292. * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';
  15293. *
  15294. * const doOnClick = ( ) => {
  15295. * // To be called when the user clicks the menu item.
  15296. * };
  15297. *
  15298. * const MyPluginBlockSettingsMenuItem = () => (
  15299. * <PluginBlockSettingsMenuItem
  15300. * allowedBlocks={ [ 'core/paragraph' ] }
  15301. * icon='dashicon-name'
  15302. * label={ __( 'Menu item text' ) }
  15303. * onClick={ doOnClick } />
  15304. * );
  15305. * ```
  15306. *
  15307. * @return {WPComponent} The component to be rendered.
  15308. */
  15309. const PluginBlockSettingsMenuItem = ({
  15310. allowedBlocks,
  15311. icon,
  15312. label,
  15313. onClick,
  15314. small,
  15315. role
  15316. }) => Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSettingsMenuControls"], null, ({
  15317. selectedBlocks,
  15318. onClose
  15319. }) => {
  15320. if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
  15321. return null;
  15322. }
  15323. return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
  15324. onClick: Object(external_wp_compose_["compose"])(onClick, onClose),
  15325. icon: icon,
  15326. label: small ? label : undefined,
  15327. role: role
  15328. }, !small && label);
  15329. });
  15330. /* harmony default export */ var plugin_block_settings_menu_item = (PluginBlockSettingsMenuItem);
  15331. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-more-menu-item/index.js
  15332. /**
  15333. * WordPress dependencies
  15334. */
  15335. /**
  15336. * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
  15337. * The text within the component appears as the menu item label.
  15338. *
  15339. * @param {Object} props Component properties.
  15340. * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
  15341. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
  15342. * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
  15343. * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](/packages/components/src/menu-item/README.md) component.
  15344. *
  15345. * @example
  15346. * ```js
  15347. * // Using ES5 syntax
  15348. * var __ = wp.i18n.__;
  15349. * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
  15350. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  15351. *
  15352. * function onButtonClick() {
  15353. * alert( 'Button clicked.' );
  15354. * }
  15355. *
  15356. * function MyButtonMoreMenuItem() {
  15357. * return wp.element.createElement(
  15358. * PluginMoreMenuItem,
  15359. * {
  15360. * icon: moreIcon,
  15361. * onClick: onButtonClick,
  15362. * },
  15363. * __( 'My button title' )
  15364. * );
  15365. * }
  15366. * ```
  15367. *
  15368. * @example
  15369. * ```jsx
  15370. * // Using ESNext syntax
  15371. * import { __ } from '@wordpress/i18n';
  15372. * import { PluginMoreMenuItem } from '@wordpress/edit-post';
  15373. * import { more } from '@wordpress/icons';
  15374. *
  15375. * function onButtonClick() {
  15376. * alert( 'Button clicked.' );
  15377. * }
  15378. *
  15379. * const MyButtonMoreMenuItem = () => (
  15380. * <PluginMoreMenuItem
  15381. * icon={ more }
  15382. * onClick={ onButtonClick }
  15383. * >
  15384. * { __( 'My button title' ) }
  15385. * </PluginMoreMenuItem>
  15386. * );
  15387. * ```
  15388. *
  15389. * @return {WPComponent} The component to be rendered.
  15390. */
  15391. /* harmony default export */ var plugin_more_menu_item = (Object(external_wp_compose_["compose"])(Object(external_wp_plugins_["withPluginContext"])((context, ownProps) => {
  15392. return {
  15393. icon: ownProps.icon || context.icon,
  15394. name: 'core/edit-post/plugin-more-menu'
  15395. };
  15396. }))(build_module["a" /* ActionItem */]));
  15397. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/header/plugin-sidebar-more-menu-item/index.js
  15398. /**
  15399. * WordPress dependencies
  15400. */
  15401. /**
  15402. * Renders a menu item in `Plugins` group in `More Menu` drop down,
  15403. * and can be used to activate the corresponding `PluginSidebar` component.
  15404. * The text within the component appears as the menu item label.
  15405. *
  15406. * @param {Object} props Component props.
  15407. * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
  15408. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
  15409. *
  15410. * @example
  15411. * ```js
  15412. * // Using ES5 syntax
  15413. * var __ = wp.i18n.__;
  15414. * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
  15415. * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
  15416. *
  15417. * function MySidebarMoreMenuItem() {
  15418. * return wp.element.createElement(
  15419. * PluginSidebarMoreMenuItem,
  15420. * {
  15421. * target: 'my-sidebar',
  15422. * icon: moreIcon,
  15423. * },
  15424. * __( 'My sidebar title' )
  15425. * )
  15426. * }
  15427. * ```
  15428. *
  15429. * @example
  15430. * ```jsx
  15431. * // Using ESNext syntax
  15432. * import { __ } from '@wordpress/i18n';
  15433. * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
  15434. * import { more } from '@wordpress/icons';
  15435. *
  15436. * const MySidebarMoreMenuItem = () => (
  15437. * <PluginSidebarMoreMenuItem
  15438. * target="my-sidebar"
  15439. * icon={ more }
  15440. * >
  15441. * { __( 'My sidebar title' ) }
  15442. * </PluginSidebarMoreMenuItem>
  15443. * );
  15444. * ```
  15445. *
  15446. * @return {WPComponent} The component to be rendered.
  15447. */
  15448. function PluginSidebarMoreMenuItem(props) {
  15449. return Object(external_wp_element_["createElement"])(build_module["c" /* ComplementaryAreaMoreMenuItem */] // Menu item is marked with unstable prop for backward compatibility.
  15450. // @see https://github.com/WordPress/gutenberg/issues/14457
  15451. , Object(esm_extends["a" /* default */])({
  15452. __unstableExplicitMenuItem: true,
  15453. scope: "core/edit-post"
  15454. }, props));
  15455. }
  15456. // CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js
  15457. /**
  15458. * WordPress dependencies
  15459. */
  15460. /**
  15461. * Internal dependencies
  15462. */
  15463. /**
  15464. * Reinitializes the editor after the user chooses to reboot the editor after
  15465. * an unhandled error occurs, replacing previously mounted editor element using
  15466. * an initial state from prior to the crash.
  15467. *
  15468. * @param {Object} postType Post type of the post to edit.
  15469. * @param {Object} postId ID of the post to edit.
  15470. * @param {Element} target DOM node in which editor is rendered.
  15471. * @param {?Object} settings Editor settings object.
  15472. * @param {Object} initialEdits Programmatic edits to apply initially, to be
  15473. * considered as non-user-initiated (bypass for
  15474. * unsaved changes prompt).
  15475. */
  15476. function reinitializeEditor(postType, postId, target, settings, initialEdits) {
  15477. Object(external_wp_element_["unmountComponentAtNode"])(target);
  15478. const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
  15479. Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(editor, {
  15480. settings: settings,
  15481. onError: reboot,
  15482. postId: postId,
  15483. postType: postType,
  15484. initialEdits: initialEdits,
  15485. recovery: true
  15486. }), target);
  15487. }
  15488. /**
  15489. * Initializes and returns an instance of Editor.
  15490. *
  15491. * @param {string} id Unique identifier for editor instance.
  15492. * @param {string} postType Post type of the post to edit.
  15493. * @param {Object} postId ID of the post to edit.
  15494. * @param {?Object} settings Editor settings object.
  15495. * @param {Object} initialEdits Programmatic edits to apply initially, to be
  15496. * considered as non-user-initiated (bypass for
  15497. * unsaved changes prompt).
  15498. */
  15499. function initializeEditor(id, postType, postId, settings, initialEdits) {
  15500. const target = document.getElementById(id);
  15501. const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
  15502. Object(external_wp_blockLibrary_["registerCoreBlocks"])();
  15503. if (false) {} // Show a console log warning if the browser is not in Standards rendering mode.
  15504. const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';
  15505. if (documentMode !== 'Standards') {
  15506. // eslint-disable-next-line no-console
  15507. console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");
  15508. } // This is a temporary fix for a couple of issues specific to Webkit on iOS.
  15509. // Without this hack the browser scrolls the mobile toolbar off-screen.
  15510. // Once supported in Safari we can replace this in favor of preventScroll.
  15511. // For details see issue #18632 and PR #18686
  15512. // Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
  15513. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
  15514. const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1;
  15515. if (isIphone) {
  15516. window.addEventListener('scroll', event => {
  15517. const editorScrollContainer = document.getElementsByClassName('interface-interface-skeleton__body')[0];
  15518. if (event.target === document) {
  15519. // Scroll element into view by scrolling the editor container by the same amount
  15520. // that Mobile Safari tried to scroll the html element upwards.
  15521. if (window.scrollY > 100) {
  15522. editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY;
  15523. } // Undo unwanted scroll on html element, but only in the visual editor.
  15524. if (document.getElementsByClassName('is-mode-visual')[0]) {
  15525. window.scrollTo(0, 0);
  15526. }
  15527. }
  15528. });
  15529. }
  15530. Object(external_wp_element_["render"])(Object(external_wp_element_["createElement"])(editor, {
  15531. settings: settings,
  15532. onError: reboot,
  15533. postId: postId,
  15534. postType: postType,
  15535. initialEdits: initialEdits
  15536. }), target);
  15537. }
  15538. /***/ }),
  15539. /***/ "g56x":
  15540. /***/ (function(module, exports) {
  15541. (function() { module.exports = window["wp"]["hooks"]; }());
  15542. /***/ }),
  15543. /***/ "gdqT":
  15544. /***/ (function(module, exports) {
  15545. (function() { module.exports = window["wp"]["a11y"]; }());
  15546. /***/ }),
  15547. /***/ "hF7m":
  15548. /***/ (function(module, exports) {
  15549. (function() { module.exports = window["wp"]["keyboardShortcuts"]; }());
  15550. /***/ }),
  15551. /***/ "iClF":
  15552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15553. "use strict";
  15554. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  15555. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  15556. /**
  15557. * WordPress dependencies
  15558. */
  15559. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  15560. /**
  15561. * Return an SVG icon.
  15562. *
  15563. * @param {IconProps} props icon is the SVG component to render
  15564. * size is a number specifiying the icon size in pixels
  15565. * Other props will be passed to wrapped SVG component
  15566. *
  15567. * @return {JSX.Element} Icon component
  15568. */
  15569. function Icon({
  15570. icon,
  15571. size = 24,
  15572. ...props
  15573. }) {
  15574. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
  15575. width: size,
  15576. height: size,
  15577. ...props
  15578. });
  15579. }
  15580. /* harmony default export */ __webpack_exports__["a"] = (Icon);
  15581. /***/ }),
  15582. /***/ "jSdM":
  15583. /***/ (function(module, exports) {
  15584. (function() { module.exports = window["wp"]["editor"]; }());
  15585. /***/ }),
  15586. /***/ "jZUy":
  15587. /***/ (function(module, exports) {
  15588. (function() { module.exports = window["wp"]["coreData"]; }());
  15589. /***/ }),
  15590. /***/ "l3Sj":
  15591. /***/ (function(module, exports) {
  15592. (function() { module.exports = window["wp"]["i18n"]; }());
  15593. /***/ }),
  15594. /***/ "onLe":
  15595. /***/ (function(module, exports) {
  15596. (function() { module.exports = window["wp"]["notices"]; }());
  15597. /***/ }),
  15598. /***/ "pPDe":
  15599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15600. "use strict";
  15601. var LEAF_KEY, hasWeakMap;
  15602. /**
  15603. * Arbitrary value used as key for referencing cache object in WeakMap tree.
  15604. *
  15605. * @type {Object}
  15606. */
  15607. LEAF_KEY = {};
  15608. /**
  15609. * Whether environment supports WeakMap.
  15610. *
  15611. * @type {boolean}
  15612. */
  15613. hasWeakMap = typeof WeakMap !== 'undefined';
  15614. /**
  15615. * Returns the first argument as the sole entry in an array.
  15616. *
  15617. * @param {*} value Value to return.
  15618. *
  15619. * @return {Array} Value returned as entry in array.
  15620. */
  15621. function arrayOf( value ) {
  15622. return [ value ];
  15623. }
  15624. /**
  15625. * Returns true if the value passed is object-like, or false otherwise. A value
  15626. * is object-like if it can support property assignment, e.g. object or array.
  15627. *
  15628. * @param {*} value Value to test.
  15629. *
  15630. * @return {boolean} Whether value is object-like.
  15631. */
  15632. function isObjectLike( value ) {
  15633. return !! value && 'object' === typeof value;
  15634. }
  15635. /**
  15636. * Creates and returns a new cache object.
  15637. *
  15638. * @return {Object} Cache object.
  15639. */
  15640. function createCache() {
  15641. var cache = {
  15642. clear: function() {
  15643. cache.head = null;
  15644. },
  15645. };
  15646. return cache;
  15647. }
  15648. /**
  15649. * Returns true if entries within the two arrays are strictly equal by
  15650. * reference from a starting index.
  15651. *
  15652. * @param {Array} a First array.
  15653. * @param {Array} b Second array.
  15654. * @param {number} fromIndex Index from which to start comparison.
  15655. *
  15656. * @return {boolean} Whether arrays are shallowly equal.
  15657. */
  15658. function isShallowEqual( a, b, fromIndex ) {
  15659. var i;
  15660. if ( a.length !== b.length ) {
  15661. return false;
  15662. }
  15663. for ( i = fromIndex; i < a.length; i++ ) {
  15664. if ( a[ i ] !== b[ i ] ) {
  15665. return false;
  15666. }
  15667. }
  15668. return true;
  15669. }
  15670. /**
  15671. * Returns a memoized selector function. The getDependants function argument is
  15672. * called before the memoized selector and is expected to return an immutable
  15673. * reference or array of references on which the selector depends for computing
  15674. * its own return value. The memoize cache is preserved only as long as those
  15675. * dependant references remain the same. If getDependants returns a different
  15676. * reference(s), the cache is cleared and the selector value regenerated.
  15677. *
  15678. * @param {Function} selector Selector function.
  15679. * @param {Function} getDependants Dependant getter returning an immutable
  15680. * reference or array of reference used in
  15681. * cache bust consideration.
  15682. *
  15683. * @return {Function} Memoized selector.
  15684. */
  15685. /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
  15686. var rootCache, getCache;
  15687. // Use object source as dependant if getter not provided
  15688. if ( ! getDependants ) {
  15689. getDependants = arrayOf;
  15690. }
  15691. /**
  15692. * Returns the root cache. If WeakMap is supported, this is assigned to the
  15693. * root WeakMap cache set, otherwise it is a shared instance of the default
  15694. * cache object.
  15695. *
  15696. * @return {(WeakMap|Object)} Root cache object.
  15697. */
  15698. function getRootCache() {
  15699. return rootCache;
  15700. }
  15701. /**
  15702. * Returns the cache for a given dependants array. When possible, a WeakMap
  15703. * will be used to create a unique cache for each set of dependants. This
  15704. * is feasible due to the nature of WeakMap in allowing garbage collection
  15705. * to occur on entries where the key object is no longer referenced. Since
  15706. * WeakMap requires the key to be an object, this is only possible when the
  15707. * dependant is object-like. The root cache is created as a hierarchy where
  15708. * each top-level key is the first entry in a dependants set, the value a
  15709. * WeakMap where each key is the next dependant, and so on. This continues
  15710. * so long as the dependants are object-like. If no dependants are object-
  15711. * like, then the cache is shared across all invocations.
  15712. *
  15713. * @see isObjectLike
  15714. *
  15715. * @param {Array} dependants Selector dependants.
  15716. *
  15717. * @return {Object} Cache object.
  15718. */
  15719. function getWeakMapCache( dependants ) {
  15720. var caches = rootCache,
  15721. isUniqueByDependants = true,
  15722. i, dependant, map, cache;
  15723. for ( i = 0; i < dependants.length; i++ ) {
  15724. dependant = dependants[ i ];
  15725. // Can only compose WeakMap from object-like key.
  15726. if ( ! isObjectLike( dependant ) ) {
  15727. isUniqueByDependants = false;
  15728. break;
  15729. }
  15730. // Does current segment of cache already have a WeakMap?
  15731. if ( caches.has( dependant ) ) {
  15732. // Traverse into nested WeakMap.
  15733. caches = caches.get( dependant );
  15734. } else {
  15735. // Create, set, and traverse into a new one.
  15736. map = new WeakMap();
  15737. caches.set( dependant, map );
  15738. caches = map;
  15739. }
  15740. }
  15741. // We use an arbitrary (but consistent) object as key for the last item
  15742. // in the WeakMap to serve as our running cache.
  15743. if ( ! caches.has( LEAF_KEY ) ) {
  15744. cache = createCache();
  15745. cache.isUniqueByDependants = isUniqueByDependants;
  15746. caches.set( LEAF_KEY, cache );
  15747. }
  15748. return caches.get( LEAF_KEY );
  15749. }
  15750. // Assign cache handler by availability of WeakMap
  15751. getCache = hasWeakMap ? getWeakMapCache : getRootCache;
  15752. /**
  15753. * Resets root memoization cache.
  15754. */
  15755. function clear() {
  15756. rootCache = hasWeakMap ? new WeakMap() : createCache();
  15757. }
  15758. // eslint-disable-next-line jsdoc/check-param-names
  15759. /**
  15760. * The augmented selector call, considering first whether dependants have
  15761. * changed before passing it to underlying memoize function.
  15762. *
  15763. * @param {Object} source Source object for derivation.
  15764. * @param {...*} extraArgs Additional arguments to pass to selector.
  15765. *
  15766. * @return {*} Selector result.
  15767. */
  15768. function callSelector( /* source, ...extraArgs */ ) {
  15769. var len = arguments.length,
  15770. cache, node, i, args, dependants;
  15771. // Create copy of arguments (avoid leaking deoptimization).
  15772. args = new Array( len );
  15773. for ( i = 0; i < len; i++ ) {
  15774. args[ i ] = arguments[ i ];
  15775. }
  15776. dependants = getDependants.apply( null, args );
  15777. cache = getCache( dependants );
  15778. // If not guaranteed uniqueness by dependants (primitive type or lack
  15779. // of WeakMap support), shallow compare against last dependants and, if
  15780. // references have changed, destroy cache to recalculate result.
  15781. if ( ! cache.isUniqueByDependants ) {
  15782. if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
  15783. cache.clear();
  15784. }
  15785. cache.lastDependants = dependants;
  15786. }
  15787. node = cache.head;
  15788. while ( node ) {
  15789. // Check whether node arguments match arguments
  15790. if ( ! isShallowEqual( node.args, args, 1 ) ) {
  15791. node = node.next;
  15792. continue;
  15793. }
  15794. // At this point we can assume we've found a match
  15795. // Surface matched node to head if not already
  15796. if ( node !== cache.head ) {
  15797. // Adjust siblings to point to each other.
  15798. node.prev.next = node.next;
  15799. if ( node.next ) {
  15800. node.next.prev = node.prev;
  15801. }
  15802. node.next = cache.head;
  15803. node.prev = null;
  15804. cache.head.prev = node;
  15805. cache.head = node;
  15806. }
  15807. // Return immediately
  15808. return node.val;
  15809. }
  15810. // No cached value found. Continue to insertion phase:
  15811. node = {
  15812. // Generate the result from original function
  15813. val: selector.apply( null, args ),
  15814. };
  15815. // Avoid including the source object in the cache.
  15816. args[ 0 ] = null;
  15817. node.args = args;
  15818. // Don't need to check whether node is already head, since it would
  15819. // have been returned above already if it was
  15820. // Shift existing head down list
  15821. if ( cache.head ) {
  15822. cache.head.prev = node;
  15823. node.next = cache.head;
  15824. }
  15825. cache.head = node;
  15826. return node.val;
  15827. }
  15828. callSelector.getDependants = getDependants;
  15829. callSelector.clear = clear;
  15830. clear();
  15831. return callSelector;
  15832. });
  15833. /***/ }),
  15834. /***/ "tI+e":
  15835. /***/ (function(module, exports) {
  15836. (function() { module.exports = window["wp"]["components"]; }());
  15837. /***/ }),
  15838. /***/ "w95h":
  15839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15840. "use strict";
  15841. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  15842. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  15843. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  15844. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  15845. /**
  15846. * WordPress dependencies
  15847. */
  15848. const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  15849. xmlns: "http://www.w3.org/2000/svg",
  15850. viewBox: "0 0 24 24"
  15851. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  15852. 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"
  15853. }));
  15854. /* harmony default export */ __webpack_exports__["a"] = (close);
  15855. /***/ }),
  15856. /***/ "wduq":
  15857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15858. "use strict";
  15859. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  15860. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  15861. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
  15862. /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
  15863. /**
  15864. * WordPress dependencies
  15865. */
  15866. const wordpress = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
  15867. xmlns: "http://www.w3.org/2000/svg",
  15868. viewBox: "-2 -2 24 24"
  15869. }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
  15870. d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
  15871. }));
  15872. /* harmony default export */ __webpack_exports__["a"] = (wordpress);
  15873. /***/ }),
  15874. /***/ "wx14":
  15875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15876. "use strict";
  15877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  15878. function _extends() {
  15879. _extends = Object.assign || function (target) {
  15880. for (var i = 1; i < arguments.length; i++) {
  15881. var source = arguments[i];
  15882. for (var key in source) {
  15883. if (Object.prototype.hasOwnProperty.call(source, key)) {
  15884. target[key] = source[key];
  15885. }
  15886. }
  15887. }
  15888. return target;
  15889. };
  15890. return _extends.apply(this, arguments);
  15891. }
  15892. /***/ }),
  15893. /***/ "xrib":
  15894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15895. "use strict";
  15896. /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export Fill */
  15897. /* unused harmony export Slot */
  15898. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
  15899. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
  15900. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tI+e");
  15901. /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
  15902. /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("K9lf");
  15903. /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
  15904. /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TvNi");
  15905. /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__);
  15906. /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("1ZqX");
  15907. /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
  15908. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y");
  15909. /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__);
  15910. /* harmony import */ var _preferences_modal_options__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("Y5n4");
  15911. /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("T40v");
  15912. /**
  15913. * Defines as extensibility slot for the Settings sidebar
  15914. */
  15915. /**
  15916. * WordPress dependencies
  15917. */
  15918. /**
  15919. * Internal dependencies
  15920. */
  15921. const {
  15922. Fill,
  15923. Slot
  15924. } = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["createSlotFill"])('PluginDocumentSettingPanel');
  15925. const PluginDocumentSettingFill = ({
  15926. isEnabled,
  15927. panelName,
  15928. opened,
  15929. onToggle,
  15930. className,
  15931. title,
  15932. icon,
  15933. children
  15934. }) => {
  15935. return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_preferences_modal_options__WEBPACK_IMPORTED_MODULE_6__[/* EnablePluginDocumentSettingPanelOption */ "d"], {
  15936. label: title,
  15937. panelName: panelName
  15938. }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Fill, null, isEnabled && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["PanelBody"], {
  15939. className: className,
  15940. title: title,
  15941. icon: icon,
  15942. opened: opened,
  15943. onToggle: onToggle
  15944. }, children)));
  15945. };
  15946. /**
  15947. * Renders items below the Status & Availability panel in the Document Sidebar.
  15948. *
  15949. * @param {Object} props Component properties.
  15950. * @param {string} [props.name] The machine-friendly name for the panel.
  15951. * @param {string} [props.className] An optional class name added to the row.
  15952. * @param {string} [props.title] The title of the panel
  15953. * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
  15954. *
  15955. * @example
  15956. * ```js
  15957. * // Using ES5 syntax
  15958. * var el = wp.element.createElement;
  15959. * var __ = wp.i18n.__;
  15960. * var registerPlugin = wp.plugins.registerPlugin;
  15961. * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;
  15962. *
  15963. * function MyDocumentSettingPlugin() {
  15964. * return el(
  15965. * PluginDocumentSettingPanel,
  15966. * {
  15967. * className: 'my-document-setting-plugin',
  15968. * title: 'My Panel',
  15969. * },
  15970. * __( 'My Document Setting Panel' )
  15971. * );
  15972. * }
  15973. *
  15974. * registerPlugin( 'my-document-setting-plugin', {
  15975. * render: MyDocumentSettingPlugin
  15976. * } );
  15977. * ```
  15978. *
  15979. * @example
  15980. * ```jsx
  15981. * // Using ESNext syntax
  15982. * import { registerPlugin } from '@wordpress/plugins';
  15983. * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
  15984. *
  15985. * const MyDocumentSettingTest = () => (
  15986. * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
  15987. * <p>My Document Setting Panel</p>
  15988. * </PluginDocumentSettingPanel>
  15989. * );
  15990. *
  15991. * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );
  15992. * ```
  15993. *
  15994. * @return {WPComponent} The component to be rendered.
  15995. */
  15996. const PluginDocumentSettingPanel = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["compose"])(Object(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_3__["withPluginContext"])((context, ownProps) => {
  15997. if (undefined === ownProps.name) {
  15998. typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('PluginDocumentSettingPanel requires a name property.') : void 0;
  15999. }
  16000. return {
  16001. icon: ownProps.icon || context.icon,
  16002. panelName: `${context.name}/${ownProps.name}`
  16003. };
  16004. }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withSelect"])((select, {
  16005. panelName
  16006. }) => {
  16007. return {
  16008. opened: select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).isEditorPanelOpened(panelName),
  16009. isEnabled: select(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).isEditorPanelEnabled(panelName)
  16010. };
  16011. }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["withDispatch"])((dispatch, {
  16012. panelName
  16013. }) => ({
  16014. onToggle() {
  16015. return dispatch(_store__WEBPACK_IMPORTED_MODULE_7__[/* store */ "a"]).toggleEditorPanelOpened(panelName);
  16016. }
  16017. })))(PluginDocumentSettingFill);
  16018. PluginDocumentSettingPanel.Slot = Slot;
  16019. /* harmony default export */ __webpack_exports__["a"] = (PluginDocumentSettingPanel);
  16020. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
  16021. /***/ })
  16022. /******/ });