block-library.js 1.7 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987
  1. /******/ (function() { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 7078:
  4. /***/ (function(module) {
  5. /**
  6. * Checks if the block is experimental based on the metadata loaded
  7. * from block.json.
  8. *
  9. * This function is in a separate file and uses the older JS syntax so
  10. * that it can be imported in both:
  11. * – block-library/src/index.js
  12. * – block-library/src/babel-plugin.js
  13. *
  14. * @param {Object} metadata Parsed block.json metadata.
  15. * @return {boolean} Is the block experimental?
  16. */
  17. module.exports = function isBlockMetadataExperimental(metadata) {
  18. return metadata && '__experimental' in metadata && metadata.__experimental !== false;
  19. };
  20. /***/ }),
  21. /***/ 3827:
  22. /***/ (function(module, exports) {
  23. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  24. Copyright (c) 2018 Jed Watson.
  25. Licensed under the MIT License (MIT), see
  26. http://jedwatson.github.io/classnames
  27. */
  28. /* global define */
  29. (function () {
  30. 'use strict';
  31. var classNames = (function () {
  32. // don't inherit from Object so we can skip hasOwnProperty check later
  33. // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
  34. function StorageObject() {}
  35. StorageObject.prototype = Object.create(null);
  36. function _parseArray (resultSet, array) {
  37. var length = array.length;
  38. for (var i = 0; i < length; ++i) {
  39. _parse(resultSet, array[i]);
  40. }
  41. }
  42. var hasOwn = {}.hasOwnProperty;
  43. function _parseNumber (resultSet, num) {
  44. resultSet[num] = true;
  45. }
  46. function _parseObject (resultSet, object) {
  47. if (object.toString !== Object.prototype.toString && !object.toString.toString().includes('[native code]')) {
  48. resultSet[object.toString()] = true;
  49. return;
  50. }
  51. for (var k in object) {
  52. if (hasOwn.call(object, k)) {
  53. // set value to false instead of deleting it to avoid changing object structure
  54. // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
  55. resultSet[k] = !!object[k];
  56. }
  57. }
  58. }
  59. var SPACE = /\s+/;
  60. function _parseString (resultSet, str) {
  61. var array = str.split(SPACE);
  62. var length = array.length;
  63. for (var i = 0; i < length; ++i) {
  64. resultSet[array[i]] = true;
  65. }
  66. }
  67. function _parse (resultSet, arg) {
  68. if (!arg) return;
  69. var argType = typeof arg;
  70. // 'foo bar'
  71. if (argType === 'string') {
  72. _parseString(resultSet, arg);
  73. // ['foo', 'bar', ...]
  74. } else if (Array.isArray(arg)) {
  75. _parseArray(resultSet, arg);
  76. // { 'foo': true, ... }
  77. } else if (argType === 'object') {
  78. _parseObject(resultSet, arg);
  79. // '130'
  80. } else if (argType === 'number') {
  81. _parseNumber(resultSet, arg);
  82. }
  83. }
  84. function _classNames () {
  85. // don't leak arguments
  86. // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
  87. var len = arguments.length;
  88. var args = Array(len);
  89. for (var i = 0; i < len; i++) {
  90. args[i] = arguments[i];
  91. }
  92. var classSet = new StorageObject();
  93. _parseArray(classSet, args);
  94. var list = [];
  95. for (var k in classSet) {
  96. if (classSet[k]) {
  97. list.push(k)
  98. }
  99. }
  100. return list.join(' ');
  101. }
  102. return _classNames;
  103. })();
  104. if ( true && module.exports) {
  105. classNames.default = classNames;
  106. module.exports = classNames;
  107. } else if (true) {
  108. // register as 'classnames', consistent with npm package name
  109. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  110. return classNames;
  111. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  112. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  113. } else {}
  114. }());
  115. /***/ }),
  116. /***/ 4403:
  117. /***/ (function(module, exports) {
  118. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  119. Copyright (c) 2018 Jed Watson.
  120. Licensed under the MIT License (MIT), see
  121. http://jedwatson.github.io/classnames
  122. */
  123. /* global define */
  124. (function () {
  125. 'use strict';
  126. var hasOwn = {}.hasOwnProperty;
  127. var nativeCodeString = '[native code]';
  128. function classNames() {
  129. var classes = [];
  130. for (var i = 0; i < arguments.length; i++) {
  131. var arg = arguments[i];
  132. if (!arg) continue;
  133. var argType = typeof arg;
  134. if (argType === 'string' || argType === 'number') {
  135. classes.push(arg);
  136. } else if (Array.isArray(arg)) {
  137. if (arg.length) {
  138. var inner = classNames.apply(null, arg);
  139. if (inner) {
  140. classes.push(inner);
  141. }
  142. }
  143. } else if (argType === 'object') {
  144. if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
  145. classes.push(arg.toString());
  146. continue;
  147. }
  148. for (var key in arg) {
  149. if (hasOwn.call(arg, key) && arg[key]) {
  150. classes.push(key);
  151. }
  152. }
  153. }
  154. }
  155. return classes.join(' ');
  156. }
  157. if ( true && module.exports) {
  158. classNames.default = classNames;
  159. module.exports = classNames;
  160. } else if (true) {
  161. // register as 'classnames', consistent with npm package name
  162. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  163. return classNames;
  164. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  165. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  166. } else {}
  167. }());
  168. /***/ }),
  169. /***/ 5027:
  170. /***/ (function(module) {
  171. /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
  172. (function (global, factory) {
  173. true ? module.exports = factory() :
  174. 0;
  175. }(this, (function () { 'use strict';
  176. function _classCallCheck(instance, Constructor) {
  177. if (!(instance instanceof Constructor)) {
  178. throw new TypeError("Cannot call a class as a function");
  179. }
  180. }
  181. function _defineProperties(target, props) {
  182. for (var i = 0; i < props.length; i++) {
  183. var descriptor = props[i];
  184. descriptor.enumerable = descriptor.enumerable || false;
  185. descriptor.configurable = true;
  186. if ("value" in descriptor) descriptor.writable = true;
  187. Object.defineProperty(target, descriptor.key, descriptor);
  188. }
  189. }
  190. function _createClass(Constructor, protoProps, staticProps) {
  191. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  192. if (staticProps) _defineProperties(Constructor, staticProps);
  193. return Constructor;
  194. }
  195. function _slicedToArray(arr, i) {
  196. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  197. }
  198. function _arrayWithHoles(arr) {
  199. if (Array.isArray(arr)) return arr;
  200. }
  201. function _iterableToArrayLimit(arr, i) {
  202. var _arr = [];
  203. var _n = true;
  204. var _d = false;
  205. var _e = undefined;
  206. try {
  207. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  208. _arr.push(_s.value);
  209. if (i && _arr.length === i) break;
  210. }
  211. } catch (err) {
  212. _d = true;
  213. _e = err;
  214. } finally {
  215. try {
  216. if (!_n && _i["return"] != null) _i["return"]();
  217. } finally {
  218. if (_d) throw _e;
  219. }
  220. }
  221. return _arr;
  222. }
  223. function _nonIterableRest() {
  224. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  225. }
  226. var FastAverageColor =
  227. /*#__PURE__*/
  228. function () {
  229. function FastAverageColor() {
  230. _classCallCheck(this, FastAverageColor);
  231. }
  232. _createClass(FastAverageColor, [{
  233. key: "getColorAsync",
  234. /**
  235. * Get asynchronously the average color from not loaded image.
  236. *
  237. * @param {HTMLImageElement} resource
  238. * @param {Function} callback
  239. * @param {Object|null} [options]
  240. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  241. * @param {*} [options.data]
  242. * @param {string} [options.mode="speed"] "precision" or "speed"
  243. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  244. * @param {number} [options.step=1]
  245. * @param {number} [options.left=0]
  246. * @param {number} [options.top=0]
  247. * @param {number} [options.width=width of resource]
  248. * @param {number} [options.height=height of resource]
  249. */
  250. value: function getColorAsync(resource, callback, options) {
  251. if (resource.complete) {
  252. callback.call(resource, this.getColor(resource, options), options && options.data);
  253. } else {
  254. this._bindImageEvents(resource, callback, options);
  255. }
  256. }
  257. /**
  258. * Get the average color from images, videos and canvas.
  259. *
  260. * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource
  261. * @param {Object|null} [options]
  262. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  263. * @param {*} [options.data]
  264. * @param {string} [options.mode="speed"] "precision" or "speed"
  265. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  266. * @param {number} [options.step=1]
  267. * @param {number} [options.left=0]
  268. * @param {number} [options.top=0]
  269. * @param {number} [options.width=width of resource]
  270. * @param {number} [options.height=height of resource]
  271. *
  272. * @returns {Object}
  273. */
  274. }, {
  275. key: "getColor",
  276. value: function getColor(resource, options) {
  277. options = options || {};
  278. var defaultColor = this._getDefaultColor(options),
  279. originalSize = this._getOriginalSize(resource),
  280. size = this._prepareSizeAndPosition(originalSize, options);
  281. var error = null,
  282. value = defaultColor;
  283. if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) {
  284. return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.'));
  285. }
  286. if (!this._ctx) {
  287. this._canvas = this._makeCanvas();
  288. this._ctx = this._canvas.getContext && this._canvas.getContext('2d');
  289. if (!this._ctx) {
  290. return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.'));
  291. }
  292. }
  293. this._canvas.width = size.destWidth;
  294. this._canvas.height = size.destHeight;
  295. try {
  296. this._ctx.clearRect(0, 0, size.destWidth, size.destHeight);
  297. this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight);
  298. var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data;
  299. value = this.getColorFromArray4(bitmapData, options);
  300. } catch (e) {
  301. // Security error, CORS
  302. // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image
  303. error = e;
  304. }
  305. return this._prepareResult(value, error);
  306. }
  307. /**
  308. * Get the average color from a array when 1 pixel is 4 bytes.
  309. *
  310. * @param {Array|Uint8Array} arr
  311. * @param {Object} [options]
  312. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  313. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  314. * @param {number} [options.step=1]
  315. *
  316. * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)]
  317. */
  318. }, {
  319. key: "getColorFromArray4",
  320. value: function getColorFromArray4(arr, options) {
  321. options = options || {};
  322. var bytesPerPixel = 4,
  323. arrLength = arr.length;
  324. if (arrLength < bytesPerPixel) {
  325. return this._getDefaultColor(options);
  326. }
  327. var len = arrLength - arrLength % bytesPerPixel,
  328. preparedStep = (options.step || 1) * bytesPerPixel,
  329. algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm';
  330. if (typeof this[algorithm] !== 'function') {
  331. throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm."));
  332. }
  333. return this[algorithm](arr, len, preparedStep);
  334. }
  335. /**
  336. * Destroy the instance.
  337. */
  338. }, {
  339. key: "destroy",
  340. value: function destroy() {
  341. delete this._canvas;
  342. delete this._ctx;
  343. }
  344. }, {
  345. key: "_getDefaultColor",
  346. value: function _getDefaultColor(options) {
  347. return this._getOption(options, 'defaultColor', [255, 255, 255, 255]);
  348. }
  349. }, {
  350. key: "_getOption",
  351. value: function _getOption(options, name, defaultValue) {
  352. return typeof options[name] === 'undefined' ? defaultValue : options[name];
  353. }
  354. }, {
  355. key: "_prepareSizeAndPosition",
  356. value: function _prepareSizeAndPosition(originalSize, options) {
  357. var srcLeft = this._getOption(options, 'left', 0),
  358. srcTop = this._getOption(options, 'top', 0),
  359. srcWidth = this._getOption(options, 'width', originalSize.width),
  360. srcHeight = this._getOption(options, 'height', originalSize.height),
  361. destWidth = srcWidth,
  362. destHeight = srcHeight;
  363. if (options.mode === 'precision') {
  364. return {
  365. srcLeft: srcLeft,
  366. srcTop: srcTop,
  367. srcWidth: srcWidth,
  368. srcHeight: srcHeight,
  369. destWidth: destWidth,
  370. destHeight: destHeight
  371. };
  372. }
  373. var maxSize = 100,
  374. minSize = 10;
  375. var factor;
  376. if (srcWidth > srcHeight) {
  377. factor = srcWidth / srcHeight;
  378. destWidth = maxSize;
  379. destHeight = Math.round(destWidth / factor);
  380. } else {
  381. factor = srcHeight / srcWidth;
  382. destHeight = maxSize;
  383. destWidth = Math.round(destHeight / factor);
  384. }
  385. if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) {
  386. destWidth = srcWidth;
  387. destHeight = srcHeight;
  388. }
  389. return {
  390. srcLeft: srcLeft,
  391. srcTop: srcTop,
  392. srcWidth: srcWidth,
  393. srcHeight: srcHeight,
  394. destWidth: destWidth,
  395. destHeight: destHeight
  396. };
  397. }
  398. }, {
  399. key: "_simpleAlgorithm",
  400. value: function _simpleAlgorithm(arr, len, preparedStep) {
  401. var redTotal = 0,
  402. greenTotal = 0,
  403. blueTotal = 0,
  404. alphaTotal = 0,
  405. count = 0;
  406. for (var i = 0; i < len; i += preparedStep) {
  407. var alpha = arr[i + 3],
  408. red = arr[i] * alpha,
  409. green = arr[i + 1] * alpha,
  410. blue = arr[i + 2] * alpha;
  411. redTotal += red;
  412. greenTotal += green;
  413. blueTotal += blue;
  414. alphaTotal += alpha;
  415. count++;
  416. }
  417. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  418. }
  419. }, {
  420. key: "_sqrtAlgorithm",
  421. value: function _sqrtAlgorithm(arr, len, preparedStep) {
  422. var redTotal = 0,
  423. greenTotal = 0,
  424. blueTotal = 0,
  425. alphaTotal = 0,
  426. count = 0;
  427. for (var i = 0; i < len; i += preparedStep) {
  428. var red = arr[i],
  429. green = arr[i + 1],
  430. blue = arr[i + 2],
  431. alpha = arr[i + 3];
  432. redTotal += red * red * alpha;
  433. greenTotal += green * green * alpha;
  434. blueTotal += blue * blue * alpha;
  435. alphaTotal += alpha;
  436. count++;
  437. }
  438. return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  439. }
  440. }, {
  441. key: "_dominantAlgorithm",
  442. value: function _dominantAlgorithm(arr, len, preparedStep) {
  443. var colorHash = {},
  444. divider = 24;
  445. for (var i = 0; i < len; i += preparedStep) {
  446. var red = arr[i],
  447. green = arr[i + 1],
  448. blue = arr[i + 2],
  449. alpha = arr[i + 3],
  450. key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider);
  451. if (colorHash[key]) {
  452. colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1];
  453. } else {
  454. colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1];
  455. }
  456. }
  457. var buffer = Object.keys(colorHash).map(function (key) {
  458. return colorHash[key];
  459. }).sort(function (a, b) {
  460. var countA = a[4],
  461. countB = b[4];
  462. return countA > countB ? -1 : countA === countB ? 0 : 1;
  463. });
  464. var _buffer$ = _slicedToArray(buffer[0], 5),
  465. redTotal = _buffer$[0],
  466. greenTotal = _buffer$[1],
  467. blueTotal = _buffer$[2],
  468. alphaTotal = _buffer$[3],
  469. count = _buffer$[4];
  470. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  471. }
  472. }, {
  473. key: "_bindImageEvents",
  474. value: function _bindImageEvents(resource, callback, options) {
  475. var _this = this;
  476. options = options || {};
  477. var data = options && options.data,
  478. defaultColor = this._getDefaultColor(options),
  479. onload = function onload() {
  480. unbindEvents();
  481. callback.call(resource, _this.getColor(resource, options), data);
  482. },
  483. onerror = function onerror() {
  484. unbindEvents();
  485. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data);
  486. },
  487. onabort = function onabort() {
  488. unbindEvents();
  489. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data);
  490. },
  491. unbindEvents = function unbindEvents() {
  492. resource.removeEventListener('load', onload);
  493. resource.removeEventListener('error', onerror);
  494. resource.removeEventListener('abort', onabort);
  495. };
  496. resource.addEventListener('load', onload);
  497. resource.addEventListener('error', onerror);
  498. resource.addEventListener('abort', onabort);
  499. }
  500. }, {
  501. key: "_prepareResult",
  502. value: function _prepareResult(value, error) {
  503. var rgb = value.slice(0, 3),
  504. rgba = [].concat(rgb, value[3] / 255),
  505. isDark = this._isDark(value);
  506. return {
  507. error: error,
  508. value: value,
  509. rgb: 'rgb(' + rgb.join(',') + ')',
  510. rgba: 'rgba(' + rgba.join(',') + ')',
  511. hex: this._arrayToHex(rgb),
  512. hexa: this._arrayToHex(value),
  513. isDark: isDark,
  514. isLight: !isDark
  515. };
  516. }
  517. }, {
  518. key: "_getOriginalSize",
  519. value: function _getOriginalSize(resource) {
  520. if (resource instanceof HTMLImageElement) {
  521. return {
  522. width: resource.naturalWidth,
  523. height: resource.naturalHeight
  524. };
  525. }
  526. if (resource instanceof HTMLVideoElement) {
  527. return {
  528. width: resource.videoWidth,
  529. height: resource.videoHeight
  530. };
  531. }
  532. return {
  533. width: resource.width,
  534. height: resource.height
  535. };
  536. }
  537. }, {
  538. key: "_toHex",
  539. value: function _toHex(num) {
  540. var str = num.toString(16);
  541. return str.length === 1 ? '0' + str : str;
  542. }
  543. }, {
  544. key: "_arrayToHex",
  545. value: function _arrayToHex(arr) {
  546. return '#' + arr.map(this._toHex).join('');
  547. }
  548. }, {
  549. key: "_isDark",
  550. value: function _isDark(color) {
  551. // http://www.w3.org/TR/AERT#color-contrast
  552. var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000;
  553. return result < 128;
  554. }
  555. }, {
  556. key: "_makeCanvas",
  557. value: function _makeCanvas() {
  558. return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas');
  559. }
  560. }]);
  561. return FastAverageColor;
  562. }();
  563. return FastAverageColor;
  564. })));
  565. /***/ }),
  566. /***/ 9756:
  567. /***/ (function(module) {
  568. /**
  569. * Memize options object.
  570. *
  571. * @typedef MemizeOptions
  572. *
  573. * @property {number} [maxSize] Maximum size of the cache.
  574. */
  575. /**
  576. * Internal cache entry.
  577. *
  578. * @typedef MemizeCacheNode
  579. *
  580. * @property {?MemizeCacheNode|undefined} [prev] Previous node.
  581. * @property {?MemizeCacheNode|undefined} [next] Next node.
  582. * @property {Array<*>} args Function arguments for cache
  583. * entry.
  584. * @property {*} val Function result.
  585. */
  586. /**
  587. * Properties of the enhanced function for controlling cache.
  588. *
  589. * @typedef MemizeMemoizedFunction
  590. *
  591. * @property {()=>void} clear Clear the cache.
  592. */
  593. /**
  594. * Accepts a function to be memoized, and returns a new memoized function, with
  595. * optional options.
  596. *
  597. * @template {Function} F
  598. *
  599. * @param {F} fn Function to memoize.
  600. * @param {MemizeOptions} [options] Options object.
  601. *
  602. * @return {F & MemizeMemoizedFunction} Memoized function.
  603. */
  604. function memize( fn, options ) {
  605. var size = 0;
  606. /** @type {?MemizeCacheNode|undefined} */
  607. var head;
  608. /** @type {?MemizeCacheNode|undefined} */
  609. var tail;
  610. options = options || {};
  611. function memoized( /* ...args */ ) {
  612. var node = head,
  613. len = arguments.length,
  614. args, i;
  615. searchCache: while ( node ) {
  616. // Perform a shallow equality test to confirm that whether the node
  617. // under test is a candidate for the arguments passed. Two arrays
  618. // are shallowly equal if their length matches and each entry is
  619. // strictly equal between the two sets. Avoid abstracting to a
  620. // function which could incur an arguments leaking deoptimization.
  621. // Check whether node arguments match arguments length
  622. if ( node.args.length !== arguments.length ) {
  623. node = node.next;
  624. continue;
  625. }
  626. // Check whether node arguments match arguments values
  627. for ( i = 0; i < len; i++ ) {
  628. if ( node.args[ i ] !== arguments[ i ] ) {
  629. node = node.next;
  630. continue searchCache;
  631. }
  632. }
  633. // At this point we can assume we've found a match
  634. // Surface matched node to head if not already
  635. if ( node !== head ) {
  636. // As tail, shift to previous. Must only shift if not also
  637. // head, since if both head and tail, there is no previous.
  638. if ( node === tail ) {
  639. tail = node.prev;
  640. }
  641. // Adjust siblings to point to each other. If node was tail,
  642. // this also handles new tail's empty `next` assignment.
  643. /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
  644. if ( node.next ) {
  645. node.next.prev = node.prev;
  646. }
  647. node.next = head;
  648. node.prev = null;
  649. /** @type {MemizeCacheNode} */ ( head ).prev = node;
  650. head = node;
  651. }
  652. // Return immediately
  653. return node.val;
  654. }
  655. // No cached value found. Continue to insertion phase:
  656. // Create a copy of arguments (avoid leaking deoptimization)
  657. args = new Array( len );
  658. for ( i = 0; i < len; i++ ) {
  659. args[ i ] = arguments[ i ];
  660. }
  661. node = {
  662. args: args,
  663. // Generate the result from original function
  664. val: fn.apply( null, args ),
  665. };
  666. // Don't need to check whether node is already head, since it would
  667. // have been returned above already if it was
  668. // Shift existing head down list
  669. if ( head ) {
  670. head.prev = node;
  671. node.next = head;
  672. } else {
  673. // If no head, follows that there's no tail (at initial or reset)
  674. tail = node;
  675. }
  676. // Trim tail if we're reached max size and are pending cache insertion
  677. if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
  678. tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
  679. /** @type {MemizeCacheNode} */ ( tail ).next = null;
  680. } else {
  681. size++;
  682. }
  683. head = node;
  684. return node.val;
  685. }
  686. memoized.clear = function() {
  687. head = null;
  688. tail = null;
  689. size = 0;
  690. };
  691. if ( false ) {}
  692. // Ignore reason: There's not a clear solution to create an intersection of
  693. // the function with additional properties, where the goal is to retain the
  694. // function signature of the incoming argument and add control properties
  695. // on the return value.
  696. // @ts-ignore
  697. return memoized;
  698. }
  699. module.exports = memize;
  700. /***/ }),
  701. /***/ 4793:
  702. /***/ (function(module) {
  703. var characterMap = {
  704. "À": "A",
  705. "Á": "A",
  706. "Â": "A",
  707. "Ã": "A",
  708. "Ä": "A",
  709. "Å": "A",
  710. "Ấ": "A",
  711. "Ắ": "A",
  712. "Ẳ": "A",
  713. "Ẵ": "A",
  714. "Ặ": "A",
  715. "Æ": "AE",
  716. "Ầ": "A",
  717. "Ằ": "A",
  718. "Ȃ": "A",
  719. "Ç": "C",
  720. "Ḉ": "C",
  721. "È": "E",
  722. "É": "E",
  723. "Ê": "E",
  724. "Ë": "E",
  725. "Ế": "E",
  726. "Ḗ": "E",
  727. "Ề": "E",
  728. "Ḕ": "E",
  729. "Ḝ": "E",
  730. "Ȇ": "E",
  731. "Ì": "I",
  732. "Í": "I",
  733. "Î": "I",
  734. "Ï": "I",
  735. "Ḯ": "I",
  736. "Ȋ": "I",
  737. "Ð": "D",
  738. "Ñ": "N",
  739. "Ò": "O",
  740. "Ó": "O",
  741. "Ô": "O",
  742. "Õ": "O",
  743. "Ö": "O",
  744. "Ø": "O",
  745. "Ố": "O",
  746. "Ṍ": "O",
  747. "Ṓ": "O",
  748. "Ȏ": "O",
  749. "Ù": "U",
  750. "Ú": "U",
  751. "Û": "U",
  752. "Ü": "U",
  753. "Ý": "Y",
  754. "à": "a",
  755. "á": "a",
  756. "â": "a",
  757. "ã": "a",
  758. "ä": "a",
  759. "å": "a",
  760. "ấ": "a",
  761. "ắ": "a",
  762. "ẳ": "a",
  763. "ẵ": "a",
  764. "ặ": "a",
  765. "æ": "ae",
  766. "ầ": "a",
  767. "ằ": "a",
  768. "ȃ": "a",
  769. "ç": "c",
  770. "ḉ": "c",
  771. "è": "e",
  772. "é": "e",
  773. "ê": "e",
  774. "ë": "e",
  775. "ế": "e",
  776. "ḗ": "e",
  777. "ề": "e",
  778. "ḕ": "e",
  779. "ḝ": "e",
  780. "ȇ": "e",
  781. "ì": "i",
  782. "í": "i",
  783. "î": "i",
  784. "ï": "i",
  785. "ḯ": "i",
  786. "ȋ": "i",
  787. "ð": "d",
  788. "ñ": "n",
  789. "ò": "o",
  790. "ó": "o",
  791. "ô": "o",
  792. "õ": "o",
  793. "ö": "o",
  794. "ø": "o",
  795. "ố": "o",
  796. "ṍ": "o",
  797. "ṓ": "o",
  798. "ȏ": "o",
  799. "ù": "u",
  800. "ú": "u",
  801. "û": "u",
  802. "ü": "u",
  803. "ý": "y",
  804. "ÿ": "y",
  805. "Ā": "A",
  806. "ā": "a",
  807. "Ă": "A",
  808. "ă": "a",
  809. "Ą": "A",
  810. "ą": "a",
  811. "Ć": "C",
  812. "ć": "c",
  813. "Ĉ": "C",
  814. "ĉ": "c",
  815. "Ċ": "C",
  816. "ċ": "c",
  817. "Č": "C",
  818. "č": "c",
  819. "C̆": "C",
  820. "c̆": "c",
  821. "Ď": "D",
  822. "ď": "d",
  823. "Đ": "D",
  824. "đ": "d",
  825. "Ē": "E",
  826. "ē": "e",
  827. "Ĕ": "E",
  828. "ĕ": "e",
  829. "Ė": "E",
  830. "ė": "e",
  831. "Ę": "E",
  832. "ę": "e",
  833. "Ě": "E",
  834. "ě": "e",
  835. "Ĝ": "G",
  836. "Ǵ": "G",
  837. "ĝ": "g",
  838. "ǵ": "g",
  839. "Ğ": "G",
  840. "ğ": "g",
  841. "Ġ": "G",
  842. "ġ": "g",
  843. "Ģ": "G",
  844. "ģ": "g",
  845. "Ĥ": "H",
  846. "ĥ": "h",
  847. "Ħ": "H",
  848. "ħ": "h",
  849. "Ḫ": "H",
  850. "ḫ": "h",
  851. "Ĩ": "I",
  852. "ĩ": "i",
  853. "Ī": "I",
  854. "ī": "i",
  855. "Ĭ": "I",
  856. "ĭ": "i",
  857. "Į": "I",
  858. "į": "i",
  859. "İ": "I",
  860. "ı": "i",
  861. "IJ": "IJ",
  862. "ij": "ij",
  863. "Ĵ": "J",
  864. "ĵ": "j",
  865. "Ķ": "K",
  866. "ķ": "k",
  867. "Ḱ": "K",
  868. "ḱ": "k",
  869. "K̆": "K",
  870. "k̆": "k",
  871. "Ĺ": "L",
  872. "ĺ": "l",
  873. "Ļ": "L",
  874. "ļ": "l",
  875. "Ľ": "L",
  876. "ľ": "l",
  877. "Ŀ": "L",
  878. "ŀ": "l",
  879. "Ł": "l",
  880. "ł": "l",
  881. "Ḿ": "M",
  882. "ḿ": "m",
  883. "M̆": "M",
  884. "m̆": "m",
  885. "Ń": "N",
  886. "ń": "n",
  887. "Ņ": "N",
  888. "ņ": "n",
  889. "Ň": "N",
  890. "ň": "n",
  891. "ʼn": "n",
  892. "N̆": "N",
  893. "n̆": "n",
  894. "Ō": "O",
  895. "ō": "o",
  896. "Ŏ": "O",
  897. "ŏ": "o",
  898. "Ő": "O",
  899. "ő": "o",
  900. "Œ": "OE",
  901. "œ": "oe",
  902. "P̆": "P",
  903. "p̆": "p",
  904. "Ŕ": "R",
  905. "ŕ": "r",
  906. "Ŗ": "R",
  907. "ŗ": "r",
  908. "Ř": "R",
  909. "ř": "r",
  910. "R̆": "R",
  911. "r̆": "r",
  912. "Ȓ": "R",
  913. "ȓ": "r",
  914. "Ś": "S",
  915. "ś": "s",
  916. "Ŝ": "S",
  917. "ŝ": "s",
  918. "Ş": "S",
  919. "Ș": "S",
  920. "ș": "s",
  921. "ş": "s",
  922. "Š": "S",
  923. "š": "s",
  924. "Ţ": "T",
  925. "ţ": "t",
  926. "ț": "t",
  927. "Ț": "T",
  928. "Ť": "T",
  929. "ť": "t",
  930. "Ŧ": "T",
  931. "ŧ": "t",
  932. "T̆": "T",
  933. "t̆": "t",
  934. "Ũ": "U",
  935. "ũ": "u",
  936. "Ū": "U",
  937. "ū": "u",
  938. "Ŭ": "U",
  939. "ŭ": "u",
  940. "Ů": "U",
  941. "ů": "u",
  942. "Ű": "U",
  943. "ű": "u",
  944. "Ų": "U",
  945. "ų": "u",
  946. "Ȗ": "U",
  947. "ȗ": "u",
  948. "V̆": "V",
  949. "v̆": "v",
  950. "Ŵ": "W",
  951. "ŵ": "w",
  952. "Ẃ": "W",
  953. "ẃ": "w",
  954. "X̆": "X",
  955. "x̆": "x",
  956. "Ŷ": "Y",
  957. "ŷ": "y",
  958. "Ÿ": "Y",
  959. "Y̆": "Y",
  960. "y̆": "y",
  961. "Ź": "Z",
  962. "ź": "z",
  963. "Ż": "Z",
  964. "ż": "z",
  965. "Ž": "Z",
  966. "ž": "z",
  967. "ſ": "s",
  968. "ƒ": "f",
  969. "Ơ": "O",
  970. "ơ": "o",
  971. "Ư": "U",
  972. "ư": "u",
  973. "Ǎ": "A",
  974. "ǎ": "a",
  975. "Ǐ": "I",
  976. "ǐ": "i",
  977. "Ǒ": "O",
  978. "ǒ": "o",
  979. "Ǔ": "U",
  980. "ǔ": "u",
  981. "Ǖ": "U",
  982. "ǖ": "u",
  983. "Ǘ": "U",
  984. "ǘ": "u",
  985. "Ǚ": "U",
  986. "ǚ": "u",
  987. "Ǜ": "U",
  988. "ǜ": "u",
  989. "Ứ": "U",
  990. "ứ": "u",
  991. "Ṹ": "U",
  992. "ṹ": "u",
  993. "Ǻ": "A",
  994. "ǻ": "a",
  995. "Ǽ": "AE",
  996. "ǽ": "ae",
  997. "Ǿ": "O",
  998. "ǿ": "o",
  999. "Þ": "TH",
  1000. "þ": "th",
  1001. "Ṕ": "P",
  1002. "ṕ": "p",
  1003. "Ṥ": "S",
  1004. "ṥ": "s",
  1005. "X́": "X",
  1006. "x́": "x",
  1007. "Ѓ": "Г",
  1008. "ѓ": "г",
  1009. "Ќ": "К",
  1010. "ќ": "к",
  1011. "A̋": "A",
  1012. "a̋": "a",
  1013. "E̋": "E",
  1014. "e̋": "e",
  1015. "I̋": "I",
  1016. "i̋": "i",
  1017. "Ǹ": "N",
  1018. "ǹ": "n",
  1019. "Ồ": "O",
  1020. "ồ": "o",
  1021. "Ṑ": "O",
  1022. "ṑ": "o",
  1023. "Ừ": "U",
  1024. "ừ": "u",
  1025. "Ẁ": "W",
  1026. "ẁ": "w",
  1027. "Ỳ": "Y",
  1028. "ỳ": "y",
  1029. "Ȁ": "A",
  1030. "ȁ": "a",
  1031. "Ȅ": "E",
  1032. "ȅ": "e",
  1033. "Ȉ": "I",
  1034. "ȉ": "i",
  1035. "Ȍ": "O",
  1036. "ȍ": "o",
  1037. "Ȑ": "R",
  1038. "ȑ": "r",
  1039. "Ȕ": "U",
  1040. "ȕ": "u",
  1041. "B̌": "B",
  1042. "b̌": "b",
  1043. "Č̣": "C",
  1044. "č̣": "c",
  1045. "Ê̌": "E",
  1046. "ê̌": "e",
  1047. "F̌": "F",
  1048. "f̌": "f",
  1049. "Ǧ": "G",
  1050. "ǧ": "g",
  1051. "Ȟ": "H",
  1052. "ȟ": "h",
  1053. "J̌": "J",
  1054. "ǰ": "j",
  1055. "Ǩ": "K",
  1056. "ǩ": "k",
  1057. "M̌": "M",
  1058. "m̌": "m",
  1059. "P̌": "P",
  1060. "p̌": "p",
  1061. "Q̌": "Q",
  1062. "q̌": "q",
  1063. "Ř̩": "R",
  1064. "ř̩": "r",
  1065. "Ṧ": "S",
  1066. "ṧ": "s",
  1067. "V̌": "V",
  1068. "v̌": "v",
  1069. "W̌": "W",
  1070. "w̌": "w",
  1071. "X̌": "X",
  1072. "x̌": "x",
  1073. "Y̌": "Y",
  1074. "y̌": "y",
  1075. "A̧": "A",
  1076. "a̧": "a",
  1077. "B̧": "B",
  1078. "b̧": "b",
  1079. "Ḑ": "D",
  1080. "ḑ": "d",
  1081. "Ȩ": "E",
  1082. "ȩ": "e",
  1083. "Ɛ̧": "E",
  1084. "ɛ̧": "e",
  1085. "Ḩ": "H",
  1086. "ḩ": "h",
  1087. "I̧": "I",
  1088. "i̧": "i",
  1089. "Ɨ̧": "I",
  1090. "ɨ̧": "i",
  1091. "M̧": "M",
  1092. "m̧": "m",
  1093. "O̧": "O",
  1094. "o̧": "o",
  1095. "Q̧": "Q",
  1096. "q̧": "q",
  1097. "U̧": "U",
  1098. "u̧": "u",
  1099. "X̧": "X",
  1100. "x̧": "x",
  1101. "Z̧": "Z",
  1102. "z̧": "z",
  1103. };
  1104. var chars = Object.keys(characterMap).join('|');
  1105. var allAccents = new RegExp(chars, 'g');
  1106. var firstAccent = new RegExp(chars, '');
  1107. function matcher(match) {
  1108. return characterMap[match];
  1109. }
  1110. var removeAccents = function(string) {
  1111. return string.replace(allAccents, matcher);
  1112. };
  1113. var hasAccents = function(string) {
  1114. return !!string.match(firstAccent);
  1115. };
  1116. module.exports = removeAccents;
  1117. module.exports.has = hasAccents;
  1118. module.exports.remove = removeAccents;
  1119. /***/ })
  1120. /******/ });
  1121. /************************************************************************/
  1122. /******/ // The module cache
  1123. /******/ var __webpack_module_cache__ = {};
  1124. /******/
  1125. /******/ // The require function
  1126. /******/ function __webpack_require__(moduleId) {
  1127. /******/ // Check if module is in cache
  1128. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  1129. /******/ if (cachedModule !== undefined) {
  1130. /******/ return cachedModule.exports;
  1131. /******/ }
  1132. /******/ // Create a new module (and put it into the cache)
  1133. /******/ var module = __webpack_module_cache__[moduleId] = {
  1134. /******/ // no module.id needed
  1135. /******/ // no module.loaded needed
  1136. /******/ exports: {}
  1137. /******/ };
  1138. /******/
  1139. /******/ // Execute the module function
  1140. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  1141. /******/
  1142. /******/ // Return the exports of the module
  1143. /******/ return module.exports;
  1144. /******/ }
  1145. /******/
  1146. /************************************************************************/
  1147. /******/ /* webpack/runtime/compat get default export */
  1148. /******/ !function() {
  1149. /******/ // getDefaultExport function for compatibility with non-harmony modules
  1150. /******/ __webpack_require__.n = function(module) {
  1151. /******/ var getter = module && module.__esModule ?
  1152. /******/ function() { return module['default']; } :
  1153. /******/ function() { return module; };
  1154. /******/ __webpack_require__.d(getter, { a: getter });
  1155. /******/ return getter;
  1156. /******/ };
  1157. /******/ }();
  1158. /******/
  1159. /******/ /* webpack/runtime/define property getters */
  1160. /******/ !function() {
  1161. /******/ // define getter functions for harmony exports
  1162. /******/ __webpack_require__.d = function(exports, definition) {
  1163. /******/ for(var key in definition) {
  1164. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  1165. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1166. /******/ }
  1167. /******/ }
  1168. /******/ };
  1169. /******/ }();
  1170. /******/
  1171. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  1172. /******/ !function() {
  1173. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  1174. /******/ }();
  1175. /******/
  1176. /******/ /* webpack/runtime/make namespace object */
  1177. /******/ !function() {
  1178. /******/ // define __esModule on exports
  1179. /******/ __webpack_require__.r = function(exports) {
  1180. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  1181. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  1182. /******/ }
  1183. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  1184. /******/ };
  1185. /******/ }();
  1186. /******/
  1187. /************************************************************************/
  1188. var __webpack_exports__ = {};
  1189. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  1190. !function() {
  1191. "use strict";
  1192. // ESM COMPAT FLAG
  1193. __webpack_require__.r(__webpack_exports__);
  1194. // EXPORTS
  1195. __webpack_require__.d(__webpack_exports__, {
  1196. "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; },
  1197. "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; },
  1198. "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; }
  1199. });
  1200. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  1201. var archives_namespaceObject = {};
  1202. __webpack_require__.r(archives_namespaceObject);
  1203. __webpack_require__.d(archives_namespaceObject, {
  1204. "init": function() { return init; },
  1205. "metadata": function() { return metadata; },
  1206. "name": function() { return archives_name; },
  1207. "settings": function() { return settings; }
  1208. });
  1209. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  1210. var avatar_namespaceObject = {};
  1211. __webpack_require__.r(avatar_namespaceObject);
  1212. __webpack_require__.d(avatar_namespaceObject, {
  1213. "init": function() { return avatar_init; },
  1214. "metadata": function() { return avatar_metadata; },
  1215. "name": function() { return avatar_name; },
  1216. "settings": function() { return avatar_settings; }
  1217. });
  1218. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  1219. var build_module_audio_namespaceObject = {};
  1220. __webpack_require__.r(build_module_audio_namespaceObject);
  1221. __webpack_require__.d(build_module_audio_namespaceObject, {
  1222. "init": function() { return audio_init; },
  1223. "metadata": function() { return audio_metadata; },
  1224. "name": function() { return audio_name; },
  1225. "settings": function() { return audio_settings; }
  1226. });
  1227. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
  1228. var build_module_button_namespaceObject = {};
  1229. __webpack_require__.r(build_module_button_namespaceObject);
  1230. __webpack_require__.d(build_module_button_namespaceObject, {
  1231. "init": function() { return button_init; },
  1232. "metadata": function() { return button_metadata; },
  1233. "name": function() { return button_name; },
  1234. "settings": function() { return button_settings; }
  1235. });
  1236. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  1237. var build_module_buttons_namespaceObject = {};
  1238. __webpack_require__.r(build_module_buttons_namespaceObject);
  1239. __webpack_require__.d(build_module_buttons_namespaceObject, {
  1240. "init": function() { return buttons_init; },
  1241. "metadata": function() { return buttons_metadata; },
  1242. "name": function() { return buttons_name; },
  1243. "settings": function() { return buttons_settings; }
  1244. });
  1245. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  1246. var build_module_calendar_namespaceObject = {};
  1247. __webpack_require__.r(build_module_calendar_namespaceObject);
  1248. __webpack_require__.d(build_module_calendar_namespaceObject, {
  1249. "init": function() { return calendar_init; },
  1250. "metadata": function() { return calendar_metadata; },
  1251. "name": function() { return calendar_name; },
  1252. "settings": function() { return calendar_settings; }
  1253. });
  1254. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  1255. var categories_namespaceObject = {};
  1256. __webpack_require__.r(categories_namespaceObject);
  1257. __webpack_require__.d(categories_namespaceObject, {
  1258. "init": function() { return categories_init; },
  1259. "metadata": function() { return categories_metadata; },
  1260. "name": function() { return categories_name; },
  1261. "settings": function() { return categories_settings; }
  1262. });
  1263. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  1264. var freeform_namespaceObject = {};
  1265. __webpack_require__.r(freeform_namespaceObject);
  1266. __webpack_require__.d(freeform_namespaceObject, {
  1267. "init": function() { return freeform_init; },
  1268. "metadata": function() { return freeform_metadata; },
  1269. "name": function() { return freeform_name; },
  1270. "settings": function() { return freeform_settings; }
  1271. });
  1272. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js
  1273. var build_module_code_namespaceObject = {};
  1274. __webpack_require__.r(build_module_code_namespaceObject);
  1275. __webpack_require__.d(build_module_code_namespaceObject, {
  1276. "init": function() { return code_init; },
  1277. "metadata": function() { return code_metadata; },
  1278. "name": function() { return code_name; },
  1279. "settings": function() { return code_settings; }
  1280. });
  1281. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js
  1282. var build_module_column_namespaceObject = {};
  1283. __webpack_require__.r(build_module_column_namespaceObject);
  1284. __webpack_require__.d(build_module_column_namespaceObject, {
  1285. "init": function() { return column_init; },
  1286. "metadata": function() { return column_metadata; },
  1287. "name": function() { return column_name; },
  1288. "settings": function() { return column_settings; }
  1289. });
  1290. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  1291. var build_module_columns_namespaceObject = {};
  1292. __webpack_require__.r(build_module_columns_namespaceObject);
  1293. __webpack_require__.d(build_module_columns_namespaceObject, {
  1294. "init": function() { return columns_init; },
  1295. "metadata": function() { return columns_metadata; },
  1296. "name": function() { return columns_name; },
  1297. "settings": function() { return columns_settings; }
  1298. });
  1299. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js
  1300. var comments_namespaceObject = {};
  1301. __webpack_require__.r(comments_namespaceObject);
  1302. __webpack_require__.d(comments_namespaceObject, {
  1303. "init": function() { return comments_init; },
  1304. "metadata": function() { return comments_metadata; },
  1305. "name": function() { return comments_name; },
  1306. "settings": function() { return comments_settings; }
  1307. });
  1308. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js
  1309. var build_module_comment_author_avatar_namespaceObject = {};
  1310. __webpack_require__.r(build_module_comment_author_avatar_namespaceObject);
  1311. __webpack_require__.d(build_module_comment_author_avatar_namespaceObject, {
  1312. "init": function() { return comment_author_avatar_init; },
  1313. "metadata": function() { return comment_author_avatar_metadata; },
  1314. "name": function() { return comment_author_avatar_name; },
  1315. "settings": function() { return comment_author_avatar_settings; }
  1316. });
  1317. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  1318. var build_module_comment_author_name_namespaceObject = {};
  1319. __webpack_require__.r(build_module_comment_author_name_namespaceObject);
  1320. __webpack_require__.d(build_module_comment_author_name_namespaceObject, {
  1321. "init": function() { return comment_author_name_init; },
  1322. "metadata": function() { return comment_author_name_metadata; },
  1323. "name": function() { return comment_author_name_name; },
  1324. "settings": function() { return comment_author_name_settings; }
  1325. });
  1326. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  1327. var build_module_comment_content_namespaceObject = {};
  1328. __webpack_require__.r(build_module_comment_content_namespaceObject);
  1329. __webpack_require__.d(build_module_comment_content_namespaceObject, {
  1330. "init": function() { return comment_content_init; },
  1331. "metadata": function() { return comment_content_metadata; },
  1332. "name": function() { return comment_content_name; },
  1333. "settings": function() { return comment_content_settings; }
  1334. });
  1335. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  1336. var comment_date_namespaceObject = {};
  1337. __webpack_require__.r(comment_date_namespaceObject);
  1338. __webpack_require__.d(comment_date_namespaceObject, {
  1339. "init": function() { return comment_date_init; },
  1340. "metadata": function() { return comment_date_metadata; },
  1341. "name": function() { return comment_date_name; },
  1342. "settings": function() { return comment_date_settings; }
  1343. });
  1344. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  1345. var build_module_comment_edit_link_namespaceObject = {};
  1346. __webpack_require__.r(build_module_comment_edit_link_namespaceObject);
  1347. __webpack_require__.d(build_module_comment_edit_link_namespaceObject, {
  1348. "init": function() { return comment_edit_link_init; },
  1349. "metadata": function() { return comment_edit_link_metadata; },
  1350. "name": function() { return comment_edit_link_name; },
  1351. "settings": function() { return comment_edit_link_settings; }
  1352. });
  1353. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  1354. var build_module_comment_reply_link_namespaceObject = {};
  1355. __webpack_require__.r(build_module_comment_reply_link_namespaceObject);
  1356. __webpack_require__.d(build_module_comment_reply_link_namespaceObject, {
  1357. "init": function() { return comment_reply_link_init; },
  1358. "metadata": function() { return comment_reply_link_metadata; },
  1359. "name": function() { return comment_reply_link_name; },
  1360. "settings": function() { return comment_reply_link_settings; }
  1361. });
  1362. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  1363. var comment_template_namespaceObject = {};
  1364. __webpack_require__.r(comment_template_namespaceObject);
  1365. __webpack_require__.d(comment_template_namespaceObject, {
  1366. "init": function() { return comment_template_init; },
  1367. "metadata": function() { return comment_template_metadata; },
  1368. "name": function() { return comment_template_name; },
  1369. "settings": function() { return comment_template_settings; }
  1370. });
  1371. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  1372. var comments_pagination_previous_namespaceObject = {};
  1373. __webpack_require__.r(comments_pagination_previous_namespaceObject);
  1374. __webpack_require__.d(comments_pagination_previous_namespaceObject, {
  1375. "init": function() { return comments_pagination_previous_init; },
  1376. "metadata": function() { return comments_pagination_previous_metadata; },
  1377. "name": function() { return comments_pagination_previous_name; },
  1378. "settings": function() { return comments_pagination_previous_settings; }
  1379. });
  1380. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  1381. var comments_pagination_namespaceObject = {};
  1382. __webpack_require__.r(comments_pagination_namespaceObject);
  1383. __webpack_require__.d(comments_pagination_namespaceObject, {
  1384. "init": function() { return comments_pagination_init; },
  1385. "metadata": function() { return comments_pagination_metadata; },
  1386. "name": function() { return comments_pagination_name; },
  1387. "settings": function() { return comments_pagination_settings; }
  1388. });
  1389. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  1390. var comments_pagination_next_namespaceObject = {};
  1391. __webpack_require__.r(comments_pagination_next_namespaceObject);
  1392. __webpack_require__.d(comments_pagination_next_namespaceObject, {
  1393. "init": function() { return comments_pagination_next_init; },
  1394. "metadata": function() { return comments_pagination_next_metadata; },
  1395. "name": function() { return comments_pagination_next_name; },
  1396. "settings": function() { return comments_pagination_next_settings; }
  1397. });
  1398. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  1399. var comments_pagination_numbers_namespaceObject = {};
  1400. __webpack_require__.r(comments_pagination_numbers_namespaceObject);
  1401. __webpack_require__.d(comments_pagination_numbers_namespaceObject, {
  1402. "init": function() { return comments_pagination_numbers_init; },
  1403. "metadata": function() { return comments_pagination_numbers_metadata; },
  1404. "name": function() { return comments_pagination_numbers_name; },
  1405. "settings": function() { return comments_pagination_numbers_settings; }
  1406. });
  1407. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  1408. var comments_title_namespaceObject = {};
  1409. __webpack_require__.r(comments_title_namespaceObject);
  1410. __webpack_require__.d(comments_title_namespaceObject, {
  1411. "init": function() { return comments_title_init; },
  1412. "metadata": function() { return comments_title_metadata; },
  1413. "name": function() { return comments_title_name; },
  1414. "settings": function() { return comments_title_settings; }
  1415. });
  1416. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  1417. var build_module_cover_namespaceObject = {};
  1418. __webpack_require__.r(build_module_cover_namespaceObject);
  1419. __webpack_require__.d(build_module_cover_namespaceObject, {
  1420. "init": function() { return cover_init; },
  1421. "metadata": function() { return cover_metadata; },
  1422. "name": function() { return cover_name; },
  1423. "settings": function() { return cover_settings; }
  1424. });
  1425. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  1426. var embed_namespaceObject = {};
  1427. __webpack_require__.r(embed_namespaceObject);
  1428. __webpack_require__.d(embed_namespaceObject, {
  1429. "init": function() { return embed_init; },
  1430. "metadata": function() { return embed_metadata; },
  1431. "name": function() { return embed_name; },
  1432. "settings": function() { return embed_settings; }
  1433. });
  1434. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js
  1435. var build_module_file_namespaceObject = {};
  1436. __webpack_require__.r(build_module_file_namespaceObject);
  1437. __webpack_require__.d(build_module_file_namespaceObject, {
  1438. "init": function() { return file_init; },
  1439. "metadata": function() { return file_metadata; },
  1440. "name": function() { return file_name; },
  1441. "settings": function() { return file_settings; }
  1442. });
  1443. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  1444. var build_module_gallery_namespaceObject = {};
  1445. __webpack_require__.r(build_module_gallery_namespaceObject);
  1446. __webpack_require__.d(build_module_gallery_namespaceObject, {
  1447. "init": function() { return gallery_init; },
  1448. "metadata": function() { return gallery_metadata; },
  1449. "name": function() { return gallery_name; },
  1450. "settings": function() { return gallery_settings; }
  1451. });
  1452. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js
  1453. var build_module_group_namespaceObject = {};
  1454. __webpack_require__.r(build_module_group_namespaceObject);
  1455. __webpack_require__.d(build_module_group_namespaceObject, {
  1456. "init": function() { return group_init; },
  1457. "metadata": function() { return group_metadata; },
  1458. "name": function() { return group_name; },
  1459. "settings": function() { return group_settings; }
  1460. });
  1461. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  1462. var build_module_heading_namespaceObject = {};
  1463. __webpack_require__.r(build_module_heading_namespaceObject);
  1464. __webpack_require__.d(build_module_heading_namespaceObject, {
  1465. "init": function() { return heading_init; },
  1466. "metadata": function() { return heading_metadata; },
  1467. "name": function() { return heading_name; },
  1468. "settings": function() { return heading_settings; }
  1469. });
  1470. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  1471. var home_link_namespaceObject = {};
  1472. __webpack_require__.r(home_link_namespaceObject);
  1473. __webpack_require__.d(home_link_namespaceObject, {
  1474. "init": function() { return home_link_init; },
  1475. "metadata": function() { return home_link_metadata; },
  1476. "name": function() { return home_link_name; },
  1477. "settings": function() { return home_link_settings; }
  1478. });
  1479. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js
  1480. var build_module_html_namespaceObject = {};
  1481. __webpack_require__.r(build_module_html_namespaceObject);
  1482. __webpack_require__.d(build_module_html_namespaceObject, {
  1483. "init": function() { return html_init; },
  1484. "metadata": function() { return html_metadata; },
  1485. "name": function() { return html_name; },
  1486. "settings": function() { return html_settings; }
  1487. });
  1488. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js
  1489. var build_module_image_namespaceObject = {};
  1490. __webpack_require__.r(build_module_image_namespaceObject);
  1491. __webpack_require__.d(build_module_image_namespaceObject, {
  1492. "init": function() { return image_init; },
  1493. "metadata": function() { return image_metadata; },
  1494. "name": function() { return image_name; },
  1495. "settings": function() { return image_settings; }
  1496. });
  1497. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  1498. var latest_comments_namespaceObject = {};
  1499. __webpack_require__.r(latest_comments_namespaceObject);
  1500. __webpack_require__.d(latest_comments_namespaceObject, {
  1501. "init": function() { return latest_comments_init; },
  1502. "metadata": function() { return latest_comments_metadata; },
  1503. "name": function() { return latest_comments_name; },
  1504. "settings": function() { return latest_comments_settings; }
  1505. });
  1506. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  1507. var latest_posts_namespaceObject = {};
  1508. __webpack_require__.r(latest_posts_namespaceObject);
  1509. __webpack_require__.d(latest_posts_namespaceObject, {
  1510. "init": function() { return latest_posts_init; },
  1511. "metadata": function() { return latest_posts_metadata; },
  1512. "name": function() { return latest_posts_name; },
  1513. "settings": function() { return latest_posts_settings; }
  1514. });
  1515. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js
  1516. var build_module_list_namespaceObject = {};
  1517. __webpack_require__.r(build_module_list_namespaceObject);
  1518. __webpack_require__.d(build_module_list_namespaceObject, {
  1519. "init": function() { return list_init; },
  1520. "metadata": function() { return list_metadata; },
  1521. "name": function() { return list_name; },
  1522. "settings": function() { return list_settings; }
  1523. });
  1524. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js
  1525. var build_module_list_item_namespaceObject = {};
  1526. __webpack_require__.r(build_module_list_item_namespaceObject);
  1527. __webpack_require__.d(build_module_list_item_namespaceObject, {
  1528. "init": function() { return list_item_init; },
  1529. "metadata": function() { return list_item_metadata; },
  1530. "name": function() { return list_item_name; },
  1531. "settings": function() { return list_item_settings; }
  1532. });
  1533. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  1534. var loginout_namespaceObject = {};
  1535. __webpack_require__.r(loginout_namespaceObject);
  1536. __webpack_require__.d(loginout_namespaceObject, {
  1537. "init": function() { return loginout_init; },
  1538. "metadata": function() { return loginout_metadata; },
  1539. "name": function() { return loginout_name; },
  1540. "settings": function() { return loginout_settings; }
  1541. });
  1542. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  1543. var media_text_namespaceObject = {};
  1544. __webpack_require__.r(media_text_namespaceObject);
  1545. __webpack_require__.d(media_text_namespaceObject, {
  1546. "init": function() { return media_text_init; },
  1547. "metadata": function() { return media_text_metadata; },
  1548. "name": function() { return media_text_name; },
  1549. "settings": function() { return media_text_settings; }
  1550. });
  1551. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  1552. var missing_namespaceObject = {};
  1553. __webpack_require__.r(missing_namespaceObject);
  1554. __webpack_require__.d(missing_namespaceObject, {
  1555. "init": function() { return missing_init; },
  1556. "metadata": function() { return missing_metadata; },
  1557. "name": function() { return missing_name; },
  1558. "settings": function() { return missing_settings; }
  1559. });
  1560. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js
  1561. var build_module_more_namespaceObject = {};
  1562. __webpack_require__.r(build_module_more_namespaceObject);
  1563. __webpack_require__.d(build_module_more_namespaceObject, {
  1564. "init": function() { return more_init; },
  1565. "metadata": function() { return more_metadata; },
  1566. "name": function() { return more_name; },
  1567. "settings": function() { return more_settings; }
  1568. });
  1569. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  1570. var build_module_navigation_namespaceObject = {};
  1571. __webpack_require__.r(build_module_navigation_namespaceObject);
  1572. __webpack_require__.d(build_module_navigation_namespaceObject, {
  1573. "init": function() { return navigation_init; },
  1574. "metadata": function() { return navigation_metadata; },
  1575. "name": function() { return navigation_name; },
  1576. "settings": function() { return navigation_settings; }
  1577. });
  1578. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  1579. var navigation_link_namespaceObject = {};
  1580. __webpack_require__.r(navigation_link_namespaceObject);
  1581. __webpack_require__.d(navigation_link_namespaceObject, {
  1582. "init": function() { return navigation_link_init; },
  1583. "metadata": function() { return navigation_link_metadata; },
  1584. "name": function() { return navigation_link_name; },
  1585. "settings": function() { return navigation_link_settings; }
  1586. });
  1587. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  1588. var navigation_submenu_namespaceObject = {};
  1589. __webpack_require__.r(navigation_submenu_namespaceObject);
  1590. __webpack_require__.d(navigation_submenu_namespaceObject, {
  1591. "init": function() { return navigation_submenu_init; },
  1592. "metadata": function() { return navigation_submenu_metadata; },
  1593. "name": function() { return navigation_submenu_name; },
  1594. "settings": function() { return navigation_submenu_settings; }
  1595. });
  1596. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  1597. var nextpage_namespaceObject = {};
  1598. __webpack_require__.r(nextpage_namespaceObject);
  1599. __webpack_require__.d(nextpage_namespaceObject, {
  1600. "init": function() { return nextpage_init; },
  1601. "metadata": function() { return nextpage_metadata; },
  1602. "name": function() { return nextpage_name; },
  1603. "settings": function() { return nextpage_settings; }
  1604. });
  1605. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  1606. var pattern_namespaceObject = {};
  1607. __webpack_require__.r(pattern_namespaceObject);
  1608. __webpack_require__.d(pattern_namespaceObject, {
  1609. "init": function() { return pattern_init; },
  1610. "metadata": function() { return pattern_metadata; },
  1611. "name": function() { return pattern_name; },
  1612. "settings": function() { return pattern_settings; }
  1613. });
  1614. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  1615. var page_list_namespaceObject = {};
  1616. __webpack_require__.r(page_list_namespaceObject);
  1617. __webpack_require__.d(page_list_namespaceObject, {
  1618. "init": function() { return page_list_init; },
  1619. "metadata": function() { return page_list_metadata; },
  1620. "name": function() { return page_list_name; },
  1621. "settings": function() { return page_list_settings; }
  1622. });
  1623. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  1624. var build_module_paragraph_namespaceObject = {};
  1625. __webpack_require__.r(build_module_paragraph_namespaceObject);
  1626. __webpack_require__.d(build_module_paragraph_namespaceObject, {
  1627. "init": function() { return paragraph_init; },
  1628. "metadata": function() { return paragraph_metadata; },
  1629. "name": function() { return paragraph_name; },
  1630. "settings": function() { return paragraph_settings; }
  1631. });
  1632. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  1633. var build_module_post_author_namespaceObject = {};
  1634. __webpack_require__.r(build_module_post_author_namespaceObject);
  1635. __webpack_require__.d(build_module_post_author_namespaceObject, {
  1636. "init": function() { return post_author_init; },
  1637. "metadata": function() { return post_author_metadata; },
  1638. "name": function() { return post_author_name; },
  1639. "settings": function() { return post_author_settings; }
  1640. });
  1641. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js
  1642. var post_author_name_namespaceObject = {};
  1643. __webpack_require__.r(post_author_name_namespaceObject);
  1644. __webpack_require__.d(post_author_name_namespaceObject, {
  1645. "init": function() { return post_author_name_init; },
  1646. "metadata": function() { return post_author_name_metadata; },
  1647. "name": function() { return post_author_name_name; },
  1648. "settings": function() { return post_author_name_settings; }
  1649. });
  1650. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  1651. var post_author_biography_namespaceObject = {};
  1652. __webpack_require__.r(post_author_biography_namespaceObject);
  1653. __webpack_require__.d(post_author_biography_namespaceObject, {
  1654. "init": function() { return post_author_biography_init; },
  1655. "metadata": function() { return post_author_biography_metadata; },
  1656. "name": function() { return post_author_biography_name; },
  1657. "settings": function() { return post_author_biography_settings; }
  1658. });
  1659. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js
  1660. var post_comment_namespaceObject = {};
  1661. __webpack_require__.r(post_comment_namespaceObject);
  1662. __webpack_require__.d(post_comment_namespaceObject, {
  1663. "init": function() { return post_comment_init; },
  1664. "metadata": function() { return post_comment_metadata; },
  1665. "name": function() { return post_comment_name; },
  1666. "settings": function() { return post_comment_settings; }
  1667. });
  1668. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js
  1669. var build_module_post_comments_count_namespaceObject = {};
  1670. __webpack_require__.r(build_module_post_comments_count_namespaceObject);
  1671. __webpack_require__.d(build_module_post_comments_count_namespaceObject, {
  1672. "init": function() { return post_comments_count_init; },
  1673. "metadata": function() { return post_comments_count_metadata; },
  1674. "name": function() { return post_comments_count_name; },
  1675. "settings": function() { return post_comments_count_settings; }
  1676. });
  1677. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  1678. var build_module_post_comments_form_namespaceObject = {};
  1679. __webpack_require__.r(build_module_post_comments_form_namespaceObject);
  1680. __webpack_require__.d(build_module_post_comments_form_namespaceObject, {
  1681. "init": function() { return post_comments_form_init; },
  1682. "metadata": function() { return post_comments_form_metadata; },
  1683. "name": function() { return post_comments_form_name; },
  1684. "settings": function() { return post_comments_form_settings; }
  1685. });
  1686. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js
  1687. var post_comments_link_namespaceObject = {};
  1688. __webpack_require__.r(post_comments_link_namespaceObject);
  1689. __webpack_require__.d(post_comments_link_namespaceObject, {
  1690. "init": function() { return post_comments_link_init; },
  1691. "metadata": function() { return post_comments_link_metadata; },
  1692. "name": function() { return post_comments_link_name; },
  1693. "settings": function() { return post_comments_link_settings; }
  1694. });
  1695. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  1696. var build_module_post_content_namespaceObject = {};
  1697. __webpack_require__.r(build_module_post_content_namespaceObject);
  1698. __webpack_require__.d(build_module_post_content_namespaceObject, {
  1699. "init": function() { return post_content_init; },
  1700. "metadata": function() { return post_content_metadata; },
  1701. "name": function() { return post_content_name; },
  1702. "settings": function() { return post_content_settings; }
  1703. });
  1704. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  1705. var build_module_post_date_namespaceObject = {};
  1706. __webpack_require__.r(build_module_post_date_namespaceObject);
  1707. __webpack_require__.d(build_module_post_date_namespaceObject, {
  1708. "init": function() { return post_date_init; },
  1709. "metadata": function() { return post_date_metadata; },
  1710. "name": function() { return post_date_name; },
  1711. "settings": function() { return post_date_settings; }
  1712. });
  1713. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  1714. var build_module_post_excerpt_namespaceObject = {};
  1715. __webpack_require__.r(build_module_post_excerpt_namespaceObject);
  1716. __webpack_require__.d(build_module_post_excerpt_namespaceObject, {
  1717. "init": function() { return post_excerpt_init; },
  1718. "metadata": function() { return post_excerpt_metadata; },
  1719. "name": function() { return post_excerpt_name; },
  1720. "settings": function() { return post_excerpt_settings; }
  1721. });
  1722. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  1723. var build_module_post_featured_image_namespaceObject = {};
  1724. __webpack_require__.r(build_module_post_featured_image_namespaceObject);
  1725. __webpack_require__.d(build_module_post_featured_image_namespaceObject, {
  1726. "init": function() { return post_featured_image_init; },
  1727. "metadata": function() { return post_featured_image_metadata; },
  1728. "name": function() { return post_featured_image_name; },
  1729. "settings": function() { return post_featured_image_settings; }
  1730. });
  1731. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  1732. var post_navigation_link_namespaceObject = {};
  1733. __webpack_require__.r(post_navigation_link_namespaceObject);
  1734. __webpack_require__.d(post_navigation_link_namespaceObject, {
  1735. "init": function() { return post_navigation_link_init; },
  1736. "metadata": function() { return post_navigation_link_metadata; },
  1737. "name": function() { return post_navigation_link_name; },
  1738. "settings": function() { return post_navigation_link_settings; }
  1739. });
  1740. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  1741. var post_template_namespaceObject = {};
  1742. __webpack_require__.r(post_template_namespaceObject);
  1743. __webpack_require__.d(post_template_namespaceObject, {
  1744. "init": function() { return post_template_init; },
  1745. "metadata": function() { return post_template_metadata; },
  1746. "name": function() { return post_template_name; },
  1747. "settings": function() { return post_template_settings; }
  1748. });
  1749. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  1750. var build_module_post_terms_namespaceObject = {};
  1751. __webpack_require__.r(build_module_post_terms_namespaceObject);
  1752. __webpack_require__.d(build_module_post_terms_namespaceObject, {
  1753. "init": function() { return post_terms_init; },
  1754. "metadata": function() { return post_terms_metadata; },
  1755. "name": function() { return post_terms_name; },
  1756. "settings": function() { return post_terms_settings; }
  1757. });
  1758. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  1759. var post_title_namespaceObject = {};
  1760. __webpack_require__.r(post_title_namespaceObject);
  1761. __webpack_require__.d(post_title_namespaceObject, {
  1762. "init": function() { return post_title_init; },
  1763. "metadata": function() { return post_title_metadata; },
  1764. "name": function() { return post_title_name; },
  1765. "settings": function() { return post_title_settings; }
  1766. });
  1767. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  1768. var build_module_preformatted_namespaceObject = {};
  1769. __webpack_require__.r(build_module_preformatted_namespaceObject);
  1770. __webpack_require__.d(build_module_preformatted_namespaceObject, {
  1771. "init": function() { return preformatted_init; },
  1772. "metadata": function() { return preformatted_metadata; },
  1773. "name": function() { return preformatted_name; },
  1774. "settings": function() { return preformatted_settings; }
  1775. });
  1776. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  1777. var build_module_pullquote_namespaceObject = {};
  1778. __webpack_require__.r(build_module_pullquote_namespaceObject);
  1779. __webpack_require__.d(build_module_pullquote_namespaceObject, {
  1780. "init": function() { return pullquote_init; },
  1781. "metadata": function() { return pullquote_metadata; },
  1782. "name": function() { return pullquote_name; },
  1783. "settings": function() { return pullquote_settings; }
  1784. });
  1785. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js
  1786. var query_namespaceObject = {};
  1787. __webpack_require__.r(query_namespaceObject);
  1788. __webpack_require__.d(query_namespaceObject, {
  1789. "init": function() { return query_init; },
  1790. "metadata": function() { return query_metadata; },
  1791. "name": function() { return query_name; },
  1792. "settings": function() { return query_settings; }
  1793. });
  1794. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  1795. var query_no_results_namespaceObject = {};
  1796. __webpack_require__.r(query_no_results_namespaceObject);
  1797. __webpack_require__.d(query_no_results_namespaceObject, {
  1798. "init": function() { return query_no_results_init; },
  1799. "metadata": function() { return query_no_results_metadata; },
  1800. "name": function() { return query_no_results_name; },
  1801. "settings": function() { return query_no_results_settings; }
  1802. });
  1803. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  1804. var build_module_query_pagination_namespaceObject = {};
  1805. __webpack_require__.r(build_module_query_pagination_namespaceObject);
  1806. __webpack_require__.d(build_module_query_pagination_namespaceObject, {
  1807. "init": function() { return query_pagination_init; },
  1808. "metadata": function() { return query_pagination_metadata; },
  1809. "name": function() { return query_pagination_name; },
  1810. "settings": function() { return query_pagination_settings; }
  1811. });
  1812. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  1813. var build_module_query_pagination_next_namespaceObject = {};
  1814. __webpack_require__.r(build_module_query_pagination_next_namespaceObject);
  1815. __webpack_require__.d(build_module_query_pagination_next_namespaceObject, {
  1816. "init": function() { return query_pagination_next_init; },
  1817. "metadata": function() { return query_pagination_next_metadata; },
  1818. "name": function() { return query_pagination_next_name; },
  1819. "settings": function() { return query_pagination_next_settings; }
  1820. });
  1821. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  1822. var build_module_query_pagination_numbers_namespaceObject = {};
  1823. __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject);
  1824. __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, {
  1825. "init": function() { return query_pagination_numbers_init; },
  1826. "metadata": function() { return query_pagination_numbers_metadata; },
  1827. "name": function() { return query_pagination_numbers_name; },
  1828. "settings": function() { return query_pagination_numbers_settings; }
  1829. });
  1830. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  1831. var build_module_query_pagination_previous_namespaceObject = {};
  1832. __webpack_require__.r(build_module_query_pagination_previous_namespaceObject);
  1833. __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, {
  1834. "init": function() { return query_pagination_previous_init; },
  1835. "metadata": function() { return query_pagination_previous_metadata; },
  1836. "name": function() { return query_pagination_previous_name; },
  1837. "settings": function() { return query_pagination_previous_settings; }
  1838. });
  1839. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  1840. var query_title_namespaceObject = {};
  1841. __webpack_require__.r(query_title_namespaceObject);
  1842. __webpack_require__.d(query_title_namespaceObject, {
  1843. "init": function() { return query_title_init; },
  1844. "metadata": function() { return query_title_metadata; },
  1845. "name": function() { return query_title_name; },
  1846. "settings": function() { return query_title_settings; }
  1847. });
  1848. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  1849. var build_module_quote_namespaceObject = {};
  1850. __webpack_require__.r(build_module_quote_namespaceObject);
  1851. __webpack_require__.d(build_module_quote_namespaceObject, {
  1852. "init": function() { return quote_init; },
  1853. "metadata": function() { return quote_metadata; },
  1854. "name": function() { return quote_name; },
  1855. "settings": function() { return quote_settings; }
  1856. });
  1857. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js
  1858. var block_namespaceObject = {};
  1859. __webpack_require__.r(block_namespaceObject);
  1860. __webpack_require__.d(block_namespaceObject, {
  1861. "init": function() { return block_init; },
  1862. "metadata": function() { return block_metadata; },
  1863. "name": function() { return block_name; },
  1864. "settings": function() { return block_settings; }
  1865. });
  1866. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  1867. var read_more_namespaceObject = {};
  1868. __webpack_require__.r(read_more_namespaceObject);
  1869. __webpack_require__.d(read_more_namespaceObject, {
  1870. "init": function() { return read_more_init; },
  1871. "metadata": function() { return read_more_metadata; },
  1872. "name": function() { return read_more_name; },
  1873. "settings": function() { return read_more_settings; }
  1874. });
  1875. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  1876. var build_module_rss_namespaceObject = {};
  1877. __webpack_require__.r(build_module_rss_namespaceObject);
  1878. __webpack_require__.d(build_module_rss_namespaceObject, {
  1879. "init": function() { return rss_init; },
  1880. "metadata": function() { return rss_metadata; },
  1881. "name": function() { return rss_name; },
  1882. "settings": function() { return rss_settings; }
  1883. });
  1884. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js
  1885. var build_module_search_namespaceObject = {};
  1886. __webpack_require__.r(build_module_search_namespaceObject);
  1887. __webpack_require__.d(build_module_search_namespaceObject, {
  1888. "init": function() { return search_init; },
  1889. "metadata": function() { return search_metadata; },
  1890. "name": function() { return search_name; },
  1891. "settings": function() { return search_settings; }
  1892. });
  1893. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  1894. var build_module_separator_namespaceObject = {};
  1895. __webpack_require__.r(build_module_separator_namespaceObject);
  1896. __webpack_require__.d(build_module_separator_namespaceObject, {
  1897. "init": function() { return separator_init; },
  1898. "metadata": function() { return separator_metadata; },
  1899. "name": function() { return separator_name; },
  1900. "settings": function() { return separator_settings; }
  1901. });
  1902. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  1903. var build_module_shortcode_namespaceObject = {};
  1904. __webpack_require__.r(build_module_shortcode_namespaceObject);
  1905. __webpack_require__.d(build_module_shortcode_namespaceObject, {
  1906. "init": function() { return shortcode_init; },
  1907. "metadata": function() { return shortcode_metadata; },
  1908. "name": function() { return shortcode_name; },
  1909. "settings": function() { return shortcode_settings; }
  1910. });
  1911. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  1912. var build_module_site_logo_namespaceObject = {};
  1913. __webpack_require__.r(build_module_site_logo_namespaceObject);
  1914. __webpack_require__.d(build_module_site_logo_namespaceObject, {
  1915. "init": function() { return site_logo_init; },
  1916. "metadata": function() { return site_logo_metadata; },
  1917. "name": function() { return site_logo_name; },
  1918. "settings": function() { return site_logo_settings; }
  1919. });
  1920. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  1921. var site_tagline_namespaceObject = {};
  1922. __webpack_require__.r(site_tagline_namespaceObject);
  1923. __webpack_require__.d(site_tagline_namespaceObject, {
  1924. "init": function() { return site_tagline_init; },
  1925. "metadata": function() { return site_tagline_metadata; },
  1926. "name": function() { return site_tagline_name; },
  1927. "settings": function() { return site_tagline_settings; }
  1928. });
  1929. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  1930. var site_title_namespaceObject = {};
  1931. __webpack_require__.r(site_title_namespaceObject);
  1932. __webpack_require__.d(site_title_namespaceObject, {
  1933. "init": function() { return site_title_init; },
  1934. "metadata": function() { return site_title_metadata; },
  1935. "name": function() { return site_title_name; },
  1936. "settings": function() { return site_title_settings; }
  1937. });
  1938. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  1939. var social_link_namespaceObject = {};
  1940. __webpack_require__.r(social_link_namespaceObject);
  1941. __webpack_require__.d(social_link_namespaceObject, {
  1942. "init": function() { return social_link_init; },
  1943. "metadata": function() { return social_link_metadata; },
  1944. "name": function() { return social_link_name; },
  1945. "settings": function() { return social_link_settings; }
  1946. });
  1947. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  1948. var social_links_namespaceObject = {};
  1949. __webpack_require__.r(social_links_namespaceObject);
  1950. __webpack_require__.d(social_links_namespaceObject, {
  1951. "init": function() { return social_links_init; },
  1952. "metadata": function() { return social_links_metadata; },
  1953. "name": function() { return social_links_name; },
  1954. "settings": function() { return social_links_settings; }
  1955. });
  1956. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  1957. var spacer_namespaceObject = {};
  1958. __webpack_require__.r(spacer_namespaceObject);
  1959. __webpack_require__.d(spacer_namespaceObject, {
  1960. "init": function() { return spacer_init; },
  1961. "metadata": function() { return spacer_metadata; },
  1962. "name": function() { return spacer_name; },
  1963. "settings": function() { return spacer_settings; }
  1964. });
  1965. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js
  1966. var build_module_table_namespaceObject = {};
  1967. __webpack_require__.r(build_module_table_namespaceObject);
  1968. __webpack_require__.d(build_module_table_namespaceObject, {
  1969. "init": function() { return table_init; },
  1970. "metadata": function() { return table_metadata; },
  1971. "name": function() { return table_name; },
  1972. "settings": function() { return table_settings; }
  1973. });
  1974. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js
  1975. var table_of_contents_namespaceObject = {};
  1976. __webpack_require__.r(table_of_contents_namespaceObject);
  1977. __webpack_require__.d(table_of_contents_namespaceObject, {
  1978. "init": function() { return table_of_contents_init; },
  1979. "metadata": function() { return table_of_contents_metadata; },
  1980. "name": function() { return table_of_contents_name; },
  1981. "settings": function() { return table_of_contents_settings; }
  1982. });
  1983. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  1984. var tag_cloud_namespaceObject = {};
  1985. __webpack_require__.r(tag_cloud_namespaceObject);
  1986. __webpack_require__.d(tag_cloud_namespaceObject, {
  1987. "init": function() { return tag_cloud_init; },
  1988. "metadata": function() { return tag_cloud_metadata; },
  1989. "name": function() { return tag_cloud_name; },
  1990. "settings": function() { return tag_cloud_settings; }
  1991. });
  1992. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  1993. var template_part_namespaceObject = {};
  1994. __webpack_require__.r(template_part_namespaceObject);
  1995. __webpack_require__.d(template_part_namespaceObject, {
  1996. "init": function() { return template_part_init; },
  1997. "metadata": function() { return template_part_metadata; },
  1998. "name": function() { return template_part_name; },
  1999. "settings": function() { return template_part_settings; }
  2000. });
  2001. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  2002. var build_module_term_description_namespaceObject = {};
  2003. __webpack_require__.r(build_module_term_description_namespaceObject);
  2004. __webpack_require__.d(build_module_term_description_namespaceObject, {
  2005. "init": function() { return term_description_init; },
  2006. "metadata": function() { return term_description_metadata; },
  2007. "name": function() { return term_description_name; },
  2008. "settings": function() { return term_description_settings; }
  2009. });
  2010. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  2011. var text_columns_namespaceObject = {};
  2012. __webpack_require__.r(text_columns_namespaceObject);
  2013. __webpack_require__.d(text_columns_namespaceObject, {
  2014. "init": function() { return text_columns_init; },
  2015. "metadata": function() { return text_columns_metadata; },
  2016. "name": function() { return text_columns_name; },
  2017. "settings": function() { return text_columns_settings; }
  2018. });
  2019. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  2020. var build_module_verse_namespaceObject = {};
  2021. __webpack_require__.r(build_module_verse_namespaceObject);
  2022. __webpack_require__.d(build_module_verse_namespaceObject, {
  2023. "init": function() { return verse_init; },
  2024. "metadata": function() { return verse_metadata; },
  2025. "name": function() { return verse_name; },
  2026. "settings": function() { return verse_settings; }
  2027. });
  2028. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js
  2029. var build_module_video_namespaceObject = {};
  2030. __webpack_require__.r(build_module_video_namespaceObject);
  2031. __webpack_require__.d(build_module_video_namespaceObject, {
  2032. "init": function() { return video_init; },
  2033. "metadata": function() { return video_metadata; },
  2034. "name": function() { return video_name; },
  2035. "settings": function() { return video_settings; }
  2036. });
  2037. ;// CONCATENATED MODULE: external ["wp","blocks"]
  2038. var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
  2039. ;// CONCATENATED MODULE: external ["wp","element"]
  2040. var external_wp_element_namespaceObject = window["wp"]["element"];
  2041. ;// CONCATENATED MODULE: external ["wp","primitives"]
  2042. var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
  2043. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js
  2044. /**
  2045. * WordPress dependencies
  2046. */
  2047. const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2048. viewBox: "0 0 24 24",
  2049. xmlns: "http://www.w3.org/2000/svg"
  2050. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2051. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"
  2052. }));
  2053. /* harmony default export */ var library_archive = (archive);
  2054. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/init-block.js
  2055. /**
  2056. * WordPress dependencies
  2057. */
  2058. /**
  2059. * Function to register an individual block.
  2060. *
  2061. * @param {Object} block The block to be registered.
  2062. *
  2063. * @return {?WPBlockType} The block, if it has been successfully registered;
  2064. * otherwise `undefined`.
  2065. */
  2066. function initBlock(block) {
  2067. if (!block) {
  2068. return;
  2069. }
  2070. const {
  2071. metadata,
  2072. settings,
  2073. name
  2074. } = block;
  2075. return (0,external_wp_blocks_namespaceObject.registerBlockType)({
  2076. name,
  2077. ...metadata
  2078. }, settings);
  2079. }
  2080. ;// CONCATENATED MODULE: external ["wp","components"]
  2081. var external_wp_components_namespaceObject = window["wp"]["components"];
  2082. ;// CONCATENATED MODULE: external ["wp","i18n"]
  2083. var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
  2084. ;// CONCATENATED MODULE: external ["wp","blockEditor"]
  2085. var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
  2086. ;// CONCATENATED MODULE: external ["wp","serverSideRender"]
  2087. var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
  2088. var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
  2089. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js
  2090. /**
  2091. * WordPress dependencies
  2092. */
  2093. function ArchivesEdit(_ref) {
  2094. let {
  2095. attributes,
  2096. setAttributes
  2097. } = _ref;
  2098. const {
  2099. showLabel,
  2100. showPostCounts,
  2101. displayAsDropdown,
  2102. type
  2103. } = attributes;
  2104. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  2105. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  2106. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2107. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  2108. checked: displayAsDropdown,
  2109. onChange: () => setAttributes({
  2110. displayAsDropdown: !displayAsDropdown
  2111. })
  2112. }), displayAsDropdown && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2113. label: (0,external_wp_i18n_namespaceObject.__)('Show label'),
  2114. checked: showLabel,
  2115. onChange: () => setAttributes({
  2116. showLabel: !showLabel
  2117. })
  2118. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2119. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  2120. checked: showPostCounts,
  2121. onChange: () => setAttributes({
  2122. showPostCounts: !showPostCounts
  2123. })
  2124. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  2125. label: (0,external_wp_i18n_namespaceObject.__)('Group by:'),
  2126. options: [{
  2127. label: (0,external_wp_i18n_namespaceObject.__)('Year'),
  2128. value: 'yearly'
  2129. }, {
  2130. label: (0,external_wp_i18n_namespaceObject.__)('Month'),
  2131. value: 'monthly'
  2132. }, {
  2133. label: (0,external_wp_i18n_namespaceObject.__)('Week'),
  2134. value: 'weekly'
  2135. }, {
  2136. label: (0,external_wp_i18n_namespaceObject.__)('Day'),
  2137. value: 'daily'
  2138. }],
  2139. value: type,
  2140. onChange: value => setAttributes({
  2141. type: value
  2142. })
  2143. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  2144. block: "core/archives",
  2145. attributes: attributes
  2146. }))));
  2147. }
  2148. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  2149. /**
  2150. * WordPress dependencies
  2151. */
  2152. /**
  2153. * Internal dependencies
  2154. */
  2155. const metadata = {
  2156. $schema: "https://schemas.wp.org/trunk/block.json",
  2157. apiVersion: 2,
  2158. name: "core/archives",
  2159. title: "Archives",
  2160. category: "widgets",
  2161. description: "Display a date archive of your posts.",
  2162. textdomain: "default",
  2163. attributes: {
  2164. displayAsDropdown: {
  2165. type: "boolean",
  2166. "default": false
  2167. },
  2168. showLabel: {
  2169. type: "boolean",
  2170. "default": true
  2171. },
  2172. showPostCounts: {
  2173. type: "boolean",
  2174. "default": false
  2175. },
  2176. type: {
  2177. type: "string",
  2178. "default": "monthly"
  2179. }
  2180. },
  2181. supports: {
  2182. align: true,
  2183. html: false,
  2184. spacing: {
  2185. margin: true,
  2186. padding: true
  2187. },
  2188. typography: {
  2189. fontSize: true,
  2190. lineHeight: true,
  2191. __experimentalFontFamily: true,
  2192. __experimentalFontWeight: true,
  2193. __experimentalFontStyle: true,
  2194. __experimentalTextTransform: true,
  2195. __experimentalTextDecoration: true,
  2196. __experimentalLetterSpacing: true,
  2197. __experimentalDefaultControls: {
  2198. fontSize: true
  2199. }
  2200. }
  2201. },
  2202. editorStyle: "wp-block-archives-editor"
  2203. };
  2204. const {
  2205. name: archives_name
  2206. } = metadata;
  2207. const settings = {
  2208. icon: library_archive,
  2209. example: {},
  2210. edit: ArchivesEdit
  2211. };
  2212. const init = () => initBlock({
  2213. name: archives_name,
  2214. metadata,
  2215. settings
  2216. });
  2217. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
  2218. /**
  2219. * WordPress dependencies
  2220. */
  2221. const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2222. xmlns: "http://www.w3.org/2000/svg",
  2223. viewBox: "0 0 24 24"
  2224. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2225. fillRule: "evenodd",
  2226. d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
  2227. clipRule: "evenodd"
  2228. }));
  2229. /* harmony default export */ var comment_author_avatar = (commentAuthorAvatar);
  2230. ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  2231. function _extends() {
  2232. _extends = Object.assign ? Object.assign.bind() : function (target) {
  2233. for (var i = 1; i < arguments.length; i++) {
  2234. var source = arguments[i];
  2235. for (var key in source) {
  2236. if (Object.prototype.hasOwnProperty.call(source, key)) {
  2237. target[key] = source[key];
  2238. }
  2239. }
  2240. }
  2241. return target;
  2242. };
  2243. return _extends.apply(this, arguments);
  2244. }
  2245. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  2246. var classnames = __webpack_require__(4403);
  2247. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  2248. ;// CONCATENATED MODULE: external ["wp","url"]
  2249. var external_wp_url_namespaceObject = window["wp"]["url"];
  2250. ;// CONCATENATED MODULE: external ["wp","coreData"]
  2251. var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
  2252. ;// CONCATENATED MODULE: external ["wp","data"]
  2253. var external_wp_data_namespaceObject = window["wp"]["data"];
  2254. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
  2255. /**
  2256. * WordPress dependencies
  2257. */
  2258. function getAvatarSizes(sizes) {
  2259. const minSize = sizes ? sizes[0] : 24;
  2260. const maxSize = sizes ? sizes[sizes.length - 1] : 96;
  2261. const maxSizeBuffer = Math.floor(maxSize * 2.5);
  2262. return {
  2263. minSize,
  2264. maxSize: maxSizeBuffer
  2265. };
  2266. }
  2267. function useDefaultAvatar() {
  2268. const {
  2269. avatarURL: defaultAvatarUrl
  2270. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  2271. const {
  2272. getSettings
  2273. } = select(external_wp_blockEditor_namespaceObject.store);
  2274. const {
  2275. __experimentalDiscussionSettings
  2276. } = getSettings();
  2277. return __experimentalDiscussionSettings;
  2278. });
  2279. return defaultAvatarUrl;
  2280. }
  2281. function useCommentAvatar(_ref) {
  2282. let {
  2283. commentId
  2284. } = _ref;
  2285. const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  2286. const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
  2287. const avatarUrls = avatars ? Object.values(avatars) : null;
  2288. const sizes = avatars ? Object.keys(avatars) : null;
  2289. const {
  2290. minSize,
  2291. maxSize
  2292. } = getAvatarSizes(sizes);
  2293. const defaultAvatar = useDefaultAvatar();
  2294. return {
  2295. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  2296. minSize,
  2297. maxSize,
  2298. // translators: %s is the Author name.
  2299. alt: authorName ? // translators: %s is the Author name.
  2300. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  2301. };
  2302. }
  2303. function useUserAvatar(_ref2) {
  2304. let {
  2305. userId,
  2306. postId,
  2307. postType
  2308. } = _ref2;
  2309. const {
  2310. authorDetails
  2311. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  2312. var _getEditedEntityRecor;
  2313. const {
  2314. getEditedEntityRecord,
  2315. getUser
  2316. } = select(external_wp_coreData_namespaceObject.store);
  2317. if (userId) {
  2318. return {
  2319. authorDetails: getUser(userId)
  2320. };
  2321. }
  2322. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  2323. return {
  2324. authorDetails: _authorId ? getUser(_authorId) : null
  2325. };
  2326. }, [postType, postId, userId]);
  2327. const avatarUrls = authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.values(authorDetails.avatar_urls) : null;
  2328. const sizes = authorDetails !== null && authorDetails !== void 0 && authorDetails.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null;
  2329. const {
  2330. minSize,
  2331. maxSize
  2332. } = getAvatarSizes(sizes);
  2333. const defaultAvatar = useDefaultAvatar();
  2334. return {
  2335. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  2336. minSize,
  2337. maxSize,
  2338. alt: authorDetails ? // translators: %s is the Author name.
  2339. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  2340. };
  2341. }
  2342. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
  2343. /**
  2344. * WordPress dependencies
  2345. */
  2346. const AUTHORS_QUERY = {
  2347. who: 'authors',
  2348. per_page: -1,
  2349. _fields: 'id,name',
  2350. context: 'view'
  2351. };
  2352. function UserControl(_ref) {
  2353. let {
  2354. value,
  2355. onChange
  2356. } = _ref;
  2357. const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)();
  2358. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  2359. const {
  2360. getUsers
  2361. } = select(external_wp_coreData_namespaceObject.store);
  2362. return getUsers(AUTHORS_QUERY);
  2363. }, []);
  2364. if (!authorsList) {
  2365. return null;
  2366. }
  2367. const options = authorsList.map(author => {
  2368. return {
  2369. label: author.name,
  2370. value: author.id
  2371. };
  2372. });
  2373. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, {
  2374. label: (0,external_wp_i18n_namespaceObject.__)('User'),
  2375. help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'),
  2376. value: value,
  2377. onChange: onChange,
  2378. options: filteredAuthorsList || options,
  2379. onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
  2380. });
  2381. }
  2382. /* harmony default export */ var user_control = (UserControl);
  2383. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js
  2384. /**
  2385. * External dependencies
  2386. */
  2387. /**
  2388. * WordPress dependencies
  2389. */
  2390. /**
  2391. * Internal dependencies
  2392. */
  2393. const AvatarInspectorControls = _ref => {
  2394. let {
  2395. setAttributes,
  2396. avatar,
  2397. attributes,
  2398. selectUser
  2399. } = _ref;
  2400. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  2401. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  2402. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  2403. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  2404. onChange: newSize => setAttributes({
  2405. size: newSize
  2406. }),
  2407. min: avatar.minSize,
  2408. max: avatar.maxSize,
  2409. initialPosition: attributes === null || attributes === void 0 ? void 0 : attributes.size,
  2410. value: attributes === null || attributes === void 0 ? void 0 : attributes.size
  2411. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2412. label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'),
  2413. onChange: () => setAttributes({
  2414. isLink: !attributes.isLink
  2415. }),
  2416. checked: attributes.isLink
  2417. }), attributes.isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2418. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  2419. onChange: value => setAttributes({
  2420. linkTarget: value ? '_blank' : '_self'
  2421. }),
  2422. checked: attributes.linkTarget === '_blank'
  2423. }), selectUser && (0,external_wp_element_namespaceObject.createElement)(user_control, {
  2424. value: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  2425. onChange: value => {
  2426. setAttributes({
  2427. userId: value
  2428. });
  2429. }
  2430. })));
  2431. };
  2432. const ResizableAvatar = _ref2 => {
  2433. let {
  2434. setAttributes,
  2435. attributes,
  2436. avatar,
  2437. blockProps,
  2438. isSelected
  2439. } = _ref2;
  2440. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  2441. const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar === null || avatar === void 0 ? void 0 : avatar.src, ['s']), {
  2442. s: (attributes === null || attributes === void 0 ? void 0 : attributes.size) * 2
  2443. });
  2444. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  2445. size: {
  2446. width: attributes.size,
  2447. height: attributes.size
  2448. },
  2449. showHandle: isSelected,
  2450. onResizeStop: (event, direction, elt, delta) => {
  2451. setAttributes({
  2452. size: parseInt(attributes.size + (delta.height || delta.width), 10)
  2453. });
  2454. },
  2455. lockAspectRatio: true,
  2456. enable: {
  2457. top: false,
  2458. right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
  2459. bottom: true,
  2460. left: (0,external_wp_i18n_namespaceObject.isRTL)()
  2461. },
  2462. minWidth: avatar.minSize,
  2463. maxWidth: avatar.maxSize
  2464. }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  2465. src: doubledSizedSrc,
  2466. alt: avatar.alt
  2467. }, borderProps, {
  2468. className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className),
  2469. style: { ...borderProps.style // Border radius, width and style.
  2470. }
  2471. }))));
  2472. };
  2473. const CommentEdit = _ref3 => {
  2474. let {
  2475. attributes,
  2476. context,
  2477. setAttributes,
  2478. isSelected
  2479. } = _ref3;
  2480. const {
  2481. commentId
  2482. } = context;
  2483. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  2484. const avatar = useCommentAvatar({
  2485. commentId
  2486. });
  2487. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  2488. avatar: avatar,
  2489. setAttributes: setAttributes,
  2490. attributes: attributes,
  2491. selectUser: false
  2492. }), attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  2493. href: "#avatar-pseudo-link",
  2494. className: "wp-block-avatar__link",
  2495. onClick: event => event.preventDefault()
  2496. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  2497. attributes: attributes,
  2498. avatar: avatar,
  2499. blockProps: blockProps,
  2500. isSelected: isSelected,
  2501. setAttributes: setAttributes
  2502. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  2503. attributes: attributes,
  2504. avatar: avatar,
  2505. blockProps: blockProps,
  2506. isSelected: isSelected,
  2507. setAttributes: setAttributes
  2508. }));
  2509. };
  2510. const UserEdit = _ref4 => {
  2511. let {
  2512. attributes,
  2513. context,
  2514. setAttributes,
  2515. isSelected
  2516. } = _ref4;
  2517. const {
  2518. postId,
  2519. postType
  2520. } = context;
  2521. const avatar = useUserAvatar({
  2522. userId: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  2523. postId,
  2524. postType
  2525. });
  2526. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  2527. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  2528. selectUser: true,
  2529. attributes: attributes,
  2530. avatar: avatar,
  2531. setAttributes: setAttributes
  2532. }), (0,external_wp_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  2533. href: "#avatar-pseudo-link",
  2534. className: "wp-block-avatar__link",
  2535. onClick: event => event.preventDefault()
  2536. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  2537. attributes: attributes,
  2538. avatar: avatar,
  2539. blockProps: blockProps,
  2540. isSelected: isSelected,
  2541. setAttributes: setAttributes
  2542. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  2543. attributes: attributes,
  2544. avatar: avatar,
  2545. blockProps: blockProps,
  2546. isSelected: isSelected,
  2547. setAttributes: setAttributes
  2548. })));
  2549. };
  2550. function Edit(props) {
  2551. var _props$context, _props$context2;
  2552. // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).
  2553. if (props !== null && props !== void 0 && (_props$context = props.context) !== null && _props$context !== void 0 && _props$context.commentId || (props === null || props === void 0 ? void 0 : (_props$context2 = props.context) === null || _props$context2 === void 0 ? void 0 : _props$context2.commentId) === null) {
  2554. return (0,external_wp_element_namespaceObject.createElement)(CommentEdit, props);
  2555. }
  2556. return (0,external_wp_element_namespaceObject.createElement)(UserEdit, props);
  2557. }
  2558. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  2559. /**
  2560. * WordPress dependencies
  2561. */
  2562. /**
  2563. * Internal dependencies
  2564. */
  2565. const avatar_metadata = {
  2566. $schema: "https://schemas.wp.org/trunk/block.json",
  2567. apiVersion: 2,
  2568. name: "core/avatar",
  2569. title: "Avatar",
  2570. category: "theme",
  2571. description: "Add a user's avatar.",
  2572. textdomain: "default",
  2573. attributes: {
  2574. userId: {
  2575. type: "number"
  2576. },
  2577. size: {
  2578. type: "number",
  2579. "default": 96
  2580. },
  2581. isLink: {
  2582. type: "boolean",
  2583. "default": false
  2584. },
  2585. linkTarget: {
  2586. type: "string",
  2587. "default": "_self"
  2588. }
  2589. },
  2590. usesContext: ["postType", "postId", "commentId"],
  2591. supports: {
  2592. html: false,
  2593. align: true,
  2594. alignWide: false,
  2595. spacing: {
  2596. margin: true,
  2597. padding: true
  2598. },
  2599. __experimentalBorder: {
  2600. __experimentalSkipSerialization: true,
  2601. radius: true,
  2602. width: true,
  2603. color: true,
  2604. style: true,
  2605. __experimentalDefaultControls: {
  2606. radius: true
  2607. }
  2608. },
  2609. color: {
  2610. text: false,
  2611. background: false,
  2612. __experimentalDuotone: "img"
  2613. }
  2614. },
  2615. editorStyle: "wp-block-avatar",
  2616. style: "wp-block-avatar"
  2617. };
  2618. const {
  2619. name: avatar_name
  2620. } = avatar_metadata;
  2621. const avatar_settings = {
  2622. icon: comment_author_avatar,
  2623. edit: Edit
  2624. };
  2625. const avatar_init = () => initBlock({
  2626. name: avatar_name,
  2627. metadata: avatar_metadata,
  2628. settings: avatar_settings
  2629. });
  2630. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js
  2631. /**
  2632. * WordPress dependencies
  2633. */
  2634. const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2635. viewBox: "0 0 24 24",
  2636. xmlns: "http://www.w3.org/2000/svg"
  2637. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2638. d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"
  2639. }));
  2640. /* harmony default export */ var library_audio = (audio);
  2641. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
  2642. /**
  2643. * WordPress dependencies
  2644. */
  2645. /* harmony default export */ var deprecated = ([{
  2646. attributes: {
  2647. src: {
  2648. type: 'string',
  2649. source: 'attribute',
  2650. selector: 'audio',
  2651. attribute: 'src'
  2652. },
  2653. caption: {
  2654. type: 'string',
  2655. source: 'html',
  2656. selector: 'figcaption'
  2657. },
  2658. id: {
  2659. type: 'number'
  2660. },
  2661. autoplay: {
  2662. type: 'boolean',
  2663. source: 'attribute',
  2664. selector: 'audio',
  2665. attribute: 'autoplay'
  2666. },
  2667. loop: {
  2668. type: 'boolean',
  2669. source: 'attribute',
  2670. selector: 'audio',
  2671. attribute: 'loop'
  2672. },
  2673. preload: {
  2674. type: 'string',
  2675. source: 'attribute',
  2676. selector: 'audio',
  2677. attribute: 'preload'
  2678. }
  2679. },
  2680. supports: {
  2681. align: true
  2682. },
  2683. save(_ref) {
  2684. let {
  2685. attributes
  2686. } = _ref;
  2687. const {
  2688. autoplay,
  2689. caption,
  2690. loop,
  2691. preload,
  2692. src
  2693. } = attributes;
  2694. return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", {
  2695. controls: "controls",
  2696. src: src,
  2697. autoPlay: autoplay,
  2698. loop: loop,
  2699. preload: preload
  2700. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  2701. tagName: "figcaption",
  2702. value: caption
  2703. }));
  2704. }
  2705. }]);
  2706. ;// CONCATENATED MODULE: external ["wp","blob"]
  2707. var external_wp_blob_namespaceObject = window["wp"]["blob"];
  2708. ;// CONCATENATED MODULE: external ["wp","notices"]
  2709. var external_wp_notices_namespaceObject = window["wp"]["notices"];
  2710. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js
  2711. const ASPECT_RATIOS = [// Common video resolutions.
  2712. {
  2713. ratio: '2.33',
  2714. className: 'wp-embed-aspect-21-9'
  2715. }, {
  2716. ratio: '2.00',
  2717. className: 'wp-embed-aspect-18-9'
  2718. }, {
  2719. ratio: '1.78',
  2720. className: 'wp-embed-aspect-16-9'
  2721. }, {
  2722. ratio: '1.33',
  2723. className: 'wp-embed-aspect-4-3'
  2724. }, // Vertical video and instagram square video support.
  2725. {
  2726. ratio: '1.00',
  2727. className: 'wp-embed-aspect-1-1'
  2728. }, {
  2729. ratio: '0.56',
  2730. className: 'wp-embed-aspect-9-16'
  2731. }, {
  2732. ratio: '0.50',
  2733. className: 'wp-embed-aspect-1-2'
  2734. }];
  2735. const WP_EMBED_TYPE = 'wp-embed';
  2736. ;// CONCATENATED MODULE: external "lodash"
  2737. var external_lodash_namespaceObject = window["lodash"];
  2738. // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
  2739. var dedupe = __webpack_require__(3827);
  2740. var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe);
  2741. // EXTERNAL MODULE: ./node_modules/memize/index.js
  2742. var memize = __webpack_require__(9756);
  2743. var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
  2744. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js
  2745. /**
  2746. * Internal dependencies
  2747. */
  2748. /**
  2749. * External dependencies
  2750. */
  2751. /**
  2752. * WordPress dependencies
  2753. */
  2754. /**
  2755. * Internal dependencies
  2756. */
  2757. const util_metadata = {
  2758. $schema: "https://schemas.wp.org/trunk/block.json",
  2759. apiVersion: 2,
  2760. name: "core/embed",
  2761. title: "Embed",
  2762. category: "embed",
  2763. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  2764. textdomain: "default",
  2765. attributes: {
  2766. url: {
  2767. type: "string"
  2768. },
  2769. caption: {
  2770. type: "string",
  2771. source: "html",
  2772. selector: "figcaption"
  2773. },
  2774. type: {
  2775. type: "string"
  2776. },
  2777. providerNameSlug: {
  2778. type: "string"
  2779. },
  2780. allowResponsive: {
  2781. type: "boolean",
  2782. "default": true
  2783. },
  2784. responsive: {
  2785. type: "boolean",
  2786. "default": false
  2787. },
  2788. previewable: {
  2789. type: "boolean",
  2790. "default": true
  2791. }
  2792. },
  2793. supports: {
  2794. align: true
  2795. },
  2796. editorStyle: "wp-block-embed-editor",
  2797. style: "wp-block-embed"
  2798. };
  2799. const {
  2800. name: DEFAULT_EMBED_BLOCK
  2801. } = util_metadata;
  2802. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  2803. /**
  2804. * Returns the embed block's information by matching the provided service provider
  2805. *
  2806. * @param {string} provider The embed block's provider
  2807. * @return {WPBlockVariation} The embed block's information
  2808. */
  2809. const getEmbedInfoByProvider = provider => {
  2810. var _getBlockVariations;
  2811. return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
  2812. let {
  2813. name
  2814. } = _ref;
  2815. return name === provider;
  2816. });
  2817. };
  2818. /**
  2819. * Returns true if any of the regular expressions match the URL.
  2820. *
  2821. * @param {string} url The URL to test.
  2822. * @param {Array} patterns The list of regular expressions to test agains.
  2823. * @return {boolean} True if any of the regular expressions match the URL.
  2824. */
  2825. const matchesPatterns = function (url) {
  2826. let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2827. return patterns.some(pattern => url.match(pattern));
  2828. };
  2829. /**
  2830. * Finds the block variation that should be used for the URL,
  2831. * based on the provided URL and the variation's patterns.
  2832. *
  2833. * @param {string} url The URL to test.
  2834. * @return {WPBlockVariation} The block variation that should be used for this URL
  2835. */
  2836. const findMoreSuitableBlock = url => {
  2837. var _getBlockVariations2;
  2838. return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
  2839. let {
  2840. patterns
  2841. } = _ref2;
  2842. return matchesPatterns(url, patterns);
  2843. });
  2844. };
  2845. const isFromWordPress = html => html && html.includes('class="wp-embedded-content"');
  2846. const getPhotoHtml = photo => {
  2847. // If full image url not found use thumbnail.
  2848. const imageUrl = photo.url || photo.thumbnail_url; // 100% width for the preview so it fits nicely into the document, some "thumbnails" are
  2849. // actually the full size photo.
  2850. const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", {
  2851. src: imageUrl,
  2852. alt: photo.title,
  2853. width: "100%"
  2854. }));
  2855. return (0,external_wp_element_namespaceObject.renderToString)(photoPreview);
  2856. };
  2857. /**
  2858. * Creates a more suitable embed block based on the passed in props
  2859. * and attributes generated from an embed block's preview.
  2860. *
  2861. * We require `attributesFromPreview` to be generated from the latest attributes
  2862. * and preview, and because of the way the react lifecycle operates, we can't
  2863. * guarantee that the attributes contained in the block's props are the latest
  2864. * versions, so we require that these are generated separately.
  2865. * See `getAttributesFromPreview` in the generated embed edit component.
  2866. *
  2867. * @param {Object} props The block's props.
  2868. * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.
  2869. * @return {Object|undefined} A more suitable embed block if one exists.
  2870. */
  2871. const createUpgradedEmbedBlock = function (props) {
  2872. var _getBlockVariations3;
  2873. let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2874. const {
  2875. preview,
  2876. attributes = {}
  2877. } = props;
  2878. const {
  2879. url,
  2880. providerNameSlug,
  2881. type,
  2882. ...restAttributes
  2883. } = attributes;
  2884. if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return;
  2885. const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns,
  2886. // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.
  2887. const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found
  2888. // that is different from the current one, create the new matched block.
  2889. const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);
  2890. if (shouldCreateNewBlock) {
  2891. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2892. url,
  2893. ...restAttributes,
  2894. ...matchedBlock.attributes
  2895. });
  2896. }
  2897. const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => {
  2898. let {
  2899. name
  2900. } = _ref3;
  2901. return name === 'wordpress';
  2902. }); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
  2903. if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
  2904. return;
  2905. } // This is not the WordPress embed block so transform it into one.
  2906. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2907. url,
  2908. ...wpVariation.attributes,
  2909. // By now we have the preview, but when the new block first renders, it
  2910. // won't have had all the attributes set, and so won't get the correct
  2911. // type and it won't render correctly. So, we pass through the current attributes
  2912. // here so that the initial render works when we switch to the WordPress
  2913. // block. This only affects the WordPress block because it can't be
  2914. // rendered in the usual Sandbox (it has a sandbox of its own) and it
  2915. // relies on the preview to set the correct render type.
  2916. ...attributesFromPreview
  2917. });
  2918. };
  2919. /**
  2920. * Removes all previously set aspect ratio related classes and return the rest
  2921. * existing class names.
  2922. *
  2923. * @param {string} existingClassNames Any existing class names.
  2924. * @return {string} The class names without any aspect ratio related class.
  2925. */
  2926. const removeAspectRatioClasses = existingClassNames => {
  2927. if (!existingClassNames) {
  2928. // Avoids extraneous work and also, by returning the same value as
  2929. // received, ensures the post is not dirtied by a change of the block
  2930. // attribute from `undefined` to an emtpy string.
  2931. return existingClassNames;
  2932. }
  2933. const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => {
  2934. let {
  2935. className
  2936. } = _ref4;
  2937. accumulator[className] = false;
  2938. return accumulator;
  2939. }, {
  2940. 'wp-has-aspect-ratio': false
  2941. });
  2942. return dedupe_default()(existingClassNames, aspectRatioClassNames);
  2943. };
  2944. /**
  2945. * Returns class names with any relevant responsive aspect ratio names.
  2946. *
  2947. * @param {string} html The preview HTML that possibly contains an iframe with width and height set.
  2948. * @param {string} existingClassNames Any existing class names.
  2949. * @param {boolean} allowResponsive If the responsive class names should be added, or removed.
  2950. * @return {string} Deduped class names.
  2951. */
  2952. function getClassNames(html, existingClassNames) {
  2953. let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2954. if (!allowResponsive) {
  2955. return removeAspectRatioClasses(existingClassNames);
  2956. }
  2957. const previewDocument = document.implementation.createHTMLDocument('');
  2958. previewDocument.body.innerHTML = html;
  2959. const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block.
  2960. if (iframe && iframe.height && iframe.width) {
  2961. const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it.
  2962. for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) {
  2963. const potentialRatio = ASPECT_RATIOS[ratioIndex];
  2964. if (aspectRatio >= potentialRatio.ratio) {
  2965. // Evaluate the difference between actual aspect ratio and closest match.
  2966. // If the difference is too big, do not scale the embed according to aspect ratio.
  2967. const ratioDiff = aspectRatio - potentialRatio.ratio;
  2968. if (ratioDiff > 0.1) {
  2969. // No close aspect ratio match found.
  2970. return removeAspectRatioClasses(existingClassNames);
  2971. } // Close aspect ratio match found.
  2972. return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio');
  2973. }
  2974. }
  2975. }
  2976. return existingClassNames;
  2977. }
  2978. /**
  2979. * Fallback behaviour for unembeddable URLs.
  2980. * Creates a paragraph block containing a link to the URL, and calls `onReplace`.
  2981. *
  2982. * @param {string} url The URL that could not be embedded.
  2983. * @param {Function} onReplace Function to call with the created fallback block.
  2984. */
  2985. function fallback(url, onReplace) {
  2986. const link = (0,external_wp_element_namespaceObject.createElement)("a", {
  2987. href: url
  2988. }, url);
  2989. onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  2990. content: (0,external_wp_element_namespaceObject.renderToString)(link)
  2991. }));
  2992. }
  2993. /***
  2994. * Gets block attributes based on the preview and responsive state.
  2995. *
  2996. * @param {Object} preview The preview data.
  2997. * @param {string} title The block's title, e.g. Twitter.
  2998. * @param {Object} currentClassNames The block's current class names.
  2999. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
  3000. * @param {boolean} allowResponsive Apply responsive classes to fixed size content.
  3001. * @return {Object} Attributes and values.
  3002. */
  3003. const getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) {
  3004. let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  3005. if (!preview) {
  3006. return {};
  3007. }
  3008. const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'.
  3009. let {
  3010. type = 'rich'
  3011. } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title,
  3012. // because not all embed code gives us a provider name.
  3013. const {
  3014. html,
  3015. provider_name: providerName
  3016. } = preview;
  3017. const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase());
  3018. if (isFromWordPress(html)) {
  3019. type = WP_EMBED_TYPE;
  3020. }
  3021. if (html || 'photo' === type) {
  3022. attributes.type = type;
  3023. attributes.providerNameSlug = providerNameSlug;
  3024. }
  3025. attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive);
  3026. return attributes;
  3027. });
  3028. /**
  3029. * Returns the attributes derived from the preview, merged with the current attributes.
  3030. *
  3031. * @param {Object} currentAttributes The current attributes of the block.
  3032. * @param {Object} preview The preview data.
  3033. * @param {string} title The block's title, e.g. Twitter.
  3034. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
  3035. * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.
  3036. * @return {Object} Merged attributes.
  3037. */
  3038. const getMergedAttributesWithPreview = function (currentAttributes, preview, title, isResponsive) {
  3039. let ignorePreviousClassName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  3040. const {
  3041. allowResponsive,
  3042. className
  3043. } = currentAttributes;
  3044. return { ...currentAttributes,
  3045. ...getAttributesFromPreview(preview, title, ignorePreviousClassName ? undefined : className, isResponsive, allowResponsive)
  3046. };
  3047. };
  3048. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js
  3049. /**
  3050. * External dependencies
  3051. */
  3052. /**
  3053. * WordPress dependencies
  3054. */
  3055. /**
  3056. * Internal dependencies
  3057. */
  3058. const ALLOWED_MEDIA_TYPES = ['audio'];
  3059. function AudioEdit(_ref) {
  3060. let {
  3061. attributes,
  3062. className,
  3063. setAttributes,
  3064. onReplace,
  3065. isSelected,
  3066. insertBlocksAfter
  3067. } = _ref;
  3068. const {
  3069. id,
  3070. autoplay,
  3071. caption,
  3072. loop,
  3073. preload,
  3074. src
  3075. } = attributes;
  3076. const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  3077. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  3078. const {
  3079. getSettings
  3080. } = select(external_wp_blockEditor_namespaceObject.store);
  3081. return getSettings().mediaUpload;
  3082. }, []);
  3083. (0,external_wp_element_namespaceObject.useEffect)(() => {
  3084. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  3085. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  3086. if (file) {
  3087. mediaUpload({
  3088. filesList: [file],
  3089. onFileChange: _ref2 => {
  3090. let [media] = _ref2;
  3091. return onSelectAudio(media);
  3092. },
  3093. onError: e => onUploadError(e),
  3094. allowedTypes: ALLOWED_MEDIA_TYPES
  3095. });
  3096. }
  3097. }
  3098. }, []);
  3099. function toggleAttribute(attribute) {
  3100. return newValue => {
  3101. setAttributes({
  3102. [attribute]: newValue
  3103. });
  3104. };
  3105. }
  3106. function onSelectURL(newSrc) {
  3107. // Set the block's src from the edit component's state, and switch off
  3108. // the editing UI.
  3109. if (newSrc !== src) {
  3110. // Check if there's an embed block that handles this URL.
  3111. const embedBlock = createUpgradedEmbedBlock({
  3112. attributes: {
  3113. url: newSrc
  3114. }
  3115. });
  3116. if (undefined !== embedBlock && onReplace) {
  3117. onReplace(embedBlock);
  3118. return;
  3119. }
  3120. setAttributes({
  3121. src: newSrc,
  3122. id: undefined
  3123. });
  3124. }
  3125. }
  3126. const {
  3127. createErrorNotice
  3128. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  3129. function onUploadError(message) {
  3130. createErrorNotice(message, {
  3131. type: 'snackbar'
  3132. });
  3133. }
  3134. function getAutoplayHelp(checked) {
  3135. return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null;
  3136. }
  3137. function onSelectAudio(media) {
  3138. if (!media || !media.url) {
  3139. // In this case there was an error and we should continue in the editing state
  3140. // previous attributes should be removed because they may be temporary blob urls.
  3141. setAttributes({
  3142. src: undefined,
  3143. id: undefined
  3144. });
  3145. return;
  3146. } // Sets the block's attribute and updates the edit component from the
  3147. // selected media, then switches off the editing UI.
  3148. setAttributes({
  3149. src: media.url,
  3150. id: media.id
  3151. });
  3152. }
  3153. const classes = classnames_default()(className, {
  3154. 'is-transient': isTemporaryAudio
  3155. });
  3156. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  3157. className: classes
  3158. });
  3159. if (!src) {
  3160. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  3161. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  3162. icon: library_audio
  3163. }),
  3164. onSelect: onSelectAudio,
  3165. onSelectURL: onSelectURL,
  3166. accept: "audio/*",
  3167. allowedTypes: ALLOWED_MEDIA_TYPES,
  3168. value: attributes,
  3169. onError: onUploadError
  3170. }));
  3171. }
  3172. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  3173. group: "other"
  3174. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  3175. mediaId: id,
  3176. mediaURL: src,
  3177. allowedTypes: ALLOWED_MEDIA_TYPES,
  3178. accept: "audio/*",
  3179. onSelect: onSelectAudio,
  3180. onSelectURL: onSelectURL,
  3181. onError: onUploadError
  3182. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  3183. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  3184. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  3185. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  3186. onChange: toggleAttribute('autoplay'),
  3187. checked: autoplay,
  3188. help: getAutoplayHelp
  3189. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  3190. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  3191. onChange: toggleAttribute('loop'),
  3192. checked: loop
  3193. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  3194. label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'),
  3195. value: preload || '' // `undefined` is required for the preload attribute to be unset.
  3196. ,
  3197. onChange: value => setAttributes({
  3198. preload: value || undefined
  3199. }),
  3200. options: [{
  3201. value: '',
  3202. label: (0,external_wp_i18n_namespaceObject.__)('Browser default')
  3203. }, {
  3204. value: 'auto',
  3205. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  3206. }, {
  3207. value: 'metadata',
  3208. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  3209. }, {
  3210. value: 'none',
  3211. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  3212. }]
  3213. }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  3214. isDisabled: !isSelected
  3215. }, (0,external_wp_element_namespaceObject.createElement)("audio", {
  3216. controls: "controls",
  3217. src: src
  3218. })), isTemporaryAudio && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  3219. tagName: "figcaption",
  3220. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  3221. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'),
  3222. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  3223. value: caption,
  3224. onChange: value => setAttributes({
  3225. caption: value
  3226. }),
  3227. inlineToolbar: true,
  3228. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  3229. })));
  3230. }
  3231. /* harmony default export */ var edit = (AudioEdit);
  3232. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js
  3233. /**
  3234. * WordPress dependencies
  3235. */
  3236. function save(_ref) {
  3237. let {
  3238. attributes
  3239. } = _ref;
  3240. const {
  3241. autoplay,
  3242. caption,
  3243. loop,
  3244. preload,
  3245. src
  3246. } = attributes;
  3247. return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", {
  3248. controls: "controls",
  3249. src: src,
  3250. autoPlay: autoplay,
  3251. loop: loop,
  3252. preload: preload
  3253. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3254. tagName: "figcaption",
  3255. value: caption,
  3256. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
  3257. }));
  3258. }
  3259. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
  3260. /**
  3261. * WordPress dependencies
  3262. */
  3263. const transforms = {
  3264. from: [{
  3265. type: 'files',
  3266. isMatch(files) {
  3267. return files.length === 1 && files[0].type.indexOf('audio/') === 0;
  3268. },
  3269. transform(files) {
  3270. const file = files[0]; // We don't need to upload the media directly here
  3271. // It's already done as part of the `componentDidMount`
  3272. // in the audio block.
  3273. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  3274. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  3275. });
  3276. return block;
  3277. }
  3278. }, {
  3279. type: 'shortcode',
  3280. tag: 'audio',
  3281. attributes: {
  3282. src: {
  3283. type: 'string',
  3284. shortcode: _ref => {
  3285. let {
  3286. named: {
  3287. src,
  3288. mp3,
  3289. m4a,
  3290. ogg,
  3291. wav,
  3292. wma
  3293. }
  3294. } = _ref;
  3295. return src || mp3 || m4a || ogg || wav || wma;
  3296. }
  3297. },
  3298. loop: {
  3299. type: 'string',
  3300. shortcode: _ref2 => {
  3301. let {
  3302. named: {
  3303. loop
  3304. }
  3305. } = _ref2;
  3306. return loop;
  3307. }
  3308. },
  3309. autoplay: {
  3310. type: 'string',
  3311. shortcode: _ref3 => {
  3312. let {
  3313. named: {
  3314. autoplay
  3315. }
  3316. } = _ref3;
  3317. return autoplay;
  3318. }
  3319. },
  3320. preload: {
  3321. type: 'string',
  3322. shortcode: _ref4 => {
  3323. let {
  3324. named: {
  3325. preload
  3326. }
  3327. } = _ref4;
  3328. return preload;
  3329. }
  3330. }
  3331. }
  3332. }]
  3333. };
  3334. /* harmony default export */ var audio_transforms = (transforms);
  3335. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  3336. /**
  3337. * WordPress dependencies
  3338. */
  3339. /**
  3340. * Internal dependencies
  3341. */
  3342. const audio_metadata = {
  3343. $schema: "https://schemas.wp.org/trunk/block.json",
  3344. apiVersion: 2,
  3345. name: "core/audio",
  3346. title: "Audio",
  3347. category: "media",
  3348. description: "Embed a simple audio player.",
  3349. keywords: ["music", "sound", "podcast", "recording"],
  3350. textdomain: "default",
  3351. attributes: {
  3352. src: {
  3353. type: "string",
  3354. source: "attribute",
  3355. selector: "audio",
  3356. attribute: "src",
  3357. __experimentalRole: "content"
  3358. },
  3359. caption: {
  3360. type: "string",
  3361. source: "html",
  3362. selector: "figcaption",
  3363. __experimentalRole: "content"
  3364. },
  3365. id: {
  3366. type: "number",
  3367. __experimentalRole: "content"
  3368. },
  3369. autoplay: {
  3370. type: "boolean",
  3371. source: "attribute",
  3372. selector: "audio",
  3373. attribute: "autoplay"
  3374. },
  3375. loop: {
  3376. type: "boolean",
  3377. source: "attribute",
  3378. selector: "audio",
  3379. attribute: "loop"
  3380. },
  3381. preload: {
  3382. type: "string",
  3383. source: "attribute",
  3384. selector: "audio",
  3385. attribute: "preload"
  3386. }
  3387. },
  3388. supports: {
  3389. anchor: true,
  3390. align: true,
  3391. spacing: {
  3392. margin: true,
  3393. padding: true
  3394. }
  3395. },
  3396. editorStyle: "wp-block-audio-editor",
  3397. style: "wp-block-audio"
  3398. };
  3399. const {
  3400. name: audio_name
  3401. } = audio_metadata;
  3402. const audio_settings = {
  3403. icon: library_audio,
  3404. example: {
  3405. attributes: {
  3406. src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg'
  3407. }
  3408. },
  3409. transforms: audio_transforms,
  3410. deprecated: deprecated,
  3411. edit: edit,
  3412. save: save
  3413. };
  3414. const audio_init = () => initBlock({
  3415. name: audio_name,
  3416. metadata: audio_metadata,
  3417. settings: audio_settings
  3418. });
  3419. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js
  3420. /**
  3421. * WordPress dependencies
  3422. */
  3423. const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3424. viewBox: "0 0 24 24",
  3425. xmlns: "http://www.w3.org/2000/svg"
  3426. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3427. d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"
  3428. }));
  3429. /* harmony default export */ var library_button = (button_button);
  3430. ;// CONCATENATED MODULE: external ["wp","compose"]
  3431. var external_wp_compose_namespaceObject = window["wp"]["compose"];
  3432. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js
  3433. /**
  3434. * External dependencies
  3435. */
  3436. const identity = x => x;
  3437. /**
  3438. * Removed empty nodes from nested objects.
  3439. *
  3440. * @param {Object} object
  3441. * @return {Object} Object cleaned from empty nodes.
  3442. */
  3443. const cleanEmptyObject = object => {
  3444. if (object === null || typeof object !== 'object' || Array.isArray(object)) {
  3445. return object;
  3446. }
  3447. const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), identity);
  3448. return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
  3449. };
  3450. /* harmony default export */ var clean_empty_object = (cleanEmptyObject);
  3451. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
  3452. /**
  3453. * Internal dependencies
  3454. */
  3455. /**
  3456. * Migrates the current style.typography.fontFamily attribute,
  3457. * whose value was "var:preset|font-family|helvetica-arial",
  3458. * to the style.fontFamily attribute, whose value will be "helvetica-arial".
  3459. *
  3460. * @param {Object} attributes The current attributes
  3461. * @return {Object} The updated attributes.
  3462. */
  3463. /* harmony default export */ function migrate_font_family(attributes) {
  3464. var _attributes$style, _attributes$style$typ;
  3465. if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) {
  3466. return attributes;
  3467. }
  3468. const {
  3469. fontFamily,
  3470. ...typography
  3471. } = attributes.style.typography;
  3472. return { ...attributes,
  3473. style: clean_empty_object({ ...attributes.style,
  3474. typography
  3475. }),
  3476. fontFamily: fontFamily.split('|').pop()
  3477. };
  3478. }
  3479. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js
  3480. /**
  3481. * External dependencies
  3482. */
  3483. /**
  3484. * WordPress dependencies
  3485. */
  3486. /**
  3487. * Internal dependencies
  3488. */
  3489. const migrateBorderRadius = attributes => {
  3490. var _newAttributes$style, _newAttributes$style$, _newAttributes$style2;
  3491. const {
  3492. borderRadius,
  3493. ...newAttributes
  3494. } = attributes; // We have to check old property `borderRadius` and if
  3495. // `styles.border.radius` is a `number`
  3496. const oldBorderRadius = [borderRadius, (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius].find(possibleBorderRadius => {
  3497. return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0;
  3498. });
  3499. if (!oldBorderRadius) {
  3500. return newAttributes;
  3501. }
  3502. return { ...newAttributes,
  3503. style: { ...newAttributes.style,
  3504. border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border),
  3505. radius: `${oldBorderRadius}px`
  3506. }
  3507. }
  3508. };
  3509. };
  3510. const migrateCustomColorsAndGradients = attributes => {
  3511. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) {
  3512. return attributes;
  3513. }
  3514. const style = {
  3515. color: {}
  3516. };
  3517. if (attributes.customTextColor) {
  3518. style.color.text = attributes.customTextColor;
  3519. }
  3520. if (attributes.customBackgroundColor) {
  3521. style.color.background = attributes.customBackgroundColor;
  3522. }
  3523. if (attributes.customGradient) {
  3524. style.color.gradient = attributes.customGradient;
  3525. }
  3526. const {
  3527. customTextColor,
  3528. customBackgroundColor,
  3529. customGradient,
  3530. ...restAttributes
  3531. } = attributes;
  3532. return { ...restAttributes,
  3533. style
  3534. };
  3535. };
  3536. const oldColorsMigration = attributes => {
  3537. const {
  3538. color,
  3539. textColor,
  3540. ...restAttributes
  3541. } = { ...attributes,
  3542. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  3543. customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined
  3544. };
  3545. return migrateCustomColorsAndGradients(restAttributes);
  3546. };
  3547. const blockAttributes = {
  3548. url: {
  3549. type: 'string',
  3550. source: 'attribute',
  3551. selector: 'a',
  3552. attribute: 'href'
  3553. },
  3554. title: {
  3555. type: 'string',
  3556. source: 'attribute',
  3557. selector: 'a',
  3558. attribute: 'title'
  3559. },
  3560. text: {
  3561. type: 'string',
  3562. source: 'html',
  3563. selector: 'a'
  3564. }
  3565. };
  3566. const v11 = {
  3567. attributes: {
  3568. url: {
  3569. type: 'string',
  3570. source: 'attribute',
  3571. selector: 'a',
  3572. attribute: 'href'
  3573. },
  3574. title: {
  3575. type: 'string',
  3576. source: 'attribute',
  3577. selector: 'a',
  3578. attribute: 'title'
  3579. },
  3580. text: {
  3581. type: 'string',
  3582. source: 'html',
  3583. selector: 'a'
  3584. },
  3585. linkTarget: {
  3586. type: 'string',
  3587. source: 'attribute',
  3588. selector: 'a',
  3589. attribute: 'target'
  3590. },
  3591. rel: {
  3592. type: 'string',
  3593. source: 'attribute',
  3594. selector: 'a',
  3595. attribute: 'rel'
  3596. },
  3597. placeholder: {
  3598. type: 'string'
  3599. },
  3600. backgroundColor: {
  3601. type: 'string'
  3602. },
  3603. textColor: {
  3604. type: 'string'
  3605. },
  3606. gradient: {
  3607. type: 'string'
  3608. },
  3609. width: {
  3610. type: 'number'
  3611. }
  3612. },
  3613. supports: {
  3614. anchor: true,
  3615. align: true,
  3616. alignWide: false,
  3617. color: {
  3618. __experimentalSkipSerialization: true,
  3619. gradients: true,
  3620. __experimentalDefaultControls: {
  3621. background: true,
  3622. text: true
  3623. }
  3624. },
  3625. typography: {
  3626. fontSize: true,
  3627. __experimentalFontFamily: true,
  3628. __experimentalDefaultControls: {
  3629. fontSize: true
  3630. }
  3631. },
  3632. reusable: false,
  3633. spacing: {
  3634. __experimentalSkipSerialization: true,
  3635. padding: ['horizontal', 'vertical'],
  3636. __experimentalDefaultControls: {
  3637. padding: true
  3638. }
  3639. },
  3640. __experimentalBorder: {
  3641. radius: true,
  3642. __experimentalSkipSerialization: true,
  3643. __experimentalDefaultControls: {
  3644. radius: true
  3645. }
  3646. },
  3647. __experimentalSelector: '.wp-block-button__link'
  3648. },
  3649. save(_ref) {
  3650. var _style$border, _style$typography;
  3651. let {
  3652. attributes,
  3653. className
  3654. } = _ref;
  3655. const {
  3656. fontSize,
  3657. linkTarget,
  3658. rel,
  3659. style,
  3660. text,
  3661. title,
  3662. url,
  3663. width
  3664. } = attributes;
  3665. if (!text) {
  3666. return null;
  3667. }
  3668. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  3669. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3670. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3671. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  3672. // For backwards compatibility add style that isn't provided via
  3673. // block support.
  3674. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  3675. });
  3676. const buttonStyle = { ...borderProps.style,
  3677. ...colorProps.style,
  3678. ...spacingProps.style
  3679. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3680. // if it had already been assigned, for the sake of backward-compatibility.
  3681. // A title will no longer be assigned for new or updated button block links.
  3682. const wrapperClasses = classnames_default()(className, {
  3683. [`has-custom-width wp-block-button__width-${width}`]: width,
  3684. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  3685. });
  3686. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3687. className: wrapperClasses
  3688. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3689. tagName: "a",
  3690. className: buttonClasses,
  3691. href: url,
  3692. title: title,
  3693. style: buttonStyle,
  3694. value: text,
  3695. target: linkTarget,
  3696. rel: rel
  3697. }));
  3698. }
  3699. };
  3700. const v10 = {
  3701. attributes: {
  3702. url: {
  3703. type: 'string',
  3704. source: 'attribute',
  3705. selector: 'a',
  3706. attribute: 'href'
  3707. },
  3708. title: {
  3709. type: 'string',
  3710. source: 'attribute',
  3711. selector: 'a',
  3712. attribute: 'title'
  3713. },
  3714. text: {
  3715. type: 'string',
  3716. source: 'html',
  3717. selector: 'a'
  3718. },
  3719. linkTarget: {
  3720. type: 'string',
  3721. source: 'attribute',
  3722. selector: 'a',
  3723. attribute: 'target'
  3724. },
  3725. rel: {
  3726. type: 'string',
  3727. source: 'attribute',
  3728. selector: 'a',
  3729. attribute: 'rel'
  3730. },
  3731. placeholder: {
  3732. type: 'string'
  3733. },
  3734. backgroundColor: {
  3735. type: 'string'
  3736. },
  3737. textColor: {
  3738. type: 'string'
  3739. },
  3740. gradient: {
  3741. type: 'string'
  3742. },
  3743. width: {
  3744. type: 'number'
  3745. }
  3746. },
  3747. supports: {
  3748. anchor: true,
  3749. align: true,
  3750. alignWide: false,
  3751. color: {
  3752. __experimentalSkipSerialization: true,
  3753. gradients: true
  3754. },
  3755. typography: {
  3756. fontSize: true,
  3757. __experimentalFontFamily: true
  3758. },
  3759. reusable: false,
  3760. spacing: {
  3761. __experimentalSkipSerialization: true,
  3762. padding: ['horizontal', 'vertical'],
  3763. __experimentalDefaultControls: {
  3764. padding: true
  3765. }
  3766. },
  3767. __experimentalBorder: {
  3768. radius: true,
  3769. __experimentalSkipSerialization: true
  3770. },
  3771. __experimentalSelector: '.wp-block-button__link'
  3772. },
  3773. save(_ref2) {
  3774. var _style$border2, _style$typography2;
  3775. let {
  3776. attributes,
  3777. className
  3778. } = _ref2;
  3779. const {
  3780. fontSize,
  3781. linkTarget,
  3782. rel,
  3783. style,
  3784. text,
  3785. title,
  3786. url,
  3787. width
  3788. } = attributes;
  3789. if (!text) {
  3790. return null;
  3791. }
  3792. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  3793. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3794. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3795. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  3796. // For backwards compatibility add style that isn't provided via
  3797. // block support.
  3798. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius) === 0
  3799. });
  3800. const buttonStyle = { ...borderProps.style,
  3801. ...colorProps.style,
  3802. ...spacingProps.style
  3803. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3804. // if it had already been assigned, for the sake of backward-compatibility.
  3805. // A title will no longer be assigned for new or updated button block links.
  3806. const wrapperClasses = classnames_default()(className, {
  3807. [`has-custom-width wp-block-button__width-${width}`]: width,
  3808. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontSize)
  3809. });
  3810. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3811. className: wrapperClasses
  3812. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3813. tagName: "a",
  3814. className: buttonClasses,
  3815. href: url,
  3816. title: title,
  3817. style: buttonStyle,
  3818. value: text,
  3819. target: linkTarget,
  3820. rel: rel
  3821. }));
  3822. },
  3823. migrate: migrate_font_family,
  3824. isEligible(_ref3) {
  3825. var _style$typography3;
  3826. let {
  3827. style
  3828. } = _ref3;
  3829. return style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontFamily;
  3830. }
  3831. };
  3832. const deprecated_deprecated = [v11, v10, {
  3833. supports: {
  3834. anchor: true,
  3835. align: true,
  3836. alignWide: false,
  3837. color: {
  3838. __experimentalSkipSerialization: true,
  3839. gradients: true
  3840. },
  3841. typography: {
  3842. fontSize: true,
  3843. __experimentalFontFamily: true
  3844. },
  3845. reusable: false,
  3846. __experimentalSelector: '.wp-block-button__link'
  3847. },
  3848. attributes: { ...blockAttributes,
  3849. linkTarget: {
  3850. type: 'string',
  3851. source: 'attribute',
  3852. selector: 'a',
  3853. attribute: 'target'
  3854. },
  3855. rel: {
  3856. type: 'string',
  3857. source: 'attribute',
  3858. selector: 'a',
  3859. attribute: 'rel'
  3860. },
  3861. placeholder: {
  3862. type: 'string'
  3863. },
  3864. backgroundColor: {
  3865. type: 'string'
  3866. },
  3867. textColor: {
  3868. type: 'string'
  3869. },
  3870. gradient: {
  3871. type: 'string'
  3872. },
  3873. width: {
  3874. type: 'number'
  3875. }
  3876. },
  3877. isEligible(_ref4) {
  3878. var _style$border3;
  3879. let {
  3880. style
  3881. } = _ref4;
  3882. return typeof (style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius) === 'number';
  3883. },
  3884. save(_ref5) {
  3885. var _style$border4, _style$border5, _style$typography4;
  3886. let {
  3887. attributes,
  3888. className
  3889. } = _ref5;
  3890. const {
  3891. fontSize,
  3892. linkTarget,
  3893. rel,
  3894. style,
  3895. text,
  3896. title,
  3897. url,
  3898. width
  3899. } = attributes;
  3900. if (!text) {
  3901. return null;
  3902. }
  3903. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius;
  3904. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3905. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3906. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border5 = style.border) === null || _style$border5 === void 0 ? void 0 : _style$border5.radius) === 0
  3907. });
  3908. const buttonStyle = {
  3909. borderRadius: borderRadius ? borderRadius : undefined,
  3910. ...colorProps.style
  3911. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3912. // if it had already been assigned, for the sake of backward-compatibility.
  3913. // A title will no longer be assigned for new or updated button block links.
  3914. const wrapperClasses = classnames_default()(className, {
  3915. [`has-custom-width wp-block-button__width-${width}`]: width,
  3916. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography4 = style.typography) === null || _style$typography4 === void 0 ? void 0 : _style$typography4.fontSize)
  3917. });
  3918. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3919. className: wrapperClasses
  3920. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3921. tagName: "a",
  3922. className: buttonClasses,
  3923. href: url,
  3924. title: title,
  3925. style: buttonStyle,
  3926. value: text,
  3927. target: linkTarget,
  3928. rel: rel
  3929. }));
  3930. },
  3931. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3932. }, {
  3933. supports: {
  3934. anchor: true,
  3935. align: true,
  3936. alignWide: false,
  3937. color: {
  3938. __experimentalSkipSerialization: true
  3939. },
  3940. reusable: false,
  3941. __experimentalSelector: '.wp-block-button__link'
  3942. },
  3943. attributes: { ...blockAttributes,
  3944. linkTarget: {
  3945. type: 'string',
  3946. source: 'attribute',
  3947. selector: 'a',
  3948. attribute: 'target'
  3949. },
  3950. rel: {
  3951. type: 'string',
  3952. source: 'attribute',
  3953. selector: 'a',
  3954. attribute: 'rel'
  3955. },
  3956. placeholder: {
  3957. type: 'string'
  3958. },
  3959. borderRadius: {
  3960. type: 'number'
  3961. },
  3962. backgroundColor: {
  3963. type: 'string'
  3964. },
  3965. textColor: {
  3966. type: 'string'
  3967. },
  3968. gradient: {
  3969. type: 'string'
  3970. },
  3971. style: {
  3972. type: 'object'
  3973. },
  3974. width: {
  3975. type: 'number'
  3976. }
  3977. },
  3978. save(_ref6) {
  3979. let {
  3980. attributes,
  3981. className
  3982. } = _ref6;
  3983. const {
  3984. borderRadius,
  3985. linkTarget,
  3986. rel,
  3987. text,
  3988. title,
  3989. url,
  3990. width
  3991. } = attributes;
  3992. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3993. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3994. 'no-border-radius': borderRadius === 0
  3995. });
  3996. const buttonStyle = {
  3997. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  3998. ...colorProps.style
  3999. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  4000. // if it had already been assigned, for the sake of backward-compatibility.
  4001. // A title will no longer be assigned for new or updated button block links.
  4002. const wrapperClasses = classnames_default()(className, {
  4003. [`has-custom-width wp-block-button__width-${width}`]: width
  4004. });
  4005. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  4006. className: wrapperClasses
  4007. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4008. tagName: "a",
  4009. className: buttonClasses,
  4010. href: url,
  4011. title: title,
  4012. style: buttonStyle,
  4013. value: text,
  4014. target: linkTarget,
  4015. rel: rel
  4016. }));
  4017. },
  4018. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  4019. }, {
  4020. supports: {
  4021. anchor: true,
  4022. align: true,
  4023. alignWide: false,
  4024. color: {
  4025. __experimentalSkipSerialization: true
  4026. },
  4027. reusable: false,
  4028. __experimentalSelector: '.wp-block-button__link'
  4029. },
  4030. attributes: { ...blockAttributes,
  4031. linkTarget: {
  4032. type: 'string',
  4033. source: 'attribute',
  4034. selector: 'a',
  4035. attribute: 'target'
  4036. },
  4037. rel: {
  4038. type: 'string',
  4039. source: 'attribute',
  4040. selector: 'a',
  4041. attribute: 'rel'
  4042. },
  4043. placeholder: {
  4044. type: 'string'
  4045. },
  4046. borderRadius: {
  4047. type: 'number'
  4048. },
  4049. backgroundColor: {
  4050. type: 'string'
  4051. },
  4052. textColor: {
  4053. type: 'string'
  4054. },
  4055. gradient: {
  4056. type: 'string'
  4057. },
  4058. style: {
  4059. type: 'object'
  4060. },
  4061. width: {
  4062. type: 'number'
  4063. }
  4064. },
  4065. save(_ref7) {
  4066. let {
  4067. attributes,
  4068. className
  4069. } = _ref7;
  4070. const {
  4071. borderRadius,
  4072. linkTarget,
  4073. rel,
  4074. text,
  4075. title,
  4076. url,
  4077. width
  4078. } = attributes;
  4079. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  4080. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  4081. 'no-border-radius': borderRadius === 0
  4082. });
  4083. const buttonStyle = {
  4084. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  4085. ...colorProps.style
  4086. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  4087. // if it had already been assigned, for the sake of backward-compatibility.
  4088. // A title will no longer be assigned for new or updated button block links.
  4089. const wrapperClasses = classnames_default()(className, {
  4090. [`has-custom-width wp-block-button__width-${width}`]: width
  4091. });
  4092. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  4093. className: wrapperClasses
  4094. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4095. tagName: "a",
  4096. className: buttonClasses,
  4097. href: url,
  4098. title: title,
  4099. style: buttonStyle,
  4100. value: text,
  4101. target: linkTarget,
  4102. rel: rel
  4103. }));
  4104. },
  4105. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  4106. }, {
  4107. supports: {
  4108. align: true,
  4109. alignWide: false,
  4110. color: {
  4111. gradients: true
  4112. }
  4113. },
  4114. attributes: { ...blockAttributes,
  4115. linkTarget: {
  4116. type: 'string',
  4117. source: 'attribute',
  4118. selector: 'a',
  4119. attribute: 'target'
  4120. },
  4121. rel: {
  4122. type: 'string',
  4123. source: 'attribute',
  4124. selector: 'a',
  4125. attribute: 'rel'
  4126. },
  4127. placeholder: {
  4128. type: 'string'
  4129. },
  4130. borderRadius: {
  4131. type: 'number'
  4132. },
  4133. backgroundColor: {
  4134. type: 'string'
  4135. },
  4136. textColor: {
  4137. type: 'string'
  4138. },
  4139. gradient: {
  4140. type: 'string'
  4141. },
  4142. style: {
  4143. type: 'object'
  4144. }
  4145. },
  4146. save(_ref8) {
  4147. let {
  4148. attributes
  4149. } = _ref8;
  4150. const {
  4151. borderRadius,
  4152. linkTarget,
  4153. rel,
  4154. text,
  4155. title,
  4156. url
  4157. } = attributes;
  4158. const buttonClasses = classnames_default()('wp-block-button__link', {
  4159. 'no-border-radius': borderRadius === 0
  4160. });
  4161. const buttonStyle = {
  4162. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  4163. };
  4164. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4165. tagName: "a",
  4166. className: buttonClasses,
  4167. href: url,
  4168. title: title,
  4169. style: buttonStyle,
  4170. value: text,
  4171. target: linkTarget,
  4172. rel: rel
  4173. });
  4174. },
  4175. migrate: migrateBorderRadius
  4176. }, {
  4177. supports: {
  4178. align: true,
  4179. alignWide: false
  4180. },
  4181. attributes: { ...blockAttributes,
  4182. linkTarget: {
  4183. type: 'string',
  4184. source: 'attribute',
  4185. selector: 'a',
  4186. attribute: 'target'
  4187. },
  4188. rel: {
  4189. type: 'string',
  4190. source: 'attribute',
  4191. selector: 'a',
  4192. attribute: 'rel'
  4193. },
  4194. placeholder: {
  4195. type: 'string'
  4196. },
  4197. borderRadius: {
  4198. type: 'number'
  4199. },
  4200. backgroundColor: {
  4201. type: 'string'
  4202. },
  4203. textColor: {
  4204. type: 'string'
  4205. },
  4206. customBackgroundColor: {
  4207. type: 'string'
  4208. },
  4209. customTextColor: {
  4210. type: 'string'
  4211. },
  4212. customGradient: {
  4213. type: 'string'
  4214. },
  4215. gradient: {
  4216. type: 'string'
  4217. }
  4218. },
  4219. isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient,
  4220. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients),
  4221. save(_ref9) {
  4222. let {
  4223. attributes
  4224. } = _ref9;
  4225. const {
  4226. backgroundColor,
  4227. borderRadius,
  4228. customBackgroundColor,
  4229. customTextColor,
  4230. customGradient,
  4231. linkTarget,
  4232. gradient,
  4233. rel,
  4234. text,
  4235. textColor,
  4236. title,
  4237. url
  4238. } = attributes;
  4239. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  4240. const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  4241. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  4242. const buttonClasses = classnames_default()('wp-block-button__link', {
  4243. 'has-text-color': textColor || customTextColor,
  4244. [textClass]: textClass,
  4245. 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient,
  4246. [backgroundClass]: backgroundClass,
  4247. 'no-border-radius': borderRadius === 0,
  4248. [gradientClass]: gradientClass
  4249. });
  4250. const buttonStyle = {
  4251. background: customGradient ? customGradient : undefined,
  4252. backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor,
  4253. color: textClass ? undefined : customTextColor,
  4254. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  4255. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  4256. // if it had already been assigned, for the sake of backward-compatibility.
  4257. // A title will no longer be assigned for new or updated button block links.
  4258. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4259. tagName: "a",
  4260. className: buttonClasses,
  4261. href: url,
  4262. title: title,
  4263. style: buttonStyle,
  4264. value: text,
  4265. target: linkTarget,
  4266. rel: rel
  4267. }));
  4268. }
  4269. }, {
  4270. attributes: { ...blockAttributes,
  4271. align: {
  4272. type: 'string',
  4273. default: 'none'
  4274. },
  4275. backgroundColor: {
  4276. type: 'string'
  4277. },
  4278. textColor: {
  4279. type: 'string'
  4280. },
  4281. customBackgroundColor: {
  4282. type: 'string'
  4283. },
  4284. customTextColor: {
  4285. type: 'string'
  4286. },
  4287. linkTarget: {
  4288. type: 'string',
  4289. source: 'attribute',
  4290. selector: 'a',
  4291. attribute: 'target'
  4292. },
  4293. rel: {
  4294. type: 'string',
  4295. source: 'attribute',
  4296. selector: 'a',
  4297. attribute: 'rel'
  4298. },
  4299. placeholder: {
  4300. type: 'string'
  4301. }
  4302. },
  4303. isEligible(attribute) {
  4304. return attribute.className && attribute.className.includes('is-style-squared');
  4305. },
  4306. migrate(attributes) {
  4307. let newClassName = attributes.className;
  4308. if (newClassName) {
  4309. newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim();
  4310. }
  4311. return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes,
  4312. className: newClassName ? newClassName : undefined,
  4313. borderRadius: 0
  4314. }));
  4315. },
  4316. save(_ref10) {
  4317. let {
  4318. attributes
  4319. } = _ref10;
  4320. const {
  4321. backgroundColor,
  4322. customBackgroundColor,
  4323. customTextColor,
  4324. linkTarget,
  4325. rel,
  4326. text,
  4327. textColor,
  4328. title,
  4329. url
  4330. } = attributes;
  4331. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  4332. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  4333. const buttonClasses = classnames_default()('wp-block-button__link', {
  4334. 'has-text-color': textColor || customTextColor,
  4335. [textClass]: textClass,
  4336. 'has-background': backgroundColor || customBackgroundColor,
  4337. [backgroundClass]: backgroundClass
  4338. });
  4339. const buttonStyle = {
  4340. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  4341. color: textClass ? undefined : customTextColor
  4342. };
  4343. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4344. tagName: "a",
  4345. className: buttonClasses,
  4346. href: url,
  4347. title: title,
  4348. style: buttonStyle,
  4349. value: text,
  4350. target: linkTarget,
  4351. rel: rel
  4352. }));
  4353. }
  4354. }, {
  4355. attributes: { ...blockAttributes,
  4356. align: {
  4357. type: 'string',
  4358. default: 'none'
  4359. },
  4360. backgroundColor: {
  4361. type: 'string'
  4362. },
  4363. textColor: {
  4364. type: 'string'
  4365. },
  4366. customBackgroundColor: {
  4367. type: 'string'
  4368. },
  4369. customTextColor: {
  4370. type: 'string'
  4371. }
  4372. },
  4373. migrate: oldColorsMigration,
  4374. save(_ref11) {
  4375. let {
  4376. attributes
  4377. } = _ref11;
  4378. const {
  4379. url,
  4380. text,
  4381. title,
  4382. backgroundColor,
  4383. textColor,
  4384. customBackgroundColor,
  4385. customTextColor
  4386. } = attributes;
  4387. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  4388. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  4389. const buttonClasses = classnames_default()('wp-block-button__link', {
  4390. 'has-text-color': textColor || customTextColor,
  4391. [textClass]: textClass,
  4392. 'has-background': backgroundColor || customBackgroundColor,
  4393. [backgroundClass]: backgroundClass
  4394. });
  4395. const buttonStyle = {
  4396. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  4397. color: textClass ? undefined : customTextColor
  4398. };
  4399. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4400. tagName: "a",
  4401. className: buttonClasses,
  4402. href: url,
  4403. title: title,
  4404. style: buttonStyle,
  4405. value: text
  4406. }));
  4407. }
  4408. }, {
  4409. attributes: { ...blockAttributes,
  4410. color: {
  4411. type: 'string'
  4412. },
  4413. textColor: {
  4414. type: 'string'
  4415. },
  4416. align: {
  4417. type: 'string',
  4418. default: 'none'
  4419. }
  4420. },
  4421. save(_ref12) {
  4422. let {
  4423. attributes
  4424. } = _ref12;
  4425. const {
  4426. url,
  4427. text,
  4428. title,
  4429. align,
  4430. color,
  4431. textColor
  4432. } = attributes;
  4433. const buttonStyle = {
  4434. backgroundColor: color,
  4435. color: textColor
  4436. };
  4437. const linkClass = 'wp-block-button__link';
  4438. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4439. className: `align${align}`
  4440. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4441. tagName: "a",
  4442. className: linkClass,
  4443. href: url,
  4444. title: title,
  4445. style: buttonStyle,
  4446. value: text
  4447. }));
  4448. },
  4449. migrate: oldColorsMigration
  4450. }, {
  4451. attributes: { ...blockAttributes,
  4452. color: {
  4453. type: 'string'
  4454. },
  4455. textColor: {
  4456. type: 'string'
  4457. },
  4458. align: {
  4459. type: 'string',
  4460. default: 'none'
  4461. }
  4462. },
  4463. save(_ref13) {
  4464. let {
  4465. attributes
  4466. } = _ref13;
  4467. const {
  4468. url,
  4469. text,
  4470. title,
  4471. align,
  4472. color,
  4473. textColor
  4474. } = attributes;
  4475. return (0,external_wp_element_namespaceObject.createElement)("div", {
  4476. className: `align${align}`,
  4477. style: {
  4478. backgroundColor: color
  4479. }
  4480. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4481. tagName: "a",
  4482. href: url,
  4483. title: title,
  4484. style: {
  4485. color: textColor
  4486. },
  4487. value: text
  4488. }));
  4489. },
  4490. migrate: oldColorsMigration
  4491. }];
  4492. /* harmony default export */ var button_deprecated = (deprecated_deprecated);
  4493. ;// CONCATENATED MODULE: external ["wp","keycodes"]
  4494. var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
  4495. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
  4496. /**
  4497. * WordPress dependencies
  4498. */
  4499. const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4500. xmlns: "http://www.w3.org/2000/svg",
  4501. viewBox: "0 0 24 24"
  4502. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4503. d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
  4504. }));
  4505. /* harmony default export */ var library_link = (link_link);
  4506. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
  4507. /**
  4508. * WordPress dependencies
  4509. */
  4510. const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4511. xmlns: "http://www.w3.org/2000/svg",
  4512. viewBox: "0 0 24 24"
  4513. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4514. d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
  4515. }));
  4516. /* harmony default export */ var link_off = (linkOff);
  4517. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js
  4518. /**
  4519. * External dependencies
  4520. */
  4521. /**
  4522. * WordPress dependencies
  4523. */
  4524. const NEW_TAB_REL = 'noreferrer noopener';
  4525. function WidthPanel(_ref) {
  4526. let {
  4527. selectedWidth,
  4528. setAttributes
  4529. } = _ref;
  4530. function handleChange(newWidth) {
  4531. // Check if we are toggling the width off
  4532. const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes.
  4533. setAttributes({
  4534. width
  4535. });
  4536. }
  4537. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  4538. title: (0,external_wp_i18n_namespaceObject.__)('Width settings')
  4539. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  4540. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width')
  4541. }, [25, 50, 75, 100].map(widthValue => {
  4542. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  4543. key: widthValue,
  4544. isSmall: true,
  4545. variant: widthValue === selectedWidth ? 'primary' : undefined,
  4546. onClick: () => handleChange(widthValue)
  4547. }, widthValue, "%");
  4548. })));
  4549. }
  4550. function ButtonEdit(props) {
  4551. var _style$border;
  4552. const {
  4553. attributes,
  4554. setAttributes,
  4555. className,
  4556. isSelected,
  4557. onReplace,
  4558. mergeBlocks
  4559. } = props;
  4560. const {
  4561. linkTarget,
  4562. placeholder,
  4563. rel,
  4564. style,
  4565. text,
  4566. url,
  4567. width
  4568. } = attributes;
  4569. const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => {
  4570. setAttributes({
  4571. rel: value
  4572. });
  4573. }, [setAttributes]);
  4574. function onToggleOpenInNewTab(value) {
  4575. const newLinkTarget = value ? '_blank' : undefined;
  4576. let updatedRel = rel;
  4577. if (newLinkTarget && !rel) {
  4578. updatedRel = NEW_TAB_REL;
  4579. } else if (!newLinkTarget && rel === NEW_TAB_REL) {
  4580. updatedRel = undefined;
  4581. }
  4582. setAttributes({
  4583. linkTarget: newLinkTarget,
  4584. rel: updatedRel
  4585. });
  4586. }
  4587. function setButtonText(newText) {
  4588. // Remove anchor tags from button text content.
  4589. setAttributes({
  4590. text: newText.replace(/<\/?a[^>]*>/g, '')
  4591. });
  4592. }
  4593. function onKeyDown(event) {
  4594. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  4595. startEditing(event);
  4596. } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) {
  4597. var _richTextRef$current;
  4598. unlink();
  4599. (_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus();
  4600. }
  4601. } // Use internal state instead of a ref to make sure that the component
  4602. // re-renders when the popover's anchor updates.
  4603. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
  4604. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  4605. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  4606. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  4607. const ref = (0,external_wp_element_namespaceObject.useRef)();
  4608. const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
  4609. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  4610. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]),
  4611. onKeyDown
  4612. });
  4613. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  4614. const isURLSet = !!url;
  4615. const opensInNewTab = linkTarget === '_blank';
  4616. function startEditing(event) {
  4617. event.preventDefault();
  4618. setIsEditingURL(true);
  4619. }
  4620. function unlink() {
  4621. setAttributes({
  4622. url: undefined,
  4623. linkTarget: undefined,
  4624. rel: undefined
  4625. });
  4626. setIsEditingURL(false);
  4627. }
  4628. (0,external_wp_element_namespaceObject.useEffect)(() => {
  4629. if (!isSelected) {
  4630. setIsEditingURL(false);
  4631. }
  4632. }, [isSelected]);
  4633. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  4634. className: classnames_default()(blockProps.className, {
  4635. [`has-custom-width wp-block-button__width-${width}`]: width,
  4636. [`has-custom-font-size`]: blockProps.style.fontSize
  4637. })
  4638. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  4639. ref: richTextRef,
  4640. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  4641. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  4642. value: text,
  4643. onChange: value => setButtonText(value),
  4644. withoutInteractiveFormatting: true,
  4645. className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, {
  4646. // For backwards compatibility add style that isn't
  4647. // provided via block support.
  4648. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  4649. }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
  4650. style: { ...borderProps.style,
  4651. ...colorProps.style,
  4652. ...spacingProps.style
  4653. },
  4654. onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes,
  4655. text: value
  4656. }),
  4657. onReplace: onReplace,
  4658. onMerge: mergeBlocks,
  4659. identifier: "text"
  4660. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  4661. group: "block"
  4662. }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  4663. name: "link",
  4664. icon: library_link,
  4665. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  4666. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  4667. onClick: startEditing
  4668. }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  4669. name: "link",
  4670. icon: link_off,
  4671. title: (0,external_wp_i18n_namespaceObject.__)('Unlink'),
  4672. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'),
  4673. onClick: unlink,
  4674. isActive: true
  4675. })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  4676. position: "bottom center",
  4677. onClose: () => {
  4678. var _richTextRef$current2;
  4679. setIsEditingURL(false);
  4680. (_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
  4681. },
  4682. anchor: popoverAnchor,
  4683. focusOnMount: isEditingURL ? 'firstElement' : false,
  4684. __unstableSlotName: '__unstable-block-tools-after',
  4685. shift: true
  4686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  4687. className: "wp-block-navigation-link__inline-link-input",
  4688. value: {
  4689. url,
  4690. opensInNewTab
  4691. },
  4692. onChange: _ref2 => {
  4693. let {
  4694. url: newURL = '',
  4695. opensInNewTab: newOpensInNewTab
  4696. } = _ref2;
  4697. setAttributes({
  4698. url: newURL
  4699. });
  4700. if (opensInNewTab !== newOpensInNewTab) {
  4701. onToggleOpenInNewTab(newOpensInNewTab);
  4702. }
  4703. },
  4704. onRemove: () => {
  4705. var _richTextRef$current3;
  4706. unlink();
  4707. (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus();
  4708. },
  4709. forceIsEditingLink: isEditingURL
  4710. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, {
  4711. selectedWidth: width,
  4712. setAttributes: setAttributes
  4713. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  4714. __experimentalGroup: "advanced"
  4715. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  4716. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  4717. value: rel || '',
  4718. onChange: onSetLinkRel
  4719. })));
  4720. }
  4721. /* harmony default export */ var button_edit = (ButtonEdit);
  4722. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js
  4723. /**
  4724. * External dependencies
  4725. */
  4726. /**
  4727. * WordPress dependencies
  4728. */
  4729. function save_save(_ref) {
  4730. var _style$border, _style$typography;
  4731. let {
  4732. attributes,
  4733. className
  4734. } = _ref;
  4735. const {
  4736. fontSize,
  4737. linkTarget,
  4738. rel,
  4739. style,
  4740. text,
  4741. title,
  4742. url,
  4743. width
  4744. } = attributes;
  4745. if (!text) {
  4746. return null;
  4747. }
  4748. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  4749. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  4750. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  4751. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  4752. // For backwards compatibility add style that isn't provided via
  4753. // block support.
  4754. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  4755. }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button'));
  4756. const buttonStyle = { ...borderProps.style,
  4757. ...colorProps.style,
  4758. ...spacingProps.style
  4759. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  4760. // if it had already been assigned, for the sake of backward-compatibility.
  4761. // A title will no longer be assigned for new or updated button block links.
  4762. const wrapperClasses = classnames_default()(className, {
  4763. [`has-custom-width wp-block-button__width-${width}`]: width,
  4764. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  4765. });
  4766. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  4767. className: wrapperClasses
  4768. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  4769. tagName: "a",
  4770. className: buttonClasses,
  4771. href: url,
  4772. title: title,
  4773. style: buttonStyle,
  4774. value: text,
  4775. target: linkTarget,
  4776. rel: rel
  4777. }));
  4778. }
  4779. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js
  4780. /**
  4781. * WordPress dependencies
  4782. */
  4783. /**
  4784. * Internal dependencies
  4785. */
  4786. const button_metadata = {
  4787. $schema: "https://schemas.wp.org/trunk/block.json",
  4788. apiVersion: 2,
  4789. name: "core/button",
  4790. title: "Button",
  4791. category: "design",
  4792. parent: ["core/buttons"],
  4793. description: "Prompt visitors to take action with a button-style link.",
  4794. keywords: ["link"],
  4795. textdomain: "default",
  4796. attributes: {
  4797. url: {
  4798. type: "string",
  4799. source: "attribute",
  4800. selector: "a",
  4801. attribute: "href"
  4802. },
  4803. title: {
  4804. type: "string",
  4805. source: "attribute",
  4806. selector: "a",
  4807. attribute: "title"
  4808. },
  4809. text: {
  4810. type: "string",
  4811. source: "html",
  4812. selector: "a"
  4813. },
  4814. linkTarget: {
  4815. type: "string",
  4816. source: "attribute",
  4817. selector: "a",
  4818. attribute: "target"
  4819. },
  4820. rel: {
  4821. type: "string",
  4822. source: "attribute",
  4823. selector: "a",
  4824. attribute: "rel"
  4825. },
  4826. placeholder: {
  4827. type: "string"
  4828. },
  4829. backgroundColor: {
  4830. type: "string"
  4831. },
  4832. textColor: {
  4833. type: "string"
  4834. },
  4835. gradient: {
  4836. type: "string"
  4837. },
  4838. width: {
  4839. type: "number"
  4840. }
  4841. },
  4842. supports: {
  4843. anchor: true,
  4844. align: true,
  4845. alignWide: false,
  4846. color: {
  4847. __experimentalSkipSerialization: true,
  4848. gradients: true,
  4849. __experimentalDefaultControls: {
  4850. background: true,
  4851. text: true
  4852. }
  4853. },
  4854. typography: {
  4855. fontSize: true,
  4856. lineHeight: true,
  4857. __experimentalFontFamily: true,
  4858. __experimentalFontWeight: true,
  4859. __experimentalFontStyle: true,
  4860. __experimentalTextTransform: true,
  4861. __experimentalTextDecoration: true,
  4862. __experimentalLetterSpacing: true,
  4863. __experimentalDefaultControls: {
  4864. fontSize: true
  4865. }
  4866. },
  4867. reusable: false,
  4868. spacing: {
  4869. __experimentalSkipSerialization: true,
  4870. padding: ["horizontal", "vertical"],
  4871. __experimentalDefaultControls: {
  4872. padding: true
  4873. }
  4874. },
  4875. __experimentalBorder: {
  4876. radius: true,
  4877. __experimentalSkipSerialization: true,
  4878. __experimentalDefaultControls: {
  4879. radius: true
  4880. }
  4881. },
  4882. __experimentalSelector: ".wp-block-button .wp-block-button__link"
  4883. },
  4884. styles: [{
  4885. name: "fill",
  4886. label: "Fill",
  4887. isDefault: true
  4888. }, {
  4889. name: "outline",
  4890. label: "Outline"
  4891. }],
  4892. editorStyle: "wp-block-button-editor",
  4893. style: "wp-block-button"
  4894. };
  4895. const {
  4896. name: button_name
  4897. } = button_metadata;
  4898. const button_settings = {
  4899. icon: library_button,
  4900. example: {
  4901. attributes: {
  4902. className: 'is-style-fill',
  4903. text: (0,external_wp_i18n_namespaceObject.__)('Call to Action')
  4904. }
  4905. },
  4906. edit: button_edit,
  4907. save: save_save,
  4908. deprecated: button_deprecated,
  4909. merge: (a, _ref) => {
  4910. let {
  4911. text = ''
  4912. } = _ref;
  4913. return { ...a,
  4914. text: (a.text || '') + text
  4915. };
  4916. }
  4917. };
  4918. const button_init = () => initBlock({
  4919. name: button_name,
  4920. metadata: button_metadata,
  4921. settings: button_settings
  4922. });
  4923. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js
  4924. /**
  4925. * WordPress dependencies
  4926. */
  4927. const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4928. viewBox: "0 0 24 24",
  4929. xmlns: "http://www.w3.org/2000/svg"
  4930. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4931. d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"
  4932. }));
  4933. /* harmony default export */ var library_buttons = (buttons);
  4934. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
  4935. /**
  4936. * External dependencies
  4937. */
  4938. /**
  4939. * WordPress dependencies
  4940. */
  4941. /**
  4942. * @param {Object} attributes Block's attributes.
  4943. */
  4944. const migrateWithLayout = attributes => {
  4945. if (!!attributes.layout) {
  4946. return attributes;
  4947. }
  4948. const {
  4949. contentJustification,
  4950. orientation,
  4951. ...updatedAttributes
  4952. } = attributes;
  4953. if (contentJustification || orientation) {
  4954. Object.assign(updatedAttributes, {
  4955. layout: {
  4956. type: 'flex',
  4957. ...(contentJustification && {
  4958. justifyContent: contentJustification
  4959. }),
  4960. ...(orientation && {
  4961. orientation
  4962. })
  4963. }
  4964. });
  4965. }
  4966. return updatedAttributes;
  4967. };
  4968. const buttons_deprecated_deprecated = [{
  4969. attributes: {
  4970. contentJustification: {
  4971. type: 'string'
  4972. },
  4973. orientation: {
  4974. type: 'string',
  4975. default: 'horizontal'
  4976. }
  4977. },
  4978. supports: {
  4979. anchor: true,
  4980. align: ['wide', 'full'],
  4981. __experimentalExposeControlsToChildren: true,
  4982. spacing: {
  4983. blockGap: true,
  4984. margin: ['top', 'bottom'],
  4985. __experimentalDefaultControls: {
  4986. blockGap: true
  4987. }
  4988. }
  4989. },
  4990. isEligible: _ref => {
  4991. let {
  4992. contentJustification,
  4993. orientation
  4994. } = _ref;
  4995. return !!contentJustification || !!orientation;
  4996. },
  4997. migrate: migrateWithLayout,
  4998. save(_ref2) {
  4999. let {
  5000. attributes: {
  5001. contentJustification,
  5002. orientation
  5003. }
  5004. } = _ref2;
  5005. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  5006. className: classnames_default()({
  5007. [`is-content-justification-${contentJustification}`]: contentJustification,
  5008. 'is-vertical': orientation === 'vertical'
  5009. })
  5010. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5011. }
  5012. }, {
  5013. supports: {
  5014. align: ['center', 'left', 'right'],
  5015. anchor: true
  5016. },
  5017. save() {
  5018. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5019. },
  5020. isEligible(_ref3) {
  5021. let {
  5022. align
  5023. } = _ref3;
  5024. return align && ['center', 'left', 'right'].includes(align);
  5025. },
  5026. migrate(attributes) {
  5027. return migrateWithLayout({ ...attributes,
  5028. align: undefined,
  5029. // Floating Buttons blocks shouldn't have been supported in the
  5030. // first place. Most users using them probably expected them to
  5031. // act like content justification controls, so these blocks are
  5032. // migrated to use content justification.
  5033. // As for center-aligned Buttons blocks, the content justification
  5034. // equivalent will create an identical end result in most cases.
  5035. contentJustification: attributes.align
  5036. });
  5037. }
  5038. }];
  5039. /* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated);
  5040. ;// CONCATENATED MODULE: external ["wp","richText"]
  5041. var external_wp_richText_namespaceObject = window["wp"]["richText"];
  5042. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js
  5043. /**
  5044. * WordPress dependencies
  5045. */
  5046. /**
  5047. * Internal dependencies
  5048. */
  5049. const {
  5050. name: transforms_name
  5051. } = {
  5052. $schema: "https://schemas.wp.org/trunk/block.json",
  5053. apiVersion: 2,
  5054. name: "core/buttons",
  5055. title: "Buttons",
  5056. category: "design",
  5057. description: "Prompt visitors to take action with a group of button-style links.",
  5058. keywords: ["link"],
  5059. textdomain: "default",
  5060. supports: {
  5061. anchor: true,
  5062. align: ["wide", "full"],
  5063. __experimentalExposeControlsToChildren: true,
  5064. spacing: {
  5065. blockGap: true,
  5066. margin: ["top", "bottom"],
  5067. __experimentalDefaultControls: {
  5068. blockGap: true
  5069. }
  5070. },
  5071. typography: {
  5072. fontSize: true,
  5073. lineHeight: true,
  5074. __experimentalFontFamily: true,
  5075. __experimentalFontWeight: true,
  5076. __experimentalFontStyle: true,
  5077. __experimentalTextTransform: true,
  5078. __experimentalTextDecoration: true,
  5079. __experimentalLetterSpacing: true,
  5080. __experimentalDefaultControls: {
  5081. fontSize: true
  5082. }
  5083. },
  5084. __experimentalLayout: {
  5085. allowSwitching: false,
  5086. allowInheriting: false,
  5087. "default": {
  5088. type: "flex"
  5089. }
  5090. }
  5091. },
  5092. editorStyle: "wp-block-buttons-editor",
  5093. style: "wp-block-buttons"
  5094. };
  5095. const transforms_transforms = {
  5096. from: [{
  5097. type: 'block',
  5098. isMultiBlock: true,
  5099. blocks: ['core/button'],
  5100. transform: buttons => // Creates the buttons block.
  5101. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  5102. buttons.map(attributes => // Create singular button in the buttons block.
  5103. (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes)))
  5104. }, {
  5105. type: 'block',
  5106. isMultiBlock: true,
  5107. blocks: ['core/paragraph'],
  5108. transform: buttons => // Creates the buttons block.
  5109. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  5110. buttons.map(attributes => {
  5111. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags.
  5112. const text = element.innerText || ''; // Get first url.
  5113. const link = element.querySelector('a');
  5114. const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block.
  5115. return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', {
  5116. text,
  5117. url
  5118. });
  5119. })),
  5120. isMatch: paragraphs => {
  5121. return paragraphs.every(attributes => {
  5122. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content);
  5123. const text = element.innerText || '';
  5124. const links = element.querySelectorAll('a');
  5125. return text.length <= 30 && links.length <= 1;
  5126. });
  5127. }
  5128. }]
  5129. };
  5130. /* harmony default export */ var buttons_transforms = (transforms_transforms);
  5131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
  5132. /**
  5133. * External dependencies
  5134. */
  5135. /**
  5136. * WordPress dependencies
  5137. */
  5138. /**
  5139. * Internal dependencies
  5140. */
  5141. const ALLOWED_BLOCKS = [button_name];
  5142. const DEFAULT_BLOCK = {
  5143. name: button_name,
  5144. attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width']
  5145. };
  5146. function ButtonsEdit(_ref) {
  5147. var _style$typography;
  5148. let {
  5149. attributes,
  5150. className
  5151. } = _ref;
  5152. const {
  5153. fontSize,
  5154. layout = {},
  5155. style
  5156. } = attributes;
  5157. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5158. className: classnames_default()(className, {
  5159. 'has-custom-font-size': fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  5160. })
  5161. });
  5162. const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5163. var _preferredStyleVariat;
  5164. const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations;
  5165. return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name];
  5166. }, []);
  5167. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  5168. allowedBlocks: ALLOWED_BLOCKS,
  5169. __experimentalDefaultBlock: DEFAULT_BLOCK,
  5170. __experimentalDirectInsert: true,
  5171. template: [[button_name, {
  5172. className: preferredStyle && `is-style-${preferredStyle}`
  5173. }]],
  5174. __experimentalLayout: layout,
  5175. templateInsertUpdatesSelection: true
  5176. });
  5177. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  5178. }
  5179. /* harmony default export */ var buttons_edit = (ButtonsEdit);
  5180. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js
  5181. /**
  5182. * External dependencies
  5183. */
  5184. /**
  5185. * WordPress dependencies
  5186. */
  5187. function buttons_save_save(_ref) {
  5188. var _style$typography;
  5189. let {
  5190. attributes,
  5191. className
  5192. } = _ref;
  5193. const {
  5194. fontSize,
  5195. style
  5196. } = attributes;
  5197. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  5198. className: classnames_default()(className, {
  5199. 'has-custom-font-size': fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  5200. })
  5201. });
  5202. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  5203. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  5204. }
  5205. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  5206. /**
  5207. * WordPress dependencies
  5208. */
  5209. /**
  5210. * Internal dependencies
  5211. */
  5212. const buttons_metadata = {
  5213. $schema: "https://schemas.wp.org/trunk/block.json",
  5214. apiVersion: 2,
  5215. name: "core/buttons",
  5216. title: "Buttons",
  5217. category: "design",
  5218. description: "Prompt visitors to take action with a group of button-style links.",
  5219. keywords: ["link"],
  5220. textdomain: "default",
  5221. supports: {
  5222. anchor: true,
  5223. align: ["wide", "full"],
  5224. __experimentalExposeControlsToChildren: true,
  5225. spacing: {
  5226. blockGap: true,
  5227. margin: ["top", "bottom"],
  5228. __experimentalDefaultControls: {
  5229. blockGap: true
  5230. }
  5231. },
  5232. typography: {
  5233. fontSize: true,
  5234. lineHeight: true,
  5235. __experimentalFontFamily: true,
  5236. __experimentalFontWeight: true,
  5237. __experimentalFontStyle: true,
  5238. __experimentalTextTransform: true,
  5239. __experimentalTextDecoration: true,
  5240. __experimentalLetterSpacing: true,
  5241. __experimentalDefaultControls: {
  5242. fontSize: true
  5243. }
  5244. },
  5245. __experimentalLayout: {
  5246. allowSwitching: false,
  5247. allowInheriting: false,
  5248. "default": {
  5249. type: "flex"
  5250. }
  5251. }
  5252. },
  5253. editorStyle: "wp-block-buttons-editor",
  5254. style: "wp-block-buttons"
  5255. };
  5256. const {
  5257. name: buttons_name
  5258. } = buttons_metadata;
  5259. const buttons_settings = {
  5260. icon: library_buttons,
  5261. example: {
  5262. innerBlocks: [{
  5263. name: 'core/button',
  5264. attributes: {
  5265. text: (0,external_wp_i18n_namespaceObject.__)('Find out more')
  5266. }
  5267. }, {
  5268. name: 'core/button',
  5269. attributes: {
  5270. text: (0,external_wp_i18n_namespaceObject.__)('Contact us')
  5271. }
  5272. }]
  5273. },
  5274. deprecated: buttons_deprecated,
  5275. transforms: buttons_transforms,
  5276. edit: buttons_edit,
  5277. save: buttons_save_save
  5278. };
  5279. const buttons_init = () => initBlock({
  5280. name: buttons_name,
  5281. metadata: buttons_metadata,
  5282. settings: buttons_settings
  5283. });
  5284. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js
  5285. /**
  5286. * WordPress dependencies
  5287. */
  5288. const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5289. viewBox: "0 0 24 24",
  5290. xmlns: "http://www.w3.org/2000/svg"
  5291. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5292. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"
  5293. }));
  5294. /* harmony default export */ var library_calendar = (calendar);
  5295. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
  5296. /**
  5297. * External dependencies
  5298. */
  5299. /**
  5300. * WordPress dependencies
  5301. */
  5302. /**
  5303. * Returns the year and month of a specified date.
  5304. *
  5305. * @see `WP_REST_Posts_Controller::prepare_date_response()`.
  5306. *
  5307. * @param {string} date Date in `ISO8601/RFC3339` format.
  5308. * @return {Object} Year and date of the specified date.
  5309. */
  5310. const getYearMonth = memize_default()(date => {
  5311. if (!date) {
  5312. return {};
  5313. }
  5314. const dateObj = new Date(date);
  5315. return {
  5316. year: dateObj.getFullYear(),
  5317. month: dateObj.getMonth() + 1
  5318. };
  5319. });
  5320. function CalendarEdit(_ref) {
  5321. let {
  5322. attributes
  5323. } = _ref;
  5324. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5325. const {
  5326. date,
  5327. hasPosts,
  5328. hasPostsResolved
  5329. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5330. const {
  5331. getEntityRecords,
  5332. hasFinishedResolution
  5333. } = select(external_wp_coreData_namespaceObject.store);
  5334. const singlePublishedPostQuery = {
  5335. status: 'publish',
  5336. per_page: 1
  5337. };
  5338. const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery);
  5339. const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]);
  5340. let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  5341. // Blocks can be loaded into a *non-post* block editor.
  5342. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  5343. const editorSelectors = select('core/editor');
  5344. if (editorSelectors) {
  5345. const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar.
  5346. // This overwrite should only happen for 'post' post types.
  5347. // For other post types the calendar always displays the current month.
  5348. if (postType === 'post') {
  5349. _date = editorSelectors.getEditedPostAttribute('date');
  5350. }
  5351. }
  5352. return {
  5353. date: _date,
  5354. hasPostsResolved: postsResolved,
  5355. hasPosts: postsResolved && (posts === null || posts === void 0 ? void 0 : posts.length) === 1
  5356. };
  5357. }, []);
  5358. if (!hasPosts) {
  5359. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  5360. icon: library_calendar,
  5361. label: (0,external_wp_i18n_namespaceObject.__)('Calendar')
  5362. }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.')));
  5363. }
  5364. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  5365. block: "core/calendar",
  5366. attributes: { ...attributes,
  5367. ...getYearMonth(date)
  5368. }
  5369. })));
  5370. }
  5371. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
  5372. /**
  5373. * WordPress dependencies
  5374. */
  5375. const calendar_transforms_transforms = {
  5376. from: [{
  5377. type: 'block',
  5378. blocks: ['core/archives'],
  5379. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar')
  5380. }],
  5381. to: [{
  5382. type: 'block',
  5383. blocks: ['core/archives'],
  5384. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives')
  5385. }]
  5386. };
  5387. /* harmony default export */ var calendar_transforms = (calendar_transforms_transforms);
  5388. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  5389. /**
  5390. * WordPress dependencies
  5391. */
  5392. /**
  5393. * Internal dependencies
  5394. */
  5395. const calendar_metadata = {
  5396. $schema: "https://schemas.wp.org/trunk/block.json",
  5397. apiVersion: 2,
  5398. name: "core/calendar",
  5399. title: "Calendar",
  5400. category: "widgets",
  5401. description: "A calendar of your site\u2019s posts.",
  5402. keywords: ["posts", "archive"],
  5403. textdomain: "default",
  5404. attributes: {
  5405. month: {
  5406. type: "integer"
  5407. },
  5408. year: {
  5409. type: "integer"
  5410. }
  5411. },
  5412. supports: {
  5413. align: true,
  5414. typography: {
  5415. fontSize: true,
  5416. lineHeight: true,
  5417. __experimentalFontFamily: true,
  5418. __experimentalFontWeight: true,
  5419. __experimentalFontStyle: true,
  5420. __experimentalTextTransform: true,
  5421. __experimentalLetterSpacing: true,
  5422. __experimentalDefaultControls: {
  5423. fontSize: true
  5424. }
  5425. }
  5426. },
  5427. style: "wp-block-calendar"
  5428. };
  5429. const {
  5430. name: calendar_name
  5431. } = calendar_metadata;
  5432. const calendar_settings = {
  5433. icon: library_calendar,
  5434. example: {},
  5435. edit: CalendarEdit,
  5436. transforms: calendar_transforms
  5437. };
  5438. const calendar_init = () => initBlock({
  5439. name: calendar_name,
  5440. metadata: calendar_metadata,
  5441. settings: calendar_settings
  5442. });
  5443. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js
  5444. /**
  5445. * WordPress dependencies
  5446. */
  5447. const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5448. viewBox: "0 0 24 24",
  5449. xmlns: "http://www.w3.org/2000/svg"
  5450. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5451. d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
  5452. fillRule: "evenodd",
  5453. clipRule: "evenodd"
  5454. }));
  5455. /* harmony default export */ var library_category = (category);
  5456. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js
  5457. /**
  5458. * WordPress dependencies
  5459. */
  5460. const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5461. xmlns: "http://www.w3.org/2000/svg",
  5462. viewBox: "0 0 24 24"
  5463. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5464. d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"
  5465. }));
  5466. /* harmony default export */ var library_pin = (pin);
  5467. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js
  5468. /**
  5469. * External dependencies
  5470. */
  5471. /**
  5472. * WordPress dependencies
  5473. */
  5474. function CategoriesEdit(_ref) {
  5475. let {
  5476. attributes: {
  5477. displayAsDropdown,
  5478. showHierarchy,
  5479. showPostCounts,
  5480. showOnlyTopLevel,
  5481. showEmpty
  5482. },
  5483. setAttributes,
  5484. className
  5485. } = _ref;
  5486. const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
  5487. const query = {
  5488. per_page: -1,
  5489. hide_empty: !showEmpty,
  5490. context: 'view'
  5491. };
  5492. if (showOnlyTopLevel) {
  5493. query.parent = 0;
  5494. }
  5495. const {
  5496. records: categories,
  5497. isResolving
  5498. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', query);
  5499. const getCategoriesList = parentId => {
  5500. if (!(categories !== null && categories !== void 0 && categories.length)) {
  5501. return [];
  5502. }
  5503. if (parentId === null) {
  5504. return categories;
  5505. }
  5506. return categories.filter(_ref2 => {
  5507. let {
  5508. parent
  5509. } = _ref2;
  5510. return parent === parentId;
  5511. });
  5512. };
  5513. const toggleAttribute = attributeName => newValue => setAttributes({
  5514. [attributeName]: newValue
  5515. });
  5516. const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim();
  5517. const renderCategoryList = () => {
  5518. const parentId = showHierarchy ? 0 : null;
  5519. const categoriesList = getCategoriesList(parentId);
  5520. return categoriesList.map(category => renderCategoryListItem(category, 0));
  5521. };
  5522. const renderCategoryListItem = category => {
  5523. const childCategories = getCategoriesList(category.id);
  5524. const {
  5525. id,
  5526. link,
  5527. count,
  5528. name
  5529. } = category;
  5530. return (0,external_wp_element_namespaceObject.createElement)("li", {
  5531. key: id,
  5532. className: `cat-item cat-item-${id}`
  5533. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  5534. href: link,
  5535. target: "_blank",
  5536. rel: "noreferrer noopener"
  5537. }, renderCategoryName(name)), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", {
  5538. className: "children"
  5539. }, childCategories.map(childCategory => renderCategoryListItem(childCategory))));
  5540. };
  5541. const renderCategoryDropdown = () => {
  5542. const parentId = showHierarchy ? 0 : null;
  5543. const categoriesList = getCategoriesList(parentId);
  5544. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  5545. as: "label",
  5546. htmlFor: selectId
  5547. }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", {
  5548. id: selectId
  5549. }, (0,external_wp_element_namespaceObject.createElement)("option", null, (0,external_wp_i18n_namespaceObject.__)('Select Category')), categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
  5550. };
  5551. const renderCategoryDropdownItem = (category, level) => {
  5552. const {
  5553. id,
  5554. count,
  5555. name
  5556. } = category;
  5557. const childCategories = getCategoriesList(id);
  5558. return [(0,external_wp_element_namespaceObject.createElement)("option", {
  5559. key: id,
  5560. className: `level-${level}`
  5561. }, Array.from({
  5562. length: level * 3
  5563. }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
  5564. };
  5565. const TagName = !!(categories !== null && categories !== void 0 && categories.length) && !displayAsDropdown && !isResolving ? 'ul' : 'div';
  5566. const classes = classnames_default()(className, {
  5567. 'wp-block-categories-list': !!(categories !== null && categories !== void 0 && categories.length) && !displayAsDropdown && !isResolving,
  5568. 'wp-block-categories-dropdown': !!(categories !== null && categories !== void 0 && categories.length) && displayAsDropdown && !isResolving
  5569. });
  5570. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5571. className: classes
  5572. });
  5573. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  5574. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  5575. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5576. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  5577. checked: displayAsDropdown,
  5578. onChange: toggleAttribute('displayAsDropdown')
  5579. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5580. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  5581. checked: showPostCounts,
  5582. onChange: toggleAttribute('showPostCounts')
  5583. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5584. label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'),
  5585. checked: showOnlyTopLevel,
  5586. onChange: toggleAttribute('showOnlyTopLevel')
  5587. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5588. label: (0,external_wp_i18n_namespaceObject.__)('Show empty categories'),
  5589. checked: showEmpty,
  5590. onChange: toggleAttribute('showEmpty')
  5591. }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5592. label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'),
  5593. checked: showHierarchy,
  5594. onChange: toggleAttribute('showHierarchy')
  5595. }))), isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  5596. icon: library_pin,
  5597. label: (0,external_wp_i18n_namespaceObject.__)('Categories')
  5598. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()));
  5599. }
  5600. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  5601. /**
  5602. * WordPress dependencies
  5603. */
  5604. /**
  5605. * Internal dependencies
  5606. */
  5607. const categories_metadata = {
  5608. $schema: "https://schemas.wp.org/trunk/block.json",
  5609. apiVersion: 2,
  5610. name: "core/categories",
  5611. title: "Categories List",
  5612. category: "widgets",
  5613. description: "Display a list of all categories.",
  5614. textdomain: "default",
  5615. attributes: {
  5616. displayAsDropdown: {
  5617. type: "boolean",
  5618. "default": false
  5619. },
  5620. showHierarchy: {
  5621. type: "boolean",
  5622. "default": false
  5623. },
  5624. showPostCounts: {
  5625. type: "boolean",
  5626. "default": false
  5627. },
  5628. showOnlyTopLevel: {
  5629. type: "boolean",
  5630. "default": false
  5631. },
  5632. showEmpty: {
  5633. type: "boolean",
  5634. "default": false
  5635. }
  5636. },
  5637. supports: {
  5638. align: true,
  5639. html: false,
  5640. spacing: {
  5641. margin: true,
  5642. padding: true
  5643. },
  5644. typography: {
  5645. fontSize: true,
  5646. lineHeight: true,
  5647. __experimentalFontFamily: true,
  5648. __experimentalFontWeight: true,
  5649. __experimentalFontStyle: true,
  5650. __experimentalTextTransform: true,
  5651. __experimentalTextDecoration: true,
  5652. __experimentalLetterSpacing: true,
  5653. __experimentalDefaultControls: {
  5654. fontSize: true
  5655. }
  5656. }
  5657. },
  5658. editorStyle: "wp-block-categories-editor",
  5659. style: "wp-block-categories"
  5660. };
  5661. const {
  5662. name: categories_name
  5663. } = categories_metadata;
  5664. const categories_settings = {
  5665. icon: library_category,
  5666. example: {},
  5667. edit: CategoriesEdit
  5668. };
  5669. const categories_init = () => initBlock({
  5670. name: categories_name,
  5671. metadata: categories_metadata,
  5672. settings: categories_settings
  5673. });
  5674. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js
  5675. /**
  5676. * WordPress dependencies
  5677. */
  5678. const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5679. viewBox: "0 0 24 24",
  5680. xmlns: "http://www.w3.org/2000/svg"
  5681. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5682. d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"
  5683. }));
  5684. /* harmony default export */ var library_classic = (classic);
  5685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
  5686. /**
  5687. * WordPress dependencies
  5688. */
  5689. const ConvertToBlocksButton = _ref => {
  5690. let {
  5691. clientId
  5692. } = _ref;
  5693. const {
  5694. replaceBlocks
  5695. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  5696. const block = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5697. return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
  5698. }, [clientId]);
  5699. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  5700. onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
  5701. HTML: (0,external_wp_blocks_namespaceObject.serialize)(block)
  5702. }))
  5703. }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks'));
  5704. };
  5705. /* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton);
  5706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js
  5707. /**
  5708. * External dependencies
  5709. */
  5710. /**
  5711. * WordPress dependencies
  5712. */
  5713. /**
  5714. * Internal dependencies
  5715. */
  5716. const {
  5717. wp
  5718. } = window;
  5719. function isTmceEmpty(editor) {
  5720. // When tinyMce is empty the content seems to be:
  5721. // <p><br data-mce-bogus="1"></p>
  5722. // avoid expensive checks for large documents
  5723. const body = editor.getBody();
  5724. if (body.childNodes.length > 1) {
  5725. return false;
  5726. } else if (body.childNodes.length === 0) {
  5727. return true;
  5728. }
  5729. if (body.childNodes[0].childNodes.length > 1) {
  5730. return false;
  5731. }
  5732. return /^\n?$/.test(body.innerText || body.textContent);
  5733. }
  5734. function ClassicEdit(_ref) {
  5735. let {
  5736. clientId,
  5737. attributes: {
  5738. content
  5739. },
  5740. setAttributes,
  5741. onReplace
  5742. } = _ref;
  5743. const {
  5744. getMultiSelectedBlockClientIds
  5745. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  5746. const didMount = (0,external_wp_element_namespaceObject.useRef)(false);
  5747. (0,external_wp_element_namespaceObject.useEffect)(() => {
  5748. if (!didMount.current) {
  5749. return;
  5750. }
  5751. const editor = window.tinymce.get(`editor-${clientId}`);
  5752. const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent();
  5753. if (currentContent !== content) {
  5754. editor.setContent(content || '');
  5755. }
  5756. }, [content]);
  5757. (0,external_wp_element_namespaceObject.useEffect)(() => {
  5758. const {
  5759. baseURL,
  5760. suffix
  5761. } = window.wpEditorL10n.tinymce;
  5762. didMount.current = true;
  5763. window.tinymce.EditorManager.overrideDefaults({
  5764. base_url: baseURL,
  5765. suffix
  5766. });
  5767. function onSetup(editor) {
  5768. let bookmark;
  5769. if (content) {
  5770. editor.on('loadContent', () => editor.setContent(content));
  5771. }
  5772. editor.on('blur', () => {
  5773. var _getMultiSelectedBloc;
  5774. bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451.
  5775. // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking
  5776. // scroll position until this is fixed in core.
  5777. const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
  5778. const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks.
  5779. // Updating during multi-selection can overwrite attributes of other blocks.
  5780. if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) {
  5781. setAttributes({
  5782. content: editor.getContent()
  5783. });
  5784. }
  5785. editor.once('focus', () => {
  5786. if (bookmark) {
  5787. editor.selection.moveToBookmark(bookmark);
  5788. if (scrollContainer.scrollTop !== scrollPosition) {
  5789. scrollContainer.scrollTop = scrollPosition;
  5790. }
  5791. }
  5792. });
  5793. return false;
  5794. });
  5795. editor.on('mousedown touchstart', () => {
  5796. bookmark = null;
  5797. });
  5798. const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => {
  5799. const value = editor.getContent();
  5800. if (value !== editor._lastChange) {
  5801. editor._lastChange = value;
  5802. setAttributes({
  5803. content: value
  5804. });
  5805. }
  5806. }, 250);
  5807. editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove
  5808. // the editor (onUnmount) this callback is executed in
  5809. // another tick. This results in setting the content to empty.
  5810. editor.on('remove', debouncedOnChange.cancel);
  5811. editor.on('keydown', event => {
  5812. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) {
  5813. // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected.
  5814. event.stopPropagation();
  5815. }
  5816. if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) {
  5817. // Delete the block.
  5818. onReplace([]);
  5819. event.preventDefault();
  5820. event.stopImmediatePropagation();
  5821. }
  5822. const {
  5823. altKey
  5824. } = event;
  5825. /*
  5826. * Prevent Mousetrap from kicking in: TinyMCE already uses its own
  5827. * `alt+f10` shortcut to focus its toolbar.
  5828. */
  5829. if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) {
  5830. event.stopPropagation();
  5831. }
  5832. });
  5833. editor.on('init', () => {
  5834. const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor.
  5835. if (rootNode.ownerDocument.activeElement === rootNode) {
  5836. rootNode.blur();
  5837. editor.focus();
  5838. }
  5839. });
  5840. }
  5841. function initialize() {
  5842. const {
  5843. settings
  5844. } = window.wpEditorL10n.tinymce;
  5845. wp.oldEditor.initialize(`editor-${clientId}`, {
  5846. tinymce: { ...settings,
  5847. inline: true,
  5848. content_css: false,
  5849. fixed_toolbar_container: `#toolbar-${clientId}`,
  5850. setup: onSetup
  5851. }
  5852. });
  5853. }
  5854. function onReadyStateChange() {
  5855. if (document.readyState === 'complete') {
  5856. initialize();
  5857. }
  5858. }
  5859. if (document.readyState === 'complete') {
  5860. initialize();
  5861. } else {
  5862. document.addEventListener('readystatechange', onReadyStateChange);
  5863. }
  5864. return () => {
  5865. document.removeEventListener('readystatechange', onReadyStateChange);
  5866. wp.oldEditor.remove(`editor-${clientId}`);
  5867. };
  5868. }, []);
  5869. function focus() {
  5870. const editor = window.tinymce.get(`editor-${clientId}`);
  5871. if (editor) {
  5872. editor.focus();
  5873. }
  5874. }
  5875. function onToolbarKeyDown(event) {
  5876. // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar.
  5877. event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar.
  5878. event.nativeEvent.stopImmediatePropagation();
  5879. } // Disable reasons:
  5880. //
  5881. // jsx-a11y/no-static-element-interactions
  5882. // - the toolbar itself is non-interactive, but must capture events
  5883. // from the KeyboardShortcuts component to stop their propagation.
  5884. /* eslint-disable jsx-a11y/no-static-element-interactions */
  5885. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, {
  5886. clientId: clientId
  5887. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  5888. key: "toolbar",
  5889. id: `toolbar-${clientId}`,
  5890. className: "block-library-classic__toolbar",
  5891. onClick: focus,
  5892. "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'),
  5893. onKeyDown: onToolbarKeyDown
  5894. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  5895. key: "editor",
  5896. id: `editor-${clientId}`,
  5897. className: "wp-block-freeform block-library-rich-text__tinymce"
  5898. })));
  5899. /* eslint-enable jsx-a11y/no-static-element-interactions */
  5900. }
  5901. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js
  5902. /**
  5903. * WordPress dependencies
  5904. */
  5905. function freeform_save_save(_ref) {
  5906. let {
  5907. attributes
  5908. } = _ref;
  5909. const {
  5910. content
  5911. } = attributes;
  5912. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content);
  5913. }
  5914. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  5915. /**
  5916. * WordPress dependencies
  5917. */
  5918. /**
  5919. * Internal dependencies
  5920. */
  5921. const freeform_metadata = {
  5922. $schema: "https://schemas.wp.org/trunk/block.json",
  5923. apiVersion: 2,
  5924. name: "core/freeform",
  5925. title: "Classic",
  5926. category: "text",
  5927. description: "Use the classic WordPress editor.",
  5928. textdomain: "default",
  5929. attributes: {
  5930. content: {
  5931. type: "string",
  5932. source: "html"
  5933. }
  5934. },
  5935. supports: {
  5936. className: false,
  5937. customClassName: false,
  5938. reusable: false
  5939. },
  5940. editorStyle: "wp-block-freeform-editor"
  5941. };
  5942. const {
  5943. name: freeform_name
  5944. } = freeform_metadata;
  5945. const freeform_settings = {
  5946. icon: library_classic,
  5947. edit: ClassicEdit,
  5948. save: freeform_save_save
  5949. };
  5950. const freeform_init = () => initBlock({
  5951. name: freeform_name,
  5952. metadata: freeform_metadata,
  5953. settings: freeform_settings
  5954. });
  5955. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
  5956. /**
  5957. * WordPress dependencies
  5958. */
  5959. const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5960. viewBox: "0 0 24 24",
  5961. xmlns: "http://www.w3.org/2000/svg"
  5962. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5963. d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
  5964. }));
  5965. /* harmony default export */ var library_code = (code);
  5966. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js
  5967. /**
  5968. * WordPress dependencies
  5969. */
  5970. function CodeEdit(_ref) {
  5971. let {
  5972. attributes,
  5973. setAttributes,
  5974. onRemove
  5975. } = _ref;
  5976. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5977. return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  5978. tagName: "code",
  5979. value: attributes.content,
  5980. onChange: content => setAttributes({
  5981. content
  5982. }),
  5983. onRemove: onRemove,
  5984. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'),
  5985. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'),
  5986. preserveWhiteSpace: true,
  5987. __unstablePastePlainText: true
  5988. }));
  5989. }
  5990. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js
  5991. /**
  5992. * External dependencies
  5993. */
  5994. /**
  5995. * Escapes ampersands, shortcodes, and links.
  5996. *
  5997. * @param {string} content The content of a code block.
  5998. * @return {string} The given content with some characters escaped.
  5999. */
  6000. function utils_escape(content) {
  6001. return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || '');
  6002. }
  6003. /**
  6004. * Returns the given content with all opening shortcode characters converted
  6005. * into their HTML entity counterpart (i.e. [ => &#91;). For instance, a
  6006. * shortcode like [embed] becomes &#91;embed]
  6007. *
  6008. * This function replicates the escaping of HTML tags, where a tag like
  6009. * <strong> becomes &lt;strong>.
  6010. *
  6011. * @param {string} content The content of a code block.
  6012. * @return {string} The given content with its opening shortcode characters
  6013. * converted into their HTML entity counterpart
  6014. * (i.e. [ => &#91;)
  6015. */
  6016. function escapeOpeningSquareBrackets(content) {
  6017. return content.replace(/\[/g, '&#91;');
  6018. }
  6019. /**
  6020. * Converts the first two forward slashes of any isolated URL into their HTML
  6021. * counterparts (i.e. // => &#47;&#47;). For instance, https://youtube.com/watch?x
  6022. * becomes https:&#47;&#47;youtube.com/watch?x.
  6023. *
  6024. * An isolated URL is a URL that sits in its own line, surrounded only by spacing
  6025. * characters.
  6026. *
  6027. * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403
  6028. *
  6029. * @param {string} content The content of a code block.
  6030. * @return {string} The given content with its ampersands converted into
  6031. * their HTML entity counterpart (i.e. & => &amp;)
  6032. */
  6033. function escapeProtocolInIsolatedUrls(content) {
  6034. return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1&#47;&#47;$2');
  6035. }
  6036. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js
  6037. /**
  6038. * WordPress dependencies
  6039. */
  6040. /**
  6041. * Internal dependencies
  6042. */
  6043. function code_save_save(_ref) {
  6044. let {
  6045. attributes
  6046. } = _ref;
  6047. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  6048. tagName: "code",
  6049. value: utils_escape(attributes.content)
  6050. }));
  6051. }
  6052. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js
  6053. /**
  6054. * WordPress dependencies
  6055. */
  6056. const code_transforms_transforms = {
  6057. from: [{
  6058. type: 'enter',
  6059. regExp: /^```$/,
  6060. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code')
  6061. }, {
  6062. type: 'block',
  6063. blocks: ['core/html', 'core/paragraph'],
  6064. transform: _ref => {
  6065. let {
  6066. content
  6067. } = _ref;
  6068. return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', {
  6069. content
  6070. });
  6071. }
  6072. }, {
  6073. type: 'raw',
  6074. isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE',
  6075. schema: {
  6076. pre: {
  6077. children: {
  6078. code: {
  6079. children: {
  6080. '#text': {}
  6081. }
  6082. }
  6083. }
  6084. }
  6085. }
  6086. }],
  6087. to: [{
  6088. type: 'block',
  6089. blocks: ['core/paragraph'],
  6090. transform: _ref2 => {
  6091. let {
  6092. content
  6093. } = _ref2;
  6094. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  6095. content
  6096. });
  6097. }
  6098. }]
  6099. };
  6100. /* harmony default export */ var code_transforms = (code_transforms_transforms);
  6101. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js
  6102. /**
  6103. * WordPress dependencies
  6104. */
  6105. /**
  6106. * Internal dependencies
  6107. */
  6108. const code_metadata = {
  6109. $schema: "https://schemas.wp.org/trunk/block.json",
  6110. apiVersion: 2,
  6111. name: "core/code",
  6112. title: "Code",
  6113. category: "text",
  6114. description: "Display code snippets that respect your spacing and tabs.",
  6115. textdomain: "default",
  6116. attributes: {
  6117. content: {
  6118. type: "string",
  6119. source: "html",
  6120. selector: "code"
  6121. }
  6122. },
  6123. supports: {
  6124. anchor: true,
  6125. typography: {
  6126. fontSize: true,
  6127. lineHeight: true,
  6128. __experimentalFontFamily: true,
  6129. __experimentalFontWeight: true,
  6130. __experimentalFontStyle: true,
  6131. __experimentalTextTransform: true,
  6132. __experimentalTextDecoration: true,
  6133. __experimentalLetterSpacing: true,
  6134. __experimentalDefaultControls: {
  6135. fontSize: true
  6136. }
  6137. },
  6138. spacing: {
  6139. margin: ["top", "bottom"],
  6140. padding: true
  6141. },
  6142. __experimentalBorder: {
  6143. radius: true,
  6144. color: true,
  6145. width: true,
  6146. style: true,
  6147. __experimentalDefaultControls: {
  6148. width: true,
  6149. color: true
  6150. }
  6151. },
  6152. color: {
  6153. text: true,
  6154. background: true,
  6155. gradients: true,
  6156. __experimentalDefaultControls: {
  6157. background: true,
  6158. text: true
  6159. }
  6160. }
  6161. },
  6162. style: "wp-block-code"
  6163. };
  6164. const {
  6165. name: code_name
  6166. } = code_metadata;
  6167. const code_settings = {
  6168. icon: library_code,
  6169. example: {
  6170. attributes: {
  6171. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  6172. // translators: Preserve \n markers for line breaks
  6173. content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')
  6174. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  6175. }
  6176. },
  6177. transforms: code_transforms,
  6178. edit: CodeEdit,
  6179. save: code_save_save
  6180. };
  6181. const code_init = () => initBlock({
  6182. name: code_name,
  6183. metadata: code_metadata,
  6184. settings: code_settings
  6185. });
  6186. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js
  6187. /**
  6188. * WordPress dependencies
  6189. */
  6190. const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6191. xmlns: "http://www.w3.org/2000/svg",
  6192. viewBox: "0 0 24 24"
  6193. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6194. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"
  6195. }));
  6196. /* harmony default export */ var library_column = (column);
  6197. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
  6198. /**
  6199. * External dependencies
  6200. */
  6201. /**
  6202. * WordPress dependencies
  6203. */
  6204. const column_deprecated_deprecated = [{
  6205. attributes: {
  6206. verticalAlignment: {
  6207. type: 'string'
  6208. },
  6209. width: {
  6210. type: 'number',
  6211. min: 0,
  6212. max: 100
  6213. }
  6214. },
  6215. isEligible(_ref) {
  6216. let {
  6217. width
  6218. } = _ref;
  6219. return isFinite(width);
  6220. },
  6221. migrate(attributes) {
  6222. return { ...attributes,
  6223. width: `${attributes.width}%`
  6224. };
  6225. },
  6226. save(_ref2) {
  6227. let {
  6228. attributes
  6229. } = _ref2;
  6230. const {
  6231. verticalAlignment,
  6232. width
  6233. } = attributes;
  6234. const wrapperClasses = classnames_default()({
  6235. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  6236. });
  6237. const style = {
  6238. flexBasis: width + '%'
  6239. };
  6240. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6241. className: wrapperClasses,
  6242. style: style
  6243. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  6244. }
  6245. }];
  6246. /* harmony default export */ var column_deprecated = (column_deprecated_deprecated);
  6247. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js
  6248. /**
  6249. * External dependencies
  6250. */
  6251. /**
  6252. * WordPress dependencies
  6253. */
  6254. function ColumnEdit(_ref) {
  6255. let {
  6256. attributes: {
  6257. verticalAlignment,
  6258. width,
  6259. templateLock,
  6260. allowedBlocks
  6261. },
  6262. setAttributes,
  6263. clientId
  6264. } = _ref;
  6265. const classes = classnames_default()('block-core-columns', {
  6266. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  6267. });
  6268. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  6269. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
  6270. });
  6271. const {
  6272. columnsIds,
  6273. hasChildBlocks,
  6274. rootClientId
  6275. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6276. const {
  6277. getBlockOrder,
  6278. getBlockRootClientId
  6279. } = select(external_wp_blockEditor_namespaceObject.store);
  6280. const rootId = getBlockRootClientId(clientId);
  6281. return {
  6282. hasChildBlocks: getBlockOrder(clientId).length > 0,
  6283. rootClientId: rootId,
  6284. columnsIds: getBlockOrder(rootId)
  6285. };
  6286. }, [clientId]);
  6287. const {
  6288. updateBlockAttributes
  6289. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  6290. const updateAlignment = value => {
  6291. // Update own alignment.
  6292. setAttributes({
  6293. verticalAlignment: value
  6294. }); // Reset parent Columns block.
  6295. updateBlockAttributes(rootClientId, {
  6296. verticalAlignment: null
  6297. });
  6298. };
  6299. const widthWithUnit = Number.isFinite(width) ? width + '%' : width;
  6300. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6301. className: classes,
  6302. style: widthWithUnit ? {
  6303. flexBasis: widthWithUnit
  6304. } : undefined
  6305. });
  6306. const columnsCount = columnsIds.length;
  6307. const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
  6308. const label = (0,external_wp_i18n_namespaceObject.sprintf)(
  6309. /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
  6310. (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount);
  6311. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
  6312. 'aria-label': label
  6313. }, {
  6314. templateLock,
  6315. allowedBlocks,
  6316. renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  6317. });
  6318. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  6319. onChange: updateAlignment,
  6320. value: verticalAlignment
  6321. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6322. title: (0,external_wp_i18n_namespaceObject.__)('Column settings')
  6323. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  6324. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  6325. labelPosition: "edge",
  6326. __unstableInputWidth: "80px",
  6327. value: width || '',
  6328. onChange: nextWidth => {
  6329. nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
  6330. setAttributes({
  6331. width: nextWidth
  6332. });
  6333. },
  6334. units: units
  6335. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  6336. }
  6337. /* harmony default export */ var column_edit = (ColumnEdit);
  6338. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js
  6339. /**
  6340. * External dependencies
  6341. */
  6342. /**
  6343. * WordPress dependencies
  6344. */
  6345. function column_save_save(_ref) {
  6346. let {
  6347. attributes
  6348. } = _ref;
  6349. const {
  6350. verticalAlignment,
  6351. width
  6352. } = attributes;
  6353. const wrapperClasses = classnames_default()({
  6354. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  6355. });
  6356. let style;
  6357. if (width && /\d/.test(width)) {
  6358. // Numbers are handled for backward compatibility as they can be still provided with templates.
  6359. let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float.
  6360. if (!Number.isFinite(width) && width !== null && width !== void 0 && width.endsWith('%')) {
  6361. const multiplier = 1000000000000; // Shrink the number back to a reasonable float.
  6362. flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%';
  6363. }
  6364. style = {
  6365. flexBasis
  6366. };
  6367. }
  6368. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  6369. className: wrapperClasses,
  6370. style
  6371. });
  6372. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  6373. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  6374. }
  6375. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js
  6376. /**
  6377. * WordPress dependencies
  6378. */
  6379. /**
  6380. * Internal dependencies
  6381. */
  6382. const column_metadata = {
  6383. $schema: "https://schemas.wp.org/trunk/block.json",
  6384. apiVersion: 2,
  6385. name: "core/column",
  6386. title: "Column",
  6387. category: "text",
  6388. parent: ["core/columns"],
  6389. description: "A single column within a columns block.",
  6390. textdomain: "default",
  6391. attributes: {
  6392. verticalAlignment: {
  6393. type: "string"
  6394. },
  6395. width: {
  6396. type: "string"
  6397. },
  6398. allowedBlocks: {
  6399. type: "array"
  6400. },
  6401. templateLock: {
  6402. type: ["string", "boolean"],
  6403. "enum": ["all", "insert", "contentOnly", false]
  6404. }
  6405. },
  6406. supports: {
  6407. anchor: true,
  6408. reusable: false,
  6409. html: false,
  6410. color: {
  6411. gradients: true,
  6412. link: true,
  6413. __experimentalDefaultControls: {
  6414. background: true,
  6415. text: true
  6416. }
  6417. },
  6418. spacing: {
  6419. blockGap: true,
  6420. padding: true,
  6421. __experimentalDefaultControls: {
  6422. padding: true
  6423. }
  6424. },
  6425. __experimentalBorder: {
  6426. color: true,
  6427. style: true,
  6428. width: true,
  6429. __experimentalDefaultControls: {
  6430. color: true,
  6431. style: true,
  6432. width: true
  6433. }
  6434. },
  6435. typography: {
  6436. fontSize: true,
  6437. lineHeight: true,
  6438. __experimentalFontFamily: true,
  6439. __experimentalFontWeight: true,
  6440. __experimentalFontStyle: true,
  6441. __experimentalTextTransform: true,
  6442. __experimentalTextDecoration: true,
  6443. __experimentalLetterSpacing: true,
  6444. __experimentalDefaultControls: {
  6445. fontSize: true
  6446. }
  6447. },
  6448. __experimentalLayout: true
  6449. }
  6450. };
  6451. const {
  6452. name: column_name
  6453. } = column_metadata;
  6454. const column_settings = {
  6455. icon: library_column,
  6456. edit: column_edit,
  6457. save: column_save_save,
  6458. deprecated: column_deprecated
  6459. };
  6460. const column_init = () => initBlock({
  6461. name: column_name,
  6462. metadata: column_metadata,
  6463. settings: column_settings
  6464. });
  6465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js
  6466. /**
  6467. * WordPress dependencies
  6468. */
  6469. const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6470. viewBox: "0 0 24 24",
  6471. xmlns: "http://www.w3.org/2000/svg"
  6472. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6473. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"
  6474. }));
  6475. /* harmony default export */ var library_columns = (columns);
  6476. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
  6477. /**
  6478. * External dependencies
  6479. */
  6480. /**
  6481. * WordPress dependencies
  6482. */
  6483. /**
  6484. * Given an HTML string for a deprecated columns inner block, returns the
  6485. * column index to which the migrated inner block should be assigned. Returns
  6486. * undefined if the inner block was not assigned to a column.
  6487. *
  6488. * @param {string} originalContent Deprecated Columns inner block HTML.
  6489. *
  6490. * @return {?number} Column to which inner block is to be assigned.
  6491. */
  6492. function getDeprecatedLayoutColumn(originalContent) {
  6493. let {
  6494. doc
  6495. } = getDeprecatedLayoutColumn;
  6496. if (!doc) {
  6497. doc = document.implementation.createHTMLDocument('');
  6498. getDeprecatedLayoutColumn.doc = doc;
  6499. }
  6500. let columnMatch;
  6501. doc.body.innerHTML = originalContent;
  6502. for (const classListItem of doc.body.firstChild.classList) {
  6503. if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
  6504. return Number(columnMatch[1]) - 1;
  6505. }
  6506. }
  6507. }
  6508. const migrateCustomColors = attributes => {
  6509. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  6510. return attributes;
  6511. }
  6512. const style = {
  6513. color: {}
  6514. };
  6515. if (attributes.customTextColor) {
  6516. style.color.text = attributes.customTextColor;
  6517. }
  6518. if (attributes.customBackgroundColor) {
  6519. style.color.background = attributes.customBackgroundColor;
  6520. }
  6521. const {
  6522. customTextColor,
  6523. customBackgroundColor,
  6524. ...restAttributes
  6525. } = attributes;
  6526. return { ...restAttributes,
  6527. style,
  6528. isStackedOnMobile: true
  6529. };
  6530. };
  6531. /* harmony default export */ var columns_deprecated = ([{
  6532. attributes: {
  6533. verticalAlignment: {
  6534. type: 'string'
  6535. },
  6536. backgroundColor: {
  6537. type: 'string'
  6538. },
  6539. customBackgroundColor: {
  6540. type: 'string'
  6541. },
  6542. customTextColor: {
  6543. type: 'string'
  6544. },
  6545. textColor: {
  6546. type: 'string'
  6547. }
  6548. },
  6549. migrate: migrateCustomColors,
  6550. save(_ref) {
  6551. let {
  6552. attributes
  6553. } = _ref;
  6554. const {
  6555. verticalAlignment,
  6556. backgroundColor,
  6557. customBackgroundColor,
  6558. textColor,
  6559. customTextColor
  6560. } = attributes;
  6561. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  6562. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  6563. const className = classnames_default()({
  6564. 'has-background': backgroundColor || customBackgroundColor,
  6565. 'has-text-color': textColor || customTextColor,
  6566. [backgroundClass]: backgroundClass,
  6567. [textClass]: textClass,
  6568. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  6569. });
  6570. const style = {
  6571. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  6572. color: textClass ? undefined : customTextColor
  6573. };
  6574. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6575. className: className ? className : undefined,
  6576. style: style
  6577. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  6578. }
  6579. }, {
  6580. attributes: {
  6581. columns: {
  6582. type: 'number',
  6583. default: 2
  6584. }
  6585. },
  6586. isEligible(attributes, innerBlocks) {
  6587. // Since isEligible is called on every valid instance of the
  6588. // Columns block and a deprecation is the unlikely case due to
  6589. // its subsequent migration, optimize for the `false` condition
  6590. // by performing a naive, inaccurate pass at inner blocks.
  6591. const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent));
  6592. if (!isFastPassEligible) {
  6593. return false;
  6594. } // Only if the fast pass is considered eligible is the more
  6595. // accurate, durable, slower condition performed.
  6596. return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined);
  6597. },
  6598. migrate(attributes, innerBlocks) {
  6599. const columns = innerBlocks.reduce((accumulator, innerBlock) => {
  6600. const {
  6601. originalContent
  6602. } = innerBlock;
  6603. let columnIndex = getDeprecatedLayoutColumn(originalContent);
  6604. if (columnIndex === undefined) {
  6605. columnIndex = 0;
  6606. }
  6607. if (!accumulator[columnIndex]) {
  6608. accumulator[columnIndex] = [];
  6609. }
  6610. accumulator[columnIndex].push(innerBlock);
  6611. return accumulator;
  6612. }, []);
  6613. const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks));
  6614. const {
  6615. columns: ignoredColumns,
  6616. ...restAttributes
  6617. } = attributes;
  6618. return [{ ...restAttributes,
  6619. isStackedOnMobile: true
  6620. }, migratedInnerBlocks];
  6621. },
  6622. save(_ref2) {
  6623. let {
  6624. attributes
  6625. } = _ref2;
  6626. const {
  6627. columns
  6628. } = attributes;
  6629. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6630. className: `has-${columns}-columns`
  6631. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  6632. }
  6633. }, {
  6634. attributes: {
  6635. columns: {
  6636. type: 'number',
  6637. default: 2
  6638. }
  6639. },
  6640. migrate(attributes, innerBlocks) {
  6641. const {
  6642. columns,
  6643. ...restAttributes
  6644. } = attributes;
  6645. attributes = { ...restAttributes,
  6646. isStackedOnMobile: true
  6647. };
  6648. return [attributes, innerBlocks];
  6649. },
  6650. save(_ref3) {
  6651. let {
  6652. attributes
  6653. } = _ref3;
  6654. const {
  6655. verticalAlignment,
  6656. columns
  6657. } = attributes;
  6658. const wrapperClasses = classnames_default()(`has-${columns}-columns`, {
  6659. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  6660. });
  6661. return (0,external_wp_element_namespaceObject.createElement)("div", {
  6662. className: wrapperClasses
  6663. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  6664. }
  6665. }]);
  6666. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js
  6667. /**
  6668. * External dependencies
  6669. */
  6670. /**
  6671. * Returns a column width attribute value rounded to standard precision.
  6672. * Returns `undefined` if the value is not a valid finite number.
  6673. *
  6674. * @param {?number} value Raw value.
  6675. *
  6676. * @return {number} Value rounded to standard precision.
  6677. */
  6678. const toWidthPrecision = value => {
  6679. const unitlessValue = parseFloat(value);
  6680. return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
  6681. };
  6682. /**
  6683. * Returns an effective width for a given block. An effective width is equal to
  6684. * its attribute value if set, or a computed value assuming equal distribution.
  6685. *
  6686. * @param {WPBlock} block Block object.
  6687. * @param {number} totalBlockCount Total number of blocks in Columns.
  6688. *
  6689. * @return {number} Effective column width.
  6690. */
  6691. function getEffectiveColumnWidth(block, totalBlockCount) {
  6692. const {
  6693. width = 100 / totalBlockCount
  6694. } = block.attributes;
  6695. return toWidthPrecision(width);
  6696. }
  6697. /**
  6698. * Returns the total width occupied by the given set of column blocks.
  6699. *
  6700. * @param {WPBlock[]} blocks Block objects.
  6701. * @param {?number} totalBlockCount Total number of blocks in Columns.
  6702. * Defaults to number of blocks passed.
  6703. *
  6704. * @return {number} Total width occupied by blocks.
  6705. */
  6706. function getTotalColumnsWidth(blocks) {
  6707. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  6708. return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0);
  6709. }
  6710. /**
  6711. * Returns an object of `clientId` → `width` of effective column widths.
  6712. *
  6713. * @param {WPBlock[]} blocks Block objects.
  6714. * @param {?number} totalBlockCount Total number of blocks in Columns.
  6715. * Defaults to number of blocks passed.
  6716. *
  6717. * @return {Object<string,number>} Column widths.
  6718. */
  6719. function getColumnWidths(blocks) {
  6720. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  6721. return blocks.reduce((accumulator, block) => {
  6722. const width = getEffectiveColumnWidth(block, totalBlockCount);
  6723. return Object.assign(accumulator, {
  6724. [block.clientId]: width
  6725. });
  6726. }, {});
  6727. }
  6728. /**
  6729. * Returns an object of `clientId` → `width` of column widths as redistributed
  6730. * proportional to their current widths, constrained or expanded to fit within
  6731. * the given available width.
  6732. *
  6733. * @param {WPBlock[]} blocks Block objects.
  6734. * @param {number} availableWidth Maximum width to fit within.
  6735. * @param {?number} totalBlockCount Total number of blocks in Columns.
  6736. * Defaults to number of blocks passed.
  6737. *
  6738. * @return {Object<string,number>} Redistributed column widths.
  6739. */
  6740. function getRedistributedColumnWidths(blocks, availableWidth) {
  6741. let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length;
  6742. const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
  6743. return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => {
  6744. const newWidth = availableWidth * width / totalWidth;
  6745. return toWidthPrecision(newWidth);
  6746. });
  6747. }
  6748. /**
  6749. * Returns true if column blocks within the provided set are assigned with
  6750. * explicit widths, or false otherwise.
  6751. *
  6752. * @param {WPBlock[]} blocks Block objects.
  6753. *
  6754. * @return {boolean} Whether columns have explicit widths.
  6755. */
  6756. function hasExplicitPercentColumnWidths(blocks) {
  6757. return blocks.every(block => {
  6758. var _blockWidth$endsWith;
  6759. const blockWidth = block.attributes.width;
  6760. return Number.isFinite(blockWidth !== null && blockWidth !== void 0 && (_blockWidth$endsWith = blockWidth.endsWith) !== null && _blockWidth$endsWith !== void 0 && _blockWidth$endsWith.call(blockWidth, '%') ? parseFloat(blockWidth) : blockWidth);
  6761. });
  6762. }
  6763. /**
  6764. * Returns a copy of the given set of blocks with new widths assigned from the
  6765. * provided object of redistributed column widths.
  6766. *
  6767. * @param {WPBlock[]} blocks Block objects.
  6768. * @param {Object<string,number>} widths Redistributed column widths.
  6769. *
  6770. * @return {WPBlock[]} blocks Mapped block objects.
  6771. */
  6772. function getMappedColumnWidths(blocks, widths) {
  6773. return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, {
  6774. attributes: {
  6775. width: `${widths[block.clientId]}%`
  6776. }
  6777. }));
  6778. }
  6779. /**
  6780. * Returns an array with columns widths values, parsed or no depends on `withParsing` flag.
  6781. *
  6782. * @param {WPBlock[]} blocks Block objects.
  6783. * @param {?boolean} withParsing Whether value has to be parsed.
  6784. *
  6785. * @return {Array<number,string>} Column widths.
  6786. */
  6787. function getWidths(blocks) {
  6788. let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  6789. return blocks.map(innerColumn => {
  6790. const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
  6791. return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
  6792. });
  6793. }
  6794. /**
  6795. * Returns a column width with unit.
  6796. *
  6797. * @param {string} width Column width.
  6798. * @param {string} unit Column width unit.
  6799. *
  6800. * @return {string} Column width with unit.
  6801. */
  6802. function getWidthWithUnit(width, unit) {
  6803. width = 0 > parseFloat(width) ? '0' : width;
  6804. if (isPercentageUnit(unit)) {
  6805. width = Math.min(width, 100);
  6806. }
  6807. return `${width}${unit}`;
  6808. }
  6809. /**
  6810. * Returns a boolean whether passed unit is percentage
  6811. *
  6812. * @param {string} unit Column width unit.
  6813. *
  6814. * @return {boolean} Whether unit is '%'.
  6815. */
  6816. function isPercentageUnit(unit) {
  6817. return unit === '%';
  6818. }
  6819. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js
  6820. /**
  6821. * External dependencies
  6822. */
  6823. /**
  6824. * WordPress dependencies
  6825. */
  6826. /**
  6827. * Internal dependencies
  6828. */
  6829. /**
  6830. * Allowed blocks constant is passed to InnerBlocks precisely as specified here.
  6831. * The contents of the array should never change.
  6832. * The array should contain the name of each block that is allowed.
  6833. * In columns block, the only block we allow is 'core/column'.
  6834. *
  6835. * @constant
  6836. * @type {string[]}
  6837. */
  6838. const edit_ALLOWED_BLOCKS = ['core/column'];
  6839. function ColumnsEditContainer(_ref) {
  6840. let {
  6841. attributes,
  6842. setAttributes,
  6843. updateAlignment,
  6844. updateColumns,
  6845. clientId
  6846. } = _ref;
  6847. const {
  6848. isStackedOnMobile,
  6849. verticalAlignment
  6850. } = attributes;
  6851. const {
  6852. count
  6853. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6854. return {
  6855. count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId)
  6856. };
  6857. }, [clientId]);
  6858. const classes = classnames_default()({
  6859. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  6860. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  6861. });
  6862. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6863. className: classes
  6864. });
  6865. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  6866. allowedBlocks: edit_ALLOWED_BLOCKS,
  6867. orientation: 'horizontal',
  6868. renderAppender: false
  6869. });
  6870. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  6871. onChange: updateAlignment,
  6872. value: verticalAlignment
  6873. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  6874. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  6875. value: count,
  6876. onChange: value => updateColumns(count, value),
  6877. min: 1,
  6878. max: Math.max(6, count)
  6879. }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  6880. status: "warning",
  6881. isDismissible: false
  6882. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6883. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  6884. checked: isStackedOnMobile,
  6885. onChange: () => setAttributes({
  6886. isStackedOnMobile: !isStackedOnMobile
  6887. })
  6888. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  6889. }
  6890. const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({
  6891. /**
  6892. * Update all child Column blocks with a new vertical alignment setting
  6893. * based on whatever alignment is passed in. This allows change to parent
  6894. * to overide anything set on a individual column basis.
  6895. *
  6896. * @param {string} verticalAlignment the vertical alignment setting
  6897. */
  6898. updateAlignment(verticalAlignment) {
  6899. const {
  6900. clientId,
  6901. setAttributes
  6902. } = ownProps;
  6903. const {
  6904. updateBlockAttributes
  6905. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  6906. const {
  6907. getBlockOrder
  6908. } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment.
  6909. setAttributes({
  6910. verticalAlignment
  6911. }); // Update all child Column Blocks to match.
  6912. const innerBlockClientIds = getBlockOrder(clientId);
  6913. innerBlockClientIds.forEach(innerBlockClientId => {
  6914. updateBlockAttributes(innerBlockClientId, {
  6915. verticalAlignment
  6916. });
  6917. });
  6918. },
  6919. /**
  6920. * Updates the column count, including necessary revisions to child Column
  6921. * blocks to grant required or redistribute available space.
  6922. *
  6923. * @param {number} previousColumns Previous column count.
  6924. * @param {number} newColumns New column count.
  6925. */
  6926. updateColumns(previousColumns, newColumns) {
  6927. const {
  6928. clientId
  6929. } = ownProps;
  6930. const {
  6931. replaceInnerBlocks
  6932. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  6933. const {
  6934. getBlocks
  6935. } = registry.select(external_wp_blockEditor_namespaceObject.store);
  6936. let innerBlocks = getBlocks(clientId);
  6937. const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.
  6938. const isAddingColumn = newColumns > previousColumns;
  6939. if (isAddingColumn && hasExplicitWidths) {
  6940. // If adding a new column, assign width to the new column equal to
  6941. // as if it were `1 / columns` of the total available space.
  6942. const newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as
  6943. // constraining the available working width.
  6944. const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
  6945. innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({
  6946. length: newColumns - previousColumns
  6947. }).map(() => {
  6948. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {
  6949. width: `${newColumnWidth}%`
  6950. });
  6951. })];
  6952. } else if (isAddingColumn) {
  6953. innerBlocks = [...innerBlocks, ...Array.from({
  6954. length: newColumns - previousColumns
  6955. }).map(() => {
  6956. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column');
  6957. })];
  6958. } else {
  6959. // The removed column will be the last of the inner blocks.
  6960. innerBlocks = innerBlocks.slice(0, -(previousColumns - newColumns));
  6961. if (hasExplicitWidths) {
  6962. // Redistribute as if block is already removed.
  6963. const widths = getRedistributedColumnWidths(innerBlocks, 100);
  6964. innerBlocks = getMappedColumnWidths(innerBlocks, widths);
  6965. }
  6966. }
  6967. replaceInnerBlocks(clientId, innerBlocks);
  6968. }
  6969. }))(ColumnsEditContainer);
  6970. function Placeholder(_ref2) {
  6971. let {
  6972. clientId,
  6973. name,
  6974. setAttributes
  6975. } = _ref2;
  6976. const {
  6977. blockType,
  6978. defaultVariation,
  6979. variations
  6980. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6981. const {
  6982. getBlockVariations,
  6983. getBlockType,
  6984. getDefaultBlockVariation
  6985. } = select(external_wp_blocks_namespaceObject.store);
  6986. return {
  6987. blockType: getBlockType(name),
  6988. defaultVariation: getDefaultBlockVariation(name, 'block'),
  6989. variations: getBlockVariations(name, 'block')
  6990. };
  6991. }, [name]);
  6992. const {
  6993. replaceInnerBlocks
  6994. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  6995. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  6996. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  6997. icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']),
  6998. label: (0,external_lodash_namespaceObject.get)(blockType, ['title']),
  6999. variations: variations,
  7000. onSelect: function () {
  7001. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  7002. if (nextVariation.attributes) {
  7003. setAttributes(nextVariation.attributes);
  7004. }
  7005. if (nextVariation.innerBlocks) {
  7006. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true);
  7007. }
  7008. },
  7009. allowSkip: true
  7010. }));
  7011. }
  7012. const ColumnsEdit = props => {
  7013. const {
  7014. clientId
  7015. } = props;
  7016. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]);
  7017. const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder;
  7018. return (0,external_wp_element_namespaceObject.createElement)(Component, props);
  7019. };
  7020. /* harmony default export */ var columns_edit = (ColumnsEdit);
  7021. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js
  7022. /**
  7023. * External dependencies
  7024. */
  7025. /**
  7026. * WordPress dependencies
  7027. */
  7028. function columns_save_save(_ref) {
  7029. let {
  7030. attributes
  7031. } = _ref;
  7032. const {
  7033. isStackedOnMobile,
  7034. verticalAlignment
  7035. } = attributes;
  7036. const className = classnames_default()({
  7037. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  7038. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  7039. });
  7040. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  7041. className
  7042. });
  7043. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  7044. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  7045. }
  7046. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js
  7047. /**
  7048. * WordPress dependencies
  7049. */
  7050. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  7051. /**
  7052. * Template option choices for predefined columns layouts.
  7053. *
  7054. * @type {WPBlockVariation[]}
  7055. */
  7056. const variations = [{
  7057. name: 'one-column-full',
  7058. title: (0,external_wp_i18n_namespaceObject.__)('100'),
  7059. description: (0,external_wp_i18n_namespaceObject.__)('One column'),
  7060. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7061. width: "48",
  7062. height: "48",
  7063. viewBox: "0 0 48 48",
  7064. xmlns: "http://www.w3.org/2000/svg"
  7065. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7066. fillRule: "evenodd",
  7067. clipRule: "evenodd",
  7068. d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"
  7069. })),
  7070. innerBlocks: [['core/column']],
  7071. scope: ['block']
  7072. }, {
  7073. name: 'two-columns-equal',
  7074. title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'),
  7075. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'),
  7076. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7077. width: "48",
  7078. height: "48",
  7079. viewBox: "0 0 48 48",
  7080. xmlns: "http://www.w3.org/2000/svg"
  7081. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7082. fillRule: "evenodd",
  7083. clipRule: "evenodd",
  7084. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"
  7085. })),
  7086. isDefault: true,
  7087. innerBlocks: [['core/column'], ['core/column']],
  7088. scope: ['block']
  7089. }, {
  7090. name: 'two-columns-one-third-two-thirds',
  7091. title: (0,external_wp_i18n_namespaceObject.__)('33 / 66'),
  7092. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'),
  7093. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7094. width: "48",
  7095. height: "48",
  7096. viewBox: "0 0 48 48",
  7097. xmlns: "http://www.w3.org/2000/svg"
  7098. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7099. fillRule: "evenodd",
  7100. clipRule: "evenodd",
  7101. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"
  7102. })),
  7103. innerBlocks: [['core/column', {
  7104. width: '33.33%'
  7105. }], ['core/column', {
  7106. width: '66.66%'
  7107. }]],
  7108. scope: ['block']
  7109. }, {
  7110. name: 'two-columns-two-thirds-one-third',
  7111. title: (0,external_wp_i18n_namespaceObject.__)('66 / 33'),
  7112. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'),
  7113. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7114. width: "48",
  7115. height: "48",
  7116. viewBox: "0 0 48 48",
  7117. xmlns: "http://www.w3.org/2000/svg"
  7118. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7119. fillRule: "evenodd",
  7120. clipRule: "evenodd",
  7121. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"
  7122. })),
  7123. innerBlocks: [['core/column', {
  7124. width: '66.66%'
  7125. }], ['core/column', {
  7126. width: '33.33%'
  7127. }]],
  7128. scope: ['block']
  7129. }, {
  7130. name: 'three-columns-equal',
  7131. title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'),
  7132. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'),
  7133. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7134. width: "48",
  7135. height: "48",
  7136. viewBox: "0 0 48 48",
  7137. xmlns: "http://www.w3.org/2000/svg"
  7138. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7139. fillRule: "evenodd",
  7140. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"
  7141. })),
  7142. innerBlocks: [['core/column'], ['core/column'], ['core/column']],
  7143. scope: ['block']
  7144. }, {
  7145. name: 'three-columns-wider-center',
  7146. title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'),
  7147. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'),
  7148. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  7149. width: "48",
  7150. height: "48",
  7151. viewBox: "0 0 48 48",
  7152. xmlns: "http://www.w3.org/2000/svg"
  7153. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  7154. fillRule: "evenodd",
  7155. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"
  7156. })),
  7157. innerBlocks: [['core/column', {
  7158. width: '25%'
  7159. }], ['core/column', {
  7160. width: '50%'
  7161. }], ['core/column', {
  7162. width: '25%'
  7163. }]],
  7164. scope: ['block']
  7165. }];
  7166. /* harmony default export */ var columns_variations = (variations);
  7167. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
  7168. /**
  7169. * WordPress dependencies
  7170. */
  7171. const MAXIMUM_SELECTED_BLOCKS = 6;
  7172. const columns_transforms_transforms = {
  7173. from: [{
  7174. type: 'block',
  7175. isMultiBlock: true,
  7176. blocks: ['*'],
  7177. __experimentalConvert: blocks => {
  7178. const columnWidth = +(100 / blocks.length).toFixed(2);
  7179. const innerBlocksTemplate = blocks.map(_ref => {
  7180. let {
  7181. name,
  7182. attributes,
  7183. innerBlocks
  7184. } = _ref;
  7185. return ['core/column', {
  7186. width: `${columnWidth}%`
  7187. }, [[name, { ...attributes
  7188. }, innerBlocks]]];
  7189. });
  7190. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  7191. },
  7192. isMatch: (_ref2, blocks) => {
  7193. let {
  7194. length: selectedBlocksLength
  7195. } = _ref2;
  7196. // If a user is trying to transform a single Columns block, skip
  7197. // the transformation. Enabling this functiontionality creates
  7198. // nested Columns blocks resulting in an unintuitive user experience.
  7199. // Multiple Columns blocks can still be transformed.
  7200. if (blocks.length === 1 && blocks[0].name === 'core/columns') {
  7201. return false;
  7202. }
  7203. return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS;
  7204. }
  7205. }, {
  7206. type: 'block',
  7207. blocks: ['core/media-text'],
  7208. priority: 1,
  7209. transform: (attributes, innerBlocks) => {
  7210. const {
  7211. align,
  7212. backgroundColor,
  7213. textColor,
  7214. style,
  7215. mediaAlt: alt,
  7216. mediaId: id,
  7217. mediaPosition,
  7218. mediaSizeSlug: sizeSlug,
  7219. mediaType,
  7220. mediaUrl: url,
  7221. mediaWidth,
  7222. verticalAlignment
  7223. } = attributes;
  7224. let media;
  7225. if (mediaType === 'image' || !mediaType) {
  7226. const imageAttrs = {
  7227. id,
  7228. alt,
  7229. url,
  7230. sizeSlug
  7231. };
  7232. const linkAttrs = {
  7233. href: attributes.href,
  7234. linkClass: attributes.linkClass,
  7235. linkDestination: attributes.linkDestination,
  7236. linkTarget: attributes.linkTarget,
  7237. rel: attributes.rel
  7238. };
  7239. media = ['core/image', { ...imageAttrs,
  7240. ...linkAttrs
  7241. }];
  7242. } else {
  7243. media = ['core/video', {
  7244. id,
  7245. src: url
  7246. }];
  7247. }
  7248. const innerBlocksTemplate = [['core/column', {
  7249. width: `${mediaWidth}%`
  7250. }, [media]], ['core/column', {
  7251. width: `${100 - mediaWidth}%`
  7252. }, innerBlocks]];
  7253. if (mediaPosition === 'right') {
  7254. innerBlocksTemplate.reverse();
  7255. }
  7256. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  7257. align,
  7258. backgroundColor,
  7259. textColor,
  7260. style,
  7261. verticalAlignment
  7262. }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  7263. }
  7264. }]
  7265. };
  7266. /* harmony default export */ var columns_transforms = (columns_transforms_transforms);
  7267. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  7268. /**
  7269. * WordPress dependencies
  7270. */
  7271. /**
  7272. * Internal dependencies
  7273. */
  7274. const columns_metadata = {
  7275. $schema: "https://schemas.wp.org/trunk/block.json",
  7276. apiVersion: 2,
  7277. name: "core/columns",
  7278. title: "Columns",
  7279. category: "design",
  7280. description: "Display content in multiple columns, with blocks added to each column.",
  7281. textdomain: "default",
  7282. attributes: {
  7283. verticalAlignment: {
  7284. type: "string"
  7285. },
  7286. isStackedOnMobile: {
  7287. type: "boolean",
  7288. "default": true
  7289. }
  7290. },
  7291. supports: {
  7292. anchor: true,
  7293. align: ["wide", "full"],
  7294. html: false,
  7295. color: {
  7296. gradients: true,
  7297. link: true,
  7298. __experimentalDefaultControls: {
  7299. background: true,
  7300. text: true
  7301. }
  7302. },
  7303. spacing: {
  7304. blockGap: {
  7305. __experimentalDefault: "2em",
  7306. sides: ["horizontal", "vertical"]
  7307. },
  7308. margin: ["top", "bottom"],
  7309. padding: true,
  7310. __experimentalDefaultControls: {
  7311. padding: true
  7312. }
  7313. },
  7314. __experimentalLayout: {
  7315. allowSwitching: false,
  7316. allowInheriting: false,
  7317. allowEditing: false,
  7318. "default": {
  7319. type: "flex",
  7320. flexWrap: "nowrap"
  7321. }
  7322. },
  7323. __experimentalBorder: {
  7324. color: true,
  7325. radius: true,
  7326. style: true,
  7327. width: true,
  7328. __experimentalDefaultControls: {
  7329. color: true,
  7330. radius: true,
  7331. style: true,
  7332. width: true
  7333. }
  7334. },
  7335. typography: {
  7336. fontSize: true,
  7337. lineHeight: true,
  7338. __experimentalFontFamily: true,
  7339. __experimentalFontWeight: true,
  7340. __experimentalFontStyle: true,
  7341. __experimentalTextTransform: true,
  7342. __experimentalTextDecoration: true,
  7343. __experimentalLetterSpacing: true,
  7344. __experimentalDefaultControls: {
  7345. fontSize: true
  7346. }
  7347. }
  7348. },
  7349. editorStyle: "wp-block-columns-editor",
  7350. style: "wp-block-columns"
  7351. };
  7352. const {
  7353. name: columns_name
  7354. } = columns_metadata;
  7355. const columns_settings = {
  7356. icon: library_columns,
  7357. variations: columns_variations,
  7358. example: {
  7359. viewportWidth: 600,
  7360. // Columns collapse "@media (max-width: 599px)".
  7361. innerBlocks: [{
  7362. name: 'core/column',
  7363. innerBlocks: [{
  7364. name: 'core/paragraph',
  7365. attributes: {
  7366. /* translators: example text. */
  7367. content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.')
  7368. }
  7369. }, {
  7370. name: 'core/image',
  7371. attributes: {
  7372. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  7373. }
  7374. }, {
  7375. name: 'core/paragraph',
  7376. attributes: {
  7377. /* translators: example text. */
  7378. content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.')
  7379. }
  7380. }]
  7381. }, {
  7382. name: 'core/column',
  7383. innerBlocks: [{
  7384. name: 'core/paragraph',
  7385. attributes: {
  7386. /* translators: example text. */
  7387. content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.')
  7388. }
  7389. }, {
  7390. name: 'core/paragraph',
  7391. attributes: {
  7392. /* translators: example text. */
  7393. content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.')
  7394. }
  7395. }]
  7396. }]
  7397. },
  7398. deprecated: columns_deprecated,
  7399. edit: columns_edit,
  7400. save: columns_save_save,
  7401. transforms: columns_transforms
  7402. };
  7403. const columns_init = () => initBlock({
  7404. name: columns_name,
  7405. metadata: columns_metadata,
  7406. settings: columns_settings
  7407. });
  7408. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
  7409. /**
  7410. * WordPress dependencies
  7411. */
  7412. const postComments = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7413. xmlns: "http://www.w3.org/2000/svg",
  7414. viewBox: "0 0 24 24"
  7415. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7416. d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"
  7417. }));
  7418. /* harmony default export */ var post_comments = (postComments);
  7419. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js
  7420. /**
  7421. * WordPress dependencies
  7422. */
  7423. // v1: Deprecate the initial version of the block which was called "Comments
  7424. // Query Loop" instead of "Comments".
  7425. const v1 = {
  7426. attributes: {
  7427. tagName: {
  7428. type: 'string',
  7429. default: 'div'
  7430. }
  7431. },
  7432. apiVersion: 2,
  7433. supports: {
  7434. align: ['wide', 'full'],
  7435. html: false,
  7436. color: {
  7437. gradients: true,
  7438. link: true,
  7439. __experimentalDefaultControls: {
  7440. background: true,
  7441. text: true,
  7442. link: true
  7443. }
  7444. }
  7445. },
  7446. save(_ref) {
  7447. let {
  7448. attributes: {
  7449. tagName: Tag
  7450. }
  7451. } = _ref;
  7452. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  7453. const {
  7454. className
  7455. } = blockProps;
  7456. const classes = (className === null || className === void 0 ? void 0 : className.split(' ')) || []; // The ID of the previous version of the block
  7457. // didn't have the `wp-block-comments` class,
  7458. // so we need to remove it here in order to mimic it.
  7459. const newClasses = classes === null || classes === void 0 ? void 0 : classes.filter(cls => cls !== 'wp-block-comments');
  7460. const newBlockProps = { ...blockProps,
  7461. className: newClasses.join(' ')
  7462. };
  7463. return (0,external_wp_element_namespaceObject.createElement)(Tag, newBlockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  7464. }
  7465. };
  7466. /* harmony default export */ var comments_deprecated = ([v1]);
  7467. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js
  7468. /**
  7469. * WordPress dependencies
  7470. */
  7471. function CommentsInspectorControls(_ref) {
  7472. let {
  7473. attributes: {
  7474. TagName
  7475. },
  7476. setAttributes
  7477. } = _ref;
  7478. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  7479. __experimentalGroup: "advanced"
  7480. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  7481. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  7482. options: [{
  7483. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  7484. value: 'div'
  7485. }, {
  7486. label: '<section>',
  7487. value: 'section'
  7488. }, {
  7489. label: '<aside>',
  7490. value: 'aside'
  7491. }],
  7492. value: TagName,
  7493. onChange: value => setAttributes({
  7494. tagName: value
  7495. })
  7496. })));
  7497. }
  7498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js
  7499. /**
  7500. * External dependencies
  7501. */
  7502. /**
  7503. * WordPress dependencies
  7504. */
  7505. const CommentsFormPlaceholder = () => {
  7506. const disabledFormRef = (0,external_wp_compose_namespaceObject.useDisabled)();
  7507. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder);
  7508. return (0,external_wp_element_namespaceObject.createElement)("div", {
  7509. className: "comment-respond"
  7510. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  7511. className: "comment-reply-title"
  7512. }, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
  7513. noValidate: true,
  7514. className: "comment-form",
  7515. ref: disabledFormRef
  7516. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("label", {
  7517. htmlFor: `comment-${instanceId}`
  7518. }, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_wp_element_namespaceObject.createElement)("textarea", {
  7519. id: `comment-${instanceId}`,
  7520. name: "comment",
  7521. cols: "45",
  7522. rows: "8"
  7523. })), (0,external_wp_element_namespaceObject.createElement)("p", {
  7524. className: "form-submit wp-block-button"
  7525. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  7526. name: "submit",
  7527. type: "submit",
  7528. className: classnames_default()('wp-block-button__link', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
  7529. label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
  7530. value: (0,external_wp_i18n_namespaceObject.__)('Post Comment')
  7531. }))));
  7532. };
  7533. const CommentsForm = _ref => {
  7534. let {
  7535. postId,
  7536. postType
  7537. } = _ref;
  7538. const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  7539. const isSiteEditor = postType === undefined || postId === undefined;
  7540. const {
  7541. defaultCommentStatus
  7542. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  7543. const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7544. var _select$getPostType;
  7545. return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
  7546. });
  7547. if (!isSiteEditor && 'open' !== commentStatus) {
  7548. if ('closed' === commentStatus) {
  7549. const actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  7550. key: "enableComments",
  7551. onClick: () => setCommentStatus('open'),
  7552. variant: "primary"
  7553. }, (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))];
  7554. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  7555. actions: actions
  7556. }, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.'));
  7557. } else if (!postTypeSupportsComments) {
  7558. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
  7559. /* translators: 1: Post type (i.e. "post", "page") */
  7560. (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType));
  7561. } else if ('open' !== defaultCommentStatus) {
  7562. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.'));
  7563. }
  7564. }
  7565. return (0,external_wp_element_namespaceObject.createElement)(CommentsFormPlaceholder, null);
  7566. };
  7567. /* harmony default export */ var post_comments_form_form = (CommentsForm);
  7568. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js
  7569. /**
  7570. * WordPress dependencies
  7571. */
  7572. /**
  7573. * Internal dependencies
  7574. */
  7575. function PostCommentsPlaceholder(_ref) {
  7576. let {
  7577. postType,
  7578. postId
  7579. } = _ref;
  7580. let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  7581. postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title');
  7582. const {
  7583. avatarURL
  7584. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  7585. const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
  7586. return (0,external_wp_element_namespaceObject.createElement)("div", {
  7587. className: "wp-block-comments__legacy-placeholder",
  7588. ref: disabledRef
  7589. }, (0,external_wp_element_namespaceObject.createElement)("h3", null,
  7590. /* translators: %s: Post title. */
  7591. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
  7592. className: "navigation"
  7593. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  7594. className: "alignleft"
  7595. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7596. href: "#top"
  7597. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  7598. className: "alignright"
  7599. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7600. href: "#top"
  7601. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("ol", {
  7602. className: "commentlist"
  7603. }, (0,external_wp_element_namespaceObject.createElement)("li", {
  7604. className: "comment even thread-even depth-1"
  7605. }, (0,external_wp_element_namespaceObject.createElement)("article", {
  7606. className: "comment-body"
  7607. }, (0,external_wp_element_namespaceObject.createElement)("footer", {
  7608. className: "comment-meta"
  7609. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  7610. className: "comment-author vcard"
  7611. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  7612. alt: "Commenter Avatar",
  7613. src: avatarURL,
  7614. className: "avatar avatar-32 photo",
  7615. height: "32",
  7616. width: "32",
  7617. loading: "lazy"
  7618. }), (0,external_wp_element_namespaceObject.createElement)("b", {
  7619. className: "fn"
  7620. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7621. href: "#top",
  7622. className: "url"
  7623. }, (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
  7624. className: "says"
  7625. }, (0,external_wp_i18n_namespaceObject.__)('says'), ":")), (0,external_wp_element_namespaceObject.createElement)("div", {
  7626. className: "comment-metadata"
  7627. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7628. href: "#top"
  7629. }, (0,external_wp_element_namespaceObject.createElement)("time", {
  7630. dateTime: "2000-01-01T00:00:00+00:00"
  7631. }, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
  7632. className: "edit-link"
  7633. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7634. className: "comment-edit-link",
  7635. href: "#top"
  7636. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  7637. className: "comment-content"
  7638. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from'), ' ', (0,external_wp_element_namespaceObject.createElement)("a", {
  7639. href: "https://gravatar.com/"
  7640. }, "Gravatar"), ".")), (0,external_wp_element_namespaceObject.createElement)("div", {
  7641. className: "reply"
  7642. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7643. className: "comment-reply-link",
  7644. href: "#top",
  7645. "aria-label": "Reply to A WordPress Commenter"
  7646. }, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  7647. className: "navigation"
  7648. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  7649. className: "alignleft"
  7650. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7651. href: "#top"
  7652. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  7653. className: "alignright"
  7654. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  7655. href: "#top"
  7656. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, {
  7657. postId: postId,
  7658. postType: postType
  7659. }));
  7660. }
  7661. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js
  7662. /**
  7663. * External dependencies
  7664. */
  7665. /**
  7666. * WordPress dependencies
  7667. */
  7668. /**
  7669. * Internal dependencies
  7670. */
  7671. function CommentsLegacy(_ref) {
  7672. let {
  7673. attributes,
  7674. setAttributes,
  7675. context: {
  7676. postType,
  7677. postId
  7678. }
  7679. } = _ref;
  7680. const {
  7681. textAlign
  7682. } = attributes;
  7683. const actions = [(0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  7684. key: "convert",
  7685. onClick: () => void setAttributes({
  7686. legacy: false
  7687. }),
  7688. variant: "primary"
  7689. }, (0,external_wp_i18n_namespaceObject.__)('Switch to editable mode'))];
  7690. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  7691. className: classnames_default()({
  7692. [`has-text-align-${textAlign}`]: textAlign
  7693. })
  7694. });
  7695. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  7696. group: "block"
  7697. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  7698. value: textAlign,
  7699. onChange: nextAlign => {
  7700. setAttributes({
  7701. textAlign: nextAlign
  7702. });
  7703. }
  7704. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  7705. actions: actions
  7706. }, (0,external_wp_i18n_namespaceObject.__)("Comments block: You're currently using the legacy version of the block. " + 'The following is just a placeholder - the final styling will likely look different. ' + 'For a better representation and more customization options, ' + 'switch the block to its editable mode.')), (0,external_wp_element_namespaceObject.createElement)(PostCommentsPlaceholder, {
  7707. postId: postId,
  7708. postType: postType
  7709. })));
  7710. }
  7711. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js
  7712. const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
  7713. width: '40px'
  7714. }, [['core/avatar', {
  7715. size: 40,
  7716. style: {
  7717. border: {
  7718. radius: '20px'
  7719. }
  7720. }
  7721. }]]], ['core/column', {}, [['core/comment-author-name', {
  7722. fontSize: 'small'
  7723. }], ['core/group', {
  7724. layout: {
  7725. type: 'flex'
  7726. },
  7727. style: {
  7728. spacing: {
  7729. margin: {
  7730. top: '0px',
  7731. bottom: '0px'
  7732. }
  7733. }
  7734. }
  7735. }, [['core/comment-date', {
  7736. fontSize: 'small'
  7737. }], ['core/comment-edit-link', {
  7738. fontSize: 'small'
  7739. }]]], ['core/comment-content'], ['core/comment-reply-link', {
  7740. fontSize: 'small'
  7741. }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
  7742. /* harmony default export */ var template = (TEMPLATE);
  7743. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js
  7744. /**
  7745. * WordPress dependencies
  7746. */
  7747. /**
  7748. * Internal dependencies
  7749. */
  7750. function CommentsEdit(props) {
  7751. const {
  7752. attributes,
  7753. setAttributes
  7754. } = props;
  7755. const {
  7756. tagName: TagName,
  7757. legacy
  7758. } = attributes;
  7759. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7760. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  7761. template: template
  7762. });
  7763. if (legacy) {
  7764. return (0,external_wp_element_namespaceObject.createElement)(CommentsLegacy, props);
  7765. }
  7766. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(CommentsInspectorControls, {
  7767. attributes: attributes,
  7768. setAttributes: setAttributes
  7769. }), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  7770. }
  7771. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/save.js
  7772. /**
  7773. * WordPress dependencies
  7774. */
  7775. function comments_save_save(_ref) {
  7776. let {
  7777. attributes: {
  7778. tagName: Tag,
  7779. legacy
  7780. }
  7781. } = _ref;
  7782. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  7783. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner
  7784. // blocks, so nothing is saved in that case.
  7785. return legacy ? null : (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  7786. }
  7787. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/index.js
  7788. /**
  7789. * WordPress dependencies
  7790. */
  7791. /**
  7792. * Internal dependencies
  7793. */
  7794. const comments_metadata = {
  7795. $schema: "https://schemas.wp.org/trunk/block.json",
  7796. apiVersion: 2,
  7797. name: "core/comments",
  7798. title: "Comments",
  7799. category: "theme",
  7800. description: "An advanced block that allows displaying post comments using different visual configurations.",
  7801. textdomain: "default",
  7802. attributes: {
  7803. tagName: {
  7804. type: "string",
  7805. "default": "div"
  7806. },
  7807. legacy: {
  7808. type: "boolean",
  7809. "default": false
  7810. }
  7811. },
  7812. supports: {
  7813. align: ["wide", "full"],
  7814. html: false,
  7815. color: {
  7816. gradients: true,
  7817. link: true,
  7818. __experimentalDefaultControls: {
  7819. background: true,
  7820. text: true,
  7821. link: true
  7822. }
  7823. },
  7824. typography: {
  7825. fontSize: true,
  7826. lineHeight: true,
  7827. __experimentalFontFamily: true,
  7828. __experimentalFontWeight: true,
  7829. __experimentalFontStyle: true,
  7830. __experimentalTextTransform: true,
  7831. __experimentalTextDecoration: true,
  7832. __experimentalLetterSpacing: true,
  7833. __experimentalDefaultControls: {
  7834. fontSize: true
  7835. }
  7836. }
  7837. },
  7838. editorStyle: "wp-block-comments-editor",
  7839. usesContext: ["postId", "postType"]
  7840. };
  7841. const {
  7842. name: comments_name
  7843. } = comments_metadata;
  7844. const comments_settings = {
  7845. icon: post_comments,
  7846. edit: CommentsEdit,
  7847. save: comments_save_save,
  7848. deprecated: comments_deprecated
  7849. };
  7850. const comments_init = () => initBlock({
  7851. name: comments_name,
  7852. metadata: comments_metadata,
  7853. settings: comments_settings
  7854. });
  7855. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js
  7856. /**
  7857. * WordPress dependencies
  7858. */
  7859. function edit_Edit(_ref) {
  7860. let {
  7861. attributes,
  7862. context: {
  7863. commentId
  7864. },
  7865. setAttributes,
  7866. isSelected
  7867. } = _ref;
  7868. const {
  7869. height,
  7870. width
  7871. } = attributes;
  7872. const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  7873. const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
  7874. const avatarUrls = avatars ? Object.values(avatars) : null;
  7875. const sizes = avatars ? Object.keys(avatars) : null;
  7876. const minSize = sizes ? sizes[0] : 24;
  7877. const maxSize = sizes ? sizes[sizes.length - 1] : 96;
  7878. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7879. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  7880. const maxSizeBuffer = Math.floor(maxSize * 2.5);
  7881. const {
  7882. avatarURL
  7883. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7884. const {
  7885. getSettings
  7886. } = select(external_wp_blockEditor_namespaceObject.store);
  7887. const {
  7888. __experimentalDiscussionSettings
  7889. } = getSettings();
  7890. return __experimentalDiscussionSettings;
  7891. });
  7892. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  7893. title: (0,external_wp_i18n_namespaceObject.__)('Avatar Settings')
  7894. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  7895. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  7896. onChange: newWidth => setAttributes({
  7897. width: newWidth,
  7898. height: newWidth
  7899. }),
  7900. min: minSize,
  7901. max: maxSizeBuffer,
  7902. initialPosition: width,
  7903. value: width
  7904. })));
  7905. const resizableAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  7906. size: {
  7907. width,
  7908. height
  7909. },
  7910. showHandle: isSelected,
  7911. onResizeStop: (event, direction, elt, delta) => {
  7912. setAttributes({
  7913. height: parseInt(height + delta.height, 10),
  7914. width: parseInt(width + delta.width, 10)
  7915. });
  7916. },
  7917. lockAspectRatio: true,
  7918. enable: {
  7919. top: false,
  7920. right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
  7921. bottom: true,
  7922. left: (0,external_wp_i18n_namespaceObject.isRTL)()
  7923. },
  7924. minWidth: minSize,
  7925. maxWidth: maxSizeBuffer
  7926. }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  7927. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL,
  7928. alt: `${authorName} ${(0,external_wp_i18n_namespaceObject.__)('Avatar')}`
  7929. }, blockProps)));
  7930. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", spacingProps, resizableAvatar));
  7931. }
  7932. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js
  7933. /**
  7934. * WordPress dependencies
  7935. */
  7936. /**
  7937. * Internal dependencies
  7938. */
  7939. const comment_author_avatar_metadata = {
  7940. $schema: "https://schemas.wp.org/trunk/block.json",
  7941. apiVersion: 2,
  7942. __experimental: "fse",
  7943. name: "core/comment-author-avatar",
  7944. title: "Comment Author Avatar (deprecated)",
  7945. category: "theme",
  7946. ancestor: ["core/comment-template"],
  7947. description: "This block is deprecated. Please use the Avatar block instead.",
  7948. textdomain: "default",
  7949. attributes: {
  7950. width: {
  7951. type: "number",
  7952. "default": 96
  7953. },
  7954. height: {
  7955. type: "number",
  7956. "default": 96
  7957. }
  7958. },
  7959. usesContext: ["commentId"],
  7960. supports: {
  7961. html: false,
  7962. inserter: false,
  7963. __experimentalBorder: {
  7964. radius: true,
  7965. width: true,
  7966. color: true,
  7967. style: true
  7968. },
  7969. color: {
  7970. background: true,
  7971. text: false,
  7972. __experimentalDefaultControls: {
  7973. background: true
  7974. }
  7975. },
  7976. spacing: {
  7977. __experimentalSkipSerialization: true,
  7978. margin: true,
  7979. padding: true
  7980. }
  7981. }
  7982. };
  7983. const {
  7984. name: comment_author_avatar_name
  7985. } = comment_author_avatar_metadata;
  7986. const comment_author_avatar_settings = {
  7987. icon: comment_author_avatar,
  7988. edit: edit_Edit
  7989. };
  7990. const comment_author_avatar_init = () => initBlock({
  7991. name: comment_author_avatar_name,
  7992. metadata: comment_author_avatar_metadata,
  7993. settings: comment_author_avatar_settings
  7994. });
  7995. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
  7996. /**
  7997. * WordPress dependencies
  7998. */
  7999. const commentAuthorName = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8000. viewBox: "0 0 24 24",
  8001. xmlns: "http://www.w3.org/2000/svg"
  8002. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8003. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
  8004. fillRule: "evenodd",
  8005. clipRule: "evenodd"
  8006. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8007. d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
  8008. fillRule: "evenodd",
  8009. clipRule: "evenodd"
  8010. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  8011. cx: "12",
  8012. cy: "9",
  8013. r: "2",
  8014. fillRule: "evenodd",
  8015. clipRule: "evenodd"
  8016. }));
  8017. /* harmony default export */ var comment_author_name = (commentAuthorName);
  8018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
  8019. /**
  8020. * External dependencies
  8021. */
  8022. /**
  8023. * WordPress dependencies
  8024. */
  8025. /**
  8026. * Renders the `core/comment-author-name` block on the editor.
  8027. *
  8028. * @param {Object} props React props.
  8029. * @param {Object} props.setAttributes Callback for updating block attributes.
  8030. * @param {Object} props.attributes Block attributes.
  8031. * @param {string} props.attributes.isLink Whether the author name should be linked.
  8032. * @param {string} props.attributes.linkTarget Target of the link.
  8033. * @param {string} props.attributes.textAlign Text alignment.
  8034. * @param {Object} props.context Inherited context.
  8035. * @param {string} props.context.commentId The comment ID.
  8036. *
  8037. * @return {JSX.Element} React element.
  8038. */
  8039. function comment_author_name_edit_Edit(_ref) {
  8040. let {
  8041. attributes: {
  8042. isLink,
  8043. linkTarget,
  8044. textAlign
  8045. },
  8046. context: {
  8047. commentId
  8048. },
  8049. setAttributes
  8050. } = _ref;
  8051. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8052. className: classnames_default()({
  8053. [`has-text-align-${textAlign}`]: textAlign
  8054. })
  8055. });
  8056. let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8057. const {
  8058. getEntityRecord
  8059. } = select(external_wp_coreData_namespaceObject.store);
  8060. const comment = getEntityRecord('root', 'comment', commentId);
  8061. const authorName = comment === null || comment === void 0 ? void 0 : comment.author_name; // eslint-disable-line camelcase
  8062. if (comment && !authorName) {
  8063. var _user$name;
  8064. const user = getEntityRecord('root', 'user', comment.author);
  8065. return (_user$name = user === null || user === void 0 ? void 0 : user.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous');
  8066. }
  8067. return authorName !== null && authorName !== void 0 ? authorName : '';
  8068. }, [commentId]);
  8069. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8070. group: "block"
  8071. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8072. value: textAlign,
  8073. onChange: newAlign => setAttributes({
  8074. textAlign: newAlign
  8075. })
  8076. }));
  8077. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  8078. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  8079. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8080. label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'),
  8081. onChange: () => setAttributes({
  8082. isLink: !isLink
  8083. }),
  8084. checked: isLink
  8085. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8086. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  8087. onChange: value => setAttributes({
  8088. linkTarget: value ? '_blank' : '_self'
  8089. }),
  8090. checked: linkTarget === '_blank'
  8091. })));
  8092. if (!commentId || !displayName) {
  8093. displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title');
  8094. }
  8095. const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  8096. href: "#comment-author-pseudo-link",
  8097. onClick: event => event.preventDefault()
  8098. }, displayName) : displayName;
  8099. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayAuthor));
  8100. }
  8101. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
  8102. /**
  8103. * Internal dependencies
  8104. */
  8105. const deprecated_v1 = {
  8106. attributes: {
  8107. isLink: {
  8108. type: 'boolean',
  8109. default: false
  8110. },
  8111. linkTarget: {
  8112. type: 'string',
  8113. default: '_self'
  8114. }
  8115. },
  8116. supports: {
  8117. html: false,
  8118. color: {
  8119. gradients: true,
  8120. link: true
  8121. },
  8122. typography: {
  8123. fontSize: true,
  8124. lineHeight: true,
  8125. __experimentalFontFamily: true,
  8126. __experimentalFontWeight: true,
  8127. __experimentalFontStyle: true,
  8128. __experimentalTextTransform: true,
  8129. __experimentalLetterSpacing: true
  8130. }
  8131. },
  8132. save() {
  8133. return null;
  8134. },
  8135. migrate: migrate_font_family,
  8136. isEligible(_ref) {
  8137. var _style$typography;
  8138. let {
  8139. style
  8140. } = _ref;
  8141. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  8142. }
  8143. };
  8144. /**
  8145. * New deprecations need to be placed first
  8146. * for them to have higher priority.
  8147. *
  8148. * Old deprecations may need to be updated as well.
  8149. *
  8150. * See block-deprecation.md
  8151. */
  8152. /* harmony default export */ var comment_author_name_deprecated = ([deprecated_v1]);
  8153. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  8154. /**
  8155. * WordPress dependencies
  8156. */
  8157. /**
  8158. * Internal dependencies
  8159. */
  8160. const comment_author_name_metadata = {
  8161. $schema: "https://schemas.wp.org/trunk/block.json",
  8162. apiVersion: 2,
  8163. name: "core/comment-author-name",
  8164. title: "Comment Author Name",
  8165. category: "theme",
  8166. ancestor: ["core/comment-template"],
  8167. description: "Displays the name of the author of the comment.",
  8168. textdomain: "default",
  8169. attributes: {
  8170. isLink: {
  8171. type: "boolean",
  8172. "default": true
  8173. },
  8174. linkTarget: {
  8175. type: "string",
  8176. "default": "_self"
  8177. },
  8178. textAlign: {
  8179. type: "string"
  8180. }
  8181. },
  8182. usesContext: ["commentId"],
  8183. supports: {
  8184. html: false,
  8185. spacing: {
  8186. margin: true,
  8187. padding: true
  8188. },
  8189. color: {
  8190. gradients: true,
  8191. link: true,
  8192. __experimentalDefaultControls: {
  8193. background: true,
  8194. text: true,
  8195. link: true
  8196. }
  8197. },
  8198. typography: {
  8199. fontSize: true,
  8200. lineHeight: true,
  8201. __experimentalFontFamily: true,
  8202. __experimentalFontWeight: true,
  8203. __experimentalFontStyle: true,
  8204. __experimentalTextTransform: true,
  8205. __experimentalTextDecoration: true,
  8206. __experimentalLetterSpacing: true,
  8207. __experimentalDefaultControls: {
  8208. fontSize: true
  8209. }
  8210. }
  8211. }
  8212. };
  8213. const {
  8214. name: comment_author_name_name
  8215. } = comment_author_name_metadata;
  8216. const comment_author_name_settings = {
  8217. icon: comment_author_name,
  8218. edit: comment_author_name_edit_Edit,
  8219. deprecated: comment_author_name_deprecated
  8220. };
  8221. const comment_author_name_init = () => initBlock({
  8222. name: comment_author_name_name,
  8223. metadata: comment_author_name_metadata,
  8224. settings: comment_author_name_settings
  8225. });
  8226. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js
  8227. /**
  8228. * WordPress dependencies
  8229. */
  8230. const commentContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8231. viewBox: "0 0 24 24",
  8232. xmlns: "http://www.w3.org/2000/svg"
  8233. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8234. fillRule: "evenodd",
  8235. clipRule: "evenodd",
  8236. d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
  8237. }));
  8238. /* harmony default export */ var comment_content = (commentContent);
  8239. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
  8240. /**
  8241. * External dependencies
  8242. */
  8243. /**
  8244. * WordPress dependencies
  8245. */
  8246. /**
  8247. * Renders the `core/comment-content` block on the editor.
  8248. *
  8249. * @param {Object} props React props.
  8250. * @param {Object} props.setAttributes Callback for updating block attributes.
  8251. * @param {Object} props.attributes Block attributes.
  8252. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  8253. * @param {Object} props.context Inherited context.
  8254. * @param {string} props.context.commentId The comment ID.
  8255. *
  8256. * @return {JSX.Element} React element.
  8257. */
  8258. function comment_content_edit_Edit(_ref) {
  8259. let {
  8260. setAttributes,
  8261. attributes: {
  8262. textAlign
  8263. },
  8264. context: {
  8265. commentId
  8266. }
  8267. } = _ref;
  8268. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8269. className: classnames_default()({
  8270. [`has-text-align-${textAlign}`]: textAlign
  8271. })
  8272. });
  8273. const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
  8274. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8275. group: "block"
  8276. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8277. value: textAlign,
  8278. onChange: newAlign => setAttributes({
  8279. textAlign: newAlign
  8280. })
  8281. }));
  8282. if (!commentId || !content) {
  8283. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title'))));
  8284. }
  8285. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
  8286. key: "html"
  8287. }, content.rendered))));
  8288. }
  8289. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  8290. /**
  8291. * WordPress dependencies
  8292. */
  8293. /**
  8294. * Internal dependencies
  8295. */
  8296. const comment_content_metadata = {
  8297. $schema: "https://schemas.wp.org/trunk/block.json",
  8298. apiVersion: 2,
  8299. name: "core/comment-content",
  8300. title: "Comment Content",
  8301. category: "theme",
  8302. ancestor: ["core/comment-template"],
  8303. description: "Displays the contents of a comment.",
  8304. textdomain: "default",
  8305. usesContext: ["commentId"],
  8306. attributes: {
  8307. textAlign: {
  8308. type: "string"
  8309. }
  8310. },
  8311. supports: {
  8312. color: {
  8313. gradients: true,
  8314. link: true,
  8315. __experimentalDefaultControls: {
  8316. background: true,
  8317. text: true
  8318. }
  8319. },
  8320. typography: {
  8321. fontSize: true,
  8322. lineHeight: true,
  8323. __experimentalFontFamily: true,
  8324. __experimentalFontWeight: true,
  8325. __experimentalFontStyle: true,
  8326. __experimentalTextTransform: true,
  8327. __experimentalTextDecoration: true,
  8328. __experimentalLetterSpacing: true,
  8329. __experimentalDefaultControls: {
  8330. fontSize: true
  8331. }
  8332. },
  8333. spacing: {
  8334. padding: ["horizontal", "vertical"],
  8335. __experimentalDefaultControls: {
  8336. padding: true
  8337. }
  8338. },
  8339. html: false
  8340. }
  8341. };
  8342. const {
  8343. name: comment_content_name
  8344. } = comment_content_metadata;
  8345. const comment_content_settings = {
  8346. icon: comment_content,
  8347. edit: comment_content_edit_Edit
  8348. };
  8349. const comment_content_init = () => initBlock({
  8350. name: comment_content_name,
  8351. metadata: comment_content_metadata,
  8352. settings: comment_content_settings
  8353. });
  8354. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
  8355. /**
  8356. * WordPress dependencies
  8357. */
  8358. const postDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8359. xmlns: "http://www.w3.org/2000/svg",
  8360. viewBox: "0 0 24 24"
  8361. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8362. d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
  8363. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8364. d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
  8365. }));
  8366. /* harmony default export */ var post_date = (postDate);
  8367. ;// CONCATENATED MODULE: external ["wp","date"]
  8368. var external_wp_date_namespaceObject = window["wp"]["date"];
  8369. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
  8370. /**
  8371. * WordPress dependencies
  8372. */
  8373. /**
  8374. * Renders the `core/comment-date` block on the editor.
  8375. *
  8376. * @param {Object} props React props.
  8377. * @param {Object} props.setAttributes Callback for updating block attributes.
  8378. * @param {Object} props.attributes Block attributes.
  8379. * @param {string} props.attributes.format Format of the date.
  8380. * @param {string} props.attributes.isLink Whether the author name should be linked.
  8381. * @param {Object} props.context Inherited context.
  8382. * @param {string} props.context.commentId The comment ID.
  8383. *
  8384. * @return {JSX.Element} React element.
  8385. */
  8386. function comment_date_edit_Edit(_ref) {
  8387. let {
  8388. attributes: {
  8389. format,
  8390. isLink
  8391. },
  8392. context: {
  8393. commentId
  8394. },
  8395. setAttributes
  8396. } = _ref;
  8397. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  8398. let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
  8399. const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  8400. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  8401. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  8402. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  8403. format: format,
  8404. defaultFormat: siteFormat,
  8405. onChange: nextFormat => setAttributes({
  8406. format: nextFormat
  8407. })
  8408. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8409. label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'),
  8410. onChange: () => setAttributes({
  8411. isLink: !isLink
  8412. }),
  8413. checked: isLink
  8414. })));
  8415. if (!commentId || !date) {
  8416. date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title');
  8417. }
  8418. let commentDate = date instanceof Date ? (0,external_wp_element_namespaceObject.createElement)("time", {
  8419. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date)
  8420. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_element_namespaceObject.createElement)("time", null, date);
  8421. if (isLink) {
  8422. commentDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  8423. href: "#comment-date-pseudo-link",
  8424. onClick: event => event.preventDefault()
  8425. }, commentDate);
  8426. }
  8427. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, commentDate));
  8428. }
  8429. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
  8430. /**
  8431. * Internal dependencies
  8432. */
  8433. const comment_date_deprecated_v1 = {
  8434. attributes: {
  8435. format: {
  8436. type: 'string'
  8437. },
  8438. isLink: {
  8439. type: 'boolean',
  8440. default: false
  8441. }
  8442. },
  8443. supports: {
  8444. html: false,
  8445. color: {
  8446. gradients: true,
  8447. link: true
  8448. },
  8449. typography: {
  8450. fontSize: true,
  8451. lineHeight: true,
  8452. __experimentalFontFamily: true,
  8453. __experimentalFontWeight: true,
  8454. __experimentalFontStyle: true,
  8455. __experimentalTextTransform: true,
  8456. __experimentalLetterSpacing: true
  8457. }
  8458. },
  8459. save() {
  8460. return null;
  8461. },
  8462. migrate: migrate_font_family,
  8463. isEligible(_ref) {
  8464. var _style$typography;
  8465. let {
  8466. style
  8467. } = _ref;
  8468. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  8469. }
  8470. };
  8471. /**
  8472. * New deprecations need to be placed first
  8473. * for them to have higher priority.
  8474. *
  8475. * Old deprecations may need to be updated as well.
  8476. *
  8477. * See block-deprecation.md
  8478. */
  8479. /* harmony default export */ var comment_date_deprecated = ([comment_date_deprecated_v1]);
  8480. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  8481. /**
  8482. * WordPress dependencies
  8483. */
  8484. /**
  8485. * Internal dependencies
  8486. */
  8487. const comment_date_metadata = {
  8488. $schema: "https://schemas.wp.org/trunk/block.json",
  8489. apiVersion: 2,
  8490. name: "core/comment-date",
  8491. title: "Comment Date",
  8492. category: "theme",
  8493. ancestor: ["core/comment-template"],
  8494. description: "Displays the date on which the comment was posted.",
  8495. textdomain: "default",
  8496. attributes: {
  8497. format: {
  8498. type: "string"
  8499. },
  8500. isLink: {
  8501. type: "boolean",
  8502. "default": true
  8503. }
  8504. },
  8505. usesContext: ["commentId"],
  8506. supports: {
  8507. html: false,
  8508. color: {
  8509. gradients: true,
  8510. link: true,
  8511. __experimentalDefaultControls: {
  8512. background: true,
  8513. text: true,
  8514. link: true
  8515. }
  8516. },
  8517. spacing: {
  8518. margin: true,
  8519. padding: true
  8520. },
  8521. typography: {
  8522. fontSize: true,
  8523. lineHeight: true,
  8524. __experimentalFontFamily: true,
  8525. __experimentalFontWeight: true,
  8526. __experimentalFontStyle: true,
  8527. __experimentalTextTransform: true,
  8528. __experimentalTextDecoration: true,
  8529. __experimentalLetterSpacing: true,
  8530. __experimentalDefaultControls: {
  8531. fontSize: true
  8532. }
  8533. }
  8534. }
  8535. };
  8536. const {
  8537. name: comment_date_name
  8538. } = comment_date_metadata;
  8539. const comment_date_settings = {
  8540. icon: post_date,
  8541. edit: comment_date_edit_Edit,
  8542. deprecated: comment_date_deprecated
  8543. };
  8544. const comment_date_init = () => initBlock({
  8545. name: comment_date_name,
  8546. metadata: comment_date_metadata,
  8547. settings: comment_date_settings
  8548. });
  8549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
  8550. /**
  8551. * WordPress dependencies
  8552. */
  8553. const commentEditLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8554. width: "24",
  8555. height: "24",
  8556. viewBox: "0 0 24 24",
  8557. xmlns: "http://www.w3.org/2000/svg"
  8558. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8559. d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"
  8560. }));
  8561. /* harmony default export */ var comment_edit_link = (commentEditLink);
  8562. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
  8563. /**
  8564. * External dependencies
  8565. */
  8566. /**
  8567. * WordPress dependencies
  8568. */
  8569. function comment_edit_link_edit_Edit(_ref) {
  8570. let {
  8571. attributes: {
  8572. linkTarget,
  8573. textAlign
  8574. },
  8575. setAttributes
  8576. } = _ref;
  8577. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8578. className: classnames_default()({
  8579. [`has-text-align-${textAlign}`]: textAlign
  8580. })
  8581. });
  8582. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8583. group: "block"
  8584. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8585. value: textAlign,
  8586. onChange: newAlign => setAttributes({
  8587. textAlign: newAlign
  8588. })
  8589. }));
  8590. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  8591. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  8592. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8593. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  8594. onChange: value => setAttributes({
  8595. linkTarget: value ? '_blank' : '_self'
  8596. }),
  8597. checked: linkTarget === '_blank'
  8598. })));
  8599. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  8600. href: "#edit-comment-pseudo-link",
  8601. onClick: event => event.preventDefault()
  8602. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))));
  8603. }
  8604. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  8605. /**
  8606. * WordPress dependencies
  8607. */
  8608. /**
  8609. * Internal dependencies
  8610. */
  8611. const comment_edit_link_metadata = {
  8612. $schema: "https://schemas.wp.org/trunk/block.json",
  8613. apiVersion: 2,
  8614. name: "core/comment-edit-link",
  8615. title: "Comment Edit Link",
  8616. category: "theme",
  8617. ancestor: ["core/comment-template"],
  8618. description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
  8619. textdomain: "default",
  8620. usesContext: ["commentId"],
  8621. attributes: {
  8622. linkTarget: {
  8623. type: "string",
  8624. "default": "_self"
  8625. },
  8626. textAlign: {
  8627. type: "string"
  8628. }
  8629. },
  8630. supports: {
  8631. html: false,
  8632. color: {
  8633. link: true,
  8634. gradients: true,
  8635. text: false,
  8636. __experimentalDefaultControls: {
  8637. background: true,
  8638. link: true
  8639. }
  8640. },
  8641. spacing: {
  8642. margin: true,
  8643. padding: true
  8644. },
  8645. typography: {
  8646. fontSize: true,
  8647. lineHeight: true,
  8648. __experimentalFontFamily: true,
  8649. __experimentalFontWeight: true,
  8650. __experimentalFontStyle: true,
  8651. __experimentalTextTransform: true,
  8652. __experimentalTextDecoration: true,
  8653. __experimentalLetterSpacing: true,
  8654. __experimentalDefaultControls: {
  8655. fontSize: true
  8656. }
  8657. }
  8658. }
  8659. };
  8660. const {
  8661. name: comment_edit_link_name
  8662. } = comment_edit_link_metadata;
  8663. const comment_edit_link_settings = {
  8664. icon: comment_edit_link,
  8665. edit: comment_edit_link_edit_Edit
  8666. };
  8667. const comment_edit_link_init = () => initBlock({
  8668. name: comment_edit_link_name,
  8669. metadata: comment_edit_link_metadata,
  8670. settings: comment_edit_link_settings
  8671. });
  8672. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
  8673. /**
  8674. * WordPress dependencies
  8675. */
  8676. const commentReplyLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8677. width: "24",
  8678. height: "24",
  8679. viewBox: "0 0 24 24",
  8680. xmlns: "http://www.w3.org/2000/svg"
  8681. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8682. d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"
  8683. }));
  8684. /* harmony default export */ var comment_reply_link = (commentReplyLink);
  8685. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
  8686. /**
  8687. * External dependencies
  8688. */
  8689. /**
  8690. * WordPress dependencies
  8691. */
  8692. /**
  8693. * Renders the `core/comment-reply-link` block on the editor.
  8694. *
  8695. * @param {Object} props React props.
  8696. * @param {Object} props.setAttributes Callback for updating block attributes.
  8697. * @param {Object} props.attributes Block attributes.
  8698. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  8699. *
  8700. * @return {JSX.Element} React element.
  8701. */
  8702. function comment_reply_link_edit_Edit(_ref) {
  8703. let {
  8704. setAttributes,
  8705. attributes: {
  8706. textAlign
  8707. }
  8708. } = _ref;
  8709. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8710. className: classnames_default()({
  8711. [`has-text-align-${textAlign}`]: textAlign
  8712. })
  8713. });
  8714. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8715. group: "block"
  8716. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8717. value: textAlign,
  8718. onChange: newAlign => setAttributes({
  8719. textAlign: newAlign
  8720. })
  8721. }));
  8722. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  8723. href: "#comment-reply-pseudo-link",
  8724. onClick: event => event.preventDefault()
  8725. }, (0,external_wp_i18n_namespaceObject.__)('Reply'))));
  8726. }
  8727. /* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);
  8728. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  8729. /**
  8730. * WordPress dependencies
  8731. */
  8732. /**
  8733. * Internal dependencies
  8734. */
  8735. const comment_reply_link_metadata = {
  8736. $schema: "https://schemas.wp.org/trunk/block.json",
  8737. apiVersion: 2,
  8738. name: "core/comment-reply-link",
  8739. title: "Comment Reply Link",
  8740. category: "theme",
  8741. ancestor: ["core/comment-template"],
  8742. description: "Displays a link to reply to a comment.",
  8743. textdomain: "default",
  8744. usesContext: ["commentId"],
  8745. attributes: {
  8746. textAlign: {
  8747. type: "string"
  8748. }
  8749. },
  8750. supports: {
  8751. color: {
  8752. gradients: true,
  8753. link: true,
  8754. text: false,
  8755. __experimentalDefaultControls: {
  8756. background: true,
  8757. link: true
  8758. }
  8759. },
  8760. spacing: {
  8761. margin: true,
  8762. padding: true
  8763. },
  8764. typography: {
  8765. fontSize: true,
  8766. lineHeight: true,
  8767. __experimentalFontFamily: true,
  8768. __experimentalFontWeight: true,
  8769. __experimentalFontStyle: true,
  8770. __experimentalTextTransform: true,
  8771. __experimentalTextDecoration: true,
  8772. __experimentalLetterSpacing: true,
  8773. __experimentalDefaultControls: {
  8774. fontSize: true
  8775. }
  8776. },
  8777. html: false
  8778. }
  8779. };
  8780. const {
  8781. name: comment_reply_link_name
  8782. } = comment_reply_link_metadata;
  8783. const comment_reply_link_settings = {
  8784. edit: comment_reply_link_edit,
  8785. icon: comment_reply_link
  8786. };
  8787. const comment_reply_link_init = () => initBlock({
  8788. name: comment_reply_link_name,
  8789. metadata: comment_reply_link_metadata,
  8790. settings: comment_reply_link_settings
  8791. });
  8792. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
  8793. /**
  8794. * WordPress dependencies
  8795. */
  8796. const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8797. xmlns: "http://www.w3.org/2000/svg",
  8798. viewBox: "0 0 24 24"
  8799. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8800. 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"
  8801. }));
  8802. /* harmony default export */ var library_layout = (layout);
  8803. ;// CONCATENATED MODULE: external ["wp","apiFetch"]
  8804. var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
  8805. var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
  8806. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
  8807. /**
  8808. * WordPress dependencies
  8809. */
  8810. // This is limited by WP REST API
  8811. const MAX_COMMENTS_PER_PAGE = 100;
  8812. /**
  8813. * Return an object with the query args needed to fetch the default page of
  8814. * comments.
  8815. *
  8816. * @param {Object} props Hook props.
  8817. * @param {number} props.postId ID of the post that contains the comments.
  8818. * discussion settings.
  8819. *
  8820. * @return {Object} Query args to retrieve the comments.
  8821. */
  8822. const useCommentQueryArgs = _ref => {
  8823. let {
  8824. postId
  8825. } = _ref;
  8826. // Initialize the query args that are not going to change.
  8827. const queryArgs = {
  8828. status: 'approve',
  8829. order: 'asc',
  8830. context: 'embed',
  8831. parent: 0,
  8832. _embed: 'children'
  8833. }; // Get the Discussion settings that may be needed to query the comments.
  8834. const {
  8835. pageComments,
  8836. commentsPerPage,
  8837. defaultCommentsPage: defaultPage
  8838. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  8839. const {
  8840. getSettings
  8841. } = select(external_wp_blockEditor_namespaceObject.store);
  8842. const {
  8843. __experimentalDiscussionSettings
  8844. } = getSettings();
  8845. return __experimentalDiscussionSettings;
  8846. }); // WP REST API doesn't allow fetching more than max items limit set per single page of data.
  8847. // As for the editor performance is more important than completeness of data and fetching only the
  8848. // max allowed for single page should be enough for the purpose of design and laying out the page.
  8849. // Fetching over the limit would return an error here but would work with backend query.
  8850. const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page.
  8851. const page = useDefaultPageIndex({
  8852. defaultPage,
  8853. postId,
  8854. perPage,
  8855. queryArgs
  8856. }); // Merge, memoize and return all query arguments, unless the default page's
  8857. // number is not known yet.
  8858. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  8859. return page ? { ...queryArgs,
  8860. post: postId,
  8861. per_page: perPage,
  8862. page
  8863. } : null;
  8864. }, [postId, perPage, page]);
  8865. };
  8866. /**
  8867. * Return the index of the default page, depending on whether `defaultPage` is
  8868. * `newest` or `oldest`. In the first case, the only way to know the page's
  8869. * index is by using the `X-WP-TotalPages` header, which forces to make an
  8870. * additional request.
  8871. *
  8872. * @param {Object} props Hook props.
  8873. * @param {string} props.defaultPage Page shown by default (newest/oldest).
  8874. * @param {number} props.postId ID of the post that contains the comments.
  8875. * @param {number} props.perPage The number of comments included per page.
  8876. * @param {Object} props.queryArgs Other query args.
  8877. *
  8878. * @return {number} Index of the default comments page.
  8879. */
  8880. const useDefaultPageIndex = _ref2 => {
  8881. let {
  8882. defaultPage,
  8883. postId,
  8884. perPage,
  8885. queryArgs
  8886. } = _ref2;
  8887. // Store the default page indices.
  8888. const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
  8889. const key = `${postId}_${perPage}`;
  8890. const page = defaultPages[key] || 0;
  8891. (0,external_wp_element_namespaceObject.useEffect)(() => {
  8892. // Do nothing if the page is already known or not the newest page.
  8893. if (page || defaultPage !== 'newest') {
  8894. return;
  8895. } // We need to fetch comments to know the index. Use HEAD and limit
  8896. // fields just to ID, to make this call as light as possible.
  8897. external_wp_apiFetch_default()({
  8898. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs,
  8899. post: postId,
  8900. per_page: perPage,
  8901. _fields: 'id'
  8902. }),
  8903. method: 'HEAD',
  8904. parse: false
  8905. }).then(res => {
  8906. const pages = parseInt(res.headers.get('X-WP-TotalPages'));
  8907. setDefaultPages({ ...defaultPages,
  8908. [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page.
  8909. });
  8910. });
  8911. }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one.
  8912. return defaultPage === 'newest' ? page : 1;
  8913. };
  8914. /**
  8915. * Generate a tree structure of comment IDs from a list of comment entities. The
  8916. * children of each comment are obtained from `_embedded`.
  8917. *
  8918. * @typedef {{ commentId: number, children: CommentNode }} CommentNode
  8919. *
  8920. * @param {Object[]} topLevelComments List of comment entities.
  8921. * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.
  8922. */
  8923. const useCommentTree = topLevelComments => {
  8924. const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments === null || topLevelComments === void 0 ? void 0 : topLevelComments.map(_ref3 => {
  8925. let {
  8926. id,
  8927. _embedded
  8928. } = _ref3;
  8929. const [children] = (_embedded === null || _embedded === void 0 ? void 0 : _embedded.children) || [[]];
  8930. return {
  8931. commentId: id,
  8932. children: children.map(child => ({
  8933. commentId: child.id
  8934. }))
  8935. };
  8936. }), [topLevelComments]);
  8937. return commentTree;
  8938. };
  8939. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
  8940. /**
  8941. * WordPress dependencies
  8942. */
  8943. /**
  8944. * Internal dependencies
  8945. */
  8946. const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
  8947. /**
  8948. * Function that returns a comment structure that will be rendered with default placehoders.
  8949. *
  8950. * Each comment has a `commentId` property that is always a negative number in
  8951. * case of the placeholders. This is to ensure that the comment does not
  8952. * conflict with the actual (real) comments.
  8953. *
  8954. * @param {Object} settings Discussion Settings.
  8955. * @param {number} [settings.perPage] - Comments per page setting or block attribute.
  8956. * @param {boolean} [settings.pageComments] - Enable break comments into pages setting.
  8957. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
  8958. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
  8959. *
  8960. * @typedef {{id: null, children: EmptyComment[]}} EmptyComment
  8961. * @return {EmptyComment[]} Inner blocks of the Comment Template
  8962. */
  8963. const getCommentsPlaceholder = _ref => {
  8964. let {
  8965. perPage,
  8966. pageComments,
  8967. threadComments,
  8968. threadCommentsDepth
  8969. } = _ref;
  8970. // Limit commentsDepth to 3
  8971. const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3);
  8972. const buildChildrenComment = commentsLevel => {
  8973. // Render children comments until commentsDepth is reached
  8974. if (commentsLevel < commentsDepth) {
  8975. const nextLevel = commentsLevel + 1;
  8976. return [{
  8977. commentId: -(commentsLevel + 3),
  8978. children: buildChildrenComment(nextLevel)
  8979. }];
  8980. }
  8981. return [];
  8982. }; // Add the first comment and its children
  8983. const placeholderComments = [{
  8984. commentId: -1,
  8985. children: buildChildrenComment(1)
  8986. }]; // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max
  8987. if ((!pageComments || perPage >= 2) && commentsDepth < 3) {
  8988. placeholderComments.push({
  8989. commentId: -2,
  8990. children: []
  8991. });
  8992. } // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments
  8993. if ((!pageComments || perPage >= 3) && commentsDepth < 2) {
  8994. placeholderComments.push({
  8995. commentId: -3,
  8996. children: []
  8997. });
  8998. } // In case that the value is set but larger than 3 we truncate it to 3.
  8999. return placeholderComments;
  9000. };
  9001. /**
  9002. * Component which renders the inner blocks of the Comment Template.
  9003. *
  9004. * @param {Object} props Component props.
  9005. * @param {Array} [props.comment] - A comment object.
  9006. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  9007. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  9008. * @param {Array} [props.firstCommentId] - ID of the first comment in the array.
  9009. * @param {Array} [props.blocks] - Array of blocks returned from
  9010. * getBlocks() in parent .
  9011. * @return {WPElement} Inner blocks of the Comment Template
  9012. */
  9013. function CommentTemplateInnerBlocks(_ref2) {
  9014. var _comment$children;
  9015. let {
  9016. comment,
  9017. activeCommentId,
  9018. setActiveCommentId,
  9019. firstCommentId,
  9020. blocks
  9021. } = _ref2;
  9022. const {
  9023. children,
  9024. ...innerBlocksProps
  9025. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
  9026. template: edit_TEMPLATE
  9027. });
  9028. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
  9029. blocks: blocks,
  9030. commentId: comment.commentId,
  9031. setActiveCommentId: setActiveCommentId,
  9032. isHidden: comment.commentId === (activeCommentId || firstCommentId)
  9033. }), (comment === null || comment === void 0 ? void 0 : (_comment$children = comment.children) === null || _comment$children === void 0 ? void 0 : _comment$children.length) > 0 ? (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  9034. comments: comment.children,
  9035. activeCommentId: activeCommentId,
  9036. setActiveCommentId: setActiveCommentId,
  9037. blocks: blocks,
  9038. firstCommentId: firstCommentId
  9039. }) : null);
  9040. }
  9041. const CommentTemplatePreview = _ref3 => {
  9042. let {
  9043. blocks,
  9044. commentId,
  9045. setActiveCommentId,
  9046. isHidden
  9047. } = _ref3;
  9048. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  9049. blocks
  9050. });
  9051. const handleOnClick = () => {
  9052. setActiveCommentId(commentId);
  9053. }; // We have to hide the preview block if the `comment` props points to
  9054. // the curently active block!
  9055. // Or, to put it differently, every preview block is visible unless it is the
  9056. // currently active block - in this case we render its inner blocks.
  9057. const style = {
  9058. display: isHidden ? 'none' : undefined
  9059. };
  9060. return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockPreviewProps, {
  9061. tabIndex: 0,
  9062. role: "button",
  9063. style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  9064. ,
  9065. onClick: handleOnClick,
  9066. onKeyPress: handleOnClick
  9067. }));
  9068. };
  9069. const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
  9070. /**
  9071. * Component that renders a list of (nested) comments. It is called recursively.
  9072. *
  9073. * @param {Object} props Component props.
  9074. * @param {Array} [props.comments] - Array of comment objects.
  9075. * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
  9076. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  9077. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  9078. * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.
  9079. * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of
  9080. * comment objects.
  9081. * @return {WPElement} List of comments.
  9082. */
  9083. const CommentsList = _ref4 => {
  9084. let {
  9085. comments,
  9086. blockProps,
  9087. activeCommentId,
  9088. setActiveCommentId,
  9089. blocks,
  9090. firstCommentId
  9091. } = _ref4;
  9092. return (0,external_wp_element_namespaceObject.createElement)("ol", blockProps, comments && comments.map((_ref5, index) => {
  9093. let {
  9094. commentId,
  9095. ...comment
  9096. } = _ref5;
  9097. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  9098. key: comment.commentId || index,
  9099. value: {
  9100. // If the commentId is negative it means that this comment is a
  9101. // "placeholder" and that the block is most likely being used in the
  9102. // site editor. In this case, we have to set the commentId to `null`
  9103. // because otherwise the (non-existent) comment with a negative ID
  9104. // would be reqested from the REST API.
  9105. commentId: commentId < 0 ? null : commentId
  9106. }
  9107. }, (0,external_wp_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
  9108. comment: {
  9109. commentId,
  9110. ...comment
  9111. },
  9112. activeCommentId: activeCommentId,
  9113. setActiveCommentId: setActiveCommentId,
  9114. blocks: blocks,
  9115. firstCommentId: firstCommentId
  9116. }));
  9117. }));
  9118. };
  9119. function CommentTemplateEdit(_ref6) {
  9120. var _commentTree$;
  9121. let {
  9122. clientId,
  9123. context: {
  9124. postId
  9125. }
  9126. } = _ref6;
  9127. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  9128. const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
  9129. const {
  9130. commentOrder,
  9131. threadCommentsDepth,
  9132. threadComments,
  9133. commentsPerPage,
  9134. pageComments
  9135. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9136. const {
  9137. getSettings
  9138. } = select(external_wp_blockEditor_namespaceObject.store);
  9139. return getSettings().__experimentalDiscussionSettings;
  9140. });
  9141. const commentQuery = useCommentQueryArgs({
  9142. postId
  9143. });
  9144. const {
  9145. topLevelComments,
  9146. blocks
  9147. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9148. const {
  9149. getEntityRecords
  9150. } = select(external_wp_coreData_namespaceObject.store);
  9151. const {
  9152. getBlocks
  9153. } = select(external_wp_blockEditor_namespaceObject.store);
  9154. return {
  9155. // Request only top-level comments. Replies are embedded.
  9156. topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null,
  9157. blocks: getBlocks(clientId)
  9158. };
  9159. }, [clientId, commentQuery]); // Generate a tree structure of comment IDs.
  9160. let commentTree = useCommentTree( // Reverse the order of top comments if needed.
  9161. commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments);
  9162. if (!topLevelComments) {
  9163. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  9164. }
  9165. if (!postId) {
  9166. commentTree = getCommentsPlaceholder({
  9167. perPage: commentsPerPage,
  9168. pageComments,
  9169. threadComments,
  9170. threadCommentsDepth
  9171. });
  9172. }
  9173. if (!commentTree.length) {
  9174. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  9175. }
  9176. return (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  9177. comments: commentTree,
  9178. blockProps: blockProps,
  9179. blocks: blocks,
  9180. activeCommentId: activeCommentId,
  9181. setActiveCommentId: setActiveCommentId,
  9182. firstCommentId: (_commentTree$ = commentTree[0]) === null || _commentTree$ === void 0 ? void 0 : _commentTree$.commentId
  9183. });
  9184. }
  9185. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
  9186. /**
  9187. * WordPress dependencies
  9188. */
  9189. function CommentTemplateSave() {
  9190. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  9191. }
  9192. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  9193. /**
  9194. * WordPress dependencies
  9195. */
  9196. /**
  9197. * Internal dependencies
  9198. */
  9199. const comment_template_metadata = {
  9200. $schema: "https://schemas.wp.org/trunk/block.json",
  9201. apiVersion: 2,
  9202. name: "core/comment-template",
  9203. title: "Comment Template",
  9204. category: "design",
  9205. parent: ["core/comments"],
  9206. description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.",
  9207. textdomain: "default",
  9208. usesContext: ["postId"],
  9209. supports: {
  9210. reusable: false,
  9211. html: false,
  9212. align: true,
  9213. typography: {
  9214. fontSize: true,
  9215. lineHeight: true,
  9216. __experimentalFontFamily: true,
  9217. __experimentalFontWeight: true,
  9218. __experimentalFontStyle: true,
  9219. __experimentalTextTransform: true,
  9220. __experimentalTextDecoration: true,
  9221. __experimentalLetterSpacing: true,
  9222. __experimentalDefaultControls: {
  9223. fontSize: true
  9224. }
  9225. }
  9226. },
  9227. style: "wp-block-comment-template"
  9228. };
  9229. const {
  9230. name: comment_template_name
  9231. } = comment_template_metadata;
  9232. const comment_template_settings = {
  9233. icon: library_layout,
  9234. edit: CommentTemplateEdit,
  9235. save: CommentTemplateSave
  9236. };
  9237. const comment_template_init = () => initBlock({
  9238. name: comment_template_name,
  9239. metadata: comment_template_metadata,
  9240. settings: comment_template_settings
  9241. });
  9242. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
  9243. /**
  9244. * WordPress dependencies
  9245. */
  9246. const queryPaginationPrevious = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9247. xmlns: "http://www.w3.org/2000/svg",
  9248. viewBox: "0 0 24 24"
  9249. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9250. d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"
  9251. }));
  9252. /* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
  9253. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
  9254. /**
  9255. * WordPress dependencies
  9256. */
  9257. const arrowMap = {
  9258. none: '',
  9259. arrow: '←',
  9260. chevron: '«'
  9261. };
  9262. function CommentsPaginationPreviousEdit(_ref) {
  9263. let {
  9264. attributes: {
  9265. label
  9266. },
  9267. setAttributes,
  9268. context: {
  9269. 'comments/paginationArrow': paginationArrow
  9270. }
  9271. } = _ref;
  9272. const displayArrow = arrowMap[paginationArrow];
  9273. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  9274. href: "#comments-pagination-previous-pseudo-link",
  9275. onClick: event => event.preventDefault()
  9276. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  9277. className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
  9278. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  9279. __experimentalVersion: 2,
  9280. tagName: "span",
  9281. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'),
  9282. placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'),
  9283. value: label,
  9284. onChange: newLabel => setAttributes({
  9285. label: newLabel
  9286. })
  9287. }));
  9288. }
  9289. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  9290. /**
  9291. * WordPress dependencies
  9292. */
  9293. /**
  9294. * Internal dependencies
  9295. */
  9296. const comments_pagination_previous_metadata = {
  9297. $schema: "https://schemas.wp.org/trunk/block.json",
  9298. apiVersion: 2,
  9299. name: "core/comments-pagination-previous",
  9300. title: "Comments Previous Page",
  9301. category: "theme",
  9302. parent: ["core/comments-pagination"],
  9303. description: "Displays the previous comment's page link.",
  9304. textdomain: "default",
  9305. attributes: {
  9306. label: {
  9307. type: "string"
  9308. }
  9309. },
  9310. usesContext: ["postId", "comments/paginationArrow"],
  9311. supports: {
  9312. reusable: false,
  9313. html: false,
  9314. color: {
  9315. gradients: true,
  9316. text: false,
  9317. __experimentalDefaultControls: {
  9318. background: true
  9319. }
  9320. },
  9321. typography: {
  9322. fontSize: true,
  9323. lineHeight: true,
  9324. __experimentalFontFamily: true,
  9325. __experimentalFontWeight: true,
  9326. __experimentalFontStyle: true,
  9327. __experimentalTextTransform: true,
  9328. __experimentalTextDecoration: true,
  9329. __experimentalLetterSpacing: true,
  9330. __experimentalDefaultControls: {
  9331. fontSize: true
  9332. }
  9333. }
  9334. }
  9335. };
  9336. const {
  9337. name: comments_pagination_previous_name
  9338. } = comments_pagination_previous_metadata;
  9339. const comments_pagination_previous_settings = {
  9340. icon: query_pagination_previous,
  9341. edit: CommentsPaginationPreviousEdit
  9342. };
  9343. const comments_pagination_previous_init = () => initBlock({
  9344. name: comments_pagination_previous_name,
  9345. metadata: comments_pagination_previous_metadata,
  9346. settings: comments_pagination_previous_settings
  9347. });
  9348. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
  9349. /**
  9350. * WordPress dependencies
  9351. */
  9352. const queryPagination = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9353. xmlns: "http://www.w3.org/2000/svg",
  9354. viewBox: "0 0 24 24"
  9355. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9356. d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
  9357. }));
  9358. /* harmony default export */ var query_pagination = (queryPagination);
  9359. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
  9360. /**
  9361. * WordPress dependencies
  9362. */
  9363. function CommentsPaginationArrowControls(_ref) {
  9364. let {
  9365. value,
  9366. onChange
  9367. } = _ref;
  9368. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  9369. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  9370. value: value,
  9371. onChange: onChange,
  9372. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'),
  9373. isBlock: true
  9374. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  9375. value: "none",
  9376. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks')
  9377. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  9378. value: "arrow",
  9379. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
  9380. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  9381. value: "chevron",
  9382. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
  9383. }));
  9384. }
  9385. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
  9386. /**
  9387. * WordPress dependencies
  9388. */
  9389. /**
  9390. * Internal dependencies
  9391. */
  9392. const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
  9393. const comments_pagination_edit_ALLOWED_BLOCKS = ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'];
  9394. const getDefaultBlockLayout = blockTypeOrName => {
  9395. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  9396. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  9397. };
  9398. function QueryPaginationEdit(_ref) {
  9399. let {
  9400. attributes: {
  9401. paginationArrow,
  9402. layout
  9403. },
  9404. setAttributes,
  9405. clientId,
  9406. name
  9407. } = _ref;
  9408. const usedLayout = layout || getDefaultBlockLayout(name);
  9409. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9410. const {
  9411. getBlocks
  9412. } = select(external_wp_blockEditor_namespaceObject.store);
  9413. const innerBlocks = getBlocks(clientId);
  9414. /**
  9415. * Show the `paginationArrow` control only if a
  9416. * Comments Pagination Next or Comments Pagination Previous
  9417. * block exists.
  9418. */
  9419. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  9420. return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name);
  9421. });
  9422. }, []);
  9423. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  9424. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  9425. template: comments_pagination_edit_TEMPLATE,
  9426. allowedBlocks: comments_pagination_edit_ALLOWED_BLOCKS,
  9427. __experimentalLayout: usedLayout
  9428. }); // Get the Discussion settings
  9429. const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9430. const {
  9431. getSettings
  9432. } = select(external_wp_blockEditor_namespaceObject.store);
  9433. const {
  9434. __experimentalDiscussionSettings
  9435. } = getSettings();
  9436. return __experimentalDiscussionSettings === null || __experimentalDiscussionSettings === void 0 ? void 0 : __experimentalDiscussionSettings.pageComments;
  9437. }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination
  9438. // controls. We don't want to remove them from the template so that when the user enables
  9439. // paging comments, the controls will be visible.
  9440. if (!pageComments) {
  9441. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings'));
  9442. }
  9443. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  9444. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  9445. }, (0,external_wp_element_namespaceObject.createElement)(CommentsPaginationArrowControls, {
  9446. value: paginationArrow,
  9447. onChange: value => {
  9448. setAttributes({
  9449. paginationArrow: value
  9450. });
  9451. }
  9452. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  9453. }
  9454. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
  9455. /**
  9456. * WordPress dependencies
  9457. */
  9458. function comments_pagination_save_save() {
  9459. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  9460. }
  9461. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  9462. /**
  9463. * WordPress dependencies
  9464. */
  9465. /**
  9466. * Internal dependencies
  9467. */
  9468. const comments_pagination_metadata = {
  9469. $schema: "https://schemas.wp.org/trunk/block.json",
  9470. apiVersion: 2,
  9471. name: "core/comments-pagination",
  9472. title: "Comments Pagination",
  9473. category: "theme",
  9474. parent: ["core/comments"],
  9475. description: "Displays a paginated navigation to next/previous set of comments, when applicable.",
  9476. textdomain: "default",
  9477. attributes: {
  9478. paginationArrow: {
  9479. type: "string",
  9480. "default": "none"
  9481. }
  9482. },
  9483. providesContext: {
  9484. "comments/paginationArrow": "paginationArrow"
  9485. },
  9486. supports: {
  9487. align: true,
  9488. reusable: false,
  9489. html: false,
  9490. color: {
  9491. gradients: true,
  9492. link: true,
  9493. __experimentalDefaultControls: {
  9494. background: true,
  9495. text: true,
  9496. link: true
  9497. }
  9498. },
  9499. __experimentalLayout: {
  9500. allowSwitching: false,
  9501. allowInheriting: false,
  9502. "default": {
  9503. type: "flex"
  9504. }
  9505. },
  9506. typography: {
  9507. fontSize: true,
  9508. lineHeight: true,
  9509. __experimentalFontFamily: true,
  9510. __experimentalFontWeight: true,
  9511. __experimentalFontStyle: true,
  9512. __experimentalTextTransform: true,
  9513. __experimentalTextDecoration: true,
  9514. __experimentalLetterSpacing: true,
  9515. __experimentalDefaultControls: {
  9516. fontSize: true
  9517. }
  9518. }
  9519. },
  9520. editorStyle: "wp-block-comments-pagination-editor",
  9521. style: "wp-block-comments-pagination"
  9522. };
  9523. const {
  9524. name: comments_pagination_name
  9525. } = comments_pagination_metadata;
  9526. const comments_pagination_settings = {
  9527. icon: query_pagination,
  9528. edit: QueryPaginationEdit,
  9529. save: comments_pagination_save_save
  9530. };
  9531. const comments_pagination_init = () => initBlock({
  9532. name: comments_pagination_name,
  9533. metadata: comments_pagination_metadata,
  9534. settings: comments_pagination_settings
  9535. });
  9536. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
  9537. /**
  9538. * WordPress dependencies
  9539. */
  9540. const queryPaginationNext = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9541. xmlns: "http://www.w3.org/2000/svg",
  9542. viewBox: "0 0 24 24"
  9543. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9544. d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"
  9545. }));
  9546. /* harmony default export */ var query_pagination_next = (queryPaginationNext);
  9547. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
  9548. /**
  9549. * WordPress dependencies
  9550. */
  9551. const edit_arrowMap = {
  9552. none: '',
  9553. arrow: '→',
  9554. chevron: '»'
  9555. };
  9556. function CommentsPaginationNextEdit(_ref) {
  9557. let {
  9558. attributes: {
  9559. label
  9560. },
  9561. setAttributes,
  9562. context: {
  9563. 'comments/paginationArrow': paginationArrow
  9564. }
  9565. } = _ref;
  9566. const displayArrow = edit_arrowMap[paginationArrow];
  9567. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  9568. href: "#comments-pagination-next-pseudo-link",
  9569. onClick: event => event.preventDefault()
  9570. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  9571. __experimentalVersion: 2,
  9572. tagName: "span",
  9573. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'),
  9574. placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'),
  9575. value: label,
  9576. onChange: newLabel => setAttributes({
  9577. label: newLabel
  9578. })
  9579. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  9580. className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
  9581. }, displayArrow));
  9582. }
  9583. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  9584. /**
  9585. * WordPress dependencies
  9586. */
  9587. /**
  9588. * Internal dependencies
  9589. */
  9590. const comments_pagination_next_metadata = {
  9591. $schema: "https://schemas.wp.org/trunk/block.json",
  9592. apiVersion: 2,
  9593. name: "core/comments-pagination-next",
  9594. title: "Comments Next Page",
  9595. category: "theme",
  9596. parent: ["core/comments-pagination"],
  9597. description: "Displays the next comment's page link.",
  9598. textdomain: "default",
  9599. attributes: {
  9600. label: {
  9601. type: "string"
  9602. }
  9603. },
  9604. usesContext: ["postId", "comments/paginationArrow"],
  9605. supports: {
  9606. reusable: false,
  9607. html: false,
  9608. color: {
  9609. gradients: true,
  9610. text: false,
  9611. __experimentalDefaultControls: {
  9612. background: true
  9613. }
  9614. },
  9615. typography: {
  9616. fontSize: true,
  9617. lineHeight: true,
  9618. __experimentalFontFamily: true,
  9619. __experimentalFontWeight: true,
  9620. __experimentalFontStyle: true,
  9621. __experimentalTextTransform: true,
  9622. __experimentalTextDecoration: true,
  9623. __experimentalLetterSpacing: true,
  9624. __experimentalDefaultControls: {
  9625. fontSize: true
  9626. }
  9627. }
  9628. }
  9629. };
  9630. const {
  9631. name: comments_pagination_next_name
  9632. } = comments_pagination_next_metadata;
  9633. const comments_pagination_next_settings = {
  9634. icon: query_pagination_next,
  9635. edit: CommentsPaginationNextEdit
  9636. };
  9637. const comments_pagination_next_init = () => initBlock({
  9638. name: comments_pagination_next_name,
  9639. metadata: comments_pagination_next_metadata,
  9640. settings: comments_pagination_next_settings
  9641. });
  9642. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
  9643. /**
  9644. * WordPress dependencies
  9645. */
  9646. const queryPaginationNumbers = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9647. xmlns: "http://www.w3.org/2000/svg",
  9648. viewBox: "0 0 24 24"
  9649. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9650. d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"
  9651. }));
  9652. /* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
  9653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
  9654. /**
  9655. * WordPress dependencies
  9656. */
  9657. const PaginationItem = _ref => {
  9658. let {
  9659. content,
  9660. tag: Tag = 'a',
  9661. extraClass = ''
  9662. } = _ref;
  9663. return Tag === 'a' ? (0,external_wp_element_namespaceObject.createElement)(Tag, {
  9664. className: `page-numbers ${extraClass}`,
  9665. href: "#comments-pagination-numbers-pseudo-link",
  9666. onClick: event => event.preventDefault()
  9667. }, content) : (0,external_wp_element_namespaceObject.createElement)(Tag, {
  9668. className: `page-numbers ${extraClass}`
  9669. }, content);
  9670. };
  9671. function CommentsPaginationNumbersEdit() {
  9672. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9673. content: "1"
  9674. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9675. content: "2"
  9676. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9677. content: "3",
  9678. tag: "span",
  9679. extraClass: "current"
  9680. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9681. content: "4"
  9682. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9683. content: "5"
  9684. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9685. content: "...",
  9686. tag: "span",
  9687. extraClass: "dots"
  9688. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  9689. content: "8"
  9690. }));
  9691. }
  9692. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  9693. /**
  9694. * WordPress dependencies
  9695. */
  9696. /**
  9697. * Internal dependencies
  9698. */
  9699. const comments_pagination_numbers_metadata = {
  9700. $schema: "https://schemas.wp.org/trunk/block.json",
  9701. apiVersion: 2,
  9702. name: "core/comments-pagination-numbers",
  9703. title: "Comments Page Numbers",
  9704. category: "theme",
  9705. parent: ["core/comments-pagination"],
  9706. description: "Displays a list of page numbers for comments pagination.",
  9707. textdomain: "default",
  9708. usesContext: ["postId"],
  9709. supports: {
  9710. reusable: false,
  9711. html: false,
  9712. typography: {
  9713. fontSize: true,
  9714. lineHeight: true,
  9715. __experimentalFontFamily: true,
  9716. __experimentalFontWeight: true,
  9717. __experimentalFontStyle: true,
  9718. __experimentalTextTransform: true,
  9719. __experimentalTextDecoration: true,
  9720. __experimentalLetterSpacing: true,
  9721. __experimentalDefaultControls: {
  9722. fontSize: true
  9723. }
  9724. }
  9725. }
  9726. };
  9727. const {
  9728. name: comments_pagination_numbers_name
  9729. } = comments_pagination_numbers_metadata;
  9730. const comments_pagination_numbers_settings = {
  9731. icon: query_pagination_numbers,
  9732. edit: CommentsPaginationNumbersEdit
  9733. };
  9734. const comments_pagination_numbers_init = () => initBlock({
  9735. name: comments_pagination_numbers_name,
  9736. metadata: comments_pagination_numbers_metadata,
  9737. settings: comments_pagination_numbers_settings
  9738. });
  9739. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/title.js
  9740. /**
  9741. * WordPress dependencies
  9742. */
  9743. const title = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9744. xmlns: "https://www.w3.org/2000/svg",
  9745. viewBox: "0 0 24 24"
  9746. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9747. d: "M4 5.417h2.267V12h1.466V5.417H10V4H4v1.417ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z"
  9748. }));
  9749. /* harmony default export */ var library_title = (title);
  9750. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
  9751. /**
  9752. * WordPress dependencies
  9753. */
  9754. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  9755. /**
  9756. * HeadingLevelIcon props.
  9757. *
  9758. * @typedef WPHeadingLevelIconProps
  9759. *
  9760. * @property {number} level The heading level to show an icon for.
  9761. * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false.
  9762. */
  9763. /**
  9764. * Heading level icon.
  9765. *
  9766. * @param {WPHeadingLevelIconProps} props Component props.
  9767. *
  9768. * @return {?WPComponent} The icon.
  9769. */
  9770. function HeadingLevelIcon(_ref) {
  9771. let {
  9772. level,
  9773. isPressed = false
  9774. } = _ref;
  9775. const levelToPath = {
  9776. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  9777. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  9778. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  9779. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  9780. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  9781. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  9782. };
  9783. if (!levelToPath.hasOwnProperty(level)) {
  9784. return null;
  9785. }
  9786. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  9787. width: "24",
  9788. height: "24",
  9789. viewBox: "0 0 20 20",
  9790. xmlns: "http://www.w3.org/2000/svg",
  9791. isPressed: isPressed
  9792. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  9793. d: levelToPath[level]
  9794. }));
  9795. }
  9796. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
  9797. /**
  9798. * WordPress dependencies
  9799. */
  9800. /**
  9801. * Internal dependencies
  9802. */
  9803. const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
  9804. const POPOVER_PROPS = {
  9805. className: 'block-library-heading-level-dropdown'
  9806. };
  9807. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  9808. /**
  9809. * HeadingLevelDropdown props.
  9810. *
  9811. * @typedef WPHeadingLevelDropdownProps
  9812. *
  9813. * @property {number} selectedLevel The chosen heading level.
  9814. * @property {(newValue:number)=>any} onChange Callback to run when
  9815. * toolbar value is changed.
  9816. */
  9817. /**
  9818. * Dropdown for selecting a heading level (1 through 6).
  9819. *
  9820. * @param {WPHeadingLevelDropdownProps} props Component props.
  9821. *
  9822. * @return {WPComponent} The toolbar.
  9823. */
  9824. function HeadingLevelDropdown(_ref) {
  9825. let {
  9826. selectedLevel,
  9827. onChange
  9828. } = _ref;
  9829. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  9830. popoverProps: POPOVER_PROPS,
  9831. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  9832. level: selectedLevel
  9833. }),
  9834. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  9835. controls: HEADING_LEVELS.map(targetLevel => {
  9836. {
  9837. const isActive = targetLevel === selectedLevel;
  9838. return {
  9839. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  9840. level: targetLevel,
  9841. isPressed: isActive
  9842. }),
  9843. label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
  9844. (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
  9845. isActive,
  9846. onClick() {
  9847. onChange(targetLevel);
  9848. },
  9849. role: 'menuitemradio'
  9850. };
  9851. }
  9852. })
  9853. });
  9854. }
  9855. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
  9856. /**
  9857. * External dependencies
  9858. */
  9859. /**
  9860. * WordPress dependencies
  9861. */
  9862. /**
  9863. * Internal dependencies
  9864. */
  9865. function comments_title_edit_Edit(_ref) {
  9866. let {
  9867. attributes: {
  9868. textAlign,
  9869. showPostTitle,
  9870. showCommentsCount,
  9871. level
  9872. },
  9873. setAttributes,
  9874. context: {
  9875. postType,
  9876. postId
  9877. }
  9878. } = _ref;
  9879. const TagName = 'h' + level;
  9880. const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
  9881. const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  9882. const isSiteEditor = typeof postId === 'undefined';
  9883. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  9884. className: classnames_default()({
  9885. [`has-text-align-${textAlign}`]: textAlign
  9886. })
  9887. });
  9888. const {
  9889. threadCommentsDepth,
  9890. threadComments,
  9891. commentsPerPage,
  9892. pageComments
  9893. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  9894. const {
  9895. getSettings
  9896. } = select(external_wp_blockEditor_namespaceObject.store);
  9897. return getSettings().__experimentalDiscussionSettings;
  9898. });
  9899. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9900. if (isSiteEditor) {
  9901. // Match the number of comments that will be shown in the comment-template/edit.js placeholder
  9902. const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0;
  9903. const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
  9904. const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber);
  9905. setCommentsCount(Math.min(commentsNumber, 3));
  9906. return;
  9907. }
  9908. const currentPostId = postId;
  9909. external_wp_apiFetch_default()({
  9910. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
  9911. post: postId,
  9912. _fields: 'id'
  9913. }),
  9914. method: 'HEAD',
  9915. parse: false
  9916. }).then(res => {
  9917. // Stale requests will have the `currentPostId` of an older closure.
  9918. if (currentPostId === postId) {
  9919. setCommentsCount(parseInt(res.headers.get('X-WP-Total')));
  9920. }
  9921. }).catch(() => {
  9922. setCommentsCount(0);
  9923. });
  9924. }, [postId]);
  9925. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  9926. group: "block"
  9927. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  9928. value: textAlign,
  9929. onChange: newAlign => setAttributes({
  9930. textAlign: newAlign
  9931. })
  9932. }), (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  9933. selectedLevel: level,
  9934. onChange: newLevel => setAttributes({
  9935. level: newLevel
  9936. })
  9937. }));
  9938. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  9939. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  9940. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9941. label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
  9942. checked: showPostTitle,
  9943. onChange: value => setAttributes({
  9944. showPostTitle: value
  9945. })
  9946. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9947. label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'),
  9948. checked: showCommentsCount,
  9949. onChange: value => setAttributes({
  9950. showCommentsCount: value
  9951. })
  9952. })));
  9953. const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('"Post Title"') : `"${rawTitle}"`;
  9954. let placeholder;
  9955. if (showCommentsCount && commentsCount !== undefined) {
  9956. if (showPostTitle) {
  9957. if (commentsCount === 1) {
  9958. /* translators: %s: Post title. */
  9959. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
  9960. } else {
  9961. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  9962. /* translators: 1: Number of comments, 2: Post title. */
  9963. (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
  9964. }
  9965. } else if (commentsCount === 1) {
  9966. placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
  9967. } else {
  9968. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  9969. /* translators: %s: Number of comments. */
  9970. (0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount);
  9971. }
  9972. } else if (showPostTitle) {
  9973. if (commentsCount === 1) {
  9974. /* translators: %s: Post title. */
  9975. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
  9976. } else {
  9977. /* translators: %s: Post title. */
  9978. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
  9979. }
  9980. } else if (commentsCount === 1) {
  9981. placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
  9982. } else {
  9983. placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
  9984. }
  9985. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
  9986. }
  9987. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
  9988. /**
  9989. * Internal dependencies
  9990. */
  9991. const deprecated_metadata = {
  9992. $schema: "https://schemas.wp.org/trunk/block.json",
  9993. apiVersion: 2,
  9994. name: "core/comments-title",
  9995. title: "Comments Title",
  9996. category: "theme",
  9997. ancestor: ["core/comments"],
  9998. description: "Displays a title with the number of comments",
  9999. textdomain: "default",
  10000. usesContext: ["postId", "postType"],
  10001. attributes: {
  10002. textAlign: {
  10003. type: "string"
  10004. },
  10005. showPostTitle: {
  10006. type: "boolean",
  10007. "default": true
  10008. },
  10009. showCommentsCount: {
  10010. type: "boolean",
  10011. "default": true
  10012. },
  10013. level: {
  10014. type: "number",
  10015. "default": 2
  10016. }
  10017. },
  10018. supports: {
  10019. anchor: false,
  10020. align: true,
  10021. html: false,
  10022. __experimentalBorder: {
  10023. radius: true,
  10024. color: true,
  10025. width: true,
  10026. style: true
  10027. },
  10028. color: {
  10029. gradients: true,
  10030. __experimentalDefaultControls: {
  10031. background: true,
  10032. text: true
  10033. }
  10034. },
  10035. spacing: {
  10036. margin: true,
  10037. padding: true
  10038. },
  10039. typography: {
  10040. fontSize: true,
  10041. lineHeight: true,
  10042. __experimentalFontFamily: true,
  10043. __experimentalFontWeight: true,
  10044. __experimentalFontStyle: true,
  10045. __experimentalTextTransform: true,
  10046. __experimentalTextDecoration: true,
  10047. __experimentalLetterSpacing: true,
  10048. __experimentalDefaultControls: {
  10049. fontSize: true,
  10050. __experimentalFontFamily: true,
  10051. __experimentalFontStyle: true,
  10052. __experimentalFontWeight: true
  10053. }
  10054. }
  10055. }
  10056. };
  10057. const {
  10058. attributes,
  10059. supports
  10060. } = deprecated_metadata;
  10061. /* harmony default export */ var comments_title_deprecated = ([{
  10062. attributes: { ...attributes,
  10063. singleCommentLabel: {
  10064. type: 'string'
  10065. },
  10066. multipleCommentsLabel: {
  10067. type: 'string'
  10068. }
  10069. },
  10070. supports,
  10071. migrate: oldAttributes => {
  10072. const {
  10073. singleCommentLabel,
  10074. multipleCommentsLabel,
  10075. ...newAttributes
  10076. } = oldAttributes;
  10077. return newAttributes;
  10078. },
  10079. isEligible: _ref => {
  10080. let {
  10081. multipleCommentsLabel,
  10082. singleCommentLabel
  10083. } = _ref;
  10084. return multipleCommentsLabel || singleCommentLabel;
  10085. },
  10086. save: () => null
  10087. }]);
  10088. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  10089. /**
  10090. * WordPress dependencies
  10091. */
  10092. /**
  10093. * Internal dependencies
  10094. */
  10095. const comments_title_metadata = {
  10096. $schema: "https://schemas.wp.org/trunk/block.json",
  10097. apiVersion: 2,
  10098. name: "core/comments-title",
  10099. title: "Comments Title",
  10100. category: "theme",
  10101. ancestor: ["core/comments"],
  10102. description: "Displays a title with the number of comments",
  10103. textdomain: "default",
  10104. usesContext: ["postId", "postType"],
  10105. attributes: {
  10106. textAlign: {
  10107. type: "string"
  10108. },
  10109. showPostTitle: {
  10110. type: "boolean",
  10111. "default": true
  10112. },
  10113. showCommentsCount: {
  10114. type: "boolean",
  10115. "default": true
  10116. },
  10117. level: {
  10118. type: "number",
  10119. "default": 2
  10120. }
  10121. },
  10122. supports: {
  10123. anchor: false,
  10124. align: true,
  10125. html: false,
  10126. __experimentalBorder: {
  10127. radius: true,
  10128. color: true,
  10129. width: true,
  10130. style: true
  10131. },
  10132. color: {
  10133. gradients: true,
  10134. __experimentalDefaultControls: {
  10135. background: true,
  10136. text: true
  10137. }
  10138. },
  10139. spacing: {
  10140. margin: true,
  10141. padding: true
  10142. },
  10143. typography: {
  10144. fontSize: true,
  10145. lineHeight: true,
  10146. __experimentalFontFamily: true,
  10147. __experimentalFontWeight: true,
  10148. __experimentalFontStyle: true,
  10149. __experimentalTextTransform: true,
  10150. __experimentalTextDecoration: true,
  10151. __experimentalLetterSpacing: true,
  10152. __experimentalDefaultControls: {
  10153. fontSize: true,
  10154. __experimentalFontFamily: true,
  10155. __experimentalFontStyle: true,
  10156. __experimentalFontWeight: true
  10157. }
  10158. }
  10159. }
  10160. };
  10161. const {
  10162. name: comments_title_name
  10163. } = comments_title_metadata;
  10164. const comments_title_settings = {
  10165. icon: library_title,
  10166. edit: comments_title_edit_Edit,
  10167. deprecated: comments_title_deprecated
  10168. };
  10169. const comments_title_init = () => initBlock({
  10170. name: comments_title_name,
  10171. metadata: comments_title_metadata,
  10172. settings: comments_title_settings
  10173. });
  10174. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
  10175. /**
  10176. * WordPress dependencies
  10177. */
  10178. const cover = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10179. xmlns: "http://www.w3.org/2000/svg",
  10180. viewBox: "0 0 24 24"
  10181. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10182. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"
  10183. }));
  10184. /* harmony default export */ var library_cover = (cover);
  10185. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js
  10186. /**
  10187. * WordPress dependencies
  10188. */
  10189. const POSITION_CLASSNAMES = {
  10190. 'top left': 'is-position-top-left',
  10191. 'top center': 'is-position-top-center',
  10192. 'top right': 'is-position-top-right',
  10193. 'center left': 'is-position-center-left',
  10194. 'center center': 'is-position-center-center',
  10195. center: 'is-position-center-center',
  10196. 'center right': 'is-position-center-right',
  10197. 'bottom left': 'is-position-bottom-left',
  10198. 'bottom center': 'is-position-bottom-center',
  10199. 'bottom right': 'is-position-bottom-right'
  10200. };
  10201. const IMAGE_BACKGROUND_TYPE = 'image';
  10202. const VIDEO_BACKGROUND_TYPE = 'video';
  10203. const COVER_MIN_HEIGHT = 50;
  10204. const COVER_MAX_HEIGHT = 1000;
  10205. const COVER_DEFAULT_HEIGHT = 300;
  10206. const DEFAULT_FOCAL_POINT = {
  10207. x: 0.5,
  10208. y: 0.5
  10209. };
  10210. const shared_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  10211. function mediaPosition() {
  10212. let {
  10213. x,
  10214. y
  10215. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_FOCAL_POINT;
  10216. return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
  10217. }
  10218. function dimRatioToClass(ratio) {
  10219. return ratio === 50 || !ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  10220. }
  10221. function attributesFromMedia(setAttributes, dimRatio) {
  10222. return media => {
  10223. if (!media || !media.url) {
  10224. setAttributes({
  10225. url: undefined,
  10226. id: undefined
  10227. });
  10228. return;
  10229. }
  10230. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  10231. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  10232. }
  10233. let mediaType; // For media selections originated from a file upload.
  10234. if (media.media_type) {
  10235. if (media.media_type === IMAGE_BACKGROUND_TYPE) {
  10236. mediaType = IMAGE_BACKGROUND_TYPE;
  10237. } else {
  10238. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  10239. // Videos contain the media type of 'file' in the object returned from the rest api.
  10240. mediaType = VIDEO_BACKGROUND_TYPE;
  10241. }
  10242. } else {
  10243. // For media selections originated from existing files in the media library.
  10244. if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
  10245. return;
  10246. }
  10247. mediaType = media.type;
  10248. }
  10249. setAttributes({
  10250. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  10251. url: media.url,
  10252. id: media.id,
  10253. alt: media === null || media === void 0 ? void 0 : media.alt,
  10254. backgroundType: mediaType,
  10255. focalPoint: undefined,
  10256. ...(mediaType === VIDEO_BACKGROUND_TYPE ? {
  10257. hasParallax: undefined
  10258. } : {})
  10259. });
  10260. };
  10261. }
  10262. /**
  10263. * Checks of the contentPosition is the center (default) position.
  10264. *
  10265. * @param {string} contentPosition The current content position.
  10266. * @return {boolean} Whether the contentPosition is center.
  10267. */
  10268. function isContentPositionCenter(contentPosition) {
  10269. return !contentPosition || contentPosition === 'center center' || contentPosition === 'center';
  10270. }
  10271. /**
  10272. * Retrieves the className for the current contentPosition.
  10273. * The default position (center) will not have a className.
  10274. *
  10275. * @param {string} contentPosition The current content position.
  10276. * @return {string} The className assigned to the contentPosition.
  10277. */
  10278. function getPositionClassName(contentPosition) {
  10279. /*
  10280. * Only render a className if the contentPosition is not center (the default).
  10281. */
  10282. if (isContentPositionCenter(contentPosition)) return '';
  10283. return POSITION_CLASSNAMES[contentPosition];
  10284. }
  10285. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
  10286. /**
  10287. * External dependencies
  10288. */
  10289. /**
  10290. * WordPress dependencies
  10291. */
  10292. /**
  10293. * Internal dependencies
  10294. */
  10295. function backgroundImageStyles(url) {
  10296. return url ? {
  10297. backgroundImage: `url(${url})`
  10298. } : {};
  10299. }
  10300. /**
  10301. * Original function to determine the background opacity classname
  10302. *
  10303. * Used in deprecations: v1-7.
  10304. *
  10305. * @param {number} ratio ratio to use for opacity.
  10306. * @return {string} background opacity class .
  10307. */
  10308. function dimRatioToClassV1(ratio) {
  10309. return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  10310. }
  10311. function migrateDimRatio(attributes) {
  10312. return { ...attributes,
  10313. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  10314. };
  10315. }
  10316. const deprecated_blockAttributes = {
  10317. url: {
  10318. type: 'string'
  10319. },
  10320. id: {
  10321. type: 'number'
  10322. },
  10323. hasParallax: {
  10324. type: 'boolean',
  10325. default: false
  10326. },
  10327. dimRatio: {
  10328. type: 'number',
  10329. default: 50
  10330. },
  10331. overlayColor: {
  10332. type: 'string'
  10333. },
  10334. customOverlayColor: {
  10335. type: 'string'
  10336. },
  10337. backgroundType: {
  10338. type: 'string',
  10339. default: 'image'
  10340. },
  10341. focalPoint: {
  10342. type: 'object'
  10343. }
  10344. };
  10345. const v8ToV10BlockAttributes = {
  10346. url: {
  10347. type: 'string'
  10348. },
  10349. id: {
  10350. type: 'number'
  10351. },
  10352. alt: {
  10353. type: 'string',
  10354. source: 'attribute',
  10355. selector: 'img',
  10356. attribute: 'alt',
  10357. default: ''
  10358. },
  10359. hasParallax: {
  10360. type: 'boolean',
  10361. default: false
  10362. },
  10363. isRepeated: {
  10364. type: 'boolean',
  10365. default: false
  10366. },
  10367. dimRatio: {
  10368. type: 'number',
  10369. default: 100
  10370. },
  10371. overlayColor: {
  10372. type: 'string'
  10373. },
  10374. customOverlayColor: {
  10375. type: 'string'
  10376. },
  10377. backgroundType: {
  10378. type: 'string',
  10379. default: 'image'
  10380. },
  10381. focalPoint: {
  10382. type: 'object'
  10383. },
  10384. minHeight: {
  10385. type: 'number'
  10386. },
  10387. minHeightUnit: {
  10388. type: 'string'
  10389. },
  10390. gradient: {
  10391. type: 'string'
  10392. },
  10393. customGradient: {
  10394. type: 'string'
  10395. },
  10396. contentPosition: {
  10397. type: 'string'
  10398. },
  10399. isDark: {
  10400. type: 'boolean',
  10401. default: true
  10402. },
  10403. allowedBlocks: {
  10404. type: 'array'
  10405. },
  10406. templateLock: {
  10407. type: ['string', 'boolean'],
  10408. enum: ['all', 'insert', false]
  10409. }
  10410. };
  10411. const v7toV10BlockSupports = {
  10412. anchor: true,
  10413. align: true,
  10414. html: false,
  10415. spacing: {
  10416. padding: true,
  10417. __experimentalDefaultControls: {
  10418. padding: true
  10419. }
  10420. },
  10421. color: {
  10422. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  10423. text: false,
  10424. background: false
  10425. }
  10426. }; // Deprecation for blocks that renders fixed background as backgroud from the main block container.
  10427. const deprecated_v10 = {
  10428. attributes: v8ToV10BlockAttributes,
  10429. supports: v7toV10BlockSupports,
  10430. save(_ref) {
  10431. let {
  10432. attributes
  10433. } = _ref;
  10434. const {
  10435. backgroundType,
  10436. gradient,
  10437. contentPosition,
  10438. customGradient,
  10439. customOverlayColor,
  10440. dimRatio,
  10441. focalPoint,
  10442. useFeaturedImage,
  10443. hasParallax,
  10444. isDark,
  10445. isRepeated,
  10446. overlayColor,
  10447. url,
  10448. alt,
  10449. id,
  10450. minHeight: minHeightProp,
  10451. minHeightUnit
  10452. } = attributes;
  10453. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10454. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10455. const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10456. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10457. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10458. const isImgElement = !(hasParallax || isRepeated);
  10459. const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
  10460. minHeight: minHeight || undefined
  10461. };
  10462. const bgStyle = {
  10463. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10464. background: customGradient ? customGradient : undefined
  10465. };
  10466. const objectPosition = // prettier-ignore
  10467. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10468. const classes = classnames_default()({
  10469. 'is-light': !isDark,
  10470. 'has-parallax': hasParallax,
  10471. 'is-repeated': isRepeated,
  10472. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10473. }, getPositionClassName(contentPosition));
  10474. const gradientValue = gradient || customGradient;
  10475. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10476. className: classes,
  10477. style
  10478. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10479. "aria-hidden": "true",
  10480. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  10481. 'has-background-dim': dimRatio !== undefined,
  10482. // For backwards compatibility. Former versions of the Cover Block applied
  10483. // `.wp-block-cover__gradient-background` in the presence of
  10484. // media, a gradient and a dim.
  10485. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10486. 'has-background-gradient': gradientValue,
  10487. [gradientClass]: gradientClass
  10488. }),
  10489. style: bgStyle
  10490. }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10491. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10492. alt: alt,
  10493. src: url,
  10494. style: {
  10495. objectPosition
  10496. },
  10497. "data-object-fit": "cover",
  10498. "data-object-position": objectPosition
  10499. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10500. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10501. autoPlay: true,
  10502. muted: true,
  10503. loop: true,
  10504. playsInline: true,
  10505. src: url,
  10506. style: {
  10507. objectPosition
  10508. },
  10509. "data-object-fit": "cover",
  10510. "data-object-position": objectPosition
  10511. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  10512. className: 'wp-block-cover__inner-container'
  10513. })));
  10514. }
  10515. }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
  10516. const v9 = {
  10517. attributes: v8ToV10BlockAttributes,
  10518. supports: v7toV10BlockSupports,
  10519. save(_ref2) {
  10520. let {
  10521. attributes
  10522. } = _ref2;
  10523. const {
  10524. backgroundType,
  10525. gradient,
  10526. contentPosition,
  10527. customGradient,
  10528. customOverlayColor,
  10529. dimRatio,
  10530. focalPoint,
  10531. hasParallax,
  10532. isDark,
  10533. isRepeated,
  10534. overlayColor,
  10535. url,
  10536. alt,
  10537. id,
  10538. minHeight: minHeightProp,
  10539. minHeightUnit
  10540. } = attributes;
  10541. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10542. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10543. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10544. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10545. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10546. const isImgElement = !(hasParallax || isRepeated);
  10547. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  10548. minHeight: minHeight || undefined
  10549. };
  10550. const bgStyle = {
  10551. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10552. background: customGradient ? customGradient : undefined
  10553. };
  10554. const objectPosition = // prettier-ignore
  10555. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10556. const classes = classnames_default()({
  10557. 'is-light': !isDark,
  10558. 'has-parallax': hasParallax,
  10559. 'is-repeated': isRepeated,
  10560. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10561. }, getPositionClassName(contentPosition));
  10562. const gradientValue = gradient || customGradient;
  10563. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10564. className: classes,
  10565. style
  10566. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10567. "aria-hidden": "true",
  10568. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  10569. 'has-background-dim': dimRatio !== undefined,
  10570. // For backwards compatibility. Former versions of the Cover Block applied
  10571. // `.wp-block-cover__gradient-background` in the presence of
  10572. // media, a gradient and a dim.
  10573. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10574. 'has-background-gradient': gradientValue,
  10575. [gradientClass]: gradientClass
  10576. }),
  10577. style: bgStyle
  10578. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10579. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10580. alt: alt,
  10581. src: url,
  10582. style: {
  10583. objectPosition
  10584. },
  10585. "data-object-fit": "cover",
  10586. "data-object-position": objectPosition
  10587. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10588. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10589. autoPlay: true,
  10590. muted: true,
  10591. loop: true,
  10592. playsInline: true,
  10593. src: url,
  10594. style: {
  10595. objectPosition
  10596. },
  10597. "data-object-fit": "cover",
  10598. "data-object-position": objectPosition
  10599. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  10600. className: 'wp-block-cover__inner-container'
  10601. })));
  10602. }
  10603. }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
  10604. const v8 = {
  10605. attributes: v8ToV10BlockAttributes,
  10606. supports: v7toV10BlockSupports,
  10607. save(_ref3) {
  10608. let {
  10609. attributes
  10610. } = _ref3;
  10611. const {
  10612. backgroundType,
  10613. gradient,
  10614. contentPosition,
  10615. customGradient,
  10616. customOverlayColor,
  10617. dimRatio,
  10618. focalPoint,
  10619. hasParallax,
  10620. isDark,
  10621. isRepeated,
  10622. overlayColor,
  10623. url,
  10624. alt,
  10625. id,
  10626. minHeight: minHeightProp,
  10627. minHeightUnit
  10628. } = attributes;
  10629. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10630. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10631. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10632. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10633. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10634. const isImgElement = !(hasParallax || isRepeated);
  10635. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  10636. minHeight: minHeight || undefined
  10637. };
  10638. const bgStyle = {
  10639. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10640. background: customGradient ? customGradient : undefined
  10641. };
  10642. const objectPosition = // prettier-ignore
  10643. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10644. const classes = classnames_default()({
  10645. 'is-light': !isDark,
  10646. 'has-parallax': hasParallax,
  10647. 'is-repeated': isRepeated,
  10648. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10649. }, getPositionClassName(contentPosition));
  10650. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10651. className: classes,
  10652. style
  10653. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10654. "aria-hidden": "true",
  10655. className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, {
  10656. 'has-background-dim': dimRatio !== undefined,
  10657. 'has-background-gradient': gradient || customGradient,
  10658. [gradientClass]: !url && gradientClass
  10659. }),
  10660. style: bgStyle
  10661. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10662. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10663. alt: alt,
  10664. src: url,
  10665. style: {
  10666. objectPosition
  10667. },
  10668. "data-object-fit": "cover",
  10669. "data-object-position": objectPosition
  10670. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10671. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10672. autoPlay: true,
  10673. muted: true,
  10674. loop: true,
  10675. playsInline: true,
  10676. src: url,
  10677. style: {
  10678. objectPosition
  10679. },
  10680. "data-object-fit": "cover",
  10681. "data-object-position": objectPosition
  10682. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  10683. className: 'wp-block-cover__inner-container'
  10684. })));
  10685. }
  10686. };
  10687. const v7 = {
  10688. attributes: { ...deprecated_blockAttributes,
  10689. isRepeated: {
  10690. type: 'boolean',
  10691. default: false
  10692. },
  10693. minHeight: {
  10694. type: 'number'
  10695. },
  10696. minHeightUnit: {
  10697. type: 'string'
  10698. },
  10699. gradient: {
  10700. type: 'string'
  10701. },
  10702. customGradient: {
  10703. type: 'string'
  10704. },
  10705. contentPosition: {
  10706. type: 'string'
  10707. },
  10708. alt: {
  10709. type: 'string',
  10710. source: 'attribute',
  10711. selector: 'img',
  10712. attribute: 'alt',
  10713. default: ''
  10714. }
  10715. },
  10716. supports: v7toV10BlockSupports,
  10717. save(_ref4) {
  10718. let {
  10719. attributes
  10720. } = _ref4;
  10721. const {
  10722. backgroundType,
  10723. gradient,
  10724. contentPosition,
  10725. customGradient,
  10726. customOverlayColor,
  10727. dimRatio,
  10728. focalPoint,
  10729. hasParallax,
  10730. isRepeated,
  10731. overlayColor,
  10732. url,
  10733. alt,
  10734. id,
  10735. minHeight: minHeightProp,
  10736. minHeightUnit
  10737. } = attributes;
  10738. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10739. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10740. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10741. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10742. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10743. const isImgElement = !(hasParallax || isRepeated);
  10744. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  10745. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10746. background: customGradient && !url ? customGradient : undefined,
  10747. minHeight: minHeight || undefined
  10748. };
  10749. const objectPosition = // prettier-ignore
  10750. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10751. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  10752. 'has-background-dim': dimRatio !== 0,
  10753. 'has-parallax': hasParallax,
  10754. 'is-repeated': isRepeated,
  10755. 'has-background-gradient': gradient || customGradient,
  10756. [gradientClass]: !url && gradientClass,
  10757. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10758. }, getPositionClassName(contentPosition));
  10759. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10760. className: classes,
  10761. style
  10762. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  10763. "aria-hidden": "true",
  10764. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  10765. style: customGradient ? {
  10766. background: customGradient
  10767. } : undefined
  10768. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10769. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10770. alt: alt,
  10771. src: url,
  10772. style: {
  10773. objectPosition
  10774. },
  10775. "data-object-fit": "cover",
  10776. "data-object-position": objectPosition
  10777. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10778. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10779. autoPlay: true,
  10780. muted: true,
  10781. loop: true,
  10782. playsInline: true,
  10783. src: url,
  10784. style: {
  10785. objectPosition
  10786. },
  10787. "data-object-fit": "cover",
  10788. "data-object-position": objectPosition
  10789. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  10790. className: "wp-block-cover__inner-container"
  10791. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  10792. },
  10793. migrate: migrateDimRatio
  10794. };
  10795. const v6 = {
  10796. attributes: { ...deprecated_blockAttributes,
  10797. isRepeated: {
  10798. type: 'boolean',
  10799. default: false
  10800. },
  10801. minHeight: {
  10802. type: 'number'
  10803. },
  10804. minHeightUnit: {
  10805. type: 'string'
  10806. },
  10807. gradient: {
  10808. type: 'string'
  10809. },
  10810. customGradient: {
  10811. type: 'string'
  10812. },
  10813. contentPosition: {
  10814. type: 'string'
  10815. }
  10816. },
  10817. supports: {
  10818. align: true
  10819. },
  10820. save(_ref5) {
  10821. let {
  10822. attributes
  10823. } = _ref5;
  10824. const {
  10825. backgroundType,
  10826. gradient,
  10827. contentPosition,
  10828. customGradient,
  10829. customOverlayColor,
  10830. dimRatio,
  10831. focalPoint,
  10832. hasParallax,
  10833. isRepeated,
  10834. overlayColor,
  10835. url,
  10836. minHeight: minHeightProp,
  10837. minHeightUnit
  10838. } = attributes;
  10839. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10840. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10841. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10842. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10843. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10844. const style = isImageBackground ? backgroundImageStyles(url) : {};
  10845. const videoStyle = {};
  10846. if (!overlayColorClass) {
  10847. style.backgroundColor = customOverlayColor;
  10848. }
  10849. if (customGradient && !url) {
  10850. style.background = customGradient;
  10851. }
  10852. style.minHeight = minHeight || undefined;
  10853. let positionValue;
  10854. if (focalPoint) {
  10855. positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  10856. if (isImageBackground && !hasParallax) {
  10857. style.backgroundPosition = positionValue;
  10858. }
  10859. if (isVideoBackground) {
  10860. videoStyle.objectPosition = positionValue;
  10861. }
  10862. }
  10863. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  10864. 'has-background-dim': dimRatio !== 0,
  10865. 'has-parallax': hasParallax,
  10866. 'is-repeated': isRepeated,
  10867. 'has-background-gradient': gradient || customGradient,
  10868. [gradientClass]: !url && gradientClass,
  10869. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10870. }, getPositionClassName(contentPosition));
  10871. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10872. className: classes,
  10873. style
  10874. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  10875. "aria-hidden": "true",
  10876. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  10877. style: customGradient ? {
  10878. background: customGradient
  10879. } : undefined
  10880. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10881. className: "wp-block-cover__video-background",
  10882. autoPlay: true,
  10883. muted: true,
  10884. loop: true,
  10885. playsInline: true,
  10886. src: url,
  10887. style: videoStyle
  10888. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  10889. className: "wp-block-cover__inner-container"
  10890. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  10891. },
  10892. migrate: migrateDimRatio
  10893. };
  10894. const v5 = {
  10895. attributes: { ...deprecated_blockAttributes,
  10896. minHeight: {
  10897. type: 'number'
  10898. },
  10899. gradient: {
  10900. type: 'string'
  10901. },
  10902. customGradient: {
  10903. type: 'string'
  10904. }
  10905. },
  10906. supports: {
  10907. align: true
  10908. },
  10909. save(_ref6) {
  10910. let {
  10911. attributes
  10912. } = _ref6;
  10913. const {
  10914. backgroundType,
  10915. gradient,
  10916. customGradient,
  10917. customOverlayColor,
  10918. dimRatio,
  10919. focalPoint,
  10920. hasParallax,
  10921. overlayColor,
  10922. url,
  10923. minHeight
  10924. } = attributes;
  10925. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10926. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10927. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  10928. if (!overlayColorClass) {
  10929. style.backgroundColor = customOverlayColor;
  10930. }
  10931. if (focalPoint && !hasParallax) {
  10932. style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  10933. }
  10934. if (customGradient && !url) {
  10935. style.background = customGradient;
  10936. }
  10937. style.minHeight = minHeight || undefined;
  10938. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  10939. 'has-background-dim': dimRatio !== 0,
  10940. 'has-parallax': hasParallax,
  10941. 'has-background-gradient': customGradient,
  10942. [gradientClass]: !url && gradientClass
  10943. });
  10944. return (0,external_wp_element_namespaceObject.createElement)("div", {
  10945. className: classes,
  10946. style: style
  10947. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  10948. "aria-hidden": "true",
  10949. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  10950. style: customGradient ? {
  10951. background: customGradient
  10952. } : undefined
  10953. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10954. className: "wp-block-cover__video-background",
  10955. autoPlay: true,
  10956. muted: true,
  10957. loop: true,
  10958. src: url
  10959. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  10960. className: "wp-block-cover__inner-container"
  10961. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  10962. },
  10963. migrate: migrateDimRatio
  10964. };
  10965. const v4 = {
  10966. attributes: { ...deprecated_blockAttributes,
  10967. minHeight: {
  10968. type: 'number'
  10969. },
  10970. gradient: {
  10971. type: 'string'
  10972. },
  10973. customGradient: {
  10974. type: 'string'
  10975. }
  10976. },
  10977. supports: {
  10978. align: true
  10979. },
  10980. save(_ref7) {
  10981. let {
  10982. attributes
  10983. } = _ref7;
  10984. const {
  10985. backgroundType,
  10986. gradient,
  10987. customGradient,
  10988. customOverlayColor,
  10989. dimRatio,
  10990. focalPoint,
  10991. hasParallax,
  10992. overlayColor,
  10993. url,
  10994. minHeight
  10995. } = attributes;
  10996. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10997. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10998. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  10999. if (!overlayColorClass) {
  11000. style.backgroundColor = customOverlayColor;
  11001. }
  11002. if (focalPoint && !hasParallax) {
  11003. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  11004. }
  11005. if (customGradient && !url) {
  11006. style.background = customGradient;
  11007. }
  11008. style.minHeight = minHeight || undefined;
  11009. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  11010. 'has-background-dim': dimRatio !== 0,
  11011. 'has-parallax': hasParallax,
  11012. 'has-background-gradient': customGradient,
  11013. [gradientClass]: !url && gradientClass
  11014. });
  11015. return (0,external_wp_element_namespaceObject.createElement)("div", {
  11016. className: classes,
  11017. style: style
  11018. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  11019. "aria-hidden": "true",
  11020. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  11021. style: customGradient ? {
  11022. background: customGradient
  11023. } : undefined
  11024. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  11025. className: "wp-block-cover__video-background",
  11026. autoPlay: true,
  11027. muted: true,
  11028. loop: true,
  11029. src: url
  11030. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  11031. className: "wp-block-cover__inner-container"
  11032. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  11033. },
  11034. migrate: migrateDimRatio
  11035. };
  11036. const v3 = {
  11037. attributes: { ...deprecated_blockAttributes,
  11038. title: {
  11039. type: 'string',
  11040. source: 'html',
  11041. selector: 'p'
  11042. },
  11043. contentAlign: {
  11044. type: 'string',
  11045. default: 'center'
  11046. }
  11047. },
  11048. supports: {
  11049. align: true
  11050. },
  11051. save(_ref8) {
  11052. let {
  11053. attributes
  11054. } = _ref8;
  11055. const {
  11056. backgroundType,
  11057. contentAlign,
  11058. customOverlayColor,
  11059. dimRatio,
  11060. focalPoint,
  11061. hasParallax,
  11062. overlayColor,
  11063. title,
  11064. url
  11065. } = attributes;
  11066. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  11067. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  11068. if (!overlayColorClass) {
  11069. style.backgroundColor = customOverlayColor;
  11070. }
  11071. if (focalPoint && !hasParallax) {
  11072. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  11073. }
  11074. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  11075. 'has-background-dim': dimRatio !== 0,
  11076. 'has-parallax': hasParallax,
  11077. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  11078. });
  11079. return (0,external_wp_element_namespaceObject.createElement)("div", {
  11080. className: classes,
  11081. style: style
  11082. }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  11083. className: "wp-block-cover__video-background",
  11084. autoPlay: true,
  11085. muted: true,
  11086. loop: true,
  11087. src: url
  11088. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11089. tagName: "p",
  11090. className: "wp-block-cover-text",
  11091. value: title
  11092. }));
  11093. },
  11094. migrate(attributes) {
  11095. const newAttribs = { ...attributes,
  11096. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  11097. };
  11098. const {
  11099. title,
  11100. contentAlign,
  11101. ...restAttributes
  11102. } = newAttribs;
  11103. return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  11104. content: attributes.title,
  11105. align: attributes.contentAlign,
  11106. fontSize: 'large',
  11107. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  11108. })]];
  11109. }
  11110. };
  11111. const v2 = {
  11112. attributes: { ...deprecated_blockAttributes,
  11113. title: {
  11114. type: 'string',
  11115. source: 'html',
  11116. selector: 'p'
  11117. },
  11118. contentAlign: {
  11119. type: 'string',
  11120. default: 'center'
  11121. },
  11122. align: {
  11123. type: 'string'
  11124. }
  11125. },
  11126. supports: {
  11127. className: false
  11128. },
  11129. save(_ref9) {
  11130. let {
  11131. attributes
  11132. } = _ref9;
  11133. const {
  11134. url,
  11135. title,
  11136. hasParallax,
  11137. dimRatio,
  11138. align,
  11139. contentAlign,
  11140. overlayColor,
  11141. customOverlayColor
  11142. } = attributes;
  11143. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  11144. const style = backgroundImageStyles(url);
  11145. if (!overlayColorClass) {
  11146. style.backgroundColor = customOverlayColor;
  11147. }
  11148. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
  11149. 'has-background-dim': dimRatio !== 0,
  11150. 'has-parallax': hasParallax,
  11151. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  11152. }, align ? `align${align}` : null);
  11153. return (0,external_wp_element_namespaceObject.createElement)("div", {
  11154. className: classes,
  11155. style: style
  11156. }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11157. tagName: "p",
  11158. className: "wp-block-cover-image-text",
  11159. value: title
  11160. }));
  11161. },
  11162. migrate(attributes) {
  11163. const newAttribs = { ...attributes,
  11164. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  11165. };
  11166. const {
  11167. title,
  11168. contentAlign,
  11169. align,
  11170. ...restAttributes
  11171. } = newAttribs;
  11172. return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  11173. content: attributes.title,
  11174. align: attributes.contentAlign,
  11175. fontSize: 'large',
  11176. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  11177. })]];
  11178. }
  11179. };
  11180. const cover_deprecated_v1 = {
  11181. attributes: { ...deprecated_blockAttributes,
  11182. title: {
  11183. type: 'string',
  11184. source: 'html',
  11185. selector: 'h2'
  11186. },
  11187. align: {
  11188. type: 'string'
  11189. },
  11190. contentAlign: {
  11191. type: 'string',
  11192. default: 'center'
  11193. }
  11194. },
  11195. supports: {
  11196. className: false
  11197. },
  11198. save(_ref10) {
  11199. let {
  11200. attributes
  11201. } = _ref10;
  11202. const {
  11203. url,
  11204. title,
  11205. hasParallax,
  11206. dimRatio,
  11207. align
  11208. } = attributes;
  11209. const style = backgroundImageStyles(url);
  11210. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
  11211. 'has-background-dim': dimRatio !== 0,
  11212. 'has-parallax': hasParallax
  11213. }, align ? `align${align}` : null);
  11214. return (0,external_wp_element_namespaceObject.createElement)("section", {
  11215. className: classes,
  11216. style: style
  11217. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11218. tagName: "h2",
  11219. value: title
  11220. }));
  11221. },
  11222. migrate(attributes) {
  11223. const newAttribs = { ...attributes,
  11224. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  11225. };
  11226. const {
  11227. title,
  11228. contentAlign,
  11229. align,
  11230. ...restAttributes
  11231. } = newAttribs;
  11232. return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  11233. content: attributes.title,
  11234. align: attributes.contentAlign,
  11235. fontSize: 'large',
  11236. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  11237. })]];
  11238. }
  11239. };
  11240. /* harmony default export */ var cover_deprecated = ([deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);
  11241. ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
  11242. var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
  11243. ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs
  11244. /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
  11245. // EXTERNAL MODULE: ./node_modules/fast-average-color/dist/index.js
  11246. var dist = __webpack_require__(5027);
  11247. var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
  11248. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/use-cover-is-dark.js
  11249. /**
  11250. * External dependencies
  11251. */
  11252. /**
  11253. * WordPress dependencies
  11254. */
  11255. function retrieveFastAverageColor() {
  11256. if (!retrieveFastAverageColor.fastAverageColor) {
  11257. retrieveFastAverageColor.fastAverageColor = new (dist_default())();
  11258. }
  11259. return retrieveFastAverageColor.fastAverageColor;
  11260. }
  11261. /**
  11262. * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
  11263. * background is dark or not.
  11264. *
  11265. * @param {?string} url Url of the media background.
  11266. * @param {?number} dimRatio Transparency of the overlay color. If an image and
  11267. * color are set, dimRatio is used to decide what is used
  11268. * for background darkness checking purposes.
  11269. * @param {?string} overlayColor String containing the overlay color value if one exists.
  11270. * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
  11271. * dom element that renders that media.
  11272. *
  11273. * @return {boolean} True if the cover background is considered "dark" and false otherwise.
  11274. */
  11275. function useCoverIsDark(url) {
  11276. let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
  11277. let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
  11278. let elementRef = arguments.length > 3 ? arguments[3] : undefined;
  11279. const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false);
  11280. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11281. // If opacity is lower than 50 the dominant color is the image or video color,
  11282. // so use that color for the dark mode computation.
  11283. if (url && dimRatio <= 50 && elementRef.current) {
  11284. retrieveFastAverageColor().getColorAsync(elementRef.current, color => {
  11285. setIsDark(color.isDark);
  11286. });
  11287. }
  11288. }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]);
  11289. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11290. // If opacity is greater than 50 the dominant color is the overlay color,
  11291. // so use that color for the dark mode computation.
  11292. if (dimRatio > 50 || !url) {
  11293. if (!overlayColor) {
  11294. // If no overlay color exists the overlay color is black (isDark )
  11295. setIsDark(true);
  11296. return;
  11297. }
  11298. setIsDark(w(overlayColor).isDark());
  11299. }
  11300. }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
  11301. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11302. if (!url && !overlayColor) {
  11303. // Reset isDark.
  11304. setIsDark(false);
  11305. }
  11306. }, [!url && !overlayColor, setIsDark]);
  11307. return isDark;
  11308. }
  11309. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js
  11310. /**
  11311. * WordPress dependencies
  11312. */
  11313. /**
  11314. * Internal dependencies
  11315. */
  11316. function CoverHeightInput(_ref) {
  11317. let {
  11318. onChange,
  11319. onUnitChange,
  11320. unit = 'px',
  11321. value = ''
  11322. } = _ref;
  11323. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  11324. const inputId = `block-cover-height-input-${instanceId}`;
  11325. const isPx = unit === 'px';
  11326. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  11327. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
  11328. defaultValues: {
  11329. px: 430,
  11330. '%': 20,
  11331. em: 20,
  11332. rem: 20,
  11333. vw: 20,
  11334. vh: 50
  11335. }
  11336. });
  11337. const handleOnChange = unprocessedValue => {
  11338. const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined;
  11339. if (isNaN(inputValue) && inputValue !== undefined) {
  11340. return;
  11341. }
  11342. onChange(inputValue);
  11343. };
  11344. const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
  11345. const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  11346. return [parsedQuantity, unit].join('');
  11347. }, [unit, value]);
  11348. const min = isPx ? COVER_MIN_HEIGHT : 0;
  11349. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  11350. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
  11351. id: inputId
  11352. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  11353. id: inputId,
  11354. isResetValueOnUnitChange: true,
  11355. min: min,
  11356. onChange: handleOnChange,
  11357. onUnitChange: onUnitChange,
  11358. style: {
  11359. maxWidth: 80
  11360. },
  11361. units: units,
  11362. value: computedValue
  11363. }));
  11364. }
  11365. function CoverInspectorControls(_ref2) {
  11366. let {
  11367. attributes,
  11368. setAttributes,
  11369. clientId,
  11370. setOverlayColor,
  11371. coverRef,
  11372. currentSettings
  11373. } = _ref2;
  11374. const {
  11375. useFeaturedImage,
  11376. dimRatio,
  11377. focalPoint,
  11378. hasParallax,
  11379. isRepeated,
  11380. minHeight,
  11381. minHeightUnit,
  11382. alt
  11383. } = attributes;
  11384. const {
  11385. isVideoBackground,
  11386. isImageBackground,
  11387. mediaElement,
  11388. url,
  11389. isImgElement,
  11390. overlayColor
  11391. } = currentSettings;
  11392. const {
  11393. gradientValue,
  11394. setGradient
  11395. } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
  11396. const toggleParallax = () => {
  11397. setAttributes({
  11398. hasParallax: !hasParallax,
  11399. ...(!hasParallax ? {
  11400. focalPoint: undefined
  11401. } : {})
  11402. });
  11403. };
  11404. const toggleIsRepeated = () => {
  11405. setAttributes({
  11406. isRepeated: !isRepeated
  11407. });
  11408. };
  11409. const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
  11410. const imperativeFocalPointPreview = value => {
  11411. const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition'];
  11412. styleOfRef[property] = mediaPosition(value);
  11413. };
  11414. const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  11415. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  11416. title: (0,external_wp_i18n_namespaceObject.__)('Media settings')
  11417. }, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  11418. label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'),
  11419. checked: hasParallax,
  11420. onChange: toggleParallax
  11421. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  11422. label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'),
  11423. checked: isRepeated,
  11424. onChange: toggleIsRepeated
  11425. })), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  11426. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  11427. url: url,
  11428. value: focalPoint,
  11429. onDragStart: imperativeFocalPointPreview,
  11430. onDrag: imperativeFocalPointPreview,
  11431. onChange: newFocalPoint => setAttributes({
  11432. focalPoint: newFocalPoint
  11433. })
  11434. }), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  11435. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  11436. value: alt,
  11437. onChange: newAlt => setAttributes({
  11438. alt: newAlt
  11439. }),
  11440. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  11441. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  11442. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  11443. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  11444. variant: "secondary",
  11445. isSmall: true,
  11446. className: "block-library-cover__reset-button",
  11447. onClick: () => setAttributes({
  11448. url: undefined,
  11449. id: undefined,
  11450. backgroundType: undefined,
  11451. focalPoint: undefined,
  11452. hasParallax: undefined,
  11453. isRepeated: undefined,
  11454. useFeaturedImage: false
  11455. })
  11456. }, (0,external_wp_i18n_namespaceObject.__)('Clear Media'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  11457. __experimentalGroup: "color"
  11458. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, _extends({
  11459. __experimentalHasMultipleOrigins: true,
  11460. __experimentalIsRenderedInSidebar: true,
  11461. settings: [{
  11462. colorValue: overlayColor.color,
  11463. gradientValue,
  11464. label: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
  11465. onColorChange: setOverlayColor,
  11466. onGradientChange: setGradient,
  11467. isShownByDefault: true,
  11468. resetAllFilter: () => ({
  11469. overlayColor: undefined,
  11470. customOverlayColor: undefined,
  11471. gradient: undefined,
  11472. customGradient: undefined
  11473. })
  11474. }],
  11475. panelId: clientId
  11476. }, colorGradientSettings)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  11477. hasValue: () => {
  11478. // If there's a media background the dimRatio will be
  11479. // defaulted to 50 whereas it will be 100 for colors.
  11480. return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100);
  11481. },
  11482. label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
  11483. onDeselect: () => setAttributes({
  11484. dimRatio: url ? 50 : 100
  11485. }),
  11486. resetAllFilter: () => ({
  11487. dimRatio: url ? 50 : 100
  11488. }),
  11489. isShownByDefault: true,
  11490. panelId: clientId
  11491. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  11492. label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
  11493. value: dimRatio,
  11494. onChange: newDimRation => setAttributes({
  11495. dimRatio: newDimRation
  11496. }),
  11497. min: 0,
  11498. max: 100,
  11499. step: 10,
  11500. required: true
  11501. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  11502. __experimentalGroup: "dimensions"
  11503. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  11504. hasValue: () => !!minHeight,
  11505. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
  11506. onDeselect: () => setAttributes({
  11507. minHeight: undefined,
  11508. minHeightUnit: undefined
  11509. }),
  11510. resetAllFilter: () => ({
  11511. minHeight: undefined,
  11512. minHeightUnit: undefined
  11513. }),
  11514. isShownByDefault: true,
  11515. panelId: clientId
  11516. }, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, {
  11517. value: minHeight,
  11518. unit: minHeightUnit,
  11519. onChange: newMinHeight => setAttributes({
  11520. minHeight: newMinHeight
  11521. }),
  11522. onUnitChange: nextUnit => setAttributes({
  11523. minHeightUnit: nextUnit
  11524. })
  11525. }))));
  11526. }
  11527. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js
  11528. /**
  11529. * WordPress dependencies
  11530. */
  11531. /**
  11532. * Internal dependencies
  11533. */
  11534. function CoverBlockControls(_ref) {
  11535. let {
  11536. attributes,
  11537. setAttributes,
  11538. onSelectMedia,
  11539. currentSettings,
  11540. toggleUseFeaturedImage
  11541. } = _ref;
  11542. const {
  11543. contentPosition,
  11544. id,
  11545. useFeaturedImage,
  11546. minHeight,
  11547. minHeightUnit
  11548. } = attributes;
  11549. const {
  11550. hasInnerBlocks,
  11551. url
  11552. } = currentSettings;
  11553. const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
  11554. const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
  11555. const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
  11556. const toggleMinFullHeight = () => {
  11557. if (isMinFullHeight) {
  11558. // If there aren't previous values, take the default ones.
  11559. if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) {
  11560. return setAttributes({
  11561. minHeight: undefined,
  11562. minHeightUnit: undefined
  11563. });
  11564. } // Set the previous values of height.
  11565. return setAttributes({
  11566. minHeight: prevMinHeightValue,
  11567. minHeightUnit: prevMinHeightUnit
  11568. });
  11569. }
  11570. setPrevMinHeightValue(minHeight);
  11571. setPrevMinHeightUnit(minHeightUnit); // Set full height.
  11572. return setAttributes({
  11573. minHeight: 100,
  11574. minHeightUnit: 'vh'
  11575. });
  11576. };
  11577. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  11578. group: "block"
  11579. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
  11580. label: (0,external_wp_i18n_namespaceObject.__)('Change content position'),
  11581. value: contentPosition,
  11582. onChange: nextPosition => setAttributes({
  11583. contentPosition: nextPosition
  11584. }),
  11585. isDisabled: !hasInnerBlocks
  11586. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
  11587. isActive: isMinFullHeight,
  11588. onToggle: toggleMinFullHeight,
  11589. isDisabled: !hasInnerBlocks
  11590. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  11591. group: "other"
  11592. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  11593. mediaId: id,
  11594. mediaURL: url,
  11595. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  11596. accept: "image/*,video/*",
  11597. onSelect: onSelectMedia,
  11598. onToggleFeaturedImage: toggleUseFeaturedImage,
  11599. useFeaturedImage: useFeaturedImage,
  11600. name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace')
  11601. })));
  11602. }
  11603. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js
  11604. /**
  11605. * WordPress dependencies
  11606. */
  11607. /**
  11608. * Internal dependencies
  11609. */
  11610. function CoverPlaceholder(_ref) {
  11611. let {
  11612. disableMediaButtons = false,
  11613. children,
  11614. onSelectMedia,
  11615. onError,
  11616. style,
  11617. toggleUseFeaturedImage
  11618. } = _ref;
  11619. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  11620. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  11621. icon: library_cover
  11622. }),
  11623. labels: {
  11624. title: (0,external_wp_i18n_namespaceObject.__)('Cover'),
  11625. instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.')
  11626. },
  11627. onSelect: onSelectMedia,
  11628. accept: "image/*,video/*",
  11629. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  11630. disableMediaButtons: disableMediaButtons,
  11631. onToggleFeaturedImage: toggleUseFeaturedImage,
  11632. onError: onError,
  11633. style: style
  11634. }, children);
  11635. }
  11636. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover.js
  11637. /**
  11638. * External dependencies
  11639. */
  11640. /**
  11641. * WordPress dependencies
  11642. */
  11643. const RESIZABLE_BOX_ENABLE_OPTION = {
  11644. top: false,
  11645. right: false,
  11646. bottom: true,
  11647. left: false,
  11648. topRight: false,
  11649. bottomRight: false,
  11650. bottomLeft: false,
  11651. topLeft: false
  11652. };
  11653. function ResizableCover(_ref) {
  11654. let {
  11655. className,
  11656. onResizeStart,
  11657. onResize,
  11658. onResizeStop,
  11659. ...props
  11660. } = _ref;
  11661. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  11662. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  11663. className: classnames_default()(className, {
  11664. 'is-resizing': isResizing
  11665. }),
  11666. enable: RESIZABLE_BOX_ENABLE_OPTION,
  11667. onResizeStart: (_event, _direction, elt) => {
  11668. onResizeStart(elt.clientHeight);
  11669. onResize(elt.clientHeight);
  11670. },
  11671. onResize: (_event, _direction, elt) => {
  11672. onResize(elt.clientHeight);
  11673. if (!isResizing) {
  11674. setIsResizing(true);
  11675. }
  11676. },
  11677. onResizeStop: (_event, _direction, elt) => {
  11678. onResizeStop(elt.clientHeight);
  11679. setIsResizing(false);
  11680. },
  11681. __experimentalShowTooltip: true,
  11682. __experimentalTooltipProps: {
  11683. axis: 'y',
  11684. position: 'bottom',
  11685. isVisible: isResizing
  11686. }
  11687. }, props));
  11688. }
  11689. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js
  11690. /**
  11691. * External dependencies
  11692. */
  11693. /**
  11694. * WordPress dependencies
  11695. */
  11696. /**
  11697. * Internal dependencies
  11698. */
  11699. k([names]);
  11700. function getInnerBlocksTemplate(attributes) {
  11701. return [['core/paragraph', {
  11702. align: 'center',
  11703. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
  11704. ...attributes
  11705. }]];
  11706. }
  11707. /**
  11708. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while
  11709. * the media (image or video) is being uploaded and will not have an id allocated yet.
  11710. *
  11711. * @param {number} id The id of the media.
  11712. * @param {string} url The url of the media.
  11713. *
  11714. * @return {boolean} Is the URL a Blob URL.
  11715. */
  11716. const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  11717. function CoverEdit(_ref) {
  11718. var _useSetting;
  11719. let {
  11720. attributes,
  11721. clientId,
  11722. isSelected,
  11723. overlayColor,
  11724. setAttributes,
  11725. setOverlayColor,
  11726. toggleSelection,
  11727. context: {
  11728. postId,
  11729. postType
  11730. }
  11731. } = _ref;
  11732. const {
  11733. contentPosition,
  11734. id,
  11735. useFeaturedImage,
  11736. dimRatio,
  11737. focalPoint,
  11738. hasParallax,
  11739. isDark,
  11740. isRepeated,
  11741. minHeight,
  11742. minHeightUnit,
  11743. alt,
  11744. allowedBlocks,
  11745. templateLock
  11746. } = attributes;
  11747. const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
  11748. const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
  11749. context: 'view'
  11750. }), [featuredImage]);
  11751. const mediaUrl = media === null || media === void 0 ? void 0 : media.source_url; // instead of destructuring the attributes
  11752. // we define the url and background type
  11753. // depending on the value of the useFeaturedImage flag
  11754. // to preview in edit the dynamic featured image
  11755. const url = useFeaturedImage ? mediaUrl : attributes.url;
  11756. const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
  11757. const {
  11758. __unstableMarkNextChangeAsNotPersistent
  11759. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  11760. const {
  11761. createErrorNotice
  11762. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  11763. const {
  11764. gradientClass,
  11765. gradientValue
  11766. } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
  11767. const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
  11768. const isUploadingMedia = isTemporaryMedia(id, url);
  11769. const onUploadError = message => {
  11770. createErrorNotice(message, {
  11771. type: 'snackbar'
  11772. });
  11773. };
  11774. const mediaElement = (0,external_wp_element_namespaceObject.useRef)();
  11775. const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color, mediaElement);
  11776. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11777. // This side-effect should not create an undo level.
  11778. __unstableMarkNextChangeAsNotPersistent();
  11779. setAttributes({
  11780. isDark: isCoverDark
  11781. });
  11782. }, [isCoverDark]);
  11783. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  11784. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  11785. const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight;
  11786. const isImgElement = !(hasParallax || isRepeated);
  11787. const style = {
  11788. minHeight: minHeightWithUnit || undefined
  11789. };
  11790. const backgroundImage = url ? `url(${url})` : undefined;
  11791. const backgroundPosition = mediaPosition(focalPoint);
  11792. const bgStyle = {
  11793. backgroundColor: overlayColor.color
  11794. };
  11795. const mediaStyle = {
  11796. objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined
  11797. };
  11798. const hasBackground = !!(url || overlayColor.color || gradientValue);
  11799. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
  11800. const ref = (0,external_wp_element_namespaceObject.useRef)();
  11801. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  11802. ref
  11803. }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
  11804. const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length);
  11805. const innerBlocksTemplate = getInnerBlocksTemplate({
  11806. fontSize: hasFontSizes ? 'large' : undefined
  11807. });
  11808. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  11809. className: 'wp-block-cover__inner-container'
  11810. }, {
  11811. // Avoid template sync when the `templateLock` value is `all` or `contentOnly`.
  11812. // See: https://github.com/WordPress/gutenberg/pull/45632
  11813. template: !hasInnerBlocks ? innerBlocksTemplate : undefined,
  11814. templateInsertUpdatesSelection: true,
  11815. allowedBlocks,
  11816. templateLock
  11817. });
  11818. const currentSettings = {
  11819. isVideoBackground,
  11820. isImageBackground,
  11821. mediaElement,
  11822. hasInnerBlocks,
  11823. url,
  11824. isImgElement,
  11825. overlayColor
  11826. };
  11827. const toggleUseFeaturedImage = () => {
  11828. setAttributes({
  11829. id: undefined,
  11830. url: undefined,
  11831. useFeaturedImage: !useFeaturedImage,
  11832. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  11833. backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
  11834. });
  11835. };
  11836. const blockControls = (0,external_wp_element_namespaceObject.createElement)(CoverBlockControls, {
  11837. attributes: attributes,
  11838. setAttributes: setAttributes,
  11839. onSelectMedia: onSelectMedia,
  11840. currentSettings: currentSettings,
  11841. toggleUseFeaturedImage: toggleUseFeaturedImage
  11842. });
  11843. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(CoverInspectorControls, {
  11844. attributes: attributes,
  11845. setAttributes: setAttributes,
  11846. clientId: clientId,
  11847. setOverlayColor: setOverlayColor,
  11848. coverRef: ref,
  11849. currentSettings: currentSettings,
  11850. toggleUseFeaturedImage: toggleUseFeaturedImage
  11851. });
  11852. if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) {
  11853. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  11854. className: classnames_default()('is-placeholder', blockProps.className)
  11855. }), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  11856. onSelectMedia: onSelectMedia,
  11857. onError: onUploadError,
  11858. style: {
  11859. minHeight: minHeightWithUnit || undefined
  11860. },
  11861. toggleUseFeaturedImage: toggleUseFeaturedImage
  11862. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  11863. className: "wp-block-cover__placeholder-background-options"
  11864. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
  11865. disableCustomColors: true,
  11866. value: overlayColor.color,
  11867. onChange: setOverlayColor,
  11868. clearable: false
  11869. }))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  11870. className: "block-library-cover__resize-container",
  11871. onResizeStart: () => {
  11872. setAttributes({
  11873. minHeightUnit: 'px'
  11874. });
  11875. toggleSelection(false);
  11876. },
  11877. onResize: value => {
  11878. setAttributes({
  11879. minHeight: value
  11880. });
  11881. },
  11882. onResizeStop: newMinHeight => {
  11883. toggleSelection(true);
  11884. setAttributes({
  11885. minHeight: newMinHeight
  11886. });
  11887. },
  11888. showHandle: isSelected
  11889. })));
  11890. }
  11891. const classes = classnames_default()({
  11892. 'is-dark-theme': isDark,
  11893. 'is-light': !isDark,
  11894. 'is-transient': isUploadingMedia,
  11895. 'has-parallax': hasParallax,
  11896. 'is-repeated': isRepeated,
  11897. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  11898. }, getPositionClassName(contentPosition));
  11899. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  11900. className: classnames_default()(classes, blockProps.className),
  11901. style: { ...style,
  11902. ...blockProps.style
  11903. },
  11904. "data-url": url
  11905. }), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  11906. className: "block-library-cover__resize-container",
  11907. onResizeStart: () => {
  11908. setAttributes({
  11909. minHeightUnit: 'px'
  11910. });
  11911. toggleSelection(false);
  11912. },
  11913. onResize: value => {
  11914. setAttributes({
  11915. minHeight: value
  11916. });
  11917. },
  11918. onResizeStop: newMinHeight => {
  11919. toggleSelection(true);
  11920. setAttributes({
  11921. minHeight: newMinHeight
  11922. });
  11923. },
  11924. showHandle: isSelected
  11925. }), (!useFeaturedImage || url) && (0,external_wp_element_namespaceObject.createElement)("span", {
  11926. "aria-hidden": "true",
  11927. className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), {
  11928. [overlayColor.class]: overlayColor.class,
  11929. 'has-background-dim': dimRatio !== undefined,
  11930. // For backwards compatibility. Former versions of the Cover Block applied
  11931. // `.wp-block-cover__gradient-background` in the presence of
  11932. // media, a gradient and a dim.
  11933. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  11934. 'has-background-gradient': gradientValue,
  11935. [gradientClass]: gradientClass
  11936. }),
  11937. style: {
  11938. backgroundImage: gradientValue,
  11939. ...bgStyle
  11940. }
  11941. }), !url && useFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  11942. className: "wp-block-cover__image--placeholder-image",
  11943. withIllustration: true
  11944. }), url && isImageBackground && (isImgElement ? (0,external_wp_element_namespaceObject.createElement)("img", {
  11945. ref: mediaElement,
  11946. className: "wp-block-cover__image-background",
  11947. alt: alt,
  11948. src: url,
  11949. style: mediaStyle
  11950. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  11951. ref: mediaElement,
  11952. role: "img",
  11953. className: classnames_default()(classes, 'wp-block-cover__image-background'),
  11954. style: {
  11955. backgroundImage,
  11956. backgroundPosition
  11957. }
  11958. })), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", {
  11959. ref: mediaElement,
  11960. className: "wp-block-cover__video-background",
  11961. autoPlay: true,
  11962. muted: true,
  11963. loop: true,
  11964. src: url,
  11965. style: mediaStyle
  11966. }), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  11967. disableMediaButtons: true,
  11968. onSelectMedia: onSelectMedia,
  11969. onError: onUploadError,
  11970. toggleUseFeaturedImage: toggleUseFeaturedImage
  11971. }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  11972. }
  11973. /* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
  11974. overlayColor: 'background-color'
  11975. })])(CoverEdit));
  11976. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js
  11977. /**
  11978. * External dependencies
  11979. */
  11980. /**
  11981. * WordPress dependencies
  11982. */
  11983. /**
  11984. * Internal dependencies
  11985. */
  11986. function cover_save_save(_ref) {
  11987. let {
  11988. attributes
  11989. } = _ref;
  11990. const {
  11991. backgroundType,
  11992. gradient,
  11993. contentPosition,
  11994. customGradient,
  11995. customOverlayColor,
  11996. dimRatio,
  11997. focalPoint,
  11998. useFeaturedImage,
  11999. hasParallax,
  12000. isDark,
  12001. isRepeated,
  12002. overlayColor,
  12003. url,
  12004. alt,
  12005. id,
  12006. minHeight: minHeightProp,
  12007. minHeightUnit
  12008. } = attributes;
  12009. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  12010. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  12011. const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  12012. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  12013. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  12014. const isImgElement = !(hasParallax || isRepeated);
  12015. const style = {
  12016. minHeight: minHeight || undefined
  12017. };
  12018. const bgStyle = {
  12019. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  12020. background: customGradient ? customGradient : undefined
  12021. };
  12022. const objectPosition = // prettier-ignore
  12023. focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined;
  12024. const backgroundImage = url ? `url(${url})` : undefined;
  12025. const backgroundPosition = mediaPosition(focalPoint);
  12026. const classes = classnames_default()({
  12027. 'is-light': !isDark,
  12028. 'has-parallax': hasParallax,
  12029. 'is-repeated': isRepeated,
  12030. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  12031. }, getPositionClassName(contentPosition));
  12032. const imgClasses = classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
  12033. 'has-parallax': hasParallax,
  12034. 'is-repeated': isRepeated
  12035. });
  12036. const gradientValue = gradient || customGradient;
  12037. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  12038. className: classes,
  12039. style
  12040. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  12041. "aria-hidden": "true",
  12042. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  12043. 'has-background-dim': dimRatio !== undefined,
  12044. // For backwards compatibility. Former versions of the Cover Block applied
  12045. // `.wp-block-cover__gradient-background` in the presence of
  12046. // media, a gradient and a dim.
  12047. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  12048. 'has-background-gradient': gradientValue,
  12049. [gradientClass]: gradientClass
  12050. }),
  12051. style: bgStyle
  12052. }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_wp_element_namespaceObject.createElement)("img", {
  12053. className: imgClasses,
  12054. alt: alt,
  12055. src: url,
  12056. style: {
  12057. objectPosition
  12058. },
  12059. "data-object-fit": "cover",
  12060. "data-object-position": objectPosition
  12061. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  12062. role: "img",
  12063. className: imgClasses,
  12064. style: {
  12065. backgroundPosition,
  12066. backgroundImage
  12067. }
  12068. })), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  12069. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  12070. autoPlay: true,
  12071. muted: true,
  12072. loop: true,
  12073. playsInline: true,
  12074. src: url,
  12075. style: {
  12076. objectPosition
  12077. },
  12078. "data-object-fit": "cover",
  12079. "data-object-position": objectPosition
  12080. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  12081. className: 'wp-block-cover__inner-container'
  12082. })));
  12083. }
  12084. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js
  12085. /**
  12086. * WordPress dependencies
  12087. */
  12088. /**
  12089. * Internal dependencies
  12090. */
  12091. const cover_transforms_transforms = {
  12092. from: [{
  12093. type: 'block',
  12094. blocks: ['core/image'],
  12095. transform: _ref => {
  12096. var _style$color;
  12097. let {
  12098. caption,
  12099. url,
  12100. alt,
  12101. align,
  12102. id,
  12103. anchor,
  12104. style
  12105. } = _ref;
  12106. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  12107. dimRatio: 50,
  12108. url,
  12109. alt,
  12110. align,
  12111. id,
  12112. anchor,
  12113. style: {
  12114. color: {
  12115. duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone
  12116. }
  12117. }
  12118. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  12119. content: caption,
  12120. fontSize: 'large',
  12121. align: 'center'
  12122. })]);
  12123. }
  12124. }, {
  12125. type: 'block',
  12126. blocks: ['core/video'],
  12127. transform: _ref2 => {
  12128. let {
  12129. caption,
  12130. src,
  12131. align,
  12132. id,
  12133. anchor
  12134. } = _ref2;
  12135. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  12136. dimRatio: 50,
  12137. url: src,
  12138. align,
  12139. id,
  12140. backgroundType: VIDEO_BACKGROUND_TYPE,
  12141. anchor
  12142. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  12143. content: caption,
  12144. fontSize: 'large',
  12145. align: 'center'
  12146. })]);
  12147. }
  12148. }, {
  12149. type: 'block',
  12150. blocks: ['core/group'],
  12151. transform: (attributes, innerBlocks) => {
  12152. var _innerBlocks$, _style$color2, _style$color3, _style$color4, _style$color5;
  12153. const {
  12154. align,
  12155. anchor,
  12156. backgroundColor,
  12157. gradient,
  12158. style
  12159. } = attributes; // If the Group block being transformed has a Cover block as its
  12160. // only child return that Cover block.
  12161. if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$ = innerBlocks[0]) === null || _innerBlocks$ === void 0 ? void 0 : _innerBlocks$.name) === 'core/cover') {
  12162. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks);
  12163. } // If no background or gradient color is provided, default to 50% opacity.
  12164. // This matches the styling of a Cover block with a background image,
  12165. // in the state where a background image has been removed.
  12166. const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
  12167. const parentAttributes = {
  12168. align,
  12169. anchor,
  12170. dimRatio,
  12171. overlayColor: backgroundColor,
  12172. customOverlayColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background,
  12173. gradient,
  12174. customGradient: style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient
  12175. };
  12176. const attributesWithoutBackgroundColors = { ...attributes,
  12177. backgroundColor: undefined,
  12178. gradient: undefined,
  12179. style: clean_empty_object({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
  12180. color: style !== null && style !== void 0 && style.color ? { ...(style === null || style === void 0 ? void 0 : style.color),
  12181. background: undefined,
  12182. gradient: undefined
  12183. } : undefined
  12184. })
  12185. }; // Preserve the block by nesting it within the Cover block,
  12186. // instead of converting the Group block directly to the Cover block.
  12187. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]);
  12188. }
  12189. }],
  12190. to: [{
  12191. type: 'block',
  12192. blocks: ['core/image'],
  12193. isMatch: _ref3 => {
  12194. let {
  12195. backgroundType,
  12196. url,
  12197. overlayColor,
  12198. customOverlayColor,
  12199. gradient,
  12200. customGradient
  12201. } = _ref3;
  12202. if (url) {
  12203. // If a url exists the transform could happen if that URL represents an image background.
  12204. return backgroundType === IMAGE_BACKGROUND_TYPE;
  12205. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  12206. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  12207. },
  12208. transform: _ref4 => {
  12209. var _style$color6;
  12210. let {
  12211. title,
  12212. url,
  12213. alt,
  12214. align,
  12215. id,
  12216. anchor,
  12217. style
  12218. } = _ref4;
  12219. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  12220. caption: title,
  12221. url,
  12222. alt,
  12223. align,
  12224. id,
  12225. anchor,
  12226. style: {
  12227. color: {
  12228. duotone: style === null || style === void 0 ? void 0 : (_style$color6 = style.color) === null || _style$color6 === void 0 ? void 0 : _style$color6.duotone
  12229. }
  12230. }
  12231. });
  12232. }
  12233. }, {
  12234. type: 'block',
  12235. blocks: ['core/video'],
  12236. isMatch: _ref5 => {
  12237. let {
  12238. backgroundType,
  12239. url,
  12240. overlayColor,
  12241. customOverlayColor,
  12242. gradient,
  12243. customGradient
  12244. } = _ref5;
  12245. if (url) {
  12246. // If a url exists the transform could happen if that URL represents a video background.
  12247. return backgroundType === VIDEO_BACKGROUND_TYPE;
  12248. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  12249. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  12250. },
  12251. transform: _ref6 => {
  12252. let {
  12253. title,
  12254. url,
  12255. align,
  12256. id,
  12257. anchor
  12258. } = _ref6;
  12259. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  12260. caption: title,
  12261. src: url,
  12262. id,
  12263. align,
  12264. anchor
  12265. });
  12266. }
  12267. }, {
  12268. type: 'block',
  12269. blocks: ['core/group'],
  12270. isMatch: _ref7 => {
  12271. let {
  12272. url,
  12273. useFeaturedImage
  12274. } = _ref7;
  12275. // If the Cover block uses background media, skip this transform,
  12276. // and instead use the Group block's default transform.
  12277. if (url || useFeaturedImage) {
  12278. return false;
  12279. }
  12280. return true;
  12281. },
  12282. transform: (attributes, innerBlocks) => {
  12283. var _attributes$style, _attributes$style2, _innerBlocks$2;
  12284. // Convert Cover overlay colors to comparable Group background colors.
  12285. const transformedColorAttributes = {
  12286. backgroundColor: attributes === null || attributes === void 0 ? void 0 : attributes.overlayColor,
  12287. gradient: attributes === null || attributes === void 0 ? void 0 : attributes.gradient,
  12288. style: clean_empty_object({ ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
  12289. color: attributes !== null && attributes !== void 0 && attributes.customOverlayColor || attributes !== null && attributes !== void 0 && attributes.customGradient || attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && _attributes$style.color ? {
  12290. background: attributes === null || attributes === void 0 ? void 0 : attributes.customOverlayColor,
  12291. gradient: attributes === null || attributes === void 0 ? void 0 : attributes.customGradient,
  12292. ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : _attributes$style2.color)
  12293. } : undefined
  12294. })
  12295. }; // If the Cover block contains only a single Group block as a direct child,
  12296. // then attempt to merge the Cover's background colors with the child Group block,
  12297. // and remove the Cover block as the wrapper.
  12298. if ((innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.length) === 1 && ((_innerBlocks$2 = innerBlocks[0]) === null || _innerBlocks$2 === void 0 ? void 0 : _innerBlocks$2.name) === 'core/group') {
  12299. var _groupAttributes$styl, _groupAttributes$styl2, _groupAttributes$styl3, _groupAttributes$styl4, _transformedColorAttr, _groupAttributes$styl5, _transformedColorAttr2, _groupAttributes$styl6, _innerBlocks$4;
  12300. const groupAttributes = clean_empty_object(innerBlocks[0].attributes || {}); // If the Group block contains any kind of background color or gradient,
  12301. // skip merging Cover background colors, and preserve the Group block's colors.
  12302. if (groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.backgroundColor || groupAttributes !== null && groupAttributes !== void 0 && groupAttributes.gradient || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl = groupAttributes.style) !== null && _groupAttributes$styl !== void 0 && (_groupAttributes$styl2 = _groupAttributes$styl.color) !== null && _groupAttributes$styl2 !== void 0 && _groupAttributes$styl2.background || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl3 = groupAttributes.style) !== null && _groupAttributes$styl3 !== void 0 && (_groupAttributes$styl4 = _groupAttributes$styl3.color) !== null && _groupAttributes$styl4 !== void 0 && _groupAttributes$styl4.gradient) {
  12303. var _innerBlocks$3;
  12304. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, (_innerBlocks$3 = innerBlocks[0]) === null || _innerBlocks$3 === void 0 ? void 0 : _innerBlocks$3.innerBlocks);
  12305. }
  12306. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...transformedColorAttributes,
  12307. ...groupAttributes,
  12308. style: clean_empty_object({ ...(groupAttributes === null || groupAttributes === void 0 ? void 0 : groupAttributes.style),
  12309. color: transformedColorAttributes !== null && transformedColorAttributes !== void 0 && (_transformedColorAttr = transformedColorAttributes.style) !== null && _transformedColorAttr !== void 0 && _transformedColorAttr.color || groupAttributes !== null && groupAttributes !== void 0 && (_groupAttributes$styl5 = groupAttributes.style) !== null && _groupAttributes$styl5 !== void 0 && _groupAttributes$styl5.color ? { ...(transformedColorAttributes === null || transformedColorAttributes === void 0 ? void 0 : (_transformedColorAttr2 = transformedColorAttributes.style) === null || _transformedColorAttr2 === void 0 ? void 0 : _transformedColorAttr2.color),
  12310. ...(groupAttributes === null || groupAttributes === void 0 ? void 0 : (_groupAttributes$styl6 = groupAttributes.style) === null || _groupAttributes$styl6 === void 0 ? void 0 : _groupAttributes$styl6.color)
  12311. } : undefined
  12312. })
  12313. }, (_innerBlocks$4 = innerBlocks[0]) === null || _innerBlocks$4 === void 0 ? void 0 : _innerBlocks$4.innerBlocks);
  12314. } // In all other cases, transform the Cover block directly to a Group block.
  12315. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...attributes,
  12316. ...transformedColorAttributes
  12317. }, innerBlocks);
  12318. }
  12319. }]
  12320. };
  12321. /* harmony default export */ var cover_transforms = (cover_transforms_transforms);
  12322. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  12323. /**
  12324. * WordPress dependencies
  12325. */
  12326. /**
  12327. * Internal dependencies
  12328. */
  12329. const cover_metadata = {
  12330. $schema: "https://schemas.wp.org/trunk/block.json",
  12331. apiVersion: 2,
  12332. name: "core/cover",
  12333. title: "Cover",
  12334. category: "media",
  12335. description: "Add an image or video with a text overlay \u2014 great for headers.",
  12336. textdomain: "default",
  12337. attributes: {
  12338. url: {
  12339. type: "string"
  12340. },
  12341. useFeaturedImage: {
  12342. type: "boolean",
  12343. "default": false
  12344. },
  12345. id: {
  12346. type: "number"
  12347. },
  12348. alt: {
  12349. type: "string",
  12350. source: "attribute",
  12351. selector: "img",
  12352. attribute: "alt",
  12353. "default": ""
  12354. },
  12355. hasParallax: {
  12356. type: "boolean",
  12357. "default": false
  12358. },
  12359. isRepeated: {
  12360. type: "boolean",
  12361. "default": false
  12362. },
  12363. dimRatio: {
  12364. type: "number",
  12365. "default": 100
  12366. },
  12367. overlayColor: {
  12368. type: "string"
  12369. },
  12370. customOverlayColor: {
  12371. type: "string"
  12372. },
  12373. backgroundType: {
  12374. type: "string",
  12375. "default": "image"
  12376. },
  12377. focalPoint: {
  12378. type: "object"
  12379. },
  12380. minHeight: {
  12381. type: "number"
  12382. },
  12383. minHeightUnit: {
  12384. type: "string"
  12385. },
  12386. gradient: {
  12387. type: "string"
  12388. },
  12389. customGradient: {
  12390. type: "string"
  12391. },
  12392. contentPosition: {
  12393. type: "string"
  12394. },
  12395. isDark: {
  12396. type: "boolean",
  12397. "default": true
  12398. },
  12399. allowedBlocks: {
  12400. type: "array"
  12401. },
  12402. templateLock: {
  12403. type: ["string", "boolean"],
  12404. "enum": ["all", "insert", "contentOnly", false]
  12405. }
  12406. },
  12407. usesContext: ["postId", "postType"],
  12408. supports: {
  12409. anchor: true,
  12410. align: true,
  12411. html: false,
  12412. spacing: {
  12413. padding: true,
  12414. margin: ["top", "bottom"],
  12415. __experimentalDefaultControls: {
  12416. padding: true
  12417. }
  12418. },
  12419. color: {
  12420. __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
  12421. text: false,
  12422. background: false
  12423. },
  12424. typography: {
  12425. fontSize: true,
  12426. lineHeight: true,
  12427. __experimentalFontFamily: true,
  12428. __experimentalFontWeight: true,
  12429. __experimentalFontStyle: true,
  12430. __experimentalTextTransform: true,
  12431. __experimentalTextDecoration: true,
  12432. __experimentalLetterSpacing: true,
  12433. __experimentalDefaultControls: {
  12434. fontSize: true
  12435. }
  12436. }
  12437. },
  12438. editorStyle: "wp-block-cover-editor",
  12439. style: "wp-block-cover"
  12440. };
  12441. const {
  12442. name: cover_name
  12443. } = cover_metadata;
  12444. const cover_settings = {
  12445. icon: library_cover,
  12446. example: {
  12447. attributes: {
  12448. customOverlayColor: '#065174',
  12449. dimRatio: 40,
  12450. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  12451. },
  12452. innerBlocks: [{
  12453. name: 'core/paragraph',
  12454. attributes: {
  12455. customFontSize: 48,
  12456. content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
  12457. align: 'center'
  12458. }
  12459. }]
  12460. },
  12461. transforms: cover_transforms,
  12462. save: cover_save_save,
  12463. edit: cover_edit,
  12464. deprecated: cover_deprecated
  12465. };
  12466. const cover_init = () => initBlock({
  12467. name: cover_name,
  12468. metadata: cover_metadata,
  12469. settings: cover_settings
  12470. });
  12471. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
  12472. /**
  12473. * WordPress dependencies
  12474. */
  12475. const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  12476. xmlns: "http://www.w3.org/2000/svg",
  12477. viewBox: "0 0 24 24"
  12478. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  12479. d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
  12480. }));
  12481. /* harmony default export */ var library_pencil = (pencil);
  12482. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
  12483. /**
  12484. * Internal dependencies
  12485. */
  12486. /* harmony default export */ var library_edit = (library_pencil);
  12487. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js
  12488. /**
  12489. * WordPress dependencies
  12490. */
  12491. function getResponsiveHelp(checked) {
  12492. return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.');
  12493. }
  12494. const EmbedControls = _ref => {
  12495. let {
  12496. blockSupportsResponsive,
  12497. showEditButton,
  12498. themeSupportsResponsive,
  12499. allowResponsive,
  12500. toggleResponsive,
  12501. switchBackToURLInput
  12502. } = _ref;
  12503. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  12504. className: "components-toolbar__control",
  12505. label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'),
  12506. icon: library_edit,
  12507. onClick: switchBackToURLInput
  12508. }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12509. title: (0,external_wp_i18n_namespaceObject.__)('Media settings'),
  12510. className: "blocks-responsive"
  12511. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12512. label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'),
  12513. checked: allowResponsive,
  12514. help: getResponsiveHelp,
  12515. onChange: toggleResponsive
  12516. }))));
  12517. };
  12518. /* harmony default export */ var embed_controls = (EmbedControls);
  12519. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js
  12520. /**
  12521. * WordPress dependencies
  12522. */
  12523. const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12524. viewBox: "0 0 24 24",
  12525. xmlns: "http://www.w3.org/2000/svg"
  12526. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12527. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"
  12528. }));
  12529. const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12530. viewBox: "0 0 24 24",
  12531. xmlns: "http://www.w3.org/2000/svg"
  12532. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12533. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"
  12534. }));
  12535. const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12536. viewBox: "0 0 24 24",
  12537. xmlns: "http://www.w3.org/2000/svg"
  12538. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12539. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  12540. }));
  12541. const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12542. viewBox: "0 0 24 24",
  12543. xmlns: "http://www.w3.org/2000/svg"
  12544. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12545. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"
  12546. }));
  12547. const embedTwitterIcon = {
  12548. foreground: '#1da1f2',
  12549. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12550. xmlns: "http://www.w3.org/2000/svg",
  12551. viewBox: "0 0 24 24"
  12552. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12553. d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"
  12554. })))
  12555. };
  12556. const embedYouTubeIcon = {
  12557. foreground: '#ff0000',
  12558. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12559. viewBox: "0 0 24 24"
  12560. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12561. d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"
  12562. }))
  12563. };
  12564. const embedFacebookIcon = {
  12565. foreground: '#3b5998',
  12566. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12567. viewBox: "0 0 24 24"
  12568. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12569. d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"
  12570. }))
  12571. };
  12572. const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12573. viewBox: "0 0 24 24"
  12574. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12575. d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"
  12576. })));
  12577. const embedWordPressIcon = {
  12578. foreground: '#0073AA',
  12579. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12580. viewBox: "0 0 24 24"
  12581. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12582. d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"
  12583. })))
  12584. };
  12585. const embedSpotifyIcon = {
  12586. foreground: '#1db954',
  12587. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12588. viewBox: "0 0 24 24"
  12589. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12590. d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"
  12591. }))
  12592. };
  12593. const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12594. viewBox: "0 0 24 24"
  12595. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12596. d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"
  12597. }));
  12598. const embedVimeoIcon = {
  12599. foreground: '#1ab7ea',
  12600. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12601. xmlns: "http://www.w3.org/2000/svg",
  12602. viewBox: "0 0 24 24"
  12603. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12604. d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"
  12605. })))
  12606. };
  12607. const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12608. viewBox: "0 0 24 24"
  12609. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12610. d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"
  12611. }));
  12612. const embedTumblrIcon = {
  12613. foreground: '#35465c',
  12614. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12615. viewBox: "0 0 24 24"
  12616. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12617. d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"
  12618. }))
  12619. };
  12620. const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12621. viewBox: "0 0 24 24"
  12622. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12623. d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"
  12624. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12625. d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"
  12626. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12627. d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"
  12628. }));
  12629. const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12630. viewBox: "0 0 24 24"
  12631. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12632. d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",
  12633. fill: "#4bc7ee"
  12634. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12635. d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",
  12636. fill: "#d4cdcb"
  12637. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12638. d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",
  12639. fill: "#c3d82e"
  12640. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12641. d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",
  12642. fill: "#e4ecb0"
  12643. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12644. d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z",
  12645. fill: "#209dbd"
  12646. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12647. d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",
  12648. fill: "#7cb3c9"
  12649. }));
  12650. const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12651. viewBox: "0 0 24 24"
  12652. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12653. d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",
  12654. fill: "#333436"
  12655. }));
  12656. const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12657. width: "24",
  12658. height: "24",
  12659. viewBox: "0 0 24 24",
  12660. version: "1.1"
  12661. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12662. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  12663. }));
  12664. const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12665. viewBox: "0 0 44 44"
  12666. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12667. d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"
  12668. }));
  12669. const embedPocketCastsIcon = {
  12670. foreground: '#f43e37',
  12671. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  12672. width: "24",
  12673. height: "24",
  12674. viewBox: "0 0 24 24",
  12675. fill: "none",
  12676. xmlns: "http://www.w3.org/2000/svg"
  12677. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12678. fillRule: "evenodd",
  12679. clipRule: "evenodd",
  12680. d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z"
  12681. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  12682. fillRule: "evenodd",
  12683. clipRule: "evenodd",
  12684. d: "M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z",
  12685. fill: "#fff"
  12686. }))
  12687. };
  12688. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js
  12689. /**
  12690. * WordPress dependencies
  12691. */
  12692. const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", {
  12693. className: "wp-block-embed is-loading"
  12694. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  12695. /* harmony default export */ var embed_loading = (EmbedLoading);
  12696. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js
  12697. /**
  12698. * WordPress dependencies
  12699. */
  12700. const EmbedPlaceholder = _ref => {
  12701. let {
  12702. icon,
  12703. label,
  12704. value,
  12705. onSubmit,
  12706. onChange,
  12707. cannotEmbed,
  12708. fallback,
  12709. tryAgain
  12710. } = _ref;
  12711. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  12712. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  12713. icon: icon,
  12714. showColors: true
  12715. }),
  12716. label: label,
  12717. className: "wp-block-embed",
  12718. instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.')
  12719. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  12720. onSubmit: onSubmit
  12721. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  12722. type: "url",
  12723. value: value || '',
  12724. className: "components-placeholder__input",
  12725. "aria-label": label,
  12726. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'),
  12727. onChange: onChange
  12728. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  12729. variant: "primary",
  12730. type: "submit"
  12731. }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  12732. className: "components-placeholder__learn-more"
  12733. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  12734. href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/')
  12735. }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", {
  12736. className: "components-placeholder__error"
  12737. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  12738. className: "components-placeholder__instructions"
  12739. }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  12740. variant: "secondary",
  12741. onClick: tryAgain
  12742. }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  12743. variant: "secondary",
  12744. onClick: fallback
  12745. }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label'))));
  12746. };
  12747. /* harmony default export */ var embed_placeholder = (EmbedPlaceholder);
  12748. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js
  12749. /**
  12750. * WordPress dependencies
  12751. */
  12752. /** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
  12753. const attributeMap = {
  12754. class: 'className',
  12755. frameborder: 'frameBorder',
  12756. marginheight: 'marginHeight',
  12757. marginwidth: 'marginWidth'
  12758. };
  12759. function WpEmbedPreview(_ref) {
  12760. let {
  12761. html
  12762. } = _ref;
  12763. const ref = (0,external_wp_element_namespaceObject.useRef)();
  12764. const props = (0,external_wp_element_namespaceObject.useMemo)(() => {
  12765. const doc = new window.DOMParser().parseFromString(html, 'text/html');
  12766. const iframe = doc.querySelector('iframe');
  12767. const iframeProps = {};
  12768. if (!iframe) return iframeProps;
  12769. Array.from(iframe.attributes).forEach(_ref2 => {
  12770. let {
  12771. name,
  12772. value
  12773. } = _ref2;
  12774. if (name === 'style') return;
  12775. iframeProps[attributeMap[name] || name] = value;
  12776. });
  12777. return iframeProps;
  12778. }, [html]);
  12779. (0,external_wp_element_namespaceObject.useEffect)(() => {
  12780. const {
  12781. ownerDocument
  12782. } = ref.current;
  12783. const {
  12784. defaultView
  12785. } = ownerDocument;
  12786. /**
  12787. * Checks for WordPress embed events signaling the height change when
  12788. * iframe content loads or iframe's window is resized. The event is
  12789. * sent from WordPress core via the window.postMessage API.
  12790. *
  12791. * References:
  12792. * window.postMessage:
  12793. * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
  12794. * WordPress core embed-template on load:
  12795. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143
  12796. * WordPress core embed-template on resize:
  12797. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187
  12798. *
  12799. * @param {MessageEvent} event Message event.
  12800. */
  12801. function resizeWPembeds(_ref3) {
  12802. let {
  12803. data: {
  12804. secret,
  12805. message,
  12806. value
  12807. } = {}
  12808. } = _ref3;
  12809. if (message !== 'height' || secret !== props['data-secret']) {
  12810. return;
  12811. }
  12812. ref.current.height = value;
  12813. }
  12814. defaultView.addEventListener('message', resizeWPembeds);
  12815. return () => {
  12816. defaultView.removeEventListener('message', resizeWPembeds);
  12817. };
  12818. }, []);
  12819. return (0,external_wp_element_namespaceObject.createElement)("div", {
  12820. className: "wp-block-embed__wrapper"
  12821. }, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({
  12822. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
  12823. title: props.title
  12824. }, props)));
  12825. }
  12826. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js
  12827. /**
  12828. * Internal dependencies
  12829. */
  12830. /**
  12831. * External dependencies
  12832. */
  12833. /**
  12834. * WordPress dependencies
  12835. */
  12836. /**
  12837. * Internal dependencies
  12838. */
  12839. class EmbedPreview extends external_wp_element_namespaceObject.Component {
  12840. constructor() {
  12841. super(...arguments);
  12842. this.hideOverlay = this.hideOverlay.bind(this);
  12843. this.state = {
  12844. interactive: false
  12845. };
  12846. }
  12847. static getDerivedStateFromProps(nextProps, state) {
  12848. if (!nextProps.isSelected && state.interactive) {
  12849. // We only want to change this when the block is not selected, because changing it when
  12850. // the block becomes selected makes the overlap disappear too early. Hiding the overlay
  12851. // happens on mouseup when the overlay is clicked.
  12852. return {
  12853. interactive: false
  12854. };
  12855. }
  12856. return null;
  12857. }
  12858. hideOverlay() {
  12859. // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
  12860. // changing, because that happens on mouse down, and the overlay immediately disappears,
  12861. // and the mouse event can end up in the preview content. We can't use onClick on
  12862. // the overlay to hide it either, because then the editor misses the mouseup event, and
  12863. // thinks we're multi-selecting blocks.
  12864. this.setState({
  12865. interactive: true
  12866. });
  12867. }
  12868. render() {
  12869. const {
  12870. preview,
  12871. previewable,
  12872. url,
  12873. type,
  12874. caption,
  12875. onCaptionChange,
  12876. isSelected,
  12877. className,
  12878. icon,
  12879. label,
  12880. insertBlocksAfter
  12881. } = this.props;
  12882. const {
  12883. scripts
  12884. } = preview;
  12885. const {
  12886. interactive
  12887. } = this.state;
  12888. const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
  12889. const parsedHost = new URL(url).host.split('.');
  12890. const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
  12891. const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com
  12892. (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl);
  12893. const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality
  12894. // as far as the user is concerned. We're just catching the first click so that
  12895. // the block can be selected without interacting with the embed preview that the overlay covers.
  12896. /* eslint-disable jsx-a11y/no-static-element-interactions */
  12897. const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, {
  12898. html: html
  12899. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  12900. className: "wp-block-embed__wrapper"
  12901. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  12902. html: html,
  12903. scripts: scripts,
  12904. title: iframeTitle,
  12905. type: sandboxClassnames,
  12906. onFocus: this.hideOverlay
  12907. }), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", {
  12908. className: "block-library-embed__interactive-overlay",
  12909. onMouseUp: this.hideOverlay
  12910. }));
  12911. /* eslint-enable jsx-a11y/no-static-element-interactions */
  12912. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  12913. className: dedupe_default()(className, 'wp-block-embed', {
  12914. 'is-type-video': 'video' === type
  12915. })
  12916. }, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  12917. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  12918. icon: icon,
  12919. showColors: true
  12920. }),
  12921. label: label
  12922. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  12923. className: "components-placeholder__error"
  12924. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  12925. href: url
  12926. }, url)), (0,external_wp_element_namespaceObject.createElement)("p", {
  12927. className: "components-placeholder__error"
  12928. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  12929. /* translators: %s: host providing embed content e.g: www.youtube.com */
  12930. (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  12931. tagName: "figcaption",
  12932. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  12933. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  12934. value: caption,
  12935. onChange: onCaptionChange,
  12936. inlineToolbar: true,
  12937. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  12938. }));
  12939. }
  12940. }
  12941. /* harmony default export */ var embed_preview = (EmbedPreview);
  12942. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js
  12943. /**
  12944. * Internal dependencies
  12945. */
  12946. /**
  12947. * External dependencies
  12948. */
  12949. /**
  12950. * WordPress dependencies
  12951. */
  12952. const EmbedEdit = props => {
  12953. const {
  12954. attributes: {
  12955. providerNameSlug,
  12956. previewable,
  12957. responsive,
  12958. url: attributesUrl
  12959. },
  12960. attributes,
  12961. isSelected,
  12962. onReplace,
  12963. setAttributes,
  12964. insertBlocksAfter,
  12965. onFocus
  12966. } = props;
  12967. const defaultEmbedInfo = {
  12968. title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'),
  12969. icon: embedContentIcon
  12970. };
  12971. const {
  12972. icon,
  12973. title
  12974. } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
  12975. const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl);
  12976. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  12977. const {
  12978. invalidateResolution
  12979. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  12980. const {
  12981. preview,
  12982. fetching,
  12983. themeSupportsResponsive,
  12984. cannotEmbed
  12985. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  12986. var _embedPreview$data;
  12987. const {
  12988. getEmbedPreview,
  12989. isPreviewEmbedFallback,
  12990. isRequestingEmbedPreview,
  12991. getThemeSupports
  12992. } = select(external_wp_coreData_namespaceObject.store);
  12993. if (!attributesUrl) {
  12994. return {
  12995. fetching: false,
  12996. cannotEmbed: false
  12997. };
  12998. }
  12999. const embedPreview = getEmbedPreview(attributesUrl);
  13000. const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html.
  13001. const badEmbedProvider = (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.html) === false && (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.type) === undefined; // Some WordPress URLs that can't be embedded will cause the API to return
  13002. // a valid JSON response with no HTML and `data.status` set to 404, rather
  13003. // than generating a fallback response as other embeds do.
  13004. const wordpressCantEmbed = (embedPreview === null || embedPreview === void 0 ? void 0 : (_embedPreview$data = embedPreview.data) === null || _embedPreview$data === void 0 ? void 0 : _embedPreview$data.status) === 404;
  13005. const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed;
  13006. return {
  13007. preview: validPreview ? embedPreview : undefined,
  13008. fetching: isRequestingEmbedPreview(attributesUrl),
  13009. themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
  13010. cannotEmbed: !validPreview || previewIsFallback
  13011. };
  13012. }, [attributesUrl]);
  13013. /**
  13014. * Returns the attributes derived from the preview, merged with the current attributes.
  13015. *
  13016. * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.
  13017. * @return {Object} Merged attributes.
  13018. */
  13019. const getMergedAttributes = function () {
  13020. let ignorePreviousClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  13021. return getMergedAttributesWithPreview(attributes, preview, title, responsive, ignorePreviousClassName);
  13022. };
  13023. const toggleResponsive = () => {
  13024. const {
  13025. allowResponsive,
  13026. className
  13027. } = attributes;
  13028. const {
  13029. html
  13030. } = preview;
  13031. const newAllowResponsive = !allowResponsive;
  13032. setAttributes({
  13033. allowResponsive: newAllowResponsive,
  13034. className: getClassNames(html, className, responsive && newAllowResponsive)
  13035. });
  13036. };
  13037. (0,external_wp_element_namespaceObject.useEffect)(() => {
  13038. if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) {
  13039. return;
  13040. } // At this stage, we're not fetching the preview and know it can't be embedded,
  13041. // so try removing any trailing slash, and resubmit.
  13042. const newURL = attributesUrl.replace(/\/$/, '');
  13043. setURL(newURL);
  13044. setIsEditingURL(false);
  13045. setAttributes({
  13046. url: newURL
  13047. });
  13048. }, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview.
  13049. (0,external_wp_element_namespaceObject.useEffect)(() => {
  13050. if (preview && !isEditingURL) {
  13051. // When obtaining an incoming preview, we set the attributes derived from
  13052. // the preview data. In this case when getting the merged attributes,
  13053. // we ignore the previous classname because it might not match the expected
  13054. // classes by the new preview.
  13055. setAttributes(getMergedAttributes(true));
  13056. if (onReplace) {
  13057. const upgradedBlock = createUpgradedEmbedBlock(props, getMergedAttributes());
  13058. if (upgradedBlock) {
  13059. onReplace(upgradedBlock);
  13060. }
  13061. }
  13062. }
  13063. }, [preview, isEditingURL]);
  13064. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  13065. if (fetching) {
  13066. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null));
  13067. } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
  13068. const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button.
  13069. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL;
  13070. if (showEmbedPlaceholder) {
  13071. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, {
  13072. icon: icon,
  13073. label: label,
  13074. onFocus: onFocus,
  13075. onSubmit: event => {
  13076. if (event) {
  13077. event.preventDefault();
  13078. }
  13079. setIsEditingURL(false);
  13080. setAttributes({
  13081. url
  13082. });
  13083. },
  13084. value: url,
  13085. cannotEmbed: cannotEmbed,
  13086. onChange: event => setURL(event.target.value),
  13087. fallback: () => fallback(url, onReplace),
  13088. tryAgain: () => {
  13089. invalidateResolution('getEmbedPreview', [url]);
  13090. }
  13091. }));
  13092. } // Even though we set attributes that get derived from the preview,
  13093. // we don't access them directly because for the initial render,
  13094. // the `setAttributes` call will not have taken effect. If we're
  13095. // rendering responsive content, setting the responsive classes
  13096. // after the preview has been rendered can result in unwanted
  13097. // clipping or scrollbars. The `getAttributesFromPreview` function
  13098. // that `getMergedAttributes` uses is memoized so that we're not
  13099. // calculating them on every render.
  13100. const {
  13101. caption,
  13102. type,
  13103. allowResponsive,
  13104. className: classFromPreview
  13105. } = getMergedAttributes();
  13106. const className = classnames_default()(classFromPreview, props.className);
  13107. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, {
  13108. showEditButton: preview && !cannotEmbed,
  13109. themeSupportsResponsive: themeSupportsResponsive,
  13110. blockSupportsResponsive: responsive,
  13111. allowResponsive: allowResponsive,
  13112. toggleResponsive: toggleResponsive,
  13113. switchBackToURLInput: () => setIsEditingURL(true)
  13114. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, {
  13115. preview: preview,
  13116. previewable: previewable,
  13117. className: className,
  13118. url: url,
  13119. type: type,
  13120. caption: caption,
  13121. onCaptionChange: value => setAttributes({
  13122. caption: value
  13123. }),
  13124. isSelected: isSelected,
  13125. icon: icon,
  13126. label: label,
  13127. insertBlocksAfter: insertBlocksAfter
  13128. })));
  13129. };
  13130. /* harmony default export */ var embed_edit = (EmbedEdit);
  13131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js
  13132. /**
  13133. * External dependencies
  13134. */
  13135. /**
  13136. * WordPress dependencies
  13137. */
  13138. function embed_save_save(_ref) {
  13139. let {
  13140. attributes
  13141. } = _ref;
  13142. const {
  13143. url,
  13144. caption,
  13145. type,
  13146. providerNameSlug
  13147. } = attributes;
  13148. if (!url) {
  13149. return null;
  13150. }
  13151. const className = dedupe_default()('wp-block-embed', {
  13152. [`is-type-${type}`]: type,
  13153. [`is-provider-${providerNameSlug}`]: providerNameSlug,
  13154. [`wp-block-embed-${providerNameSlug}`]: providerNameSlug
  13155. });
  13156. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  13157. className
  13158. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  13159. className: "wp-block-embed__wrapper"
  13160. }, `\n${url}\n`
  13161. /* URL needs to be on its own line. */
  13162. ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13163. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  13164. tagName: "figcaption",
  13165. value: caption
  13166. }));
  13167. }
  13168. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js
  13169. /**
  13170. * WordPress dependencies
  13171. */
  13172. /**
  13173. * Internal dependencies
  13174. */
  13175. const transforms_metadata = {
  13176. $schema: "https://schemas.wp.org/trunk/block.json",
  13177. apiVersion: 2,
  13178. name: "core/embed",
  13179. title: "Embed",
  13180. category: "embed",
  13181. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  13182. textdomain: "default",
  13183. attributes: {
  13184. url: {
  13185. type: "string"
  13186. },
  13187. caption: {
  13188. type: "string",
  13189. source: "html",
  13190. selector: "figcaption"
  13191. },
  13192. type: {
  13193. type: "string"
  13194. },
  13195. providerNameSlug: {
  13196. type: "string"
  13197. },
  13198. allowResponsive: {
  13199. type: "boolean",
  13200. "default": true
  13201. },
  13202. responsive: {
  13203. type: "boolean",
  13204. "default": false
  13205. },
  13206. previewable: {
  13207. type: "boolean",
  13208. "default": true
  13209. }
  13210. },
  13211. supports: {
  13212. align: true
  13213. },
  13214. editorStyle: "wp-block-embed-editor",
  13215. style: "wp-block-embed"
  13216. };
  13217. const {
  13218. name: EMBED_BLOCK
  13219. } = transforms_metadata;
  13220. /**
  13221. * Default transforms for generic embeds.
  13222. */
  13223. const embed_transforms_transforms = {
  13224. from: [{
  13225. type: 'raw',
  13226. isMatch: node => {
  13227. var _node$textContent, _node$textContent$mat;
  13228. return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1;
  13229. },
  13230. transform: node => {
  13231. return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, {
  13232. url: node.textContent.trim()
  13233. });
  13234. }
  13235. }],
  13236. to: [{
  13237. type: 'block',
  13238. blocks: ['core/paragraph'],
  13239. isMatch: _ref => {
  13240. let {
  13241. url
  13242. } = _ref;
  13243. return !!url;
  13244. },
  13245. transform: _ref2 => {
  13246. let {
  13247. url,
  13248. caption
  13249. } = _ref2;
  13250. let value = `<a href="${url}">${url}</a>`;
  13251. if (caption !== null && caption !== void 0 && caption.trim()) {
  13252. value += `<br />${caption}`;
  13253. }
  13254. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  13255. content: value
  13256. });
  13257. }
  13258. }]
  13259. };
  13260. /* harmony default export */ var embed_transforms = (embed_transforms_transforms);
  13261. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js
  13262. /**
  13263. * WordPress dependencies
  13264. */
  13265. /**
  13266. * Internal dependencies
  13267. */
  13268. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  13269. /**
  13270. * Template option choices for predefined columns layouts.
  13271. *
  13272. * @type {WPBlockVariation[]}
  13273. */
  13274. const variations_variations = [{
  13275. name: 'twitter',
  13276. title: 'Twitter',
  13277. icon: embedTwitterIcon,
  13278. keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')],
  13279. description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'),
  13280. patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i],
  13281. attributes: {
  13282. providerNameSlug: 'twitter',
  13283. responsive: true
  13284. }
  13285. }, {
  13286. name: 'youtube',
  13287. title: 'YouTube',
  13288. icon: embedYouTubeIcon,
  13289. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')],
  13290. description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'),
  13291. patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i],
  13292. attributes: {
  13293. providerNameSlug: 'youtube',
  13294. responsive: true
  13295. }
  13296. }, {
  13297. // Deprecate Facebook Embed per FB policy
  13298. // See: https://developers.facebook.com/docs/plugins/oembed-legacy
  13299. name: 'facebook',
  13300. title: 'Facebook',
  13301. icon: embedFacebookIcon,
  13302. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  13303. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'),
  13304. scope: ['block'],
  13305. patterns: [],
  13306. attributes: {
  13307. providerNameSlug: 'facebook',
  13308. previewable: false,
  13309. responsive: true
  13310. }
  13311. }, {
  13312. // Deprecate Instagram per FB policy
  13313. // See: https://developers.facebook.com/docs/instagram/oembed-legacy
  13314. name: 'instagram',
  13315. title: 'Instagram',
  13316. icon: embedInstagramIcon,
  13317. keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')],
  13318. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'),
  13319. scope: ['block'],
  13320. patterns: [],
  13321. attributes: {
  13322. providerNameSlug: 'instagram',
  13323. responsive: true
  13324. }
  13325. }, {
  13326. name: 'wordpress',
  13327. title: 'WordPress',
  13328. icon: embedWordPressIcon,
  13329. keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')],
  13330. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'),
  13331. attributes: {
  13332. providerNameSlug: 'wordpress'
  13333. }
  13334. }, {
  13335. name: 'soundcloud',
  13336. title: 'SoundCloud',
  13337. icon: embedAudioIcon,
  13338. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  13339. description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'),
  13340. patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],
  13341. attributes: {
  13342. providerNameSlug: 'soundcloud',
  13343. responsive: true
  13344. }
  13345. }, {
  13346. name: 'spotify',
  13347. title: 'Spotify',
  13348. icon: embedSpotifyIcon,
  13349. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  13350. description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'),
  13351. patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i],
  13352. attributes: {
  13353. providerNameSlug: 'spotify',
  13354. responsive: true
  13355. }
  13356. }, {
  13357. name: 'flickr',
  13358. title: 'Flickr',
  13359. icon: embedFlickrIcon,
  13360. keywords: [(0,external_wp_i18n_namespaceObject.__)('image')],
  13361. description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'),
  13362. patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i],
  13363. attributes: {
  13364. providerNameSlug: 'flickr',
  13365. responsive: true
  13366. }
  13367. }, {
  13368. name: 'vimeo',
  13369. title: 'Vimeo',
  13370. icon: embedVimeoIcon,
  13371. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  13372. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'),
  13373. patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i],
  13374. attributes: {
  13375. providerNameSlug: 'vimeo',
  13376. responsive: true
  13377. }
  13378. }, {
  13379. name: 'animoto',
  13380. title: 'Animoto',
  13381. icon: embedAnimotoIcon,
  13382. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'),
  13383. patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],
  13384. attributes: {
  13385. providerNameSlug: 'animoto',
  13386. responsive: true
  13387. }
  13388. }, {
  13389. name: 'cloudup',
  13390. title: 'Cloudup',
  13391. icon: embedContentIcon,
  13392. description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'),
  13393. patterns: [/^https?:\/\/cloudup\.com\/.+/i],
  13394. attributes: {
  13395. providerNameSlug: 'cloudup',
  13396. responsive: true
  13397. }
  13398. }, {
  13399. // Deprecated since CollegeHumor content is now powered by YouTube.
  13400. name: 'collegehumor',
  13401. title: 'CollegeHumor',
  13402. icon: embedVideoIcon,
  13403. description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'),
  13404. scope: ['block'],
  13405. patterns: [],
  13406. attributes: {
  13407. providerNameSlug: 'collegehumor',
  13408. responsive: true
  13409. }
  13410. }, {
  13411. name: 'crowdsignal',
  13412. title: 'Crowdsignal',
  13413. icon: embedContentIcon,
  13414. keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')],
  13415. description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'),
  13416. patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],
  13417. attributes: {
  13418. providerNameSlug: 'crowdsignal',
  13419. responsive: true
  13420. }
  13421. }, {
  13422. name: 'dailymotion',
  13423. title: 'Dailymotion',
  13424. icon: embedDailymotionIcon,
  13425. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  13426. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'),
  13427. patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],
  13428. attributes: {
  13429. providerNameSlug: 'dailymotion',
  13430. responsive: true
  13431. }
  13432. }, {
  13433. name: 'imgur',
  13434. title: 'Imgur',
  13435. icon: embedPhotoIcon,
  13436. description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'),
  13437. patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i],
  13438. attributes: {
  13439. providerNameSlug: 'imgur',
  13440. responsive: true
  13441. }
  13442. }, {
  13443. name: 'issuu',
  13444. title: 'Issuu',
  13445. icon: embedContentIcon,
  13446. description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'),
  13447. patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i],
  13448. attributes: {
  13449. providerNameSlug: 'issuu',
  13450. responsive: true
  13451. }
  13452. }, {
  13453. name: 'kickstarter',
  13454. title: 'Kickstarter',
  13455. icon: embedContentIcon,
  13456. description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'),
  13457. patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i],
  13458. attributes: {
  13459. providerNameSlug: 'kickstarter',
  13460. responsive: true
  13461. }
  13462. }, {
  13463. name: 'mixcloud',
  13464. title: 'Mixcloud',
  13465. icon: embedAudioIcon,
  13466. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  13467. description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'),
  13468. patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],
  13469. attributes: {
  13470. providerNameSlug: 'mixcloud',
  13471. responsive: true
  13472. }
  13473. }, {
  13474. name: 'pocketcasts',
  13475. title: 'Pocket Casts',
  13476. icon: embedPocketCastsIcon,
  13477. keywords: [(0,external_wp_i18n_namespaceObject.__)('podcast'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  13478. description: (0,external_wp_i18n_namespaceObject.__)('Embed a podcast player from Pocket Casts.'),
  13479. patterns: [/^https:\/\/pca.st\/\w+/i],
  13480. attributes: {
  13481. providerNameSlug: 'pocketcasts',
  13482. responsive: true
  13483. }
  13484. }, {
  13485. name: 'reddit',
  13486. title: 'Reddit',
  13487. icon: embedRedditIcon,
  13488. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'),
  13489. patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i],
  13490. attributes: {
  13491. providerNameSlug: 'reddit',
  13492. responsive: true
  13493. }
  13494. }, {
  13495. name: 'reverbnation',
  13496. title: 'ReverbNation',
  13497. icon: embedAudioIcon,
  13498. description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'),
  13499. patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],
  13500. attributes: {
  13501. providerNameSlug: 'reverbnation',
  13502. responsive: true
  13503. }
  13504. }, {
  13505. name: 'screencast',
  13506. title: 'Screencast',
  13507. icon: embedVideoIcon,
  13508. description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'),
  13509. patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i],
  13510. attributes: {
  13511. providerNameSlug: 'screencast',
  13512. responsive: true
  13513. }
  13514. }, {
  13515. name: 'scribd',
  13516. title: 'Scribd',
  13517. icon: embedContentIcon,
  13518. description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'),
  13519. patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i],
  13520. attributes: {
  13521. providerNameSlug: 'scribd',
  13522. responsive: true
  13523. }
  13524. }, {
  13525. name: 'slideshare',
  13526. title: 'Slideshare',
  13527. icon: embedContentIcon,
  13528. description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'),
  13529. patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],
  13530. attributes: {
  13531. providerNameSlug: 'slideshare',
  13532. responsive: true
  13533. }
  13534. }, {
  13535. name: 'smugmug',
  13536. title: 'SmugMug',
  13537. icon: embedPhotoIcon,
  13538. description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'),
  13539. patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],
  13540. attributes: {
  13541. providerNameSlug: 'smugmug',
  13542. previewable: false,
  13543. responsive: true
  13544. }
  13545. }, {
  13546. name: 'speaker-deck',
  13547. title: 'Speaker Deck',
  13548. icon: embedContentIcon,
  13549. description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'),
  13550. patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],
  13551. attributes: {
  13552. providerNameSlug: 'speaker-deck',
  13553. responsive: true
  13554. }
  13555. }, {
  13556. name: 'tiktok',
  13557. title: 'TikTok',
  13558. icon: embedVideoIcon,
  13559. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  13560. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'),
  13561. patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i],
  13562. attributes: {
  13563. providerNameSlug: 'tiktok',
  13564. responsive: true
  13565. }
  13566. }, {
  13567. name: 'ted',
  13568. title: 'TED',
  13569. icon: embedVideoIcon,
  13570. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'),
  13571. patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],
  13572. attributes: {
  13573. providerNameSlug: 'ted',
  13574. responsive: true
  13575. }
  13576. }, {
  13577. name: 'tumblr',
  13578. title: 'Tumblr',
  13579. icon: embedTumblrIcon,
  13580. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  13581. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'),
  13582. patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i],
  13583. attributes: {
  13584. providerNameSlug: 'tumblr',
  13585. responsive: true
  13586. }
  13587. }, {
  13588. name: 'videopress',
  13589. title: 'VideoPress',
  13590. icon: embedVideoIcon,
  13591. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  13592. description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'),
  13593. patterns: [/^https?:\/\/videopress\.com\/.+/i],
  13594. attributes: {
  13595. providerNameSlug: 'videopress',
  13596. responsive: true
  13597. }
  13598. }, {
  13599. name: 'wordpress-tv',
  13600. title: 'WordPress.tv',
  13601. icon: embedVideoIcon,
  13602. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'),
  13603. patterns: [/^https?:\/\/wordpress\.tv\/.+/i],
  13604. attributes: {
  13605. providerNameSlug: 'wordpress-tv',
  13606. responsive: true
  13607. }
  13608. }, {
  13609. name: 'amazon-kindle',
  13610. title: 'Amazon Kindle',
  13611. icon: embedAmazonIcon,
  13612. keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')],
  13613. description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'),
  13614. patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],
  13615. attributes: {
  13616. providerNameSlug: 'amazon-kindle'
  13617. }
  13618. }, {
  13619. name: 'pinterest',
  13620. title: 'Pinterest',
  13621. icon: embedPinterestIcon,
  13622. keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')],
  13623. description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'),
  13624. patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],
  13625. attributes: {
  13626. providerNameSlug: 'pinterest'
  13627. }
  13628. }, {
  13629. name: 'wolfram-cloud',
  13630. title: 'Wolfram',
  13631. icon: embedWolframIcon,
  13632. description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'),
  13633. patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],
  13634. attributes: {
  13635. providerNameSlug: 'wolfram-cloud',
  13636. responsive: true
  13637. }
  13638. }];
  13639. /**
  13640. * Add `isActive` function to all `embed` variations, if not defined.
  13641. * `isActive` function is used to find a variation match from a created
  13642. * Block by providing its attributes.
  13643. */
  13644. variations_variations.forEach(variation => {
  13645. if (variation.isActive) return;
  13646. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug;
  13647. });
  13648. /* harmony default export */ var embed_variations = (variations_variations);
  13649. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js
  13650. /**
  13651. * External dependencies
  13652. */
  13653. /**
  13654. * Internal dependencies
  13655. */
  13656. const embed_deprecated_metadata = {
  13657. $schema: "https://schemas.wp.org/trunk/block.json",
  13658. apiVersion: 2,
  13659. name: "core/embed",
  13660. title: "Embed",
  13661. category: "embed",
  13662. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  13663. textdomain: "default",
  13664. attributes: {
  13665. url: {
  13666. type: "string"
  13667. },
  13668. caption: {
  13669. type: "string",
  13670. source: "html",
  13671. selector: "figcaption"
  13672. },
  13673. type: {
  13674. type: "string"
  13675. },
  13676. providerNameSlug: {
  13677. type: "string"
  13678. },
  13679. allowResponsive: {
  13680. type: "boolean",
  13681. "default": true
  13682. },
  13683. responsive: {
  13684. type: "boolean",
  13685. "default": false
  13686. },
  13687. previewable: {
  13688. type: "boolean",
  13689. "default": true
  13690. }
  13691. },
  13692. supports: {
  13693. align: true
  13694. },
  13695. editorStyle: "wp-block-embed-editor",
  13696. style: "wp-block-embed"
  13697. };
  13698. /**
  13699. * WordPress dependencies
  13700. */
  13701. const {
  13702. attributes: embed_deprecated_blockAttributes
  13703. } = embed_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
  13704. // to the embed figcaption element.
  13705. const deprecated_v2 = {
  13706. attributes: embed_deprecated_blockAttributes,
  13707. save(_ref) {
  13708. let {
  13709. attributes
  13710. } = _ref;
  13711. const {
  13712. url,
  13713. caption,
  13714. type,
  13715. providerNameSlug
  13716. } = attributes;
  13717. if (!url) {
  13718. return null;
  13719. }
  13720. const className = classnames_default()('wp-block-embed', {
  13721. [`is-type-${type}`]: type,
  13722. [`is-provider-${providerNameSlug}`]: providerNameSlug,
  13723. [`wp-block-embed-${providerNameSlug}`]: providerNameSlug
  13724. });
  13725. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  13726. className
  13727. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  13728. className: "wp-block-embed__wrapper"
  13729. }, `\n${url}\n`
  13730. /* URL needs to be on its own line. */
  13731. ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13732. tagName: "figcaption",
  13733. value: caption
  13734. }));
  13735. }
  13736. };
  13737. const embed_deprecated_v1 = {
  13738. attributes: embed_deprecated_blockAttributes,
  13739. save(_ref2) {
  13740. let {
  13741. attributes: {
  13742. url,
  13743. caption,
  13744. type,
  13745. providerNameSlug
  13746. }
  13747. } = _ref2;
  13748. if (!url) {
  13749. return null;
  13750. }
  13751. const embedClassName = classnames_default()('wp-block-embed', {
  13752. [`is-type-${type}`]: type,
  13753. [`is-provider-${providerNameSlug}`]: providerNameSlug
  13754. });
  13755. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13756. className: embedClassName
  13757. }, `\n${url}\n`
  13758. /* URL needs to be on its own line. */
  13759. , !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13760. tagName: "figcaption",
  13761. value: caption
  13762. }));
  13763. }
  13764. };
  13765. const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1];
  13766. /* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated);
  13767. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  13768. /**
  13769. * Internal dependencies
  13770. */
  13771. const embed_metadata = {
  13772. $schema: "https://schemas.wp.org/trunk/block.json",
  13773. apiVersion: 2,
  13774. name: "core/embed",
  13775. title: "Embed",
  13776. category: "embed",
  13777. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  13778. textdomain: "default",
  13779. attributes: {
  13780. url: {
  13781. type: "string"
  13782. },
  13783. caption: {
  13784. type: "string",
  13785. source: "html",
  13786. selector: "figcaption"
  13787. },
  13788. type: {
  13789. type: "string"
  13790. },
  13791. providerNameSlug: {
  13792. type: "string"
  13793. },
  13794. allowResponsive: {
  13795. type: "boolean",
  13796. "default": true
  13797. },
  13798. responsive: {
  13799. type: "boolean",
  13800. "default": false
  13801. },
  13802. previewable: {
  13803. type: "boolean",
  13804. "default": true
  13805. }
  13806. },
  13807. supports: {
  13808. align: true
  13809. },
  13810. editorStyle: "wp-block-embed-editor",
  13811. style: "wp-block-embed"
  13812. };
  13813. const {
  13814. name: embed_name
  13815. } = embed_metadata;
  13816. const embed_settings = {
  13817. icon: embedContentIcon,
  13818. edit: embed_edit,
  13819. save: embed_save_save,
  13820. transforms: embed_transforms,
  13821. variations: embed_variations,
  13822. deprecated: embed_deprecated
  13823. };
  13824. const embed_init = () => initBlock({
  13825. name: embed_name,
  13826. metadata: embed_metadata,
  13827. settings: embed_settings
  13828. });
  13829. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js
  13830. /**
  13831. * WordPress dependencies
  13832. */
  13833. const file = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  13834. viewBox: "0 0 24 24",
  13835. xmlns: "http://www.w3.org/2000/svg"
  13836. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  13837. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"
  13838. }));
  13839. /* harmony default export */ var library_file = (file);
  13840. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js
  13841. /**
  13842. * External dependencies
  13843. */
  13844. /**
  13845. * WordPress dependencies
  13846. */
  13847. // Version of the file block without PR#43050 removing the translated aria-label.
  13848. const deprecated_v3 = {
  13849. attributes: {
  13850. id: {
  13851. type: 'number'
  13852. },
  13853. href: {
  13854. type: 'string'
  13855. },
  13856. fileId: {
  13857. type: 'string',
  13858. source: 'attribute',
  13859. selector: 'a:not([download])',
  13860. attribute: 'id'
  13861. },
  13862. fileName: {
  13863. type: 'string',
  13864. source: 'html',
  13865. selector: 'a:not([download])'
  13866. },
  13867. textLinkHref: {
  13868. type: 'string',
  13869. source: 'attribute',
  13870. selector: 'a:not([download])',
  13871. attribute: 'href'
  13872. },
  13873. textLinkTarget: {
  13874. type: 'string',
  13875. source: 'attribute',
  13876. selector: 'a:not([download])',
  13877. attribute: 'target'
  13878. },
  13879. showDownloadButton: {
  13880. type: 'boolean',
  13881. default: true
  13882. },
  13883. downloadButtonText: {
  13884. type: 'string',
  13885. source: 'html',
  13886. selector: 'a[download]'
  13887. },
  13888. displayPreview: {
  13889. type: 'boolean'
  13890. },
  13891. previewHeight: {
  13892. type: 'number',
  13893. default: 600
  13894. }
  13895. },
  13896. supports: {
  13897. anchor: true,
  13898. align: true
  13899. },
  13900. save(_ref) {
  13901. let {
  13902. attributes
  13903. } = _ref;
  13904. const {
  13905. href,
  13906. fileId,
  13907. fileName,
  13908. textLinkHref,
  13909. textLinkTarget,
  13910. showDownloadButton,
  13911. downloadButtonText,
  13912. displayPreview,
  13913. previewHeight
  13914. } = attributes;
  13915. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  13916. /* translators: %s: filename. */
  13917. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  13918. const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
  13919. // actually rendered.
  13920. const describedById = hasFilename ? fileId : undefined;
  13921. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  13922. className: "wp-block-file__embed",
  13923. data: href,
  13924. type: "application/pdf",
  13925. style: {
  13926. width: '100%',
  13927. height: `${previewHeight}px`
  13928. },
  13929. "aria-label": pdfEmbedLabel
  13930. })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
  13931. id: describedById,
  13932. href: textLinkHref,
  13933. target: textLinkTarget,
  13934. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  13935. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13936. value: fileName
  13937. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  13938. href: href,
  13939. className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
  13940. download: true,
  13941. "aria-describedby": describedById
  13942. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13943. value: downloadButtonText
  13944. })));
  13945. }
  13946. }; // In #41239 the button was made an element button which added a `wp-element-button` classname
  13947. // to the download link element.
  13948. const file_deprecated_v2 = {
  13949. attributes: {
  13950. id: {
  13951. type: 'number'
  13952. },
  13953. href: {
  13954. type: 'string'
  13955. },
  13956. fileId: {
  13957. type: 'string',
  13958. source: 'attribute',
  13959. selector: 'a:not([download])',
  13960. attribute: 'id'
  13961. },
  13962. fileName: {
  13963. type: 'string',
  13964. source: 'html',
  13965. selector: 'a:not([download])'
  13966. },
  13967. textLinkHref: {
  13968. type: 'string',
  13969. source: 'attribute',
  13970. selector: 'a:not([download])',
  13971. attribute: 'href'
  13972. },
  13973. textLinkTarget: {
  13974. type: 'string',
  13975. source: 'attribute',
  13976. selector: 'a:not([download])',
  13977. attribute: 'target'
  13978. },
  13979. showDownloadButton: {
  13980. type: 'boolean',
  13981. default: true
  13982. },
  13983. downloadButtonText: {
  13984. type: 'string',
  13985. source: 'html',
  13986. selector: 'a[download]'
  13987. },
  13988. displayPreview: {
  13989. type: 'boolean'
  13990. },
  13991. previewHeight: {
  13992. type: 'number',
  13993. default: 600
  13994. }
  13995. },
  13996. supports: {
  13997. anchor: true,
  13998. align: true
  13999. },
  14000. save(_ref2) {
  14001. let {
  14002. attributes
  14003. } = _ref2;
  14004. const {
  14005. href,
  14006. fileId,
  14007. fileName,
  14008. textLinkHref,
  14009. textLinkTarget,
  14010. showDownloadButton,
  14011. downloadButtonText,
  14012. displayPreview,
  14013. previewHeight
  14014. } = attributes;
  14015. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  14016. /* translators: %s: filename. */
  14017. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  14018. const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
  14019. // actually rendered.
  14020. const describedById = hasFilename ? fileId : undefined;
  14021. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  14022. className: "wp-block-file__embed",
  14023. data: href,
  14024. type: "application/pdf",
  14025. style: {
  14026. width: '100%',
  14027. height: `${previewHeight}px`
  14028. },
  14029. "aria-label": pdfEmbedLabel
  14030. })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
  14031. id: describedById,
  14032. href: textLinkHref,
  14033. target: textLinkTarget,
  14034. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  14035. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14036. value: fileName
  14037. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  14038. href: href,
  14039. className: "wp-block-file__button",
  14040. download: true,
  14041. "aria-describedby": describedById
  14042. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14043. value: downloadButtonText
  14044. })));
  14045. }
  14046. }; // Version of the file block without PR#28062 accessibility fix.
  14047. const file_deprecated_v1 = {
  14048. attributes: {
  14049. id: {
  14050. type: 'number'
  14051. },
  14052. href: {
  14053. type: 'string'
  14054. },
  14055. fileName: {
  14056. type: 'string',
  14057. source: 'html',
  14058. selector: 'a:not([download])'
  14059. },
  14060. textLinkHref: {
  14061. type: 'string',
  14062. source: 'attribute',
  14063. selector: 'a:not([download])',
  14064. attribute: 'href'
  14065. },
  14066. textLinkTarget: {
  14067. type: 'string',
  14068. source: 'attribute',
  14069. selector: 'a:not([download])',
  14070. attribute: 'target'
  14071. },
  14072. showDownloadButton: {
  14073. type: 'boolean',
  14074. default: true
  14075. },
  14076. downloadButtonText: {
  14077. type: 'string',
  14078. source: 'html',
  14079. selector: 'a[download]'
  14080. },
  14081. displayPreview: {
  14082. type: 'boolean'
  14083. },
  14084. previewHeight: {
  14085. type: 'number',
  14086. default: 600
  14087. }
  14088. },
  14089. supports: {
  14090. anchor: true,
  14091. align: true
  14092. },
  14093. save(_ref3) {
  14094. let {
  14095. attributes
  14096. } = _ref3;
  14097. const {
  14098. href,
  14099. fileName,
  14100. textLinkHref,
  14101. textLinkTarget,
  14102. showDownloadButton,
  14103. downloadButtonText,
  14104. displayPreview,
  14105. previewHeight
  14106. } = attributes;
  14107. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  14108. /* translators: %s: filename. */
  14109. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  14110. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  14111. className: "wp-block-file__embed",
  14112. data: href,
  14113. type: "application/pdf",
  14114. style: {
  14115. width: '100%',
  14116. height: `${previewHeight}px`
  14117. },
  14118. "aria-label": pdfEmbedLabel
  14119. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", {
  14120. href: textLinkHref,
  14121. target: textLinkTarget,
  14122. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  14123. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14124. value: fileName
  14125. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  14126. href: href,
  14127. className: "wp-block-file__button",
  14128. download: true
  14129. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14130. value: downloadButtonText
  14131. })));
  14132. }
  14133. };
  14134. const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1];
  14135. /* harmony default export */ var file_deprecated = (file_deprecated_deprecated);
  14136. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js
  14137. /**
  14138. * WordPress dependencies
  14139. */
  14140. /**
  14141. * Internal dependencies
  14142. */
  14143. function FileBlockInspector(_ref) {
  14144. let {
  14145. hrefs,
  14146. openInNewWindow,
  14147. showDownloadButton,
  14148. changeLinkDestinationOption,
  14149. changeOpenInNewWindow,
  14150. changeShowDownloadButton,
  14151. displayPreview,
  14152. changeDisplayPreview,
  14153. previewHeight,
  14154. changePreviewHeight
  14155. } = _ref;
  14156. const {
  14157. href,
  14158. textLinkHref,
  14159. attachmentPage
  14160. } = hrefs;
  14161. let linkDestinationOptions = [{
  14162. value: href,
  14163. label: (0,external_wp_i18n_namespaceObject.__)('URL')
  14164. }];
  14165. if (attachmentPage) {
  14166. linkDestinationOptions = [{
  14167. value: href,
  14168. label: (0,external_wp_i18n_namespaceObject.__)('Media file')
  14169. }, {
  14170. value: attachmentPage,
  14171. label: (0,external_wp_i18n_namespaceObject.__)('Attachment page')
  14172. }];
  14173. }
  14174. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  14175. title: (0,external_wp_i18n_namespaceObject.__)('PDF settings')
  14176. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14177. label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'),
  14178. help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
  14179. checked: !!displayPreview,
  14180. onChange: changeDisplayPreview
  14181. }), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  14182. label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'),
  14183. min: MIN_PREVIEW_HEIGHT,
  14184. max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight),
  14185. value: previewHeight,
  14186. onChange: changePreviewHeight
  14187. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  14188. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  14189. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  14190. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  14191. value: textLinkHref,
  14192. options: linkDestinationOptions,
  14193. onChange: changeLinkDestinationOption
  14194. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14195. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  14196. checked: openInNewWindow,
  14197. onChange: changeOpenInNewWindow
  14198. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14199. label: (0,external_wp_i18n_namespaceObject.__)('Show download button'),
  14200. checked: showDownloadButton,
  14201. onChange: changeShowDownloadButton
  14202. }))));
  14203. }
  14204. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js
  14205. /**
  14206. * Uses a combination of user agent matching and feature detection to determine whether
  14207. * the current browser supports rendering PDFs inline.
  14208. *
  14209. * @return {boolean} Whether or not the browser supports inline PDFs.
  14210. */
  14211. const browserSupportsPdfs = () => {
  14212. // Most mobile devices include "Mobi" in their UA.
  14213. if (window.navigator.userAgent.indexOf('Mobi') > -1) {
  14214. return false;
  14215. } // Android tablets are the noteable exception.
  14216. if (window.navigator.userAgent.indexOf('Android') > -1) {
  14217. return false;
  14218. } // iPad pretends to be a Mac.
  14219. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
  14220. return false;
  14221. } // IE only supports PDFs when there's an ActiveX object available for it.
  14222. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
  14223. return false;
  14224. }
  14225. return true;
  14226. };
  14227. /**
  14228. * Helper function for creating ActiveX objects, catching any errors that are thrown
  14229. * when it's generated.
  14230. *
  14231. * @param {string} type The name of the ActiveX object to create.
  14232. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
  14233. */
  14234. const createActiveXObject = type => {
  14235. let ax;
  14236. try {
  14237. ax = new window.ActiveXObject(type);
  14238. } catch (e) {
  14239. ax = undefined;
  14240. }
  14241. return ax;
  14242. };
  14243. /**
  14244. * Hides all .wp-block-file__embed elements on the document. This function is only intended
  14245. * to be run on the front-end, it may have weird side effects running in the block editor.
  14246. */
  14247. const hidePdfEmbedsOnUnsupportedBrowsers = () => {
  14248. if (!browserSupportsPdfs()) {
  14249. const embeds = document.getElementsByClassName('wp-block-file__embed');
  14250. Array.from(embeds).forEach(embed => {
  14251. embed.style.display = 'none';
  14252. });
  14253. }
  14254. };
  14255. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js
  14256. /**
  14257. * External dependencies
  14258. */
  14259. /**
  14260. * WordPress dependencies
  14261. */
  14262. /**
  14263. * Internal dependencies
  14264. */
  14265. const MIN_PREVIEW_HEIGHT = 200;
  14266. const MAX_PREVIEW_HEIGHT = 2000;
  14267. function ClipboardToolbarButton(_ref) {
  14268. let {
  14269. text,
  14270. disabled
  14271. } = _ref;
  14272. const {
  14273. createNotice
  14274. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  14275. const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
  14276. createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), {
  14277. isDismissible: true,
  14278. type: 'snackbar'
  14279. });
  14280. });
  14281. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  14282. className: "components-clipboard-toolbar-button",
  14283. ref: ref,
  14284. disabled: disabled
  14285. }, (0,external_wp_i18n_namespaceObject.__)('Copy URL'));
  14286. }
  14287. function FileEdit(_ref2) {
  14288. let {
  14289. attributes,
  14290. isSelected,
  14291. setAttributes,
  14292. clientId
  14293. } = _ref2;
  14294. const {
  14295. id,
  14296. fileId,
  14297. fileName,
  14298. href,
  14299. textLinkHref,
  14300. textLinkTarget,
  14301. showDownloadButton,
  14302. downloadButtonText,
  14303. displayPreview,
  14304. previewHeight
  14305. } = attributes;
  14306. const {
  14307. media,
  14308. mediaUpload
  14309. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  14310. media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id),
  14311. mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
  14312. }), [id]);
  14313. const {
  14314. createErrorNotice
  14315. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  14316. const {
  14317. toggleSelection,
  14318. __unstableMarkNextChangeAsNotPersistent
  14319. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  14320. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14321. // Upload a file drag-and-dropped into the editor.
  14322. if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) {
  14323. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href);
  14324. mediaUpload({
  14325. filesList: [file],
  14326. onFileChange: _ref3 => {
  14327. let [newMedia] = _ref3;
  14328. return onSelectFile(newMedia);
  14329. },
  14330. onError: onUploadError
  14331. });
  14332. (0,external_wp_blob_namespaceObject.revokeBlobURL)(href);
  14333. }
  14334. if (downloadButtonText === undefined) {
  14335. changeDownloadButtonText((0,external_wp_i18n_namespaceObject._x)('Download', 'button label'));
  14336. }
  14337. }, []);
  14338. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14339. if (!fileId && href) {
  14340. // Add a unique fileId to each file block.
  14341. __unstableMarkNextChangeAsNotPersistent();
  14342. setAttributes({
  14343. fileId: `wp-block-file--media-${clientId}`
  14344. });
  14345. }
  14346. }, [href, fileId, clientId]);
  14347. function onSelectFile(newMedia) {
  14348. if (newMedia && newMedia.url) {
  14349. const isPdf = newMedia.url.endsWith('.pdf');
  14350. setAttributes({
  14351. href: newMedia.url,
  14352. fileName: newMedia.title,
  14353. textLinkHref: newMedia.url,
  14354. id: newMedia.id,
  14355. displayPreview: isPdf ? true : undefined,
  14356. previewHeight: isPdf ? 600 : undefined
  14357. });
  14358. }
  14359. }
  14360. function onUploadError(message) {
  14361. setAttributes({
  14362. href: undefined
  14363. });
  14364. createErrorNotice(message, {
  14365. type: 'snackbar'
  14366. });
  14367. }
  14368. function changeLinkDestinationOption(newHref) {
  14369. // Choose Media File or Attachment Page (when file is in Media Library).
  14370. setAttributes({
  14371. textLinkHref: newHref
  14372. });
  14373. }
  14374. function changeOpenInNewWindow(newValue) {
  14375. setAttributes({
  14376. textLinkTarget: newValue ? '_blank' : false
  14377. });
  14378. }
  14379. function changeShowDownloadButton(newValue) {
  14380. setAttributes({
  14381. showDownloadButton: newValue
  14382. });
  14383. }
  14384. function changeDownloadButtonText(newValue) {
  14385. // Remove anchor tags from button text content.
  14386. setAttributes({
  14387. downloadButtonText: newValue.replace(/<\/?a[^>]*>/g, '')
  14388. });
  14389. }
  14390. function changeDisplayPreview(newValue) {
  14391. setAttributes({
  14392. displayPreview: newValue
  14393. });
  14394. }
  14395. function handleOnResizeStop(event, direction, elt, delta) {
  14396. toggleSelection(true);
  14397. const newHeight = parseInt(previewHeight + delta.height, 10);
  14398. setAttributes({
  14399. previewHeight: newHeight
  14400. });
  14401. }
  14402. function changePreviewHeight(newValue) {
  14403. const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT);
  14404. setAttributes({
  14405. previewHeight: newHeight
  14406. });
  14407. }
  14408. const attachmentPage = media && media.link;
  14409. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  14410. className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
  14411. type: 'loading'
  14412. }), {
  14413. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  14414. })
  14415. });
  14416. const displayPreviewInEditor = browserSupportsPdfs() && displayPreview;
  14417. if (!href) {
  14418. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  14419. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  14420. icon: library_file
  14421. }),
  14422. labels: {
  14423. title: (0,external_wp_i18n_namespaceObject.__)('File'),
  14424. instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.')
  14425. },
  14426. onSelect: onSelectFile,
  14427. onError: onUploadError,
  14428. accept: "*"
  14429. }));
  14430. }
  14431. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(FileBlockInspector, {
  14432. hrefs: {
  14433. href,
  14434. textLinkHref,
  14435. attachmentPage
  14436. },
  14437. openInNewWindow: !!textLinkTarget,
  14438. showDownloadButton,
  14439. changeLinkDestinationOption,
  14440. changeOpenInNewWindow,
  14441. changeShowDownloadButton,
  14442. displayPreview,
  14443. changeDisplayPreview,
  14444. previewHeight,
  14445. changePreviewHeight
  14446. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  14447. group: "other"
  14448. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  14449. mediaId: id,
  14450. mediaURL: href,
  14451. accept: "*",
  14452. onSelect: onSelectFile,
  14453. onError: onUploadError
  14454. }), (0,external_wp_element_namespaceObject.createElement)(ClipboardToolbarButton, {
  14455. text: href,
  14456. disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  14457. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayPreviewInEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  14458. size: {
  14459. height: previewHeight
  14460. },
  14461. minHeight: MIN_PREVIEW_HEIGHT,
  14462. maxHeight: MAX_PREVIEW_HEIGHT,
  14463. minWidth: "100%",
  14464. grid: [10, 10],
  14465. enable: {
  14466. top: false,
  14467. right: false,
  14468. bottom: true,
  14469. left: false,
  14470. topRight: false,
  14471. bottomRight: false,
  14472. bottomLeft: false,
  14473. topLeft: false
  14474. },
  14475. onResizeStart: () => toggleSelection(false),
  14476. onResizeStop: handleOnResizeStop,
  14477. showHandle: isSelected
  14478. }, (0,external_wp_element_namespaceObject.createElement)("object", {
  14479. className: "wp-block-file__preview",
  14480. data: href,
  14481. type: "application/pdf",
  14482. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.')
  14483. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  14484. className: "wp-block-file__preview-overlay"
  14485. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  14486. className: 'wp-block-file__content-wrapper'
  14487. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  14488. tagName: "a",
  14489. value: fileName,
  14490. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'),
  14491. withoutInteractiveFormatting: true,
  14492. onChange: text => setAttributes({
  14493. fileName: text
  14494. }),
  14495. href: textLinkHref
  14496. }), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("div", {
  14497. className: 'wp-block-file__button-richtext-wrapper'
  14498. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  14499. tagName: "div" // Must be block-level or else cursor disappears.
  14500. ,
  14501. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'),
  14502. className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
  14503. value: downloadButtonText,
  14504. withoutInteractiveFormatting: true,
  14505. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  14506. onChange: text => changeDownloadButtonText(text)
  14507. })))));
  14508. }
  14509. /* harmony default export */ var file_edit = (FileEdit);
  14510. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js
  14511. /**
  14512. * External dependencies
  14513. */
  14514. /**
  14515. * WordPress dependencies
  14516. */
  14517. function file_save_save(_ref) {
  14518. let {
  14519. attributes
  14520. } = _ref;
  14521. const {
  14522. href,
  14523. fileId,
  14524. fileName,
  14525. textLinkHref,
  14526. textLinkTarget,
  14527. showDownloadButton,
  14528. downloadButtonText,
  14529. displayPreview,
  14530. previewHeight
  14531. } = attributes;
  14532. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF embed' : fileName;
  14533. const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
  14534. // actually rendered.
  14535. const describedById = hasFilename ? fileId : undefined;
  14536. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  14537. className: "wp-block-file__embed",
  14538. data: href,
  14539. type: "application/pdf",
  14540. style: {
  14541. width: '100%',
  14542. height: `${previewHeight}px`
  14543. },
  14544. "aria-label": pdfEmbedLabel
  14545. })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
  14546. id: describedById,
  14547. href: textLinkHref,
  14548. target: textLinkTarget,
  14549. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  14550. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14551. value: fileName
  14552. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  14553. href: href,
  14554. className: classnames_default()('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
  14555. download: true,
  14556. "aria-describedby": describedById
  14557. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  14558. value: downloadButtonText
  14559. })));
  14560. }
  14561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js
  14562. /**
  14563. * External dependencies
  14564. */
  14565. /**
  14566. * WordPress dependencies
  14567. */
  14568. const file_transforms_transforms = {
  14569. from: [{
  14570. type: 'files',
  14571. isMatch(files) {
  14572. return files.length > 0;
  14573. },
  14574. // We define a lower priorty (higher number) than the default of 10. This
  14575. // ensures that the File block is only created as a fallback.
  14576. priority: 15,
  14577. transform: files => {
  14578. const blocks = [];
  14579. files.forEach(file => {
  14580. const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount()
  14581. blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  14582. href: blobURL,
  14583. fileName: file.name,
  14584. textLinkHref: blobURL
  14585. }));
  14586. });
  14587. return blocks;
  14588. }
  14589. }, {
  14590. type: 'block',
  14591. blocks: ['core/audio'],
  14592. transform: attributes => {
  14593. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  14594. href: attributes.src,
  14595. fileName: attributes.caption,
  14596. textLinkHref: attributes.src,
  14597. id: attributes.id,
  14598. anchor: attributes.anchor
  14599. });
  14600. }
  14601. }, {
  14602. type: 'block',
  14603. blocks: ['core/video'],
  14604. transform: attributes => {
  14605. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  14606. href: attributes.src,
  14607. fileName: attributes.caption,
  14608. textLinkHref: attributes.src,
  14609. id: attributes.id,
  14610. anchor: attributes.anchor
  14611. });
  14612. }
  14613. }, {
  14614. type: 'block',
  14615. blocks: ['core/image'],
  14616. transform: attributes => {
  14617. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  14618. href: attributes.url,
  14619. fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url),
  14620. textLinkHref: attributes.url,
  14621. id: attributes.id,
  14622. anchor: attributes.anchor
  14623. });
  14624. }
  14625. }],
  14626. to: [{
  14627. type: 'block',
  14628. blocks: ['core/audio'],
  14629. isMatch: _ref => {
  14630. let {
  14631. id
  14632. } = _ref;
  14633. if (!id) {
  14634. return false;
  14635. }
  14636. const {
  14637. getMedia
  14638. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  14639. const media = getMedia(id);
  14640. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'audio');
  14641. },
  14642. transform: attributes => {
  14643. return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  14644. src: attributes.href,
  14645. caption: attributes.fileName,
  14646. id: attributes.id,
  14647. anchor: attributes.anchor
  14648. });
  14649. }
  14650. }, {
  14651. type: 'block',
  14652. blocks: ['core/video'],
  14653. isMatch: _ref2 => {
  14654. let {
  14655. id
  14656. } = _ref2;
  14657. if (!id) {
  14658. return false;
  14659. }
  14660. const {
  14661. getMedia
  14662. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  14663. const media = getMedia(id);
  14664. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'video');
  14665. },
  14666. transform: attributes => {
  14667. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  14668. src: attributes.href,
  14669. caption: attributes.fileName,
  14670. id: attributes.id,
  14671. anchor: attributes.anchor
  14672. });
  14673. }
  14674. }, {
  14675. type: 'block',
  14676. blocks: ['core/image'],
  14677. isMatch: _ref3 => {
  14678. let {
  14679. id
  14680. } = _ref3;
  14681. if (!id) {
  14682. return false;
  14683. }
  14684. const {
  14685. getMedia
  14686. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  14687. const media = getMedia(id);
  14688. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'image');
  14689. },
  14690. transform: attributes => {
  14691. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  14692. url: attributes.href,
  14693. caption: attributes.fileName,
  14694. id: attributes.id,
  14695. anchor: attributes.anchor
  14696. });
  14697. }
  14698. }]
  14699. };
  14700. /* harmony default export */ var file_transforms = (file_transforms_transforms);
  14701. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js
  14702. /**
  14703. * WordPress dependencies
  14704. */
  14705. /**
  14706. * Internal dependencies
  14707. */
  14708. const file_metadata = {
  14709. $schema: "https://schemas.wp.org/trunk/block.json",
  14710. apiVersion: 2,
  14711. name: "core/file",
  14712. title: "File",
  14713. category: "media",
  14714. description: "Add a link to a downloadable file.",
  14715. keywords: ["document", "pdf", "download"],
  14716. textdomain: "default",
  14717. attributes: {
  14718. id: {
  14719. type: "number"
  14720. },
  14721. href: {
  14722. type: "string"
  14723. },
  14724. fileId: {
  14725. type: "string",
  14726. source: "attribute",
  14727. selector: "a:not([download])",
  14728. attribute: "id"
  14729. },
  14730. fileName: {
  14731. type: "string",
  14732. source: "html",
  14733. selector: "a:not([download])"
  14734. },
  14735. textLinkHref: {
  14736. type: "string",
  14737. source: "attribute",
  14738. selector: "a:not([download])",
  14739. attribute: "href"
  14740. },
  14741. textLinkTarget: {
  14742. type: "string",
  14743. source: "attribute",
  14744. selector: "a:not([download])",
  14745. attribute: "target"
  14746. },
  14747. showDownloadButton: {
  14748. type: "boolean",
  14749. "default": true
  14750. },
  14751. downloadButtonText: {
  14752. type: "string",
  14753. source: "html",
  14754. selector: "a[download]"
  14755. },
  14756. displayPreview: {
  14757. type: "boolean"
  14758. },
  14759. previewHeight: {
  14760. type: "number",
  14761. "default": 600
  14762. }
  14763. },
  14764. supports: {
  14765. anchor: true,
  14766. align: true
  14767. },
  14768. viewScript: "file:./view.min.js",
  14769. editorStyle: "wp-block-file-editor",
  14770. style: "wp-block-file"
  14771. };
  14772. const {
  14773. name: file_name
  14774. } = file_metadata;
  14775. const file_settings = {
  14776. icon: library_file,
  14777. example: {
  14778. attributes: {
  14779. href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
  14780. fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file')
  14781. }
  14782. },
  14783. transforms: file_transforms,
  14784. deprecated: file_deprecated,
  14785. edit: file_edit,
  14786. save: file_save_save
  14787. };
  14788. const file_init = () => initBlock({
  14789. name: file_name,
  14790. metadata: file_metadata,
  14791. settings: file_settings
  14792. });
  14793. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js
  14794. /**
  14795. * WordPress dependencies
  14796. */
  14797. const gallery = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14798. viewBox: "0 0 24 24",
  14799. xmlns: "http://www.w3.org/2000/svg"
  14800. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14801. d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"
  14802. }));
  14803. /* harmony default export */ var library_gallery = (gallery);
  14804. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
  14805. const LINK_DESTINATION_NONE = 'none';
  14806. const LINK_DESTINATION_MEDIA = 'media';
  14807. const LINK_DESTINATION_ATTACHMENT = 'attachment';
  14808. const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
  14809. const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
  14810. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js
  14811. /**
  14812. * External dependencies
  14813. */
  14814. /**
  14815. * WordPress dependencies
  14816. */
  14817. function defaultColumnsNumber(imageCount) {
  14818. return imageCount ? Math.min(3, imageCount) : 3;
  14819. }
  14820. const pickRelevantMediaFiles = function (image) {
  14821. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  14822. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link']);
  14823. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url || image.source_url;
  14824. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  14825. if (fullUrl) {
  14826. imageProps.fullUrl = fullUrl;
  14827. }
  14828. return imageProps;
  14829. };
  14830. function getGalleryBlockV2Enabled() {
  14831. // We want to fail early here, at least during beta testing phase, to ensure
  14832. // there aren't instances where undefined values cause false negatives.
  14833. if (!window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean') {
  14834. throw 'window.wp.galleryBlockV2Enabled is not defined';
  14835. }
  14836. return window.wp.galleryBlockV2Enabled;
  14837. }
  14838. /**
  14839. * The new gallery block format is not compatible with the use_BalanceTags option
  14840. * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
  14841. * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method
  14842. * can be removed when minimum supported WP version >=5.9.
  14843. */
  14844. function isGalleryV2Enabled() {
  14845. // The logic for the native version is located in a different if statement
  14846. // due to a lint rule that prohibits a single conditional combining
  14847. // `process.env.IS_GUTENBERG_PLUGIN` with a native platform check.
  14848. if (external_wp_element_namespaceObject.Platform.isNative) {
  14849. return getGalleryBlockV2Enabled();
  14850. } // Only run the Gallery version compat check if the plugin is running, otherwise
  14851. // assume we are in 5.9 core and enable by default.
  14852. if (false) {}
  14853. return true;
  14854. }
  14855. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js
  14856. /**
  14857. * External dependencies
  14858. */
  14859. /**
  14860. * WordPress dependencies
  14861. */
  14862. /**
  14863. * Internal dependencies
  14864. */
  14865. const DEPRECATED_LINK_DESTINATION_MEDIA = 'file';
  14866. const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post';
  14867. /**
  14868. * Original function to determine default number of columns from a block's
  14869. * attributes.
  14870. *
  14871. * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks.
  14872. *
  14873. * @param {Object} attributes Block attributes.
  14874. * @return {number} Default number of columns for the gallery.
  14875. */
  14876. function defaultColumnsNumberV1(attributes) {
  14877. var _attributes$images;
  14878. return Math.min(3, attributes === null || attributes === void 0 ? void 0 : (_attributes$images = attributes.images) === null || _attributes$images === void 0 ? void 0 : _attributes$images.length);
  14879. }
  14880. /**
  14881. * Original function to determine new href and linkDestination values for an image block from the
  14882. * supplied Gallery link destination.
  14883. *
  14884. * Used in deprecations: v1-6.
  14885. *
  14886. * @param {Object} image Gallery image.
  14887. * @param {string} destination Gallery's selected link destination.
  14888. * @return {Object} New attributes to assign to image block.
  14889. */
  14890. function getHrefAndDestination(image, destination) {
  14891. // Need to determine the URL that the selected destination maps to.
  14892. // Gutenberg and WordPress use different constants so the new link
  14893. // destination also needs to be tweaked.
  14894. switch (destination) {
  14895. case DEPRECATED_LINK_DESTINATION_MEDIA:
  14896. return {
  14897. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  14898. // eslint-disable-line camelcase
  14899. linkDestination: LINK_DESTINATION_MEDIA
  14900. };
  14901. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  14902. return {
  14903. href: image === null || image === void 0 ? void 0 : image.link,
  14904. linkDestination: LINK_DESTINATION_ATTACHMENT
  14905. };
  14906. case LINK_DESTINATION_MEDIA:
  14907. return {
  14908. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  14909. // eslint-disable-line camelcase
  14910. linkDestination: LINK_DESTINATION_MEDIA
  14911. };
  14912. case LINK_DESTINATION_ATTACHMENT:
  14913. return {
  14914. href: image === null || image === void 0 ? void 0 : image.link,
  14915. linkDestination: LINK_DESTINATION_ATTACHMENT
  14916. };
  14917. case LINK_DESTINATION_NONE:
  14918. return {
  14919. href: undefined,
  14920. linkDestination: LINK_DESTINATION_NONE
  14921. };
  14922. }
  14923. return {};
  14924. }
  14925. function runV2Migration(attributes) {
  14926. let linkTo = attributes.linkTo ? attributes.linkTo : 'none';
  14927. if (linkTo === 'post') {
  14928. linkTo = 'attachment';
  14929. } else if (linkTo === 'file') {
  14930. linkTo = 'media';
  14931. }
  14932. const imageBlocks = attributes.images.map(image => {
  14933. return getImageBlock(image, attributes.sizeSlug, linkTo);
  14934. });
  14935. const {
  14936. images,
  14937. ids,
  14938. ...restAttributes
  14939. } = attributes;
  14940. return [{ ...restAttributes,
  14941. linkTo,
  14942. allowResize: false
  14943. }, imageBlocks];
  14944. }
  14945. /**
  14946. * Gets an Image block from gallery image data
  14947. *
  14948. * Used to migrate Galleries to nested Image InnerBlocks.
  14949. *
  14950. * @param {Object} image Image properties.
  14951. * @param {string} sizeSlug Gallery sizeSlug attribute.
  14952. * @param {string} linkTo Gallery linkTo attribute.
  14953. * @return {Object} Image block.
  14954. */
  14955. function getImageBlock(image, sizeSlug, linkTo) {
  14956. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && {
  14957. id: parseInt(image.id)
  14958. }),
  14959. url: image.url,
  14960. alt: image.alt,
  14961. caption: image.caption,
  14962. sizeSlug,
  14963. ...getHrefAndDestination(image, linkTo)
  14964. });
  14965. } // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
  14966. // to the gallery figcaption element.
  14967. const deprecated_v7 = {
  14968. attributes: {
  14969. images: {
  14970. type: 'array',
  14971. default: [],
  14972. source: 'query',
  14973. selector: '.blocks-gallery-item',
  14974. query: {
  14975. url: {
  14976. type: 'string',
  14977. source: 'attribute',
  14978. selector: 'img',
  14979. attribute: 'src'
  14980. },
  14981. fullUrl: {
  14982. type: 'string',
  14983. source: 'attribute',
  14984. selector: 'img',
  14985. attribute: 'data-full-url'
  14986. },
  14987. link: {
  14988. type: 'string',
  14989. source: 'attribute',
  14990. selector: 'img',
  14991. attribute: 'data-link'
  14992. },
  14993. alt: {
  14994. type: 'string',
  14995. source: 'attribute',
  14996. selector: 'img',
  14997. attribute: 'alt',
  14998. default: ''
  14999. },
  15000. id: {
  15001. type: 'string',
  15002. source: 'attribute',
  15003. selector: 'img',
  15004. attribute: 'data-id'
  15005. },
  15006. caption: {
  15007. type: 'string',
  15008. source: 'html',
  15009. selector: '.blocks-gallery-item__caption'
  15010. }
  15011. }
  15012. },
  15013. ids: {
  15014. type: 'array',
  15015. items: {
  15016. type: 'number'
  15017. },
  15018. default: []
  15019. },
  15020. shortCodeTransforms: {
  15021. type: 'array',
  15022. default: [],
  15023. items: {
  15024. type: 'object'
  15025. }
  15026. },
  15027. columns: {
  15028. type: 'number',
  15029. minimum: 1,
  15030. maximum: 8
  15031. },
  15032. caption: {
  15033. type: 'string',
  15034. source: 'html',
  15035. selector: '.blocks-gallery-caption'
  15036. },
  15037. imageCrop: {
  15038. type: 'boolean',
  15039. default: true
  15040. },
  15041. fixedHeight: {
  15042. type: 'boolean',
  15043. default: true
  15044. },
  15045. linkTarget: {
  15046. type: 'string'
  15047. },
  15048. linkTo: {
  15049. type: 'string'
  15050. },
  15051. sizeSlug: {
  15052. type: 'string',
  15053. default: 'large'
  15054. },
  15055. allowResize: {
  15056. type: 'boolean',
  15057. default: false
  15058. }
  15059. },
  15060. save(_ref) {
  15061. let {
  15062. attributes
  15063. } = _ref;
  15064. const {
  15065. caption,
  15066. columns,
  15067. imageCrop
  15068. } = attributes;
  15069. const className = classnames_default()('has-nested-images', {
  15070. [`columns-${columns}`]: columns !== undefined,
  15071. [`columns-default`]: columns === undefined,
  15072. 'is-cropped': imageCrop
  15073. });
  15074. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15075. className
  15076. });
  15077. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  15078. return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15079. tagName: "figcaption",
  15080. className: "blocks-gallery-caption",
  15081. value: caption
  15082. }));
  15083. }
  15084. };
  15085. const deprecated_v6 = {
  15086. attributes: {
  15087. images: {
  15088. type: 'array',
  15089. default: [],
  15090. source: 'query',
  15091. selector: '.blocks-gallery-item',
  15092. query: {
  15093. url: {
  15094. type: 'string',
  15095. source: 'attribute',
  15096. selector: 'img',
  15097. attribute: 'src'
  15098. },
  15099. fullUrl: {
  15100. type: 'string',
  15101. source: 'attribute',
  15102. selector: 'img',
  15103. attribute: 'data-full-url'
  15104. },
  15105. link: {
  15106. type: 'string',
  15107. source: 'attribute',
  15108. selector: 'img',
  15109. attribute: 'data-link'
  15110. },
  15111. alt: {
  15112. type: 'string',
  15113. source: 'attribute',
  15114. selector: 'img',
  15115. attribute: 'alt',
  15116. default: ''
  15117. },
  15118. id: {
  15119. type: 'string',
  15120. source: 'attribute',
  15121. selector: 'img',
  15122. attribute: 'data-id'
  15123. },
  15124. caption: {
  15125. type: 'string',
  15126. source: 'html',
  15127. selector: '.blocks-gallery-item__caption'
  15128. }
  15129. }
  15130. },
  15131. ids: {
  15132. type: 'array',
  15133. items: {
  15134. type: 'number'
  15135. },
  15136. default: []
  15137. },
  15138. columns: {
  15139. type: 'number',
  15140. minimum: 1,
  15141. maximum: 8
  15142. },
  15143. caption: {
  15144. type: 'string',
  15145. source: 'html',
  15146. selector: '.blocks-gallery-caption'
  15147. },
  15148. imageCrop: {
  15149. type: 'boolean',
  15150. default: true
  15151. },
  15152. fixedHeight: {
  15153. type: 'boolean',
  15154. default: true
  15155. },
  15156. linkTo: {
  15157. type: 'string'
  15158. },
  15159. sizeSlug: {
  15160. type: 'string',
  15161. default: 'large'
  15162. }
  15163. },
  15164. supports: {
  15165. anchor: true,
  15166. align: true
  15167. },
  15168. save(_ref2) {
  15169. let {
  15170. attributes
  15171. } = _ref2;
  15172. const {
  15173. images,
  15174. columns = defaultColumnsNumberV1(attributes),
  15175. imageCrop,
  15176. caption,
  15177. linkTo
  15178. } = attributes;
  15179. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  15180. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15181. className
  15182. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  15183. className: "blocks-gallery-grid"
  15184. }, images.map(image => {
  15185. let href;
  15186. switch (linkTo) {
  15187. case DEPRECATED_LINK_DESTINATION_MEDIA:
  15188. href = image.fullUrl || image.url;
  15189. break;
  15190. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  15191. href = image.link;
  15192. break;
  15193. }
  15194. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15195. src: image.url,
  15196. alt: image.alt,
  15197. "data-id": image.id,
  15198. "data-full-url": image.fullUrl,
  15199. "data-link": image.link,
  15200. className: image.id ? `wp-image-${image.id}` : null
  15201. });
  15202. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15203. key: image.id || image.url,
  15204. className: "blocks-gallery-item"
  15205. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15206. href: href
  15207. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15208. tagName: "figcaption",
  15209. className: "blocks-gallery-item__caption",
  15210. value: image.caption
  15211. })));
  15212. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15213. tagName: "figcaption",
  15214. className: "blocks-gallery-caption",
  15215. value: caption
  15216. }));
  15217. },
  15218. migrate(attributes) {
  15219. if (isGalleryV2Enabled()) {
  15220. return runV2Migration(attributes);
  15221. }
  15222. return attributes;
  15223. }
  15224. };
  15225. const deprecated_v5 = {
  15226. attributes: {
  15227. images: {
  15228. type: 'array',
  15229. default: [],
  15230. source: 'query',
  15231. selector: '.blocks-gallery-item',
  15232. query: {
  15233. url: {
  15234. type: 'string',
  15235. source: 'attribute',
  15236. selector: 'img',
  15237. attribute: 'src'
  15238. },
  15239. fullUrl: {
  15240. type: 'string',
  15241. source: 'attribute',
  15242. selector: 'img',
  15243. attribute: 'data-full-url'
  15244. },
  15245. link: {
  15246. type: 'string',
  15247. source: 'attribute',
  15248. selector: 'img',
  15249. attribute: 'data-link'
  15250. },
  15251. alt: {
  15252. type: 'string',
  15253. source: 'attribute',
  15254. selector: 'img',
  15255. attribute: 'alt',
  15256. default: ''
  15257. },
  15258. id: {
  15259. type: 'string',
  15260. source: 'attribute',
  15261. selector: 'img',
  15262. attribute: 'data-id'
  15263. },
  15264. caption: {
  15265. type: 'string',
  15266. source: 'html',
  15267. selector: '.blocks-gallery-item__caption'
  15268. }
  15269. }
  15270. },
  15271. ids: {
  15272. type: 'array',
  15273. items: {
  15274. type: 'number'
  15275. },
  15276. default: []
  15277. },
  15278. columns: {
  15279. type: 'number',
  15280. minimum: 1,
  15281. maximum: 8
  15282. },
  15283. caption: {
  15284. type: 'string',
  15285. source: 'html',
  15286. selector: '.blocks-gallery-caption'
  15287. },
  15288. imageCrop: {
  15289. type: 'boolean',
  15290. default: true
  15291. },
  15292. linkTo: {
  15293. type: 'string',
  15294. default: 'none'
  15295. },
  15296. sizeSlug: {
  15297. type: 'string',
  15298. default: 'large'
  15299. }
  15300. },
  15301. supports: {
  15302. align: true
  15303. },
  15304. isEligible(_ref3) {
  15305. let {
  15306. linkTo
  15307. } = _ref3;
  15308. return !linkTo || linkTo === 'attachment' || linkTo === 'media';
  15309. },
  15310. migrate(attributes) {
  15311. if (isGalleryV2Enabled()) {
  15312. return runV2Migration(attributes);
  15313. }
  15314. let linkTo = attributes.linkTo;
  15315. if (!attributes.linkTo) {
  15316. linkTo = 'none';
  15317. } else if (attributes.linkTo === 'attachment') {
  15318. linkTo = 'post';
  15319. } else if (attributes.linkTo === 'media') {
  15320. linkTo = 'file';
  15321. }
  15322. return { ...attributes,
  15323. linkTo
  15324. };
  15325. },
  15326. save(_ref4) {
  15327. let {
  15328. attributes
  15329. } = _ref4;
  15330. const {
  15331. images,
  15332. columns = defaultColumnsNumberV1(attributes),
  15333. imageCrop,
  15334. caption,
  15335. linkTo
  15336. } = attributes;
  15337. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  15338. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  15339. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  15340. className: "blocks-gallery-grid"
  15341. }, images.map(image => {
  15342. let href;
  15343. switch (linkTo) {
  15344. case 'media':
  15345. href = image.fullUrl || image.url;
  15346. break;
  15347. case 'attachment':
  15348. href = image.link;
  15349. break;
  15350. }
  15351. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15352. src: image.url,
  15353. alt: image.alt,
  15354. "data-id": image.id,
  15355. "data-full-url": image.fullUrl,
  15356. "data-link": image.link,
  15357. className: image.id ? `wp-image-${image.id}` : null
  15358. });
  15359. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15360. key: image.id || image.url,
  15361. className: "blocks-gallery-item"
  15362. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15363. href: href
  15364. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15365. tagName: "figcaption",
  15366. className: "blocks-gallery-item__caption",
  15367. value: image.caption
  15368. })));
  15369. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15370. tagName: "figcaption",
  15371. className: "blocks-gallery-caption",
  15372. value: caption
  15373. }));
  15374. }
  15375. };
  15376. const deprecated_v4 = {
  15377. attributes: {
  15378. images: {
  15379. type: 'array',
  15380. default: [],
  15381. source: 'query',
  15382. selector: '.blocks-gallery-item',
  15383. query: {
  15384. url: {
  15385. source: 'attribute',
  15386. selector: 'img',
  15387. attribute: 'src'
  15388. },
  15389. fullUrl: {
  15390. source: 'attribute',
  15391. selector: 'img',
  15392. attribute: 'data-full-url'
  15393. },
  15394. link: {
  15395. source: 'attribute',
  15396. selector: 'img',
  15397. attribute: 'data-link'
  15398. },
  15399. alt: {
  15400. source: 'attribute',
  15401. selector: 'img',
  15402. attribute: 'alt',
  15403. default: ''
  15404. },
  15405. id: {
  15406. source: 'attribute',
  15407. selector: 'img',
  15408. attribute: 'data-id'
  15409. },
  15410. caption: {
  15411. type: 'string',
  15412. source: 'html',
  15413. selector: '.blocks-gallery-item__caption'
  15414. }
  15415. }
  15416. },
  15417. ids: {
  15418. type: 'array',
  15419. default: []
  15420. },
  15421. columns: {
  15422. type: 'number'
  15423. },
  15424. caption: {
  15425. type: 'string',
  15426. source: 'html',
  15427. selector: '.blocks-gallery-caption'
  15428. },
  15429. imageCrop: {
  15430. type: 'boolean',
  15431. default: true
  15432. },
  15433. linkTo: {
  15434. type: 'string',
  15435. default: 'none'
  15436. }
  15437. },
  15438. supports: {
  15439. align: true
  15440. },
  15441. isEligible(_ref5) {
  15442. let {
  15443. ids
  15444. } = _ref5;
  15445. return ids && ids.some(id => typeof id === 'string');
  15446. },
  15447. migrate(attributes) {
  15448. if (isGalleryV2Enabled()) {
  15449. return runV2Migration(attributes);
  15450. }
  15451. return { ...attributes,
  15452. ids: (0,external_lodash_namespaceObject.map)(attributes.ids, id => {
  15453. const parsedId = parseInt(id, 10);
  15454. return Number.isInteger(parsedId) ? parsedId : null;
  15455. })
  15456. };
  15457. },
  15458. save(_ref6) {
  15459. let {
  15460. attributes
  15461. } = _ref6;
  15462. const {
  15463. images,
  15464. columns = defaultColumnsNumberV1(attributes),
  15465. imageCrop,
  15466. caption,
  15467. linkTo
  15468. } = attributes;
  15469. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  15470. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  15471. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  15472. className: "blocks-gallery-grid"
  15473. }, images.map(image => {
  15474. let href;
  15475. switch (linkTo) {
  15476. case 'media':
  15477. href = image.fullUrl || image.url;
  15478. break;
  15479. case 'attachment':
  15480. href = image.link;
  15481. break;
  15482. }
  15483. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15484. src: image.url,
  15485. alt: image.alt,
  15486. "data-id": image.id,
  15487. "data-full-url": image.fullUrl,
  15488. "data-link": image.link,
  15489. className: image.id ? `wp-image-${image.id}` : null
  15490. });
  15491. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15492. key: image.id || image.url,
  15493. className: "blocks-gallery-item"
  15494. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15495. href: href
  15496. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15497. tagName: "figcaption",
  15498. className: "blocks-gallery-item__caption",
  15499. value: image.caption
  15500. })));
  15501. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15502. tagName: "figcaption",
  15503. className: "blocks-gallery-caption",
  15504. value: caption
  15505. }));
  15506. }
  15507. };
  15508. const gallery_deprecated_v3 = {
  15509. attributes: {
  15510. images: {
  15511. type: 'array',
  15512. default: [],
  15513. source: 'query',
  15514. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  15515. query: {
  15516. url: {
  15517. source: 'attribute',
  15518. selector: 'img',
  15519. attribute: 'src'
  15520. },
  15521. fullUrl: {
  15522. source: 'attribute',
  15523. selector: 'img',
  15524. attribute: 'data-full-url'
  15525. },
  15526. alt: {
  15527. source: 'attribute',
  15528. selector: 'img',
  15529. attribute: 'alt',
  15530. default: ''
  15531. },
  15532. id: {
  15533. source: 'attribute',
  15534. selector: 'img',
  15535. attribute: 'data-id'
  15536. },
  15537. link: {
  15538. source: 'attribute',
  15539. selector: 'img',
  15540. attribute: 'data-link'
  15541. },
  15542. caption: {
  15543. type: 'string',
  15544. source: 'html',
  15545. selector: 'figcaption'
  15546. }
  15547. }
  15548. },
  15549. ids: {
  15550. type: 'array',
  15551. default: []
  15552. },
  15553. columns: {
  15554. type: 'number'
  15555. },
  15556. imageCrop: {
  15557. type: 'boolean',
  15558. default: true
  15559. },
  15560. linkTo: {
  15561. type: 'string',
  15562. default: 'none'
  15563. }
  15564. },
  15565. supports: {
  15566. align: true
  15567. },
  15568. save(_ref7) {
  15569. let {
  15570. attributes
  15571. } = _ref7;
  15572. const {
  15573. images,
  15574. columns = defaultColumnsNumberV1(attributes),
  15575. imageCrop,
  15576. linkTo
  15577. } = attributes;
  15578. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  15579. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  15580. }, images.map(image => {
  15581. let href;
  15582. switch (linkTo) {
  15583. case 'media':
  15584. href = image.fullUrl || image.url;
  15585. break;
  15586. case 'attachment':
  15587. href = image.link;
  15588. break;
  15589. }
  15590. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15591. src: image.url,
  15592. alt: image.alt,
  15593. "data-id": image.id,
  15594. "data-full-url": image.fullUrl,
  15595. "data-link": image.link,
  15596. className: image.id ? `wp-image-${image.id}` : null
  15597. });
  15598. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15599. key: image.id || image.url,
  15600. className: "blocks-gallery-item"
  15601. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15602. href: href
  15603. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15604. tagName: "figcaption",
  15605. value: image.caption
  15606. })));
  15607. }));
  15608. },
  15609. migrate(attributes) {
  15610. if (isGalleryV2Enabled()) {
  15611. return runV2Migration(attributes);
  15612. }
  15613. return attributes;
  15614. }
  15615. };
  15616. const gallery_deprecated_v2 = {
  15617. attributes: {
  15618. images: {
  15619. type: 'array',
  15620. default: [],
  15621. source: 'query',
  15622. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  15623. query: {
  15624. url: {
  15625. source: 'attribute',
  15626. selector: 'img',
  15627. attribute: 'src'
  15628. },
  15629. alt: {
  15630. source: 'attribute',
  15631. selector: 'img',
  15632. attribute: 'alt',
  15633. default: ''
  15634. },
  15635. id: {
  15636. source: 'attribute',
  15637. selector: 'img',
  15638. attribute: 'data-id'
  15639. },
  15640. link: {
  15641. source: 'attribute',
  15642. selector: 'img',
  15643. attribute: 'data-link'
  15644. },
  15645. caption: {
  15646. type: 'string',
  15647. source: 'html',
  15648. selector: 'figcaption'
  15649. }
  15650. }
  15651. },
  15652. columns: {
  15653. type: 'number'
  15654. },
  15655. imageCrop: {
  15656. type: 'boolean',
  15657. default: true
  15658. },
  15659. linkTo: {
  15660. type: 'string',
  15661. default: 'none'
  15662. }
  15663. },
  15664. isEligible(_ref8) {
  15665. let {
  15666. images,
  15667. ids
  15668. } = _ref8;
  15669. return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || (0,external_lodash_namespaceObject.some)(images, (id, index) => {
  15670. if (!id && ids[index] !== null) {
  15671. return true;
  15672. }
  15673. return parseInt(id, 10) !== ids[index];
  15674. }));
  15675. },
  15676. migrate(attributes) {
  15677. if (isGalleryV2Enabled()) {
  15678. return runV2Migration(attributes);
  15679. }
  15680. return { ...attributes,
  15681. ids: (0,external_lodash_namespaceObject.map)(attributes.images, _ref9 => {
  15682. let {
  15683. id
  15684. } = _ref9;
  15685. if (!id) {
  15686. return null;
  15687. }
  15688. return parseInt(id, 10);
  15689. })
  15690. };
  15691. },
  15692. supports: {
  15693. align: true
  15694. },
  15695. save(_ref10) {
  15696. let {
  15697. attributes
  15698. } = _ref10;
  15699. const {
  15700. images,
  15701. columns = defaultColumnsNumberV1(attributes),
  15702. imageCrop,
  15703. linkTo
  15704. } = attributes;
  15705. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  15706. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  15707. }, images.map(image => {
  15708. let href;
  15709. switch (linkTo) {
  15710. case 'media':
  15711. href = image.url;
  15712. break;
  15713. case 'attachment':
  15714. href = image.link;
  15715. break;
  15716. }
  15717. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15718. src: image.url,
  15719. alt: image.alt,
  15720. "data-id": image.id,
  15721. "data-link": image.link,
  15722. className: image.id ? `wp-image-${image.id}` : null
  15723. });
  15724. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15725. key: image.id || image.url,
  15726. className: "blocks-gallery-item"
  15727. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15728. href: href
  15729. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15730. tagName: "figcaption",
  15731. value: image.caption
  15732. })));
  15733. }));
  15734. }
  15735. };
  15736. const gallery_deprecated_v1 = {
  15737. attributes: {
  15738. images: {
  15739. type: 'array',
  15740. default: [],
  15741. source: 'query',
  15742. selector: 'div.wp-block-gallery figure.blocks-gallery-image img',
  15743. query: {
  15744. url: {
  15745. source: 'attribute',
  15746. attribute: 'src'
  15747. },
  15748. alt: {
  15749. source: 'attribute',
  15750. attribute: 'alt',
  15751. default: ''
  15752. },
  15753. id: {
  15754. source: 'attribute',
  15755. attribute: 'data-id'
  15756. }
  15757. }
  15758. },
  15759. columns: {
  15760. type: 'number'
  15761. },
  15762. imageCrop: {
  15763. type: 'boolean',
  15764. default: true
  15765. },
  15766. linkTo: {
  15767. type: 'string',
  15768. default: 'none'
  15769. },
  15770. align: {
  15771. type: 'string',
  15772. default: 'none'
  15773. }
  15774. },
  15775. supports: {
  15776. align: true
  15777. },
  15778. save(_ref11) {
  15779. let {
  15780. attributes
  15781. } = _ref11;
  15782. const {
  15783. images,
  15784. columns = defaultColumnsNumberV1(attributes),
  15785. align,
  15786. imageCrop,
  15787. linkTo
  15788. } = attributes;
  15789. const className = classnames_default()(`columns-${columns}`, {
  15790. alignnone: align === 'none',
  15791. 'is-cropped': imageCrop
  15792. });
  15793. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15794. className: className
  15795. }, images.map(image => {
  15796. let href;
  15797. switch (linkTo) {
  15798. case 'media':
  15799. href = image.url;
  15800. break;
  15801. case 'attachment':
  15802. href = image.link;
  15803. break;
  15804. }
  15805. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15806. src: image.url,
  15807. alt: image.alt,
  15808. "data-id": image.id
  15809. });
  15810. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  15811. key: image.id || image.url,
  15812. className: "blocks-gallery-image"
  15813. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15814. href: href
  15815. }, img) : img);
  15816. }));
  15817. },
  15818. migrate(attributes) {
  15819. if (isGalleryV2Enabled()) {
  15820. return runV2Migration(attributes);
  15821. }
  15822. return attributes;
  15823. }
  15824. };
  15825. /* harmony default export */ var gallery_deprecated = ([deprecated_v7, deprecated_v6, deprecated_v5, deprecated_v4, gallery_deprecated_v3, gallery_deprecated_v2, gallery_deprecated_v1]);
  15826. ;// CONCATENATED MODULE: external ["wp","viewport"]
  15827. var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
  15828. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js
  15829. /**
  15830. * WordPress dependencies
  15831. */
  15832. const sharedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  15833. icon: library_gallery
  15834. });
  15835. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js
  15836. const MIN_SIZE = 20;
  15837. const constants_LINK_DESTINATION_NONE = 'none';
  15838. const constants_LINK_DESTINATION_MEDIA = 'media';
  15839. const constants_LINK_DESTINATION_ATTACHMENT = 'attachment';
  15840. const LINK_DESTINATION_CUSTOM = 'custom';
  15841. const constants_NEW_TAB_REL = ['noreferrer', 'noopener'];
  15842. const constants_ALLOWED_MEDIA_TYPES = ['image'];
  15843. const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
  15844. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js
  15845. /**
  15846. * Internal dependencies
  15847. */
  15848. /**
  15849. * Determines new href and linkDestination values for an Image block from the
  15850. * supplied Gallery link destination, or falls back to the Image blocks link.
  15851. *
  15852. * @param {Object} image Gallery image.
  15853. * @param {string} galleryDestination Gallery's selected link destination.
  15854. * @param {Object} imageDestination Image blocks attributes.
  15855. * @return {Object} New attributes to assign to image block.
  15856. */
  15857. function utils_getHrefAndDestination(image, galleryDestination, imageDestination) {
  15858. // Gutenberg and WordPress use different constants so if image_default_link_type
  15859. // option is set we need to map from the WP Core values.
  15860. switch (imageDestination ? imageDestination : galleryDestination) {
  15861. case LINK_DESTINATION_MEDIA_WP_CORE:
  15862. case LINK_DESTINATION_MEDIA:
  15863. return {
  15864. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  15865. // eslint-disable-line camelcase
  15866. linkDestination: constants_LINK_DESTINATION_MEDIA
  15867. };
  15868. case LINK_DESTINATION_ATTACHMENT_WP_CORE:
  15869. case LINK_DESTINATION_ATTACHMENT:
  15870. return {
  15871. href: image === null || image === void 0 ? void 0 : image.link,
  15872. linkDestination: constants_LINK_DESTINATION_ATTACHMENT
  15873. };
  15874. case LINK_DESTINATION_NONE:
  15875. return {
  15876. href: undefined,
  15877. linkDestination: constants_LINK_DESTINATION_NONE
  15878. };
  15879. }
  15880. return {};
  15881. }
  15882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js
  15883. /**
  15884. * External dependencies
  15885. */
  15886. /**
  15887. * Internal dependencies
  15888. */
  15889. function removeNewTabRel(currentRel) {
  15890. let newRel = currentRel;
  15891. if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  15892. if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  15893. constants_NEW_TAB_REL.forEach(relVal => {
  15894. const regExp = new RegExp('\\b' + relVal + '\\b', 'gi');
  15895. newRel = newRel.replace(regExp, '');
  15896. }); // Only trim if NEW_TAB_REL values was replaced.
  15897. if (newRel !== currentRel) {
  15898. newRel = newRel.trim();
  15899. }
  15900. if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  15901. newRel = undefined;
  15902. }
  15903. }
  15904. }
  15905. return newRel;
  15906. }
  15907. /**
  15908. * Helper to get the link target settings to be stored.
  15909. *
  15910. * @param {boolean} value The new link target value.
  15911. * @param {Object} attributes Block attributes.
  15912. * @param {Object} attributes.rel Image block's rel attribute.
  15913. *
  15914. * @return {Object} Updated link target settings.
  15915. */
  15916. function getUpdatedLinkTargetSettings(value, _ref) {
  15917. let {
  15918. rel
  15919. } = _ref;
  15920. const linkTarget = value ? '_blank' : undefined;
  15921. let updatedRel;
  15922. if (!linkTarget && !rel) {
  15923. updatedRel = undefined;
  15924. } else {
  15925. updatedRel = removeNewTabRel(rel);
  15926. }
  15927. return {
  15928. linkTarget,
  15929. rel: updatedRel
  15930. };
  15931. }
  15932. /**
  15933. * Determines new Image block attributes size selection.
  15934. *
  15935. * @param {Object} image Media file object for gallery image.
  15936. * @param {string} size Selected size slug to apply.
  15937. */
  15938. function getImageSizeAttributes(image, size) {
  15939. const url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']);
  15940. if (url) {
  15941. return {
  15942. url,
  15943. width: undefined,
  15944. height: undefined,
  15945. sizeSlug: size
  15946. };
  15947. }
  15948. return {};
  15949. }
  15950. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js
  15951. /**
  15952. * External dependencies
  15953. */
  15954. /**
  15955. * WordPress dependencies
  15956. */
  15957. const allowedBlocks = ['core/image'];
  15958. const Gallery = props => {
  15959. const {
  15960. attributes,
  15961. isSelected,
  15962. setAttributes,
  15963. mediaPlaceholder,
  15964. insertBlocksAfter,
  15965. blockProps
  15966. } = props;
  15967. const {
  15968. align,
  15969. columns,
  15970. caption,
  15971. imageCrop
  15972. } = attributes;
  15973. const {
  15974. children,
  15975. ...innerBlocksProps
  15976. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  15977. allowedBlocks,
  15978. orientation: 'horizontal',
  15979. renderAppender: false,
  15980. __experimentalLayout: {
  15981. type: 'default',
  15982. alignments: []
  15983. }
  15984. });
  15985. const [captionFocused, setCaptionFocused] = (0,external_wp_element_namespaceObject.useState)(false);
  15986. function onFocusCaption() {
  15987. if (!captionFocused) {
  15988. setCaptionFocused(true);
  15989. }
  15990. }
  15991. function removeCaptionFocus() {
  15992. if (captionFocused) {
  15993. setCaptionFocused(false);
  15994. }
  15995. }
  15996. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15997. if (!isSelected) {
  15998. setCaptionFocused(false);
  15999. }
  16000. }, [isSelected]);
  16001. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, innerBlocksProps, {
  16002. className: classnames_default()(blockProps.className, 'blocks-gallery-grid', {
  16003. [`align${align}`]: align,
  16004. [`columns-${columns}`]: columns !== undefined,
  16005. [`columns-default`]: columns === undefined,
  16006. 'is-cropped': imageCrop
  16007. })
  16008. }), children, isSelected && !children && (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  16009. className: "blocks-gallery-media-placeholder-wrapper",
  16010. onClick: removeCaptionFocus
  16011. }, mediaPlaceholder), (0,external_wp_element_namespaceObject.createElement)(RichTextVisibilityHelper, {
  16012. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  16013. captionFocused: captionFocused,
  16014. onFocusCaption: onFocusCaption,
  16015. tagName: "figcaption",
  16016. className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
  16017. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  16018. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  16019. value: caption,
  16020. onChange: value => setAttributes({
  16021. caption: value
  16022. }),
  16023. inlineToolbar: true,
  16024. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  16025. }));
  16026. };
  16027. function RichTextVisibilityHelper(_ref) {
  16028. let {
  16029. isHidden,
  16030. captionFocused,
  16031. onFocusCaption,
  16032. className,
  16033. value,
  16034. placeholder,
  16035. tagName,
  16036. captionRef,
  16037. ...richTextProps
  16038. } = _ref;
  16039. if (isHidden) {
  16040. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  16041. as: external_wp_blockEditor_namespaceObject.RichText
  16042. }, richTextProps));
  16043. }
  16044. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  16045. ref: captionRef,
  16046. value: value,
  16047. placeholder: placeholder,
  16048. className: className,
  16049. tagName: tagName,
  16050. isSelected: captionFocused,
  16051. onClick: onFocusCaption
  16052. }, richTextProps));
  16053. }
  16054. /* harmony default export */ var gallery_gallery = (Gallery);
  16055. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js
  16056. /**
  16057. * External dependencies
  16058. */
  16059. /**
  16060. * WordPress dependencies
  16061. */
  16062. /**
  16063. * Calculates the image sizes that are avaible for the current gallery images in order to
  16064. * populate the 'Image size' selector.
  16065. *
  16066. * @param {Array} images Basic image block data taken from current gallery innerBlock
  16067. * @param {boolean} isSelected Is the block currently selected in the editor.
  16068. * @param {Function} getSettings Block editor store selector.
  16069. *
  16070. * @return {Array} An array of image size options.
  16071. */
  16072. function useImageSizes(images, isSelected, getSettings) {
  16073. return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]);
  16074. function getImageSizing() {
  16075. if (!images || images.length === 0) {
  16076. return;
  16077. }
  16078. const {
  16079. imageSizes
  16080. } = getSettings();
  16081. let resizedImages = {};
  16082. if (isSelected) {
  16083. resizedImages = images.reduce((currentResizedImages, img) => {
  16084. if (!img.id) {
  16085. return currentResizedImages;
  16086. }
  16087. const sizes = imageSizes.reduce((currentSizes, size) => {
  16088. const defaultUrl = (0,external_lodash_namespaceObject.get)(img, ['sizes', size.slug, 'url']);
  16089. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(img, ['media_details', 'sizes', size.slug, 'source_url']);
  16090. return { ...currentSizes,
  16091. [size.slug]: defaultUrl || mediaDetailsUrl
  16092. };
  16093. }, {});
  16094. return { ...currentResizedImages,
  16095. [parseInt(img.id, 10)]: sizes
  16096. };
  16097. }, {});
  16098. }
  16099. return imageSizes.filter(_ref => {
  16100. let {
  16101. slug
  16102. } = _ref;
  16103. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  16104. }).map(_ref2 => {
  16105. let {
  16106. name,
  16107. slug
  16108. } = _ref2;
  16109. return {
  16110. value: slug,
  16111. label: name
  16112. };
  16113. });
  16114. }
  16115. }
  16116. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js
  16117. /**
  16118. * WordPress dependencies
  16119. */
  16120. /**
  16121. * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This
  16122. * is required so default gallery attributes can be applied without overwriting any custom
  16123. * attributes applied to existing images.
  16124. *
  16125. * @param {Array} images Basic image block data taken from current gallery innerBlock
  16126. * @param {Array} imageData The related image data for each of the current gallery images.
  16127. *
  16128. * @return {Array} An array of any new images that have been added to the gallery.
  16129. */
  16130. function useGetNewImages(images, imageData) {
  16131. const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]);
  16132. return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]);
  16133. function getNewImages() {
  16134. let imagesUpdated = false; // First lets check if any images have been deleted.
  16135. const newCurrentImages = currentImages.filter(currentImg => images.find(img => {
  16136. return currentImg.clientId === img.clientId;
  16137. }));
  16138. if (newCurrentImages.length < currentImages.length) {
  16139. imagesUpdated = true;
  16140. } // Now lets see if we have any images hydrated from saved content and if so
  16141. // add them to currentImages state.
  16142. images.forEach(image => {
  16143. if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) {
  16144. imagesUpdated = true;
  16145. newCurrentImages.push(image);
  16146. }
  16147. }); // Now check for any new images that have been added to InnerBlocks and for which
  16148. // we have the imageData we need for setting default block attributes.
  16149. const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && (imageData === null || imageData === void 0 ? void 0 : imageData.find(img => img.id === image.id)) && !image.fromSavedConent);
  16150. if (imagesUpdated || (newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  16151. setCurrentImages([...newCurrentImages, ...newImages]);
  16152. }
  16153. return newImages.length > 0 ? newImages : null;
  16154. }
  16155. }
  16156. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js
  16157. /**
  16158. * WordPress dependencies
  16159. */
  16160. const EMPTY_IMAGE_MEDIA = [];
  16161. /**
  16162. * Retrieves the extended media info for each gallery image from the store. This is used to
  16163. * determine which image size options are available for the current gallery.
  16164. *
  16165. * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.
  16166. *
  16167. * @return {Array} An array of media info options for each gallery image.
  16168. */
  16169. function useGetMedia(innerBlockImages) {
  16170. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  16171. var _select$getMediaItems;
  16172. const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined);
  16173. if (imageIds.length === 0) {
  16174. return EMPTY_IMAGE_MEDIA;
  16175. }
  16176. return (_select$getMediaItems = select(external_wp_coreData_namespaceObject.store).getMediaItems({
  16177. include: imageIds.join(','),
  16178. per_page: imageIds.length,
  16179. orderby: 'include'
  16180. })) !== null && _select$getMediaItems !== void 0 ? _select$getMediaItems : EMPTY_IMAGE_MEDIA;
  16181. }, [innerBlockImages]);
  16182. }
  16183. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js
  16184. /**
  16185. * WordPress dependencies
  16186. */
  16187. function GapStyles(_ref) {
  16188. let {
  16189. blockGap,
  16190. clientId
  16191. } = _ref;
  16192. const styleElement = (0,external_wp_element_namespaceObject.useContext)(external_wp_blockEditor_namespaceObject.BlockList.__unstableElementContext); // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
  16193. // gap on the gallery.
  16194. const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
  16195. let gapValue = fallbackValue;
  16196. let column = fallbackValue;
  16197. let row; // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736
  16198. if (!!blockGap) {
  16199. row = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap === null || blockGap === void 0 ? void 0 : blockGap.top) || fallbackValue;
  16200. column = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap === null || blockGap === void 0 ? void 0 : blockGap.left) || fallbackValue;
  16201. gapValue = row === column ? row : `${row} ${column}`;
  16202. } // The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`.
  16203. const gap = `#block-${clientId} {
  16204. --wp--style--unstable-gallery-gap: ${column === '0' ? '0px' : column};
  16205. gap: ${gapValue}
  16206. }`;
  16207. const GapStyle = () => {
  16208. return (0,external_wp_element_namespaceObject.createElement)("style", null, gap);
  16209. };
  16210. return gap && styleElement ? (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(GapStyle, null), styleElement) : null;
  16211. }
  16212. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js
  16213. /**
  16214. * External dependencies
  16215. */
  16216. /**
  16217. * WordPress dependencies
  16218. */
  16219. /**
  16220. * Internal dependencies
  16221. */
  16222. const MAX_COLUMNS = 8;
  16223. const linkOptions = [{
  16224. value: LINK_DESTINATION_ATTACHMENT,
  16225. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  16226. }, {
  16227. value: LINK_DESTINATION_MEDIA,
  16228. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  16229. }, {
  16230. value: LINK_DESTINATION_NONE,
  16231. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option')
  16232. }];
  16233. const edit_ALLOWED_MEDIA_TYPES = ['image'];
  16234. const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.');
  16235. const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? {
  16236. type: 'stepper'
  16237. } : {};
  16238. function GalleryEdit(props) {
  16239. var _attributes$style, _attributes$style$spa;
  16240. const {
  16241. setAttributes,
  16242. attributes,
  16243. className,
  16244. clientId,
  16245. isSelected,
  16246. insertBlocksAfter
  16247. } = props;
  16248. const {
  16249. columns,
  16250. imageCrop,
  16251. linkTarget,
  16252. linkTo,
  16253. sizeSlug
  16254. } = attributes;
  16255. const {
  16256. __unstableMarkNextChangeAsNotPersistent,
  16257. replaceInnerBlocks,
  16258. updateBlockAttributes,
  16259. selectBlock,
  16260. clearSelectedBlock
  16261. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  16262. const {
  16263. createSuccessNotice,
  16264. createErrorNotice
  16265. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  16266. const {
  16267. getBlock,
  16268. getSettings,
  16269. preferredStyle
  16270. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  16271. var _preferredStyleVariat;
  16272. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  16273. const preferredStyleVariations = settings.__experimentalPreferredStyleVariations;
  16274. return {
  16275. getBlock: select(external_wp_blockEditor_namespaceObject.store).getBlock,
  16276. getSettings: select(external_wp_blockEditor_namespaceObject.store).getSettings,
  16277. preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat['core/image']
  16278. };
  16279. }, []);
  16280. const innerBlockImages = (0,external_wp_data_namespaceObject.useSelect)(select => {
  16281. var _select$getBlock;
  16282. return (_select$getBlock = select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks;
  16283. }, [clientId]);
  16284. const wasBlockJustInserted = (0,external_wp_data_namespaceObject.useSelect)(select => {
  16285. return select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu');
  16286. }, [clientId]);
  16287. const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({
  16288. clientId: block.clientId,
  16289. id: block.attributes.id,
  16290. url: block.attributes.url,
  16291. attributes: block.attributes,
  16292. fromSavedContent: Boolean(block.originalContent)
  16293. })), [innerBlockImages]);
  16294. const imageData = useGetMedia(innerBlockImages);
  16295. const newImages = useGetNewImages(images, imageData);
  16296. (0,external_wp_element_namespaceObject.useEffect)(() => {
  16297. newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => {
  16298. // Update the images data without creating new undo levels.
  16299. __unstableMarkNextChangeAsNotPersistent();
  16300. updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes),
  16301. id: newImage.id,
  16302. align: undefined
  16303. });
  16304. });
  16305. if ((newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  16306. clearSelectedBlock();
  16307. }
  16308. }, [newImages]);
  16309. const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings);
  16310. /**
  16311. * Determines the image attributes that should be applied to an image block
  16312. * after the gallery updates.
  16313. *
  16314. * The gallery will receive the full collection of images when a new image
  16315. * is added. As a result we need to reapply the image's original settings if
  16316. * it already existed in the gallery. If the image is in fact new, we need
  16317. * to apply the gallery's current settings to the image.
  16318. *
  16319. * @param {Object} imageAttributes Media object for the actual image.
  16320. * @return {Object} Attributes to set on the new image block.
  16321. */
  16322. function buildImageAttributes(imageAttributes) {
  16323. var _image$caption;
  16324. const image = imageAttributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  16325. id: imageAttributes.id
  16326. }) : null;
  16327. let newClassName;
  16328. if (imageAttributes.className && imageAttributes.className !== '') {
  16329. newClassName = imageAttributes.className;
  16330. } else {
  16331. newClassName = preferredStyle ? `is-style-${preferredStyle}` : undefined;
  16332. }
  16333. let newLinkTarget;
  16334. if (imageAttributes.linkTarget || imageAttributes.rel) {
  16335. // When transformed from image blocks, the link destination and rel attributes are inherited.
  16336. newLinkTarget = {
  16337. linkTarget: imageAttributes.linkTarget,
  16338. rel: imageAttributes.rel
  16339. };
  16340. } else {
  16341. // When an image is added, update the link destination and rel attributes according to the gallery settings
  16342. newLinkTarget = getUpdatedLinkTargetSettings(linkTarget, attributes);
  16343. }
  16344. return { ...pickRelevantMediaFiles(image, sizeSlug),
  16345. ...utils_getHrefAndDestination(image, linkTo, imageAttributes === null || imageAttributes === void 0 ? void 0 : imageAttributes.linkDestination),
  16346. ...newLinkTarget,
  16347. className: newClassName,
  16348. sizeSlug,
  16349. caption: imageAttributes.caption || ((_image$caption = image.caption) === null || _image$caption === void 0 ? void 0 : _image$caption.raw),
  16350. alt: imageAttributes.alt || image.alt_text
  16351. };
  16352. }
  16353. function isValidFileType(file) {
  16354. var _file$url;
  16355. return edit_ALLOWED_MEDIA_TYPES.some(mediaType => {
  16356. var _file$type;
  16357. return ((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf(mediaType)) === 0;
  16358. }) || ((_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.indexOf('blob:')) === 0;
  16359. }
  16360. function updateImages(selectedImages) {
  16361. const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]';
  16362. const imageArray = newFileUploads ? Array.from(selectedImages).map(file => {
  16363. if (!file.url) {
  16364. return pickRelevantMediaFiles({
  16365. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  16366. });
  16367. }
  16368. return file;
  16369. }) : selectedImages;
  16370. if (!imageArray.every(isValidFileType)) {
  16371. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  16372. id: 'gallery-upload-invalid-file',
  16373. type: 'snackbar'
  16374. });
  16375. }
  16376. const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => {
  16377. if (!file.url) {
  16378. return pickRelevantMediaFiles({
  16379. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  16380. });
  16381. }
  16382. return file;
  16383. }); // Because we are reusing existing innerImage blocks any reordering
  16384. // done in the media library will be lost so we need to reapply that ordering
  16385. // once the new image blocks are merged in with existing.
  16386. const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {});
  16387. const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages;
  16388. const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id));
  16389. const newBlocks = newImageList.map(image => {
  16390. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  16391. id: image.id,
  16392. url: image.url,
  16393. caption: image.caption,
  16394. alt: image.alt
  16395. });
  16396. });
  16397. if ((newBlocks === null || newBlocks === void 0 ? void 0 : newBlocks.length) > 0) {
  16398. selectBlock(newBlocks[0].clientId);
  16399. }
  16400. replaceInnerBlocks(clientId, existingImageBlocks.concat(newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id]));
  16401. }
  16402. function onUploadError(message) {
  16403. createErrorNotice(message, {
  16404. type: 'snackbar'
  16405. });
  16406. }
  16407. function setLinkTo(value) {
  16408. setAttributes({
  16409. linkTo: value
  16410. });
  16411. const changedAttributes = {};
  16412. const blocks = [];
  16413. getBlock(clientId).innerBlocks.forEach(block => {
  16414. blocks.push(block.clientId);
  16415. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  16416. id: block.attributes.id
  16417. }) : null;
  16418. changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value);
  16419. });
  16420. updateBlockAttributes(blocks, changedAttributes, true);
  16421. const linkToText = [...linkOptions].find(linkType => linkType.value === value);
  16422. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  16423. /* translators: %s: image size settings */
  16424. (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), {
  16425. id: 'gallery-attributes-linkTo',
  16426. type: 'snackbar'
  16427. });
  16428. }
  16429. function setColumnsNumber(value) {
  16430. setAttributes({
  16431. columns: value
  16432. });
  16433. }
  16434. function toggleImageCrop() {
  16435. setAttributes({
  16436. imageCrop: !imageCrop
  16437. });
  16438. }
  16439. function getImageCropHelp(checked) {
  16440. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  16441. }
  16442. function toggleOpenInNewTab(openInNewTab) {
  16443. const newLinkTarget = openInNewTab ? '_blank' : undefined;
  16444. setAttributes({
  16445. linkTarget: newLinkTarget
  16446. });
  16447. const changedAttributes = {};
  16448. const blocks = [];
  16449. getBlock(clientId).innerBlocks.forEach(block => {
  16450. blocks.push(block.clientId);
  16451. changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes);
  16452. });
  16453. updateBlockAttributes(blocks, changedAttributes, true);
  16454. const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab');
  16455. createSuccessNotice(noticeText, {
  16456. id: 'gallery-attributes-openInNewTab',
  16457. type: 'snackbar'
  16458. });
  16459. }
  16460. function updateImagesSize(newSizeSlug) {
  16461. setAttributes({
  16462. sizeSlug: newSizeSlug
  16463. });
  16464. const changedAttributes = {};
  16465. const blocks = [];
  16466. getBlock(clientId).innerBlocks.forEach(block => {
  16467. blocks.push(block.clientId);
  16468. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  16469. id: block.attributes.id
  16470. }) : null;
  16471. changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug);
  16472. });
  16473. updateBlockAttributes(blocks, changedAttributes, true);
  16474. const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug);
  16475. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  16476. /* translators: %s: image size settings */
  16477. (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), {
  16478. id: 'gallery-attributes-sizeSlug',
  16479. type: 'snackbar'
  16480. });
  16481. }
  16482. (0,external_wp_element_namespaceObject.useEffect)(() => {
  16483. // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.
  16484. if (!linkTo) {
  16485. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  16486. __unstableMarkNextChangeAsNotPersistent();
  16487. setAttributes({
  16488. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || LINK_DESTINATION_NONE
  16489. });
  16490. }
  16491. }, [linkTo]);
  16492. const hasImages = !!images.length;
  16493. const hasImageIds = hasImages && images.some(image => !!image.id);
  16494. const imagesUploading = images.some(img => {
  16495. var _img$url, _img$url2;
  16496. return !external_wp_element_namespaceObject.Platform.isNative ? !img.id && ((_img$url = img.url) === null || _img$url === void 0 ? void 0 : _img$url.indexOf('blob:')) === 0 : ((_img$url2 = img.url) === null || _img$url2 === void 0 ? void 0 : _img$url2.indexOf('file:')) === 0;
  16497. }); // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set.
  16498. const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({
  16499. web: {
  16500. addToGallery: false,
  16501. disableMediaButtons: imagesUploading,
  16502. value: {}
  16503. },
  16504. native: {
  16505. addToGallery: hasImageIds,
  16506. isAppender: hasImages,
  16507. disableMediaButtons: hasImages && !isSelected || imagesUploading,
  16508. value: hasImageIds ? images : {},
  16509. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  16510. }
  16511. });
  16512. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, _extends({
  16513. handleUpload: false,
  16514. icon: sharedIcon,
  16515. labels: {
  16516. title: (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  16517. instructions: PLACEHOLDER_TEXT
  16518. },
  16519. onSelect: updateImages,
  16520. accept: "image/*",
  16521. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  16522. multiple: true,
  16523. onError: onUploadError
  16524. }, mediaPlaceholderProps));
  16525. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  16526. className: classnames_default()(className, 'has-nested-images')
  16527. });
  16528. if (!hasImages) {
  16529. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  16530. }
  16531. const hasLinkTo = linkTo && linkTo !== 'none';
  16532. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  16533. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  16534. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  16535. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  16536. value: columns ? columns : defaultColumnsNumber(images.length),
  16537. onChange: setColumnsNumber,
  16538. min: 1,
  16539. max: Math.min(MAX_COLUMNS, images.length)
  16540. }, MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  16541. required: true
  16542. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  16543. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  16544. checked: !!imageCrop,
  16545. onChange: toggleImageCrop,
  16546. help: getImageCropHelp
  16547. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  16548. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  16549. value: linkTo,
  16550. onChange: setLinkTo,
  16551. options: linkOptions,
  16552. hideCancelButton: true
  16553. }), hasLinkTo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  16554. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  16555. checked: linkTarget === '_blank',
  16556. onChange: toggleOpenInNewTab
  16557. }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  16558. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  16559. value: sizeSlug,
  16560. options: imageSizeOptions,
  16561. onChange: updateImagesSize,
  16562. hideCancelButton: true
  16563. }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  16564. className: 'gallery-image-sizes'
  16565. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image size')), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  16566. className: 'gallery-image-sizes__loading'
  16567. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  16568. group: "other"
  16569. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  16570. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  16571. accept: "image/*",
  16572. handleUpload: false,
  16573. onSelect: updateImages,
  16574. name: (0,external_wp_i18n_namespaceObject.__)('Add'),
  16575. multiple: true,
  16576. mediaIds: images.filter(image => image.id).map(image => image.id),
  16577. addToGallery: hasImageIds
  16578. })), external_wp_element_namespaceObject.Platform.isWeb && (0,external_wp_element_namespaceObject.createElement)(GapStyles, {
  16579. blockGap: (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.blockGap,
  16580. clientId: clientId
  16581. }), (0,external_wp_element_namespaceObject.createElement)(gallery_gallery, _extends({}, props, {
  16582. images: images,
  16583. mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined,
  16584. blockProps: blockProps,
  16585. insertBlocksAfter: insertBlocksAfter
  16586. })));
  16587. }
  16588. /* harmony default export */ var gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_viewport_namespaceObject.withViewportMatch)({
  16589. isNarrow: '< small'
  16590. })])(GalleryEdit));
  16591. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js
  16592. /**
  16593. * External dependencies
  16594. */
  16595. const shared_pickRelevantMediaFiles = function (image) {
  16596. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  16597. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  16598. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
  16599. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  16600. if (fullUrl) {
  16601. imageProps.fullUrl = fullUrl;
  16602. }
  16603. return imageProps;
  16604. };
  16605. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js
  16606. /**
  16607. * WordPress dependencies
  16608. */
  16609. const image_image = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16610. viewBox: "0 0 24 24",
  16611. xmlns: "http://www.w3.org/2000/svg"
  16612. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16613. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  16614. }));
  16615. /* harmony default export */ var library_image = (image_image);
  16616. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
  16617. /**
  16618. * WordPress dependencies
  16619. */
  16620. const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16621. xmlns: "http://www.w3.org/2000/svg",
  16622. viewBox: "0 0 24 24"
  16623. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16624. d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
  16625. }));
  16626. /* harmony default export */ var chevron_left = (chevronLeft);
  16627. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
  16628. /**
  16629. * WordPress dependencies
  16630. */
  16631. const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16632. xmlns: "http://www.w3.org/2000/svg",
  16633. viewBox: "0 0 24 24"
  16634. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16635. d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
  16636. }));
  16637. /* harmony default export */ var chevron_right = (chevronRight);
  16638. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  16639. /**
  16640. * WordPress dependencies
  16641. */
  16642. const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16643. xmlns: "http://www.w3.org/2000/svg",
  16644. viewBox: "0 0 24 24"
  16645. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16646. 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"
  16647. }));
  16648. /* harmony default export */ var close_small = (closeSmall);
  16649. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js
  16650. const v1_constants_LINK_DESTINATION_NONE = 'none';
  16651. const v1_constants_LINK_DESTINATION_MEDIA = 'file';
  16652. const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post';
  16653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js
  16654. /**
  16655. * External dependencies
  16656. */
  16657. /**
  16658. * WordPress dependencies
  16659. */
  16660. /**
  16661. * Internal dependencies
  16662. */
  16663. const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  16664. class GalleryImage extends external_wp_element_namespaceObject.Component {
  16665. constructor() {
  16666. super(...arguments);
  16667. this.onSelectImage = this.onSelectImage.bind(this);
  16668. this.onRemoveImage = this.onRemoveImage.bind(this);
  16669. this.bindContainer = this.bindContainer.bind(this);
  16670. this.onEdit = this.onEdit.bind(this);
  16671. this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this);
  16672. this.onSelectCustomURL = this.onSelectCustomURL.bind(this);
  16673. this.state = {
  16674. isEditing: false
  16675. };
  16676. }
  16677. bindContainer(ref) {
  16678. this.container = ref;
  16679. }
  16680. onSelectImage() {
  16681. if (!this.props.isSelected) {
  16682. this.props.onSelect();
  16683. }
  16684. }
  16685. onRemoveImage(event) {
  16686. if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) {
  16687. event.preventDefault();
  16688. this.props.onRemove();
  16689. }
  16690. }
  16691. onEdit() {
  16692. this.setState({
  16693. isEditing: true
  16694. });
  16695. }
  16696. componentDidUpdate() {
  16697. const {
  16698. image,
  16699. url,
  16700. __unstableMarkNextChangeAsNotPersistent
  16701. } = this.props;
  16702. if (image && !url) {
  16703. __unstableMarkNextChangeAsNotPersistent();
  16704. this.props.setAttributes({
  16705. url: image.source_url,
  16706. alt: image.alt_text
  16707. });
  16708. }
  16709. }
  16710. deselectOnBlur() {
  16711. this.props.onDeselect();
  16712. }
  16713. onSelectImageFromLibrary(media) {
  16714. const {
  16715. setAttributes,
  16716. id,
  16717. url,
  16718. alt,
  16719. caption,
  16720. sizeSlug
  16721. } = this.props;
  16722. if (!media || !media.url) {
  16723. return;
  16724. }
  16725. let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); // If the current image is temporary but an alt text was meanwhile
  16726. // written by the user, make sure the text is not overwritten.
  16727. if (isTemporaryImage(id, url)) {
  16728. if (alt) {
  16729. const {
  16730. alt: omittedAlt,
  16731. ...restMediaAttributes
  16732. } = mediaAttributes;
  16733. mediaAttributes = restMediaAttributes;
  16734. }
  16735. } // If a caption text was meanwhile written by the user,
  16736. // make sure the text is not overwritten by empty captions.
  16737. if (caption && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  16738. const {
  16739. caption: omittedCaption,
  16740. ...restMediaAttributes
  16741. } = mediaAttributes;
  16742. mediaAttributes = restMediaAttributes;
  16743. }
  16744. setAttributes(mediaAttributes);
  16745. this.setState({
  16746. isEditing: false
  16747. });
  16748. }
  16749. onSelectCustomURL(newURL) {
  16750. const {
  16751. setAttributes,
  16752. url
  16753. } = this.props;
  16754. if (newURL !== url) {
  16755. setAttributes({
  16756. url: newURL,
  16757. id: undefined
  16758. });
  16759. this.setState({
  16760. isEditing: false
  16761. });
  16762. }
  16763. }
  16764. render() {
  16765. const {
  16766. url,
  16767. alt,
  16768. id,
  16769. linkTo,
  16770. link,
  16771. isFirstItem,
  16772. isLastItem,
  16773. isSelected,
  16774. caption,
  16775. onRemove,
  16776. onMoveForward,
  16777. onMoveBackward,
  16778. setAttributes,
  16779. 'aria-label': ariaLabel
  16780. } = this.props;
  16781. const {
  16782. isEditing
  16783. } = this.state;
  16784. let href;
  16785. switch (linkTo) {
  16786. case v1_constants_LINK_DESTINATION_MEDIA:
  16787. href = url;
  16788. break;
  16789. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  16790. href = link;
  16791. break;
  16792. }
  16793. const img = // Disable reason: Image itself is not meant to be interactive, but should
  16794. // direct image selection and unfocus caption fields.
  16795. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
  16796. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  16797. src: url,
  16798. alt: alt,
  16799. "data-id": id,
  16800. onKeyDown: this.onRemoveImage,
  16801. tabIndex: "0",
  16802. "aria-label": ariaLabel,
  16803. ref: this.bindContainer
  16804. }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  16805. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
  16806. ;
  16807. const className = classnames_default()({
  16808. 'is-selected': isSelected,
  16809. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url)
  16810. });
  16811. return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
  16812. (0,external_wp_element_namespaceObject.createElement)("figure", {
  16813. className: className,
  16814. onClick: this.onSelectImage,
  16815. onFocus: this.onSelectImage
  16816. }, !isEditing && (href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  16817. href: href
  16818. }, img) : img), isEditing && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  16819. labels: {
  16820. title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image')
  16821. },
  16822. icon: library_image,
  16823. onSelect: this.onSelectImageFromLibrary,
  16824. onSelectURL: this.onSelectCustomURL,
  16825. accept: "image/*",
  16826. allowedTypes: ['image'],
  16827. value: {
  16828. id,
  16829. src: url
  16830. }
  16831. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  16832. className: "block-library-gallery-item__inline-menu is-left"
  16833. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  16834. icon: chevron_left,
  16835. onClick: isFirstItem ? undefined : onMoveBackward,
  16836. label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'),
  16837. "aria-disabled": isFirstItem,
  16838. disabled: !isSelected
  16839. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  16840. icon: chevron_right,
  16841. onClick: isLastItem ? undefined : onMoveForward,
  16842. label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'),
  16843. "aria-disabled": isLastItem,
  16844. disabled: !isSelected
  16845. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  16846. className: "block-library-gallery-item__inline-menu is-right"
  16847. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  16848. icon: library_edit,
  16849. onClick: this.onEdit,
  16850. label: (0,external_wp_i18n_namespaceObject.__)('Replace image'),
  16851. disabled: !isSelected
  16852. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  16853. icon: close_small,
  16854. onClick: onRemove,
  16855. label: (0,external_wp_i18n_namespaceObject.__)('Remove image'),
  16856. disabled: !isSelected
  16857. })), !isEditing && (isSelected || caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  16858. tagName: "figcaption",
  16859. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  16860. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  16861. placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null,
  16862. value: caption,
  16863. onChange: newCaption => setAttributes({
  16864. caption: newCaption
  16865. }),
  16866. inlineToolbar: true
  16867. }))
  16868. );
  16869. }
  16870. }
  16871. /* harmony default export */ var gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
  16872. const {
  16873. getMedia
  16874. } = select(external_wp_coreData_namespaceObject.store);
  16875. const {
  16876. id
  16877. } = ownProps;
  16878. return {
  16879. image: id ? getMedia(parseInt(id, 10)) : null
  16880. };
  16881. }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
  16882. const {
  16883. __unstableMarkNextChangeAsNotPersistent
  16884. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  16885. return {
  16886. __unstableMarkNextChangeAsNotPersistent
  16887. };
  16888. })])(GalleryImage));
  16889. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js
  16890. /**
  16891. * External dependencies
  16892. */
  16893. /**
  16894. * WordPress dependencies
  16895. */
  16896. /**
  16897. * Internal dependencies
  16898. */
  16899. const gallery_Gallery = props => {
  16900. const {
  16901. attributes,
  16902. isSelected,
  16903. setAttributes,
  16904. selectedImage,
  16905. mediaPlaceholder,
  16906. onMoveBackward,
  16907. onMoveForward,
  16908. onRemoveImage,
  16909. onSelectImage,
  16910. onDeselectImage,
  16911. onSetImageAttributes,
  16912. insertBlocksAfter,
  16913. blockProps
  16914. } = props;
  16915. const {
  16916. align,
  16917. columns = defaultColumnsNumberV1(attributes),
  16918. caption,
  16919. imageCrop,
  16920. images
  16921. } = attributes;
  16922. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, blockProps, {
  16923. className: classnames_default()(blockProps.className, {
  16924. [`align${align}`]: align,
  16925. [`columns-${columns}`]: columns,
  16926. 'is-cropped': imageCrop
  16927. })
  16928. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  16929. className: "blocks-gallery-grid"
  16930. }, images.map((img, index) => {
  16931. const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
  16932. /* translators: 1: the order number of the image. 2: the total number of images. */
  16933. (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length);
  16934. return (0,external_wp_element_namespaceObject.createElement)("li", {
  16935. className: "blocks-gallery-item",
  16936. key: img.id ? `${img.id}-${index}` : img.url
  16937. }, (0,external_wp_element_namespaceObject.createElement)(gallery_image, {
  16938. url: img.url,
  16939. alt: img.alt,
  16940. id: img.id,
  16941. isFirstItem: index === 0,
  16942. isLastItem: index + 1 === images.length,
  16943. isSelected: isSelected && selectedImage === index,
  16944. onMoveBackward: onMoveBackward(index),
  16945. onMoveForward: onMoveForward(index),
  16946. onRemove: onRemoveImage(index),
  16947. onSelect: onSelectImage(index),
  16948. onDeselect: onDeselectImage(index),
  16949. setAttributes: attrs => onSetImageAttributes(index, attrs),
  16950. caption: img.caption,
  16951. "aria-label": ariaLabel,
  16952. sizeSlug: attributes.sizeSlug
  16953. }));
  16954. })), mediaPlaceholder, (0,external_wp_element_namespaceObject.createElement)(gallery_RichTextVisibilityHelper, {
  16955. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  16956. tagName: "figcaption",
  16957. className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
  16958. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  16959. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  16960. value: caption,
  16961. onChange: value => setAttributes({
  16962. caption: value
  16963. }),
  16964. inlineToolbar: true,
  16965. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  16966. }));
  16967. };
  16968. function gallery_RichTextVisibilityHelper(_ref) {
  16969. let {
  16970. isHidden,
  16971. ...richTextProps
  16972. } = _ref;
  16973. return isHidden ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  16974. as: external_wp_blockEditor_namespaceObject.RichText
  16975. }, richTextProps)) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, richTextProps);
  16976. }
  16977. /* harmony default export */ var v1_gallery = (gallery_Gallery);
  16978. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js
  16979. /**
  16980. * External dependencies
  16981. */
  16982. /**
  16983. * WordPress dependencies
  16984. */
  16985. /**
  16986. * Internal dependencies
  16987. */
  16988. const edit_MAX_COLUMNS = 8;
  16989. const edit_linkOptions = [{
  16990. value: v1_constants_LINK_DESTINATION_ATTACHMENT,
  16991. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  16992. }, {
  16993. value: v1_constants_LINK_DESTINATION_MEDIA,
  16994. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  16995. }, {
  16996. value: v1_constants_LINK_DESTINATION_NONE,
  16997. label: (0,external_wp_i18n_namespaceObject.__)('None')
  16998. }];
  16999. const v1_edit_ALLOWED_MEDIA_TYPES = ['image'];
  17000. const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({
  17001. web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'),
  17002. native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA')
  17003. });
  17004. const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({
  17005. web: {},
  17006. native: {
  17007. type: 'stepper'
  17008. }
  17009. });
  17010. function edit_GalleryEdit(props) {
  17011. const {
  17012. attributes,
  17013. clientId,
  17014. isSelected,
  17015. noticeUI,
  17016. noticeOperations,
  17017. onFocus
  17018. } = props;
  17019. const {
  17020. columns = defaultColumnsNumberV1(attributes),
  17021. imageCrop,
  17022. images,
  17023. linkTo,
  17024. sizeSlug
  17025. } = attributes;
  17026. const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)();
  17027. const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)();
  17028. const {
  17029. __unstableMarkNextChangeAsNotPersistent
  17030. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  17031. const {
  17032. imageSizes,
  17033. mediaUpload,
  17034. getMedia,
  17035. wasBlockJustInserted
  17036. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17037. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  17038. return {
  17039. imageSizes: settings.imageSizes,
  17040. mediaUpload: settings.mediaUpload,
  17041. getMedia: select(external_wp_coreData_namespaceObject.store).getMedia,
  17042. wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu')
  17043. };
  17044. });
  17045. const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => {
  17046. if (isSelected) {
  17047. return (0,external_lodash_namespaceObject.reduce)(attributes.ids, (currentResizedImages, id) => {
  17048. if (!id) {
  17049. return currentResizedImages;
  17050. }
  17051. const image = getMedia(id);
  17052. const sizes = (0,external_lodash_namespaceObject.reduce)(imageSizes, (currentSizes, size) => {
  17053. const defaultUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', size.slug, 'url']);
  17054. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size.slug, 'source_url']);
  17055. return { ...currentSizes,
  17056. [size.slug]: defaultUrl || mediaDetailsUrl
  17057. };
  17058. }, {});
  17059. return { ...currentResizedImages,
  17060. [parseInt(id, 10)]: sizes
  17061. };
  17062. }, {});
  17063. }
  17064. return {};
  17065. }, [isSelected, attributes.ids, imageSizes]);
  17066. function onFocusGalleryCaption() {
  17067. setSelectedImage();
  17068. }
  17069. function setAttributes(newAttrs) {
  17070. if (newAttrs.ids) {
  17071. throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');
  17072. }
  17073. if (newAttrs.images) {
  17074. newAttrs = { ...newAttrs,
  17075. // Unlike images[ n ].id which is a string, always ensure the
  17076. // ids array contains numbers as per its attribute type.
  17077. ids: (0,external_lodash_namespaceObject.map)(newAttrs.images, _ref => {
  17078. let {
  17079. id
  17080. } = _ref;
  17081. return parseInt(id, 10);
  17082. })
  17083. };
  17084. }
  17085. props.setAttributes(newAttrs);
  17086. }
  17087. function onSelectImage(index) {
  17088. return () => {
  17089. setSelectedImage(index);
  17090. };
  17091. }
  17092. function onDeselectImage() {
  17093. return () => {
  17094. setSelectedImage();
  17095. };
  17096. }
  17097. function onMove(oldIndex, newIndex) {
  17098. const newImages = [...images];
  17099. newImages.splice(newIndex, 1, images[oldIndex]);
  17100. newImages.splice(oldIndex, 1, images[newIndex]);
  17101. setSelectedImage(newIndex);
  17102. setAttributes({
  17103. images: newImages
  17104. });
  17105. }
  17106. function onMoveForward(oldIndex) {
  17107. return () => {
  17108. if (oldIndex === images.length - 1) {
  17109. return;
  17110. }
  17111. onMove(oldIndex, oldIndex + 1);
  17112. };
  17113. }
  17114. function onMoveBackward(oldIndex) {
  17115. return () => {
  17116. if (oldIndex === 0) {
  17117. return;
  17118. }
  17119. onMove(oldIndex, oldIndex - 1);
  17120. };
  17121. }
  17122. function onRemoveImage(index) {
  17123. return () => {
  17124. const newImages = (0,external_lodash_namespaceObject.filter)(images, (img, i) => index !== i);
  17125. setSelectedImage();
  17126. setAttributes({
  17127. images: newImages,
  17128. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  17129. });
  17130. };
  17131. }
  17132. function selectCaption(newImage) {
  17133. // The image id in both the images and attachmentCaptions arrays is a
  17134. // string, so ensure comparison works correctly by converting the
  17135. // newImage.id to a string.
  17136. const newImageId = newImage.id.toString();
  17137. const currentImage = (0,external_lodash_namespaceObject.find)(images, {
  17138. id: newImageId
  17139. });
  17140. const currentImageCaption = currentImage ? currentImage.caption : newImage.caption;
  17141. if (!attachmentCaptions) {
  17142. return currentImageCaption;
  17143. }
  17144. const attachment = (0,external_lodash_namespaceObject.find)(attachmentCaptions, {
  17145. id: newImageId
  17146. }); // If the attachment caption is updated.
  17147. if (attachment && attachment.caption !== newImage.caption) {
  17148. return newImage.caption;
  17149. }
  17150. return currentImageCaption;
  17151. }
  17152. function onSelectImages(newImages) {
  17153. setAttachmentCaptions(newImages.map(newImage => ({
  17154. // Store the attachmentCaption id as a string for consistency
  17155. // with the type of the id in the images attribute.
  17156. id: newImage.id.toString(),
  17157. caption: newImage.caption
  17158. })));
  17159. setAttributes({
  17160. images: newImages.map(newImage => ({ ...shared_pickRelevantMediaFiles(newImage, sizeSlug),
  17161. caption: selectCaption(newImage, images, attachmentCaptions),
  17162. // The id value is stored in a data attribute, so when the
  17163. // block is parsed it's converted to a string. Converting
  17164. // to a string here ensures it's type is consistent.
  17165. id: newImage.id.toString()
  17166. })),
  17167. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  17168. });
  17169. }
  17170. function onUploadError(message) {
  17171. noticeOperations.removeAllNotices();
  17172. noticeOperations.createErrorNotice(message);
  17173. }
  17174. function setLinkTo(value) {
  17175. setAttributes({
  17176. linkTo: value
  17177. });
  17178. }
  17179. function setColumnsNumber(value) {
  17180. setAttributes({
  17181. columns: value
  17182. });
  17183. }
  17184. function toggleImageCrop() {
  17185. setAttributes({
  17186. imageCrop: !imageCrop
  17187. });
  17188. }
  17189. function getImageCropHelp(checked) {
  17190. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  17191. }
  17192. function setImageAttributes(index, newAttributes) {
  17193. if (!images[index]) {
  17194. return;
  17195. }
  17196. setAttributes({
  17197. images: [...images.slice(0, index), { ...images[index],
  17198. ...newAttributes
  17199. }, ...images.slice(index + 1)]
  17200. });
  17201. }
  17202. function getImagesSizeOptions() {
  17203. return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  17204. let {
  17205. slug
  17206. } = _ref2;
  17207. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  17208. }), _ref3 => {
  17209. let {
  17210. name,
  17211. slug
  17212. } = _ref3;
  17213. return {
  17214. value: slug,
  17215. label: name
  17216. };
  17217. });
  17218. }
  17219. function updateImagesSize(newSizeSlug) {
  17220. const updatedImages = (0,external_lodash_namespaceObject.map)(images, image => {
  17221. if (!image.id) {
  17222. return image;
  17223. }
  17224. const url = (0,external_lodash_namespaceObject.get)(resizedImages, [parseInt(image.id, 10), newSizeSlug]);
  17225. return { ...image,
  17226. ...(url && {
  17227. url
  17228. })
  17229. };
  17230. });
  17231. setAttributes({
  17232. images: updatedImages,
  17233. sizeSlug: newSizeSlug
  17234. });
  17235. }
  17236. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17237. if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && (0,external_lodash_namespaceObject.every)(images, _ref4 => {
  17238. let {
  17239. url
  17240. } = _ref4;
  17241. return (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  17242. })) {
  17243. const filesList = (0,external_lodash_namespaceObject.map)(images, _ref5 => {
  17244. let {
  17245. url
  17246. } = _ref5;
  17247. return (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  17248. });
  17249. images.forEach(_ref6 => {
  17250. let {
  17251. url
  17252. } = _ref6;
  17253. return (0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
  17254. });
  17255. mediaUpload({
  17256. filesList,
  17257. onFileChange: onSelectImages,
  17258. allowedTypes: ['image']
  17259. });
  17260. }
  17261. }, []);
  17262. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17263. // Deselect images when deselecting the block.
  17264. if (!isSelected) {
  17265. setSelectedImage();
  17266. }
  17267. }, [isSelected]);
  17268. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17269. // linkTo attribute must be saved so blocks don't break when changing
  17270. // image_default_link_type in options.php.
  17271. if (!linkTo) {
  17272. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  17273. __unstableMarkNextChangeAsNotPersistent();
  17274. setAttributes({
  17275. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || v1_constants_LINK_DESTINATION_NONE
  17276. });
  17277. }
  17278. }, [linkTo]);
  17279. const hasImages = !!images.length;
  17280. const hasImageIds = hasImages && images.some(image => !!image.id);
  17281. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  17282. addToGallery: hasImageIds,
  17283. isAppender: hasImages,
  17284. disableMediaButtons: hasImages && !isSelected,
  17285. icon: !hasImages && sharedIcon,
  17286. labels: {
  17287. title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  17288. instructions: !hasImages && edit_PLACEHOLDER_TEXT
  17289. },
  17290. onSelect: onSelectImages,
  17291. accept: "image/*",
  17292. allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES,
  17293. multiple: true,
  17294. value: hasImageIds ? images : {},
  17295. onError: onUploadError,
  17296. notices: hasImages ? undefined : noticeUI,
  17297. onFocus: onFocus,
  17298. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  17299. });
  17300. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  17301. if (!hasImages) {
  17302. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  17303. }
  17304. const imageSizeOptions = getImagesSizeOptions();
  17305. const shouldShowSizeOptions = hasImages && !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions);
  17306. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  17307. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  17308. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  17309. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  17310. value: columns,
  17311. onChange: setColumnsNumber,
  17312. min: 1,
  17313. max: Math.min(edit_MAX_COLUMNS, images.length)
  17314. }, edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  17315. required: true
  17316. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  17317. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  17318. checked: !!imageCrop,
  17319. onChange: toggleImageCrop,
  17320. help: getImageCropHelp
  17321. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  17322. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  17323. value: linkTo,
  17324. onChange: setLinkTo,
  17325. options: edit_linkOptions,
  17326. hideCancelButton: true
  17327. }), shouldShowSizeOptions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  17328. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  17329. value: sizeSlug,
  17330. options: imageSizeOptions,
  17331. onChange: updateImagesSize,
  17332. hideCancelButton: true
  17333. }))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(v1_gallery, _extends({}, props, {
  17334. selectedImage: selectedImage,
  17335. mediaPlaceholder: mediaPlaceholder,
  17336. onMoveBackward: onMoveBackward,
  17337. onMoveForward: onMoveForward,
  17338. onRemoveImage: onRemoveImage,
  17339. onSelectImage: onSelectImage,
  17340. onDeselectImage: onDeselectImage,
  17341. onSetImageAttributes: setImageAttributes,
  17342. blockProps: blockProps // This prop is used by gallery.native.js.
  17343. ,
  17344. onFocusGalleryCaption: onFocusGalleryCaption
  17345. })));
  17346. }
  17347. /* harmony default export */ var v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
  17348. isNarrow: '< small'
  17349. })])(edit_GalleryEdit));
  17350. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js
  17351. /**
  17352. * WordPress dependencies
  17353. */
  17354. /**
  17355. * Internal dependencies
  17356. */
  17357. /*
  17358. * Using a wrapper around the logic to load the edit for v1 of Gallery block
  17359. * or the refactored version with InnerBlocks. This is to prevent conditional
  17360. * use of hooks lint errors if adding this logic to the top of the edit component.
  17361. */
  17362. function GalleryEditWrapper(props) {
  17363. if (!isGalleryV2Enabled()) {
  17364. return (0,external_wp_element_namespaceObject.createElement)(v1_edit, props);
  17365. }
  17366. return (0,external_wp_element_namespaceObject.createElement)(gallery_edit, props);
  17367. }
  17368. /* harmony default export */ var edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper));
  17369. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js
  17370. /**
  17371. * External dependencies
  17372. */
  17373. /**
  17374. * WordPress dependencies
  17375. */
  17376. /**
  17377. * Internal dependencies
  17378. */
  17379. function saveV1(_ref) {
  17380. let {
  17381. attributes
  17382. } = _ref;
  17383. const {
  17384. images,
  17385. columns = defaultColumnsNumberV1(attributes),
  17386. imageCrop,
  17387. caption,
  17388. linkTo
  17389. } = attributes;
  17390. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  17391. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  17392. className
  17393. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  17394. className: "blocks-gallery-grid"
  17395. }, images.map(image => {
  17396. let href;
  17397. switch (linkTo) {
  17398. case v1_constants_LINK_DESTINATION_MEDIA:
  17399. href = image.fullUrl || image.url;
  17400. break;
  17401. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  17402. href = image.link;
  17403. break;
  17404. }
  17405. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  17406. src: image.url,
  17407. alt: image.alt,
  17408. "data-id": image.id,
  17409. "data-full-url": image.fullUrl,
  17410. "data-link": image.link,
  17411. className: image.id ? `wp-image-${image.id}` : null
  17412. });
  17413. return (0,external_wp_element_namespaceObject.createElement)("li", {
  17414. key: image.id || image.url,
  17415. className: "blocks-gallery-item"
  17416. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17417. href: href
  17418. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17419. tagName: "figcaption",
  17420. className: classnames_default()('blocks-gallery-item', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
  17421. value: image.caption
  17422. })));
  17423. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17424. tagName: "figcaption",
  17425. className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
  17426. value: caption
  17427. }));
  17428. }
  17429. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js
  17430. /**
  17431. * External dependencies
  17432. */
  17433. /**
  17434. * WordPress dependencies
  17435. */
  17436. /**
  17437. * Internal dependencies
  17438. */
  17439. function saveWithInnerBlocks(_ref) {
  17440. let {
  17441. attributes
  17442. } = _ref;
  17443. if (!isGalleryV2Enabled()) {
  17444. return saveV1({
  17445. attributes
  17446. });
  17447. }
  17448. const {
  17449. caption,
  17450. columns,
  17451. imageCrop
  17452. } = attributes;
  17453. const className = classnames_default()('has-nested-images', {
  17454. [`columns-${columns}`]: columns !== undefined,
  17455. [`columns-default`]: columns === undefined,
  17456. 'is-cropped': imageCrop
  17457. });
  17458. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  17459. className
  17460. });
  17461. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  17462. return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17463. tagName: "figcaption",
  17464. className: classnames_default()('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
  17465. value: caption
  17466. }));
  17467. }
  17468. ;// CONCATENATED MODULE: external ["wp","hooks"]
  17469. var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
  17470. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js
  17471. /**
  17472. * External dependencies
  17473. */
  17474. /**
  17475. * WordPress dependencies
  17476. */
  17477. /**
  17478. * Internal dependencies
  17479. */
  17480. const parseShortcodeIds = ids => {
  17481. if (!ids) {
  17482. return [];
  17483. }
  17484. return ids.split(',').map(id => parseInt(id, 10));
  17485. };
  17486. /**
  17487. * Third party block plugins don't have an easy way to detect if the
  17488. * innerBlocks version of the Gallery is running when they run a
  17489. * 3rdPartyBlock -> GalleryBlock transform so this tranform filter
  17490. * will handle this. Once the innerBlocks version is the default
  17491. * in a core release, this could be deprecated and removed after
  17492. * plugin authors have been given time to update transforms.
  17493. *
  17494. * @typedef {Object} Attributes
  17495. * @typedef {Object} Block
  17496. * @property {Attributes} attributes The attributes of the block.
  17497. * @param {Block} block The transformed block.
  17498. * @return {Block} The transformed block.
  17499. */
  17500. function updateThirdPartyTransformToGallery(block) {
  17501. var _block$attributes;
  17502. if (isGalleryV2Enabled() && block.name === 'core/gallery' && ((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.images.length) > 0) {
  17503. const innerBlocks = block.attributes.images.map(_ref => {
  17504. let {
  17505. url,
  17506. id,
  17507. alt
  17508. } = _ref;
  17509. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17510. url,
  17511. id: id ? parseInt(id, 10) : null,
  17512. alt,
  17513. sizeSlug: block.attributes.sizeSlug,
  17514. linkDestination: block.attributes.linkDestination
  17515. });
  17516. });
  17517. delete block.attributes.ids;
  17518. delete block.attributes.images;
  17519. block.innerBlocks = innerBlocks;
  17520. }
  17521. return block;
  17522. }
  17523. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery);
  17524. /**
  17525. * Third party block plugins don't have an easy way to detect if the
  17526. * innerBlocks version of the Gallery is running when they run a
  17527. * GalleryBlock -> 3rdPartyBlock transform so this transform filter
  17528. * will handle this. Once the innerBlocks version is the default
  17529. * in a core release, this could be deprecated and removed after
  17530. * plugin authors have been given time to update transforms.
  17531. *
  17532. * @typedef {Object} Attributes
  17533. * @typedef {Object} Block
  17534. * @property {Attributes} attributes The attributes of the block.
  17535. * @param {Block} toBlock The block to transform to.
  17536. * @param {Block[]} fromBlocks The blocks to transform from.
  17537. * @return {Block} The transformed block.
  17538. */
  17539. function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) {
  17540. const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks];
  17541. const galleryBlock = from.find(transformedBlock => {
  17542. var _transformedBlock$att;
  17543. return transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !((_transformedBlock$att = transformedBlock.attributes.images) !== null && _transformedBlock$att !== void 0 && _transformedBlock$att.length) > 0 && !toBlock.name.includes('core/');
  17544. });
  17545. if (galleryBlock) {
  17546. const images = galleryBlock.innerBlocks.map(_ref2 => {
  17547. let {
  17548. attributes: {
  17549. url,
  17550. id,
  17551. alt
  17552. }
  17553. } = _ref2;
  17554. return {
  17555. url,
  17556. id: id ? parseInt(id, 10) : null,
  17557. alt
  17558. };
  17559. });
  17560. const ids = images.map(_ref3 => {
  17561. let {
  17562. id
  17563. } = _ref3;
  17564. return id;
  17565. });
  17566. galleryBlock.attributes.images = images;
  17567. galleryBlock.attributes.ids = ids;
  17568. }
  17569. return toBlock;
  17570. }
  17571. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery);
  17572. const gallery_transforms_transforms = {
  17573. from: [{
  17574. type: 'block',
  17575. isMultiBlock: true,
  17576. blocks: ['core/image'],
  17577. transform: attributes => {
  17578. // Init the align and size from the first item which may be either the placeholder or an image.
  17579. let {
  17580. align,
  17581. sizeSlug
  17582. } = attributes[0]; // Loop through all the images and check if they have the same align and size.
  17583. align = (0,external_lodash_namespaceObject.every)(attributes, ['align', align]) ? align : undefined;
  17584. sizeSlug = (0,external_lodash_namespaceObject.every)(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined;
  17585. const validImages = (0,external_lodash_namespaceObject.filter)(attributes, _ref4 => {
  17586. let {
  17587. url
  17588. } = _ref4;
  17589. return url;
  17590. });
  17591. if (isGalleryV2Enabled()) {
  17592. const innerBlocks = validImages.map(image => {
  17593. // Gallery images can't currently be resized so make sure height and width are undefined.
  17594. image.width = undefined;
  17595. image.height = undefined;
  17596. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image);
  17597. });
  17598. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  17599. align,
  17600. sizeSlug
  17601. }, innerBlocks);
  17602. }
  17603. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  17604. images: validImages.map(_ref5 => {
  17605. let {
  17606. id,
  17607. url,
  17608. alt,
  17609. caption
  17610. } = _ref5;
  17611. return {
  17612. id: id.toString(),
  17613. url,
  17614. alt,
  17615. caption
  17616. };
  17617. }),
  17618. ids: validImages.map(_ref6 => {
  17619. let {
  17620. id
  17621. } = _ref6;
  17622. return parseInt(id, 10);
  17623. }),
  17624. align,
  17625. sizeSlug
  17626. });
  17627. }
  17628. }, {
  17629. type: 'shortcode',
  17630. tag: 'gallery',
  17631. attributes: {
  17632. images: {
  17633. type: 'array',
  17634. shortcode: _ref7 => {
  17635. let {
  17636. named: {
  17637. ids
  17638. }
  17639. } = _ref7;
  17640. if (!isGalleryV2Enabled()) {
  17641. return parseShortcodeIds(ids).map(id => ({
  17642. id: id.toString()
  17643. }));
  17644. }
  17645. }
  17646. },
  17647. ids: {
  17648. type: 'array',
  17649. shortcode: _ref8 => {
  17650. let {
  17651. named: {
  17652. ids
  17653. }
  17654. } = _ref8;
  17655. if (!isGalleryV2Enabled()) {
  17656. return parseShortcodeIds(ids);
  17657. }
  17658. }
  17659. },
  17660. columns: {
  17661. type: 'number',
  17662. shortcode: _ref9 => {
  17663. let {
  17664. named: {
  17665. columns = '3'
  17666. }
  17667. } = _ref9;
  17668. return parseInt(columns, 10);
  17669. }
  17670. },
  17671. linkTo: {
  17672. type: 'string',
  17673. shortcode: _ref10 => {
  17674. let {
  17675. named: {
  17676. link
  17677. }
  17678. } = _ref10;
  17679. if (!isGalleryV2Enabled()) {
  17680. switch (link) {
  17681. case 'post':
  17682. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  17683. case 'file':
  17684. return v1_constants_LINK_DESTINATION_MEDIA;
  17685. default:
  17686. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  17687. }
  17688. }
  17689. switch (link) {
  17690. case 'post':
  17691. return LINK_DESTINATION_ATTACHMENT;
  17692. case 'file':
  17693. return LINK_DESTINATION_MEDIA;
  17694. default:
  17695. return LINK_DESTINATION_NONE;
  17696. }
  17697. }
  17698. }
  17699. },
  17700. transform(_ref11) {
  17701. let {
  17702. named: {
  17703. ids,
  17704. columns = 3,
  17705. link
  17706. }
  17707. } = _ref11;
  17708. const imageIds = parseShortcodeIds(ids).map(id => parseInt(id, 10));
  17709. let linkTo = LINK_DESTINATION_NONE;
  17710. if (link === 'post') {
  17711. linkTo = LINK_DESTINATION_ATTACHMENT;
  17712. } else if (link === 'file') {
  17713. linkTo = LINK_DESTINATION_MEDIA;
  17714. }
  17715. const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  17716. columns: parseInt(columns, 10),
  17717. linkTo
  17718. }, imageIds.map(imageId => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17719. id: imageId
  17720. })));
  17721. return galleryBlock;
  17722. },
  17723. isMatch(_ref12) {
  17724. let {
  17725. named
  17726. } = _ref12;
  17727. return undefined !== named.ids;
  17728. }
  17729. }, {
  17730. // When created by drag and dropping multiple files on an insertion point. Because multiple
  17731. // files must not be transformed to a gallery when dropped within a gallery there is another transform
  17732. // within the image block to handle that case. Therefore this transform has to have priority 1
  17733. // set so that it overrrides the image block transformation when mulitple images are dropped outside
  17734. // of a gallery block.
  17735. type: 'files',
  17736. priority: 1,
  17737. isMatch(files) {
  17738. return files.length !== 1 && (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  17739. },
  17740. transform(files) {
  17741. if (isGalleryV2Enabled()) {
  17742. const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17743. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  17744. }));
  17745. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks);
  17746. }
  17747. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  17748. images: files.map(file => pickRelevantMediaFiles({
  17749. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  17750. }))
  17751. });
  17752. return block;
  17753. }
  17754. }],
  17755. to: [{
  17756. type: 'block',
  17757. blocks: ['core/image'],
  17758. transform: (_ref13, innerBlocks) => {
  17759. let {
  17760. align,
  17761. images,
  17762. ids,
  17763. sizeSlug
  17764. } = _ref13;
  17765. if (isGalleryV2Enabled()) {
  17766. if (innerBlocks.length > 0) {
  17767. return innerBlocks.map(_ref14 => {
  17768. let {
  17769. attributes: {
  17770. url,
  17771. alt,
  17772. caption,
  17773. title,
  17774. href,
  17775. rel,
  17776. linkClass,
  17777. id,
  17778. sizeSlug: imageSizeSlug,
  17779. linkDestination,
  17780. linkTarget,
  17781. anchor,
  17782. className
  17783. }
  17784. } = _ref14;
  17785. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17786. align,
  17787. url,
  17788. alt,
  17789. caption,
  17790. title,
  17791. href,
  17792. rel,
  17793. linkClass,
  17794. id,
  17795. sizeSlug: imageSizeSlug,
  17796. linkDestination,
  17797. linkTarget,
  17798. anchor,
  17799. className
  17800. });
  17801. });
  17802. }
  17803. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17804. align
  17805. });
  17806. }
  17807. if (images.length > 0) {
  17808. return images.map((_ref15, index) => {
  17809. let {
  17810. url,
  17811. alt,
  17812. caption
  17813. } = _ref15;
  17814. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17815. id: ids[index],
  17816. url,
  17817. alt,
  17818. caption,
  17819. align,
  17820. sizeSlug
  17821. });
  17822. });
  17823. }
  17824. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  17825. align
  17826. });
  17827. }
  17828. }]
  17829. };
  17830. /* harmony default export */ var gallery_transforms = (gallery_transforms_transforms);
  17831. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  17832. /**
  17833. * WordPress dependencies
  17834. */
  17835. /**
  17836. * Internal dependencies
  17837. */
  17838. const gallery_metadata = {
  17839. $schema: "https://schemas.wp.org/trunk/block.json",
  17840. apiVersion: 2,
  17841. name: "core/gallery",
  17842. title: "Gallery",
  17843. category: "media",
  17844. description: "Display multiple images in a rich gallery.",
  17845. keywords: ["images", "photos"],
  17846. textdomain: "default",
  17847. attributes: {
  17848. images: {
  17849. type: "array",
  17850. "default": [],
  17851. source: "query",
  17852. selector: ".blocks-gallery-item",
  17853. query: {
  17854. url: {
  17855. type: "string",
  17856. source: "attribute",
  17857. selector: "img",
  17858. attribute: "src"
  17859. },
  17860. fullUrl: {
  17861. type: "string",
  17862. source: "attribute",
  17863. selector: "img",
  17864. attribute: "data-full-url"
  17865. },
  17866. link: {
  17867. type: "string",
  17868. source: "attribute",
  17869. selector: "img",
  17870. attribute: "data-link"
  17871. },
  17872. alt: {
  17873. type: "string",
  17874. source: "attribute",
  17875. selector: "img",
  17876. attribute: "alt",
  17877. "default": ""
  17878. },
  17879. id: {
  17880. type: "string",
  17881. source: "attribute",
  17882. selector: "img",
  17883. attribute: "data-id"
  17884. },
  17885. caption: {
  17886. type: "string",
  17887. source: "html",
  17888. selector: ".blocks-gallery-item__caption"
  17889. }
  17890. }
  17891. },
  17892. ids: {
  17893. type: "array",
  17894. items: {
  17895. type: "number"
  17896. },
  17897. "default": []
  17898. },
  17899. shortCodeTransforms: {
  17900. type: "array",
  17901. "default": [],
  17902. items: {
  17903. type: "object"
  17904. }
  17905. },
  17906. columns: {
  17907. type: "number",
  17908. minimum: 1,
  17909. maximum: 8
  17910. },
  17911. caption: {
  17912. type: "string",
  17913. source: "html",
  17914. selector: ".blocks-gallery-caption"
  17915. },
  17916. imageCrop: {
  17917. type: "boolean",
  17918. "default": true
  17919. },
  17920. fixedHeight: {
  17921. type: "boolean",
  17922. "default": true
  17923. },
  17924. linkTarget: {
  17925. type: "string"
  17926. },
  17927. linkTo: {
  17928. type: "string"
  17929. },
  17930. sizeSlug: {
  17931. type: "string",
  17932. "default": "large"
  17933. },
  17934. allowResize: {
  17935. type: "boolean",
  17936. "default": false
  17937. }
  17938. },
  17939. providesContext: {
  17940. allowResize: "allowResize",
  17941. imageCrop: "imageCrop",
  17942. fixedHeight: "fixedHeight"
  17943. },
  17944. supports: {
  17945. anchor: true,
  17946. align: true,
  17947. html: false,
  17948. units: ["px", "em", "rem", "vh", "vw"],
  17949. spacing: {
  17950. margin: true,
  17951. padding: true,
  17952. blockGap: ["horizontal", "vertical"],
  17953. __experimentalSkipSerialization: ["blockGap"],
  17954. __experimentalDefaultControls: {
  17955. blockGap: true
  17956. }
  17957. },
  17958. color: {
  17959. text: false,
  17960. background: true,
  17961. gradients: true
  17962. },
  17963. __experimentalLayout: {
  17964. allowSwitching: false,
  17965. allowInheriting: false,
  17966. allowEditing: false,
  17967. "default": {
  17968. type: "flex"
  17969. }
  17970. }
  17971. },
  17972. editorStyle: "wp-block-gallery-editor",
  17973. style: "wp-block-gallery"
  17974. };
  17975. const {
  17976. name: gallery_name
  17977. } = gallery_metadata;
  17978. const gallery_settings = {
  17979. icon: library_gallery,
  17980. example: {
  17981. attributes: {
  17982. columns: 2
  17983. },
  17984. innerBlocks: [{
  17985. name: 'core/image',
  17986. attributes: {
  17987. url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg'
  17988. }
  17989. }, {
  17990. name: 'core/image',
  17991. attributes: {
  17992. url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg'
  17993. }
  17994. }]
  17995. },
  17996. transforms: gallery_transforms,
  17997. edit: edit_wrapper,
  17998. save: saveWithInnerBlocks,
  17999. deprecated: gallery_deprecated
  18000. };
  18001. const gallery_init = () => initBlock({
  18002. name: gallery_name,
  18003. metadata: gallery_metadata,
  18004. settings: gallery_settings
  18005. });
  18006. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js
  18007. /**
  18008. * WordPress dependencies
  18009. */
  18010. const group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18011. viewBox: "0 0 24 24",
  18012. xmlns: "http://www.w3.org/2000/svg"
  18013. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18014. d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
  18015. }));
  18016. /* harmony default export */ var library_group = (group);
  18017. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js
  18018. /**
  18019. * External dependencies
  18020. */
  18021. /**
  18022. * WordPress dependencies
  18023. */
  18024. const migrateAttributes = attributes => {
  18025. if (!attributes.tagName) {
  18026. attributes = { ...attributes,
  18027. tagName: 'div'
  18028. };
  18029. }
  18030. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  18031. return attributes;
  18032. }
  18033. const style = {
  18034. color: {}
  18035. };
  18036. if (attributes.customTextColor) {
  18037. style.color.text = attributes.customTextColor;
  18038. }
  18039. if (attributes.customBackgroundColor) {
  18040. style.color.background = attributes.customBackgroundColor;
  18041. }
  18042. const {
  18043. customTextColor,
  18044. customBackgroundColor,
  18045. ...restAttributes
  18046. } = attributes;
  18047. return { ...restAttributes,
  18048. style
  18049. };
  18050. };
  18051. const group_deprecated_deprecated = [// Version with default layout.
  18052. {
  18053. attributes: {
  18054. tagName: {
  18055. type: 'string',
  18056. default: 'div'
  18057. },
  18058. templateLock: {
  18059. type: 'string'
  18060. }
  18061. },
  18062. supports: {
  18063. __experimentalOnEnter: true,
  18064. __experimentalSettings: true,
  18065. align: ['wide', 'full'],
  18066. anchor: true,
  18067. ariaLabel: true,
  18068. html: false,
  18069. color: {
  18070. gradients: true,
  18071. link: true,
  18072. __experimentalDefaultControls: {
  18073. background: true,
  18074. text: true
  18075. }
  18076. },
  18077. spacing: {
  18078. margin: ['top', 'bottom'],
  18079. padding: true,
  18080. blockGap: true,
  18081. __experimentalDefaultControls: {
  18082. padding: true,
  18083. blockGap: true
  18084. }
  18085. },
  18086. __experimentalBorder: {
  18087. color: true,
  18088. radius: true,
  18089. style: true,
  18090. width: true,
  18091. __experimentalDefaultControls: {
  18092. color: true,
  18093. radius: true,
  18094. style: true,
  18095. width: true
  18096. }
  18097. },
  18098. typography: {
  18099. fontSize: true,
  18100. lineHeight: true,
  18101. __experimentalFontStyle: true,
  18102. __experimentalFontWeight: true,
  18103. __experimentalLetterSpacing: true,
  18104. __experimentalTextTransform: true,
  18105. __experimentalDefaultControls: {
  18106. fontSize: true
  18107. }
  18108. },
  18109. __experimentalLayout: true
  18110. },
  18111. save(_ref) {
  18112. let {
  18113. attributes: {
  18114. tagName: Tag
  18115. }
  18116. } = _ref;
  18117. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
  18118. },
  18119. isEligible: _ref2 => {
  18120. let {
  18121. layout
  18122. } = _ref2;
  18123. return !layout || layout.inherit || layout.contentSize;
  18124. },
  18125. migrate: attributes => {
  18126. const {
  18127. layout = null
  18128. } = attributes;
  18129. if (!layout) {
  18130. return attributes;
  18131. }
  18132. if (layout.inherit || layout.contentSize) {
  18133. return { ...attributes,
  18134. layout: { ...layout,
  18135. type: 'constrained'
  18136. }
  18137. };
  18138. }
  18139. }
  18140. }, // Version of the block with the double div.
  18141. {
  18142. attributes: {
  18143. tagName: {
  18144. type: 'string',
  18145. default: 'div'
  18146. },
  18147. templateLock: {
  18148. type: 'string'
  18149. }
  18150. },
  18151. supports: {
  18152. align: ['wide', 'full'],
  18153. anchor: true,
  18154. color: {
  18155. gradients: true,
  18156. link: true
  18157. },
  18158. spacing: {
  18159. padding: true
  18160. },
  18161. __experimentalBorder: {
  18162. radius: true
  18163. }
  18164. },
  18165. save(_ref3) {
  18166. let {
  18167. attributes
  18168. } = _ref3;
  18169. const {
  18170. tagName: Tag
  18171. } = attributes;
  18172. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("div", {
  18173. className: "wp-block-group__inner-container"
  18174. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  18175. }
  18176. }, // Version of the block without global styles support
  18177. {
  18178. attributes: {
  18179. backgroundColor: {
  18180. type: 'string'
  18181. },
  18182. customBackgroundColor: {
  18183. type: 'string'
  18184. },
  18185. textColor: {
  18186. type: 'string'
  18187. },
  18188. customTextColor: {
  18189. type: 'string'
  18190. }
  18191. },
  18192. supports: {
  18193. align: ['wide', 'full'],
  18194. anchor: true,
  18195. html: false
  18196. },
  18197. migrate: migrateAttributes,
  18198. save(_ref4) {
  18199. let {
  18200. attributes
  18201. } = _ref4;
  18202. const {
  18203. backgroundColor,
  18204. customBackgroundColor,
  18205. textColor,
  18206. customTextColor
  18207. } = attributes;
  18208. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  18209. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  18210. const className = classnames_default()(backgroundClass, textClass, {
  18211. 'has-text-color': textColor || customTextColor,
  18212. 'has-background': backgroundColor || customBackgroundColor
  18213. });
  18214. const styles = {
  18215. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  18216. color: textClass ? undefined : customTextColor
  18217. };
  18218. return (0,external_wp_element_namespaceObject.createElement)("div", {
  18219. className: className,
  18220. style: styles
  18221. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  18222. className: "wp-block-group__inner-container"
  18223. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  18224. }
  18225. }, // Version of the group block with a bug that made text color class not applied.
  18226. {
  18227. attributes: {
  18228. backgroundColor: {
  18229. type: 'string'
  18230. },
  18231. customBackgroundColor: {
  18232. type: 'string'
  18233. },
  18234. textColor: {
  18235. type: 'string'
  18236. },
  18237. customTextColor: {
  18238. type: 'string'
  18239. }
  18240. },
  18241. migrate: migrateAttributes,
  18242. supports: {
  18243. align: ['wide', 'full'],
  18244. anchor: true,
  18245. html: false
  18246. },
  18247. save(_ref5) {
  18248. let {
  18249. attributes
  18250. } = _ref5;
  18251. const {
  18252. backgroundColor,
  18253. customBackgroundColor,
  18254. textColor,
  18255. customTextColor
  18256. } = attributes;
  18257. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  18258. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  18259. const className = classnames_default()(backgroundClass, {
  18260. 'has-text-color': textColor || customTextColor,
  18261. 'has-background': backgroundColor || customBackgroundColor
  18262. });
  18263. const styles = {
  18264. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  18265. color: textClass ? undefined : customTextColor
  18266. };
  18267. return (0,external_wp_element_namespaceObject.createElement)("div", {
  18268. className: className,
  18269. style: styles
  18270. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  18271. className: "wp-block-group__inner-container"
  18272. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  18273. }
  18274. }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`.
  18275. {
  18276. attributes: {
  18277. backgroundColor: {
  18278. type: 'string'
  18279. },
  18280. customBackgroundColor: {
  18281. type: 'string'
  18282. }
  18283. },
  18284. supports: {
  18285. align: ['wide', 'full'],
  18286. anchor: true,
  18287. html: false
  18288. },
  18289. migrate: migrateAttributes,
  18290. save(_ref6) {
  18291. let {
  18292. attributes
  18293. } = _ref6;
  18294. const {
  18295. backgroundColor,
  18296. customBackgroundColor
  18297. } = attributes;
  18298. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  18299. const className = classnames_default()(backgroundClass, {
  18300. 'has-background': backgroundColor || customBackgroundColor
  18301. });
  18302. const styles = {
  18303. backgroundColor: backgroundClass ? undefined : customBackgroundColor
  18304. };
  18305. return (0,external_wp_element_namespaceObject.createElement)("div", {
  18306. className: className,
  18307. style: styles
  18308. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  18309. }
  18310. }];
  18311. /* harmony default export */ var group_deprecated = (group_deprecated_deprecated);
  18312. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js
  18313. /**
  18314. * WordPress dependencies
  18315. */
  18316. const htmlElementMessages = {
  18317. header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
  18318. main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
  18319. section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
  18320. article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
  18321. aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
  18322. footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
  18323. };
  18324. function GroupEdit(_ref) {
  18325. let {
  18326. attributes,
  18327. setAttributes,
  18328. clientId
  18329. } = _ref;
  18330. const {
  18331. hasInnerBlocks,
  18332. themeSupportsLayout
  18333. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  18334. var _getSettings;
  18335. const {
  18336. getBlock,
  18337. getSettings
  18338. } = select(external_wp_blockEditor_namespaceObject.store);
  18339. const block = getBlock(clientId);
  18340. return {
  18341. hasInnerBlocks: !!(block && block.innerBlocks.length),
  18342. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  18343. };
  18344. }, [clientId]);
  18345. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  18346. const {
  18347. tagName: TagName = 'div',
  18348. templateLock,
  18349. layout = {}
  18350. } = attributes;
  18351. const usedLayout = !(layout !== null && layout !== void 0 && layout.type) ? { ...defaultLayout,
  18352. ...layout,
  18353. type: 'default'
  18354. } : { ...defaultLayout,
  18355. ...layout
  18356. };
  18357. const {
  18358. type = 'default'
  18359. } = usedLayout;
  18360. const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
  18361. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  18362. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
  18363. className: 'wp-block-group__inner-container'
  18364. }, {
  18365. templateLock,
  18366. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  18367. __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
  18368. });
  18369. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  18370. __experimentalGroup: "advanced"
  18371. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  18372. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  18373. options: [{
  18374. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  18375. value: 'div'
  18376. }, {
  18377. label: '<header>',
  18378. value: 'header'
  18379. }, {
  18380. label: '<main>',
  18381. value: 'main'
  18382. }, {
  18383. label: '<section>',
  18384. value: 'section'
  18385. }, {
  18386. label: '<article>',
  18387. value: 'article'
  18388. }, {
  18389. label: '<aside>',
  18390. value: 'aside'
  18391. }, {
  18392. label: '<footer>',
  18393. value: 'footer'
  18394. }],
  18395. value: TagName,
  18396. onChange: value => setAttributes({
  18397. tagName: value
  18398. }),
  18399. help: htmlElementMessages[TagName]
  18400. })), layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  18401. }
  18402. /* harmony default export */ var group_edit = (GroupEdit);
  18403. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
  18404. /**
  18405. * WordPress dependencies
  18406. */
  18407. function group_save_save(_ref) {
  18408. let {
  18409. attributes: {
  18410. tagName: Tag
  18411. }
  18412. } = _ref;
  18413. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
  18414. }
  18415. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/transforms.js
  18416. /**
  18417. * WordPress dependencies
  18418. */
  18419. const group_transforms_transforms = {
  18420. from: [{
  18421. type: 'block',
  18422. isMultiBlock: true,
  18423. blocks: ['*'],
  18424. __experimentalConvert(blocks) {
  18425. const alignments = ['wide', 'full']; // Determine the widest setting of all the blocks to be grouped
  18426. const widestAlignment = blocks.reduce((accumulator, block) => {
  18427. const {
  18428. align
  18429. } = block.attributes;
  18430. return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator;
  18431. }, undefined); // Clone the Blocks to be Grouped
  18432. // Failing to create new block references causes the original blocks
  18433. // to be replaced in the switchToBlockType call thereby meaning they
  18434. // are removed both from their original location and within the
  18435. // new group block.
  18436. const groupInnerBlocks = blocks.map(block => {
  18437. return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
  18438. });
  18439. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
  18440. align: widestAlignment,
  18441. layout: {
  18442. type: 'constrained'
  18443. }
  18444. }, groupInnerBlocks);
  18445. }
  18446. }],
  18447. to: [{
  18448. type: 'block',
  18449. blocks: ['*'],
  18450. transform: (attributes, innerBlocks) => innerBlocks
  18451. }]
  18452. };
  18453. /* harmony default export */ var group_transforms = (group_transforms_transforms);
  18454. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/row.js
  18455. /**
  18456. * WordPress dependencies
  18457. */
  18458. const row = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18459. xmlns: "http://www.w3.org/2000/svg",
  18460. viewBox: "0 0 24 24"
  18461. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18462. d: "M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"
  18463. }));
  18464. /* harmony default export */ var library_row = (row);
  18465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js
  18466. /**
  18467. * WordPress dependencies
  18468. */
  18469. const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18470. xmlns: "http://www.w3.org/2000/svg",
  18471. viewBox: "0 0 24 24"
  18472. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18473. d: "M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"
  18474. }));
  18475. /* harmony default export */ var library_stack = (stack);
  18476. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
  18477. /**
  18478. * WordPress dependencies
  18479. */
  18480. const group_variations_variations = [{
  18481. name: 'group',
  18482. title: (0,external_wp_i18n_namespaceObject.__)('Group'),
  18483. description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a container.'),
  18484. attributes: {
  18485. layout: {
  18486. type: 'constrained'
  18487. }
  18488. },
  18489. isDefault: true,
  18490. scope: ['inserter', 'transform'],
  18491. isActive: blockAttributes => {
  18492. var _blockAttributes$layo, _blockAttributes$layo2, _blockAttributes$layo3;
  18493. return !blockAttributes.layout || !((_blockAttributes$layo = blockAttributes.layout) !== null && _blockAttributes$layo !== void 0 && _blockAttributes$layo.type) || ((_blockAttributes$layo2 = blockAttributes.layout) === null || _blockAttributes$layo2 === void 0 ? void 0 : _blockAttributes$layo2.type) === 'default' || ((_blockAttributes$layo3 = blockAttributes.layout) === null || _blockAttributes$layo3 === void 0 ? void 0 : _blockAttributes$layo3.type) === 'constrained';
  18494. },
  18495. icon: library_group
  18496. }, {
  18497. name: 'group-row',
  18498. title: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'),
  18499. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'),
  18500. attributes: {
  18501. layout: {
  18502. type: 'flex',
  18503. flexWrap: 'nowrap'
  18504. }
  18505. },
  18506. scope: ['inserter', 'transform'],
  18507. isActive: blockAttributes => {
  18508. var _blockAttributes$layo4, _blockAttributes$layo5, _blockAttributes$layo6;
  18509. return ((_blockAttributes$layo4 = blockAttributes.layout) === null || _blockAttributes$layo4 === void 0 ? void 0 : _blockAttributes$layo4.type) === 'flex' && (!((_blockAttributes$layo5 = blockAttributes.layout) !== null && _blockAttributes$layo5 !== void 0 && _blockAttributes$layo5.orientation) || ((_blockAttributes$layo6 = blockAttributes.layout) === null || _blockAttributes$layo6 === void 0 ? void 0 : _blockAttributes$layo6.orientation) === 'horizontal');
  18510. },
  18511. icon: library_row
  18512. }, {
  18513. name: 'group-stack',
  18514. title: (0,external_wp_i18n_namespaceObject.__)('Stack'),
  18515. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'),
  18516. attributes: {
  18517. layout: {
  18518. type: 'flex',
  18519. orientation: 'vertical'
  18520. }
  18521. },
  18522. scope: ['inserter', 'transform'],
  18523. isActive: blockAttributes => {
  18524. var _blockAttributes$layo7, _blockAttributes$layo8;
  18525. return ((_blockAttributes$layo7 = blockAttributes.layout) === null || _blockAttributes$layo7 === void 0 ? void 0 : _blockAttributes$layo7.type) === 'flex' && ((_blockAttributes$layo8 = blockAttributes.layout) === null || _blockAttributes$layo8 === void 0 ? void 0 : _blockAttributes$layo8.orientation) === 'vertical';
  18526. },
  18527. icon: library_stack
  18528. }];
  18529. /* harmony default export */ var group_variations = (group_variations_variations);
  18530. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
  18531. /**
  18532. * WordPress dependencies
  18533. */
  18534. /**
  18535. * Internal dependencies
  18536. */
  18537. const group_metadata = {
  18538. $schema: "https://schemas.wp.org/trunk/block.json",
  18539. apiVersion: 2,
  18540. name: "core/group",
  18541. title: "Group",
  18542. category: "design",
  18543. description: "Gather blocks in a layout container.",
  18544. keywords: ["container", "wrapper", "row", "section"],
  18545. textdomain: "default",
  18546. attributes: {
  18547. tagName: {
  18548. type: "string",
  18549. "default": "div"
  18550. },
  18551. templateLock: {
  18552. type: ["string", "boolean"],
  18553. "enum": ["all", "insert", "contentOnly", false]
  18554. }
  18555. },
  18556. supports: {
  18557. __experimentalOnEnter: true,
  18558. __experimentalSettings: true,
  18559. align: ["wide", "full"],
  18560. anchor: true,
  18561. ariaLabel: true,
  18562. html: false,
  18563. color: {
  18564. gradients: true,
  18565. link: true,
  18566. __experimentalDefaultControls: {
  18567. background: true,
  18568. text: true
  18569. }
  18570. },
  18571. spacing: {
  18572. margin: ["top", "bottom"],
  18573. padding: true,
  18574. blockGap: true,
  18575. __experimentalDefaultControls: {
  18576. padding: true,
  18577. blockGap: true
  18578. }
  18579. },
  18580. __experimentalBorder: {
  18581. color: true,
  18582. radius: true,
  18583. style: true,
  18584. width: true,
  18585. __experimentalDefaultControls: {
  18586. color: true,
  18587. radius: true,
  18588. style: true,
  18589. width: true
  18590. }
  18591. },
  18592. typography: {
  18593. fontSize: true,
  18594. lineHeight: true,
  18595. __experimentalFontFamily: true,
  18596. __experimentalFontWeight: true,
  18597. __experimentalFontStyle: true,
  18598. __experimentalTextTransform: true,
  18599. __experimentalTextDecoration: true,
  18600. __experimentalLetterSpacing: true,
  18601. __experimentalDefaultControls: {
  18602. fontSize: true
  18603. }
  18604. },
  18605. __experimentalLayout: true
  18606. },
  18607. editorStyle: "wp-block-group-editor",
  18608. style: "wp-block-group"
  18609. };
  18610. const {
  18611. name: group_name
  18612. } = group_metadata;
  18613. const group_settings = {
  18614. icon: library_group,
  18615. example: {
  18616. attributes: {
  18617. style: {
  18618. color: {
  18619. text: '#000000',
  18620. background: '#ffffff'
  18621. }
  18622. }
  18623. },
  18624. innerBlocks: [{
  18625. name: 'core/paragraph',
  18626. attributes: {
  18627. customTextColor: '#cf2e2e',
  18628. fontSize: 'large',
  18629. content: (0,external_wp_i18n_namespaceObject.__)('One.')
  18630. }
  18631. }, {
  18632. name: 'core/paragraph',
  18633. attributes: {
  18634. customTextColor: '#ff6900',
  18635. fontSize: 'large',
  18636. content: (0,external_wp_i18n_namespaceObject.__)('Two.')
  18637. }
  18638. }, {
  18639. name: 'core/paragraph',
  18640. attributes: {
  18641. customTextColor: '#fcb900',
  18642. fontSize: 'large',
  18643. content: (0,external_wp_i18n_namespaceObject.__)('Three.')
  18644. }
  18645. }, {
  18646. name: 'core/paragraph',
  18647. attributes: {
  18648. customTextColor: '#00d084',
  18649. fontSize: 'large',
  18650. content: (0,external_wp_i18n_namespaceObject.__)('Four.')
  18651. }
  18652. }, {
  18653. name: 'core/paragraph',
  18654. attributes: {
  18655. customTextColor: '#0693e3',
  18656. fontSize: 'large',
  18657. content: (0,external_wp_i18n_namespaceObject.__)('Five.')
  18658. }
  18659. }, {
  18660. name: 'core/paragraph',
  18661. attributes: {
  18662. customTextColor: '#9b51e0',
  18663. fontSize: 'large',
  18664. content: (0,external_wp_i18n_namespaceObject.__)('Six.')
  18665. }
  18666. }]
  18667. },
  18668. transforms: group_transforms,
  18669. edit: group_edit,
  18670. save: group_save_save,
  18671. deprecated: group_deprecated,
  18672. variations: group_variations
  18673. };
  18674. const group_init = () => initBlock({
  18675. name: group_name,
  18676. metadata: group_metadata,
  18677. settings: group_settings
  18678. });
  18679. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
  18680. /**
  18681. * WordPress dependencies
  18682. */
  18683. const heading = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18684. xmlns: "http://www.w3.org/2000/svg",
  18685. viewBox: "0 0 24 24"
  18686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18687. d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"
  18688. }));
  18689. /* harmony default export */ var library_heading = (heading);
  18690. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
  18691. /**
  18692. * External dependencies
  18693. */
  18694. /**
  18695. * WordPress dependencies
  18696. */
  18697. const blockSupports = {
  18698. className: false,
  18699. anchor: true
  18700. };
  18701. const heading_deprecated_blockAttributes = {
  18702. align: {
  18703. type: 'string'
  18704. },
  18705. content: {
  18706. type: 'string',
  18707. source: 'html',
  18708. selector: 'h1,h2,h3,h4,h5,h6',
  18709. default: ''
  18710. },
  18711. level: {
  18712. type: 'number',
  18713. default: 2
  18714. },
  18715. placeholder: {
  18716. type: 'string'
  18717. }
  18718. };
  18719. const deprecated_migrateCustomColors = attributes => {
  18720. if (!attributes.customTextColor) {
  18721. return attributes;
  18722. }
  18723. const style = {
  18724. color: {
  18725. text: attributes.customTextColor
  18726. }
  18727. };
  18728. const {
  18729. customTextColor,
  18730. ...restAttributes
  18731. } = attributes;
  18732. return { ...restAttributes,
  18733. style
  18734. };
  18735. };
  18736. const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
  18737. const migrateTextAlign = attributes => {
  18738. const {
  18739. align,
  18740. ...rest
  18741. } = attributes;
  18742. return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest,
  18743. textAlign: align
  18744. } : attributes;
  18745. };
  18746. const heading_deprecated_deprecated = [{
  18747. supports: {
  18748. align: ['wide', 'full'],
  18749. anchor: true,
  18750. className: false,
  18751. color: {
  18752. link: true
  18753. },
  18754. fontSize: true,
  18755. lineHeight: true,
  18756. __experimentalSelector: {
  18757. 'core/heading/h1': 'h1',
  18758. 'core/heading/h2': 'h2',
  18759. 'core/heading/h3': 'h3',
  18760. 'core/heading/h4': 'h4',
  18761. 'core/heading/h5': 'h5',
  18762. 'core/heading/h6': 'h6'
  18763. },
  18764. __unstablePasteTextInline: true
  18765. },
  18766. attributes: heading_deprecated_blockAttributes,
  18767. isEligible: _ref => {
  18768. let {
  18769. align
  18770. } = _ref;
  18771. return TEXT_ALIGN_OPTIONS.includes(align);
  18772. },
  18773. migrate: migrateTextAlign,
  18774. save(_ref2) {
  18775. let {
  18776. attributes
  18777. } = _ref2;
  18778. const {
  18779. align,
  18780. content,
  18781. level
  18782. } = attributes;
  18783. const TagName = 'h' + level;
  18784. const className = classnames_default()({
  18785. [`has-text-align-${align}`]: align
  18786. });
  18787. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  18788. className
  18789. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18790. value: content
  18791. }));
  18792. }
  18793. }, {
  18794. supports: blockSupports,
  18795. attributes: { ...heading_deprecated_blockAttributes,
  18796. customTextColor: {
  18797. type: 'string'
  18798. },
  18799. textColor: {
  18800. type: 'string'
  18801. }
  18802. },
  18803. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  18804. save(_ref3) {
  18805. let {
  18806. attributes
  18807. } = _ref3;
  18808. const {
  18809. align,
  18810. content,
  18811. customTextColor,
  18812. level,
  18813. textColor
  18814. } = attributes;
  18815. const tagName = 'h' + level;
  18816. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  18817. const className = classnames_default()({
  18818. [textClass]: textClass,
  18819. 'has-text-color': textColor || customTextColor,
  18820. [`has-text-align-${align}`]: align
  18821. });
  18822. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18823. className: className ? className : undefined,
  18824. tagName: tagName,
  18825. style: {
  18826. color: textClass ? undefined : customTextColor
  18827. },
  18828. value: content
  18829. });
  18830. }
  18831. }, {
  18832. attributes: { ...heading_deprecated_blockAttributes,
  18833. customTextColor: {
  18834. type: 'string'
  18835. },
  18836. textColor: {
  18837. type: 'string'
  18838. }
  18839. },
  18840. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  18841. save(_ref4) {
  18842. let {
  18843. attributes
  18844. } = _ref4;
  18845. const {
  18846. align,
  18847. content,
  18848. customTextColor,
  18849. level,
  18850. textColor
  18851. } = attributes;
  18852. const tagName = 'h' + level;
  18853. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  18854. const className = classnames_default()({
  18855. [textClass]: textClass,
  18856. [`has-text-align-${align}`]: align
  18857. });
  18858. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18859. className: className ? className : undefined,
  18860. tagName: tagName,
  18861. style: {
  18862. color: textClass ? undefined : customTextColor
  18863. },
  18864. value: content
  18865. });
  18866. },
  18867. supports: blockSupports
  18868. }, {
  18869. supports: blockSupports,
  18870. attributes: { ...heading_deprecated_blockAttributes,
  18871. customTextColor: {
  18872. type: 'string'
  18873. },
  18874. textColor: {
  18875. type: 'string'
  18876. }
  18877. },
  18878. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  18879. save(_ref5) {
  18880. let {
  18881. attributes
  18882. } = _ref5;
  18883. const {
  18884. align,
  18885. level,
  18886. content,
  18887. textColor,
  18888. customTextColor
  18889. } = attributes;
  18890. const tagName = 'h' + level;
  18891. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  18892. const className = classnames_default()({
  18893. [textClass]: textClass
  18894. });
  18895. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18896. className: className ? className : undefined,
  18897. tagName: tagName,
  18898. style: {
  18899. textAlign: align,
  18900. color: textClass ? undefined : customTextColor
  18901. },
  18902. value: content
  18903. });
  18904. }
  18905. }];
  18906. /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated);
  18907. // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
  18908. var remove_accents = __webpack_require__(4793);
  18909. var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
  18910. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
  18911. /**
  18912. * External dependencies
  18913. */
  18914. /**
  18915. * Object map tracking anchors.
  18916. *
  18917. * @type {Record<string, string | null>}
  18918. */
  18919. const autogenerate_anchors_anchors = {};
  18920. /**
  18921. * Returns the text without markup.
  18922. *
  18923. * @param {string} text The text.
  18924. *
  18925. * @return {string} The text without markup.
  18926. */
  18927. const getTextWithoutMarkup = text => {
  18928. const dummyElement = document.createElement('div');
  18929. dummyElement.innerHTML = text;
  18930. return dummyElement.innerText;
  18931. };
  18932. /**
  18933. * Get the slug from the content.
  18934. *
  18935. * @param {string} content The block content.
  18936. *
  18937. * @return {string} Returns the slug.
  18938. */
  18939. const getSlug = content => {
  18940. // Get the slug.
  18941. return remove_accents_default()(getTextWithoutMarkup(content)) // Convert anything that's not a letter or number to a hyphen.
  18942. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase
  18943. .toLowerCase() // Remove any remaining leading or trailing hyphens.
  18944. .replace(/(^-+)|(-+$)/g, '');
  18945. };
  18946. /**
  18947. * Generate the anchor for a heading.
  18948. *
  18949. * @param {string} clientId The block ID.
  18950. * @param {string} content The block content.
  18951. *
  18952. * @return {string|null} Return the heading anchor.
  18953. */
  18954. const generateAnchor = (clientId, content) => {
  18955. const slug = getSlug(content); // If slug is empty, then return null.
  18956. // Returning null instead of an empty string allows us to check again when the content changes.
  18957. if ('' === slug) {
  18958. return null;
  18959. }
  18960. delete autogenerate_anchors_anchors[clientId];
  18961. let anchor = slug;
  18962. let i = 0; // If the anchor already exists in another heading, append -i.
  18963. while (Object.values(autogenerate_anchors_anchors).includes(anchor)) {
  18964. i += 1;
  18965. anchor = slug + '-' + i;
  18966. }
  18967. return anchor;
  18968. };
  18969. /**
  18970. * Set the anchor for a heading.
  18971. *
  18972. * @param {string} clientId The block ID.
  18973. * @param {string|null} anchor The block anchor.
  18974. */
  18975. const setAnchor = (clientId, anchor) => {
  18976. autogenerate_anchors_anchors[clientId] = anchor;
  18977. };
  18978. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
  18979. /**
  18980. * External dependencies
  18981. */
  18982. /**
  18983. * WordPress dependencies
  18984. */
  18985. /**
  18986. * Internal dependencies
  18987. */
  18988. function HeadingEdit(_ref) {
  18989. let {
  18990. attributes,
  18991. setAttributes,
  18992. mergeBlocks,
  18993. onReplace,
  18994. style,
  18995. clientId
  18996. } = _ref;
  18997. const {
  18998. textAlign,
  18999. content,
  19000. level,
  19001. placeholder,
  19002. anchor
  19003. } = attributes;
  19004. const tagName = 'h' + level;
  19005. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19006. className: classnames_default()({
  19007. [`has-text-align-${textAlign}`]: textAlign
  19008. }),
  19009. style
  19010. });
  19011. const {
  19012. canGenerateAnchors
  19013. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  19014. const {
  19015. getGlobalBlockCount,
  19016. getSettings
  19017. } = select(external_wp_blockEditor_namespaceObject.store);
  19018. const settings = getSettings();
  19019. return {
  19020. canGenerateAnchors: !!settings.generateAnchors || getGlobalBlockCount('core/table-of-contents') > 0
  19021. };
  19022. }, []);
  19023. const {
  19024. __unstableMarkNextChangeAsNotPersistent
  19025. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set.
  19026. // This is used when transforming a block to heading, or for legacy anchors.
  19027. (0,external_wp_element_namespaceObject.useEffect)(() => {
  19028. if (!canGenerateAnchors) {
  19029. return;
  19030. }
  19031. if (!anchor && content) {
  19032. // This side-effect should not create an undo level.
  19033. __unstableMarkNextChangeAsNotPersistent();
  19034. setAttributes({
  19035. anchor: generateAnchor(clientId, content)
  19036. });
  19037. }
  19038. setAnchor(clientId, anchor); // Remove anchor map when block unmounts.
  19039. return () => setAnchor(clientId, null);
  19040. }, [anchor, content, clientId, canGenerateAnchors]);
  19041. const onContentChange = value => {
  19042. const newAttrs = {
  19043. content: value
  19044. };
  19045. if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) {
  19046. newAttrs.anchor = generateAnchor(clientId, value);
  19047. }
  19048. setAttributes(newAttrs);
  19049. };
  19050. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  19051. group: "block"
  19052. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  19053. selectedLevel: level,
  19054. onChange: newLevel => setAttributes({
  19055. level: newLevel
  19056. })
  19057. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  19058. value: textAlign,
  19059. onChange: nextAlign => {
  19060. setAttributes({
  19061. textAlign: nextAlign
  19062. });
  19063. }
  19064. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  19065. identifier: "content",
  19066. tagName: tagName,
  19067. value: content,
  19068. onChange: onContentChange,
  19069. onMerge: mergeBlocks,
  19070. onSplit: (value, isOriginal) => {
  19071. let block;
  19072. if (isOriginal || value) {
  19073. block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
  19074. content: value
  19075. });
  19076. } else {
  19077. var _getDefaultBlockName;
  19078. block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
  19079. }
  19080. if (isOriginal) {
  19081. block.clientId = clientId;
  19082. }
  19083. return block;
  19084. },
  19085. onReplace: onReplace,
  19086. onRemove: () => onReplace([]),
  19087. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading text'),
  19088. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'),
  19089. textAlign: textAlign
  19090. }, external_wp_element_namespaceObject.Platform.isNative && {
  19091. deleteEnter: true
  19092. }, blockProps)));
  19093. }
  19094. /* harmony default export */ var heading_edit = (HeadingEdit);
  19095. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
  19096. /**
  19097. * External dependencies
  19098. */
  19099. /**
  19100. * WordPress dependencies
  19101. */
  19102. function heading_save_save(_ref) {
  19103. let {
  19104. attributes
  19105. } = _ref;
  19106. const {
  19107. textAlign,
  19108. content,
  19109. level
  19110. } = attributes;
  19111. const TagName = 'h' + level;
  19112. const className = classnames_default()({
  19113. [`has-text-align-${textAlign}`]: textAlign
  19114. });
  19115. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19116. className
  19117. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19118. value: content
  19119. }));
  19120. }
  19121. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
  19122. /**
  19123. * Given a node name string for a heading node, returns its numeric level.
  19124. *
  19125. * @param {string} nodeName Heading node name.
  19126. *
  19127. * @return {number} Heading level.
  19128. */
  19129. function getLevelFromHeadingNodeName(nodeName) {
  19130. return Number(nodeName.substr(1));
  19131. }
  19132. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
  19133. /**
  19134. * WordPress dependencies
  19135. */
  19136. /**
  19137. * Internal dependencies
  19138. */
  19139. const {
  19140. name: heading_transforms_name
  19141. } = {
  19142. $schema: "https://schemas.wp.org/trunk/block.json",
  19143. apiVersion: 2,
  19144. name: "core/heading",
  19145. title: "Heading",
  19146. category: "text",
  19147. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  19148. keywords: ["title", "subtitle"],
  19149. textdomain: "default",
  19150. attributes: {
  19151. textAlign: {
  19152. type: "string"
  19153. },
  19154. content: {
  19155. type: "string",
  19156. source: "html",
  19157. selector: "h1,h2,h3,h4,h5,h6",
  19158. "default": "",
  19159. __experimentalRole: "content"
  19160. },
  19161. level: {
  19162. type: "number",
  19163. "default": 2
  19164. },
  19165. placeholder: {
  19166. type: "string"
  19167. }
  19168. },
  19169. supports: {
  19170. align: ["wide", "full"],
  19171. anchor: true,
  19172. className: false,
  19173. color: {
  19174. gradients: true,
  19175. link: true,
  19176. __experimentalDefaultControls: {
  19177. background: true,
  19178. text: true
  19179. }
  19180. },
  19181. spacing: {
  19182. margin: true,
  19183. padding: true
  19184. },
  19185. typography: {
  19186. fontSize: true,
  19187. lineHeight: true,
  19188. __experimentalFontFamily: true,
  19189. __experimentalFontStyle: true,
  19190. __experimentalFontWeight: true,
  19191. __experimentalLetterSpacing: true,
  19192. __experimentalTextTransform: true,
  19193. __experimentalTextDecoration: true,
  19194. __experimentalDefaultControls: {
  19195. fontSize: true,
  19196. fontAppearance: true,
  19197. textTransform: true
  19198. }
  19199. },
  19200. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  19201. __unstablePasteTextInline: true,
  19202. __experimentalSlashInserter: true
  19203. },
  19204. editorStyle: "wp-block-heading-editor",
  19205. style: "wp-block-heading"
  19206. };
  19207. const heading_transforms_transforms = {
  19208. from: [{
  19209. type: 'block',
  19210. isMultiBlock: true,
  19211. blocks: ['core/paragraph'],
  19212. transform: attributes => attributes.map(_ref => {
  19213. let {
  19214. content,
  19215. anchor,
  19216. align: textAlign
  19217. } = _ref;
  19218. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  19219. content,
  19220. anchor,
  19221. textAlign
  19222. });
  19223. })
  19224. }, {
  19225. type: 'raw',
  19226. selector: 'h1,h2,h3,h4,h5,h6',
  19227. schema: _ref2 => {
  19228. let {
  19229. phrasingContentSchema,
  19230. isPaste
  19231. } = _ref2;
  19232. const schema = {
  19233. children: phrasingContentSchema,
  19234. attributes: isPaste ? [] : ['style', 'id']
  19235. };
  19236. return {
  19237. h1: schema,
  19238. h2: schema,
  19239. h3: schema,
  19240. h4: schema,
  19241. h5: schema,
  19242. h6: schema
  19243. };
  19244. },
  19245. transform(node) {
  19246. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
  19247. const {
  19248. textAlign
  19249. } = node.style || {};
  19250. attributes.level = getLevelFromHeadingNodeName(node.nodeName);
  19251. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  19252. attributes.align = textAlign;
  19253. }
  19254. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
  19255. }
  19256. }, ...[1, 2, 3, 4, 5, 6].map(level => ({
  19257. type: 'prefix',
  19258. prefix: Array(level + 1).join('#'),
  19259. transform(content) {
  19260. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  19261. level,
  19262. content
  19263. });
  19264. }
  19265. })), ...[1, 2, 3, 4, 5, 6].map(level => ({
  19266. type: 'enter',
  19267. regExp: new RegExp(`^/(h|H)${level}$`),
  19268. transform(content) {
  19269. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  19270. level,
  19271. content
  19272. });
  19273. }
  19274. }))],
  19275. to: [{
  19276. type: 'block',
  19277. isMultiBlock: true,
  19278. blocks: ['core/paragraph'],
  19279. transform: attributes => attributes.map(_ref3 => {
  19280. let {
  19281. content,
  19282. textAlign: align
  19283. } = _ref3;
  19284. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  19285. content,
  19286. align
  19287. });
  19288. })
  19289. }]
  19290. };
  19291. /* harmony default export */ var heading_transforms = (heading_transforms_transforms);
  19292. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  19293. /**
  19294. * External dependencies
  19295. */
  19296. /**
  19297. * WordPress dependencies
  19298. */
  19299. /**
  19300. * Internal dependencies
  19301. */
  19302. const heading_metadata = {
  19303. $schema: "https://schemas.wp.org/trunk/block.json",
  19304. apiVersion: 2,
  19305. name: "core/heading",
  19306. title: "Heading",
  19307. category: "text",
  19308. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  19309. keywords: ["title", "subtitle"],
  19310. textdomain: "default",
  19311. attributes: {
  19312. textAlign: {
  19313. type: "string"
  19314. },
  19315. content: {
  19316. type: "string",
  19317. source: "html",
  19318. selector: "h1,h2,h3,h4,h5,h6",
  19319. "default": "",
  19320. __experimentalRole: "content"
  19321. },
  19322. level: {
  19323. type: "number",
  19324. "default": 2
  19325. },
  19326. placeholder: {
  19327. type: "string"
  19328. }
  19329. },
  19330. supports: {
  19331. align: ["wide", "full"],
  19332. anchor: true,
  19333. className: false,
  19334. color: {
  19335. gradients: true,
  19336. link: true,
  19337. __experimentalDefaultControls: {
  19338. background: true,
  19339. text: true
  19340. }
  19341. },
  19342. spacing: {
  19343. margin: true,
  19344. padding: true
  19345. },
  19346. typography: {
  19347. fontSize: true,
  19348. lineHeight: true,
  19349. __experimentalFontFamily: true,
  19350. __experimentalFontStyle: true,
  19351. __experimentalFontWeight: true,
  19352. __experimentalLetterSpacing: true,
  19353. __experimentalTextTransform: true,
  19354. __experimentalTextDecoration: true,
  19355. __experimentalDefaultControls: {
  19356. fontSize: true,
  19357. fontAppearance: true,
  19358. textTransform: true
  19359. }
  19360. },
  19361. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  19362. __unstablePasteTextInline: true,
  19363. __experimentalSlashInserter: true
  19364. },
  19365. editorStyle: "wp-block-heading-editor",
  19366. style: "wp-block-heading"
  19367. };
  19368. const {
  19369. name: heading_name
  19370. } = heading_metadata;
  19371. const heading_settings = {
  19372. icon: library_heading,
  19373. example: {
  19374. attributes: {
  19375. content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'),
  19376. level: 2
  19377. }
  19378. },
  19379. __experimentalLabel(attributes, _ref) {
  19380. let {
  19381. context
  19382. } = _ref;
  19383. const {
  19384. content,
  19385. level
  19386. } = attributes; // In the list view, use the block's content as the label.
  19387. // If the content is empty, fall back to the default label.
  19388. if (context === 'list-view' && content) {
  19389. return content;
  19390. }
  19391. if (context === 'accessibility') {
  19392. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.sprintf)(
  19393. /* translators: accessibility text. %s: heading level. */
  19394. (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(
  19395. /* translators: accessibility text. 1: heading level. 2: heading content. */
  19396. (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
  19397. }
  19398. },
  19399. transforms: heading_transforms,
  19400. deprecated: heading_deprecated,
  19401. merge(attributes, attributesToMerge) {
  19402. return {
  19403. content: (attributes.content || '') + (attributesToMerge.content || '')
  19404. };
  19405. },
  19406. edit: heading_edit,
  19407. save: heading_save_save
  19408. };
  19409. const heading_init = () => initBlock({
  19410. name: heading_name,
  19411. metadata: heading_metadata,
  19412. settings: heading_settings
  19413. });
  19414. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
  19415. /**
  19416. * WordPress dependencies
  19417. */
  19418. const home = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19419. xmlns: "http://www.w3.org/2000/svg",
  19420. viewBox: "0 0 24 24"
  19421. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19422. d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
  19423. }));
  19424. /* harmony default export */ var library_home = (home);
  19425. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/edit.js
  19426. /**
  19427. * External dependencies
  19428. */
  19429. /**
  19430. * WordPress dependencies
  19431. */
  19432. const preventDefault = event => event.preventDefault();
  19433. function HomeEdit(_ref) {
  19434. var _style$color, _style$color2, _style$color3, _style$color4;
  19435. let {
  19436. attributes,
  19437. setAttributes,
  19438. context
  19439. } = _ref;
  19440. const {
  19441. homeUrl
  19442. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  19443. var _getUnstableBase;
  19444. const {
  19445. getUnstableBase // Site index.
  19446. } = select(external_wp_coreData_namespaceObject.store);
  19447. return {
  19448. homeUrl: (_getUnstableBase = getUnstableBase()) === null || _getUnstableBase === void 0 ? void 0 : _getUnstableBase.home
  19449. };
  19450. }, []);
  19451. const {
  19452. __unstableMarkNextChangeAsNotPersistent
  19453. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  19454. const {
  19455. textColor,
  19456. backgroundColor,
  19457. style
  19458. } = context;
  19459. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19460. className: classnames_default()('wp-block-navigation-item', {
  19461. 'has-text-color': !!textColor || !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text),
  19462. [`has-${textColor}-color`]: !!textColor,
  19463. 'has-background': !!backgroundColor || !!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background),
  19464. [`has-${backgroundColor}-background-color`]: !!backgroundColor
  19465. }),
  19466. style: {
  19467. color: style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.text,
  19468. backgroundColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background
  19469. }
  19470. });
  19471. const {
  19472. label
  19473. } = attributes;
  19474. (0,external_wp_element_namespaceObject.useEffect)(() => {
  19475. if (label === undefined) {
  19476. __unstableMarkNextChangeAsNotPersistent();
  19477. setAttributes({
  19478. label: (0,external_wp_i18n_namespaceObject.__)('Home')
  19479. });
  19480. }
  19481. }, [label]);
  19482. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  19483. className: "wp-block-home-link__content wp-block-navigation-item__content",
  19484. href: homeUrl,
  19485. onClick: preventDefault
  19486. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  19487. identifier: "label",
  19488. className: "wp-block-home-link__label",
  19489. value: label,
  19490. onChange: labelValue => {
  19491. setAttributes({
  19492. label: labelValue
  19493. });
  19494. },
  19495. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'),
  19496. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'),
  19497. withoutInteractiveFormatting: true,
  19498. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
  19499. }))));
  19500. }
  19501. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/save.js
  19502. /**
  19503. * WordPress dependencies
  19504. */
  19505. function home_link_save_save() {
  19506. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  19507. }
  19508. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  19509. /**
  19510. * WordPress dependencies
  19511. */
  19512. /**
  19513. * Internal dependencies
  19514. */
  19515. const home_link_metadata = {
  19516. $schema: "https://schemas.wp.org/trunk/block.json",
  19517. apiVersion: 2,
  19518. name: "core/home-link",
  19519. category: "design",
  19520. parent: ["core/navigation"],
  19521. title: "Home Link",
  19522. description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",
  19523. textdomain: "default",
  19524. attributes: {
  19525. label: {
  19526. type: "string"
  19527. }
  19528. },
  19529. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"],
  19530. supports: {
  19531. reusable: false,
  19532. html: false,
  19533. typography: {
  19534. fontSize: true,
  19535. lineHeight: true,
  19536. __experimentalFontFamily: true,
  19537. __experimentalFontWeight: true,
  19538. __experimentalFontStyle: true,
  19539. __experimentalTextTransform: true,
  19540. __experimentalTextDecoration: true,
  19541. __experimentalLetterSpacing: true,
  19542. __experimentalDefaultControls: {
  19543. fontSize: true
  19544. }
  19545. }
  19546. },
  19547. editorStyle: "wp-block-home-link-editor",
  19548. style: "wp-block-home-link"
  19549. };
  19550. const {
  19551. name: home_link_name
  19552. } = home_link_metadata;
  19553. const home_link_settings = {
  19554. icon: library_home,
  19555. edit: HomeEdit,
  19556. save: home_link_save_save,
  19557. example: {
  19558. attributes: {
  19559. label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example')
  19560. }
  19561. }
  19562. };
  19563. const home_link_init = () => initBlock({
  19564. name: home_link_name,
  19565. metadata: home_link_metadata,
  19566. settings: home_link_settings
  19567. });
  19568. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
  19569. /**
  19570. * WordPress dependencies
  19571. */
  19572. const html = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19573. viewBox: "0 0 24 24",
  19574. xmlns: "http://www.w3.org/2000/svg"
  19575. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19576. d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"
  19577. }));
  19578. /* harmony default export */ var library_html = (html);
  19579. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/preview.js
  19580. /**
  19581. * WordPress dependencies
  19582. */
  19583. // Default styles used to unset some of the styles
  19584. // that might be inherited from the editor style.
  19585. const DEFAULT_STYLES = `
  19586. html,body,:root {
  19587. margin: 0 !important;
  19588. padding: 0 !important;
  19589. overflow: visible !important;
  19590. min-height: auto !important;
  19591. }
  19592. `;
  19593. function HTMLEditPreview(_ref) {
  19594. let {
  19595. content,
  19596. isSelected
  19597. } = _ref;
  19598. const settingStyles = (0,external_wp_data_namespaceObject.useSelect)(select => {
  19599. var _select$getSettings;
  19600. return (_select$getSettings = select(external_wp_blockEditor_namespaceObject.store).getSettings()) === null || _select$getSettings === void 0 ? void 0 : _select$getSettings.styles;
  19601. }, []);
  19602. const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [DEFAULT_STYLES, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(settingStyles)], [settingStyles]);
  19603. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  19604. html: content,
  19605. styles: styles
  19606. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  19607. className: "block-library-html__preview-overlay"
  19608. }));
  19609. }
  19610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
  19611. /**
  19612. * WordPress dependencies
  19613. */
  19614. /**
  19615. * Internal dependencies
  19616. */
  19617. function HTMLEdit(_ref) {
  19618. let {
  19619. attributes,
  19620. setAttributes,
  19621. isSelected
  19622. } = _ref;
  19623. const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)();
  19624. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  19625. function switchToPreview() {
  19626. setIsPreview(true);
  19627. }
  19628. function switchToHTML() {
  19629. setIsPreview(false);
  19630. }
  19631. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19632. className: 'block-library-html__edit'
  19633. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19634. className: "components-tab-button",
  19635. isPressed: !isPreview,
  19636. onClick: switchToHTML
  19637. }, "HTML"), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19638. className: "components-tab-button",
  19639. isPressed: isPreview,
  19640. onClick: switchToPreview
  19641. }, (0,external_wp_i18n_namespaceObject.__)('Preview')))), isPreview || isDisabled ? (0,external_wp_element_namespaceObject.createElement)(HTMLEditPreview, {
  19642. content: attributes.content,
  19643. isSelected: isSelected
  19644. }) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  19645. value: attributes.content,
  19646. onChange: content => setAttributes({
  19647. content
  19648. }),
  19649. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'),
  19650. "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML')
  19651. }));
  19652. }
  19653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
  19654. /**
  19655. * WordPress dependencies
  19656. */
  19657. function html_save_save(_ref) {
  19658. let {
  19659. attributes
  19660. } = _ref;
  19661. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  19662. }
  19663. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
  19664. /**
  19665. * WordPress dependencies
  19666. */
  19667. const html_transforms_transforms = {
  19668. from: [{
  19669. type: 'block',
  19670. blocks: ['core/code'],
  19671. transform: _ref => {
  19672. let {
  19673. content
  19674. } = _ref;
  19675. return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  19676. content
  19677. });
  19678. }
  19679. }]
  19680. };
  19681. /* harmony default export */ var html_transforms = (html_transforms_transforms);
  19682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
  19683. /**
  19684. * WordPress dependencies
  19685. */
  19686. /**
  19687. * Internal dependencies
  19688. */
  19689. const html_metadata = {
  19690. $schema: "https://schemas.wp.org/trunk/block.json",
  19691. apiVersion: 2,
  19692. name: "core/html",
  19693. title: "Custom HTML",
  19694. category: "widgets",
  19695. description: "Add custom HTML code and preview it as you edit.",
  19696. keywords: ["embed"],
  19697. textdomain: "default",
  19698. attributes: {
  19699. content: {
  19700. type: "string",
  19701. source: "html"
  19702. }
  19703. },
  19704. supports: {
  19705. customClassName: false,
  19706. className: false,
  19707. html: false
  19708. },
  19709. editorStyle: "wp-block-html-editor"
  19710. };
  19711. const {
  19712. name: html_name
  19713. } = html_metadata;
  19714. const html_settings = {
  19715. icon: library_html,
  19716. example: {
  19717. attributes: {
  19718. content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>'
  19719. }
  19720. },
  19721. edit: HTMLEdit,
  19722. save: html_save_save,
  19723. transforms: html_transforms
  19724. };
  19725. const html_init = () => initBlock({
  19726. name: html_name,
  19727. metadata: html_metadata,
  19728. settings: html_settings
  19729. });
  19730. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
  19731. /**
  19732. * External dependencies
  19733. */
  19734. /**
  19735. * WordPress dependencies
  19736. */
  19737. const image_deprecated_blockAttributes = {
  19738. align: {
  19739. type: 'string'
  19740. },
  19741. url: {
  19742. type: 'string',
  19743. source: 'attribute',
  19744. selector: 'img',
  19745. attribute: 'src'
  19746. },
  19747. alt: {
  19748. type: 'string',
  19749. source: 'attribute',
  19750. selector: 'img',
  19751. attribute: 'alt',
  19752. default: ''
  19753. },
  19754. caption: {
  19755. type: 'string',
  19756. source: 'html',
  19757. selector: 'figcaption'
  19758. },
  19759. title: {
  19760. type: 'string',
  19761. source: 'attribute',
  19762. selector: 'img',
  19763. attribute: 'title'
  19764. },
  19765. href: {
  19766. type: 'string',
  19767. source: 'attribute',
  19768. selector: 'figure > a',
  19769. attribute: 'href'
  19770. },
  19771. rel: {
  19772. type: 'string',
  19773. source: 'attribute',
  19774. selector: 'figure > a',
  19775. attribute: 'rel'
  19776. },
  19777. linkClass: {
  19778. type: 'string',
  19779. source: 'attribute',
  19780. selector: 'figure > a',
  19781. attribute: 'class'
  19782. },
  19783. id: {
  19784. type: 'number'
  19785. },
  19786. width: {
  19787. type: 'number'
  19788. },
  19789. height: {
  19790. type: 'number'
  19791. },
  19792. sizeSlug: {
  19793. type: 'string'
  19794. },
  19795. linkDestination: {
  19796. type: 'string'
  19797. },
  19798. linkTarget: {
  19799. type: 'string',
  19800. source: 'attribute',
  19801. selector: 'figure > a',
  19802. attribute: 'target'
  19803. }
  19804. };
  19805. const deprecated_blockSupports = {
  19806. anchor: true,
  19807. color: {
  19808. __experimentalDuotone: 'img',
  19809. text: false,
  19810. background: false
  19811. },
  19812. __experimentalBorder: {
  19813. radius: true,
  19814. __experimentalDefaultControls: {
  19815. radius: true
  19816. }
  19817. }
  19818. };
  19819. const image_deprecated_deprecated = [// The following deprecation moves existing border radius styles onto the
  19820. // inner img element where new border block support styles must be applied.
  19821. // It will also add a new `.has-custom-border` class for existing blocks
  19822. // with border radii set. This class is required to improve caption position
  19823. // and styling when an image within a gallery has a custom border or
  19824. // rounded corners.
  19825. //
  19826. // See: https://github.com/WordPress/gutenberg/pull/31366/
  19827. {
  19828. attributes: image_deprecated_blockAttributes,
  19829. supports: deprecated_blockSupports,
  19830. save(_ref) {
  19831. let {
  19832. attributes
  19833. } = _ref;
  19834. const {
  19835. url,
  19836. alt,
  19837. caption,
  19838. align,
  19839. href,
  19840. rel,
  19841. linkClass,
  19842. width,
  19843. height,
  19844. id,
  19845. linkTarget,
  19846. sizeSlug,
  19847. title
  19848. } = attributes;
  19849. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  19850. const classes = classnames_default()({
  19851. [`align${align}`]: align,
  19852. [`size-${sizeSlug}`]: sizeSlug,
  19853. 'is-resized': width || height
  19854. });
  19855. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  19856. src: url,
  19857. alt: alt,
  19858. className: id ? `wp-image-${id}` : null,
  19859. width: width,
  19860. height: height,
  19861. title: title
  19862. });
  19863. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  19864. className: linkClass,
  19865. href: href,
  19866. target: linkTarget,
  19867. rel: newRel
  19868. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19869. tagName: "figcaption",
  19870. value: caption
  19871. }));
  19872. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19873. className: classes
  19874. }), figure);
  19875. }
  19876. }, {
  19877. attributes: { ...image_deprecated_blockAttributes,
  19878. title: {
  19879. type: 'string',
  19880. source: 'attribute',
  19881. selector: 'img',
  19882. attribute: 'title'
  19883. },
  19884. sizeSlug: {
  19885. type: 'string'
  19886. }
  19887. },
  19888. supports: deprecated_blockSupports,
  19889. save(_ref2) {
  19890. let {
  19891. attributes
  19892. } = _ref2;
  19893. const {
  19894. url,
  19895. alt,
  19896. caption,
  19897. align,
  19898. href,
  19899. rel,
  19900. linkClass,
  19901. width,
  19902. height,
  19903. id,
  19904. linkTarget,
  19905. sizeSlug,
  19906. title
  19907. } = attributes;
  19908. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  19909. const classes = classnames_default()({
  19910. [`align${align}`]: align,
  19911. [`size-${sizeSlug}`]: sizeSlug,
  19912. 'is-resized': width || height
  19913. });
  19914. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  19915. src: url,
  19916. alt: alt,
  19917. className: id ? `wp-image-${id}` : null,
  19918. width: width,
  19919. height: height,
  19920. title: title
  19921. });
  19922. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  19923. className: linkClass,
  19924. href: href,
  19925. target: linkTarget,
  19926. rel: newRel
  19927. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19928. tagName: "figcaption",
  19929. value: caption
  19930. }));
  19931. if ('left' === align || 'right' === align || 'center' === align) {
  19932. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("figure", {
  19933. className: classes
  19934. }, figure));
  19935. }
  19936. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19937. className: classes
  19938. }), figure);
  19939. }
  19940. }, {
  19941. attributes: image_deprecated_blockAttributes,
  19942. save(_ref3) {
  19943. let {
  19944. attributes
  19945. } = _ref3;
  19946. const {
  19947. url,
  19948. alt,
  19949. caption,
  19950. align,
  19951. href,
  19952. width,
  19953. height,
  19954. id
  19955. } = attributes;
  19956. const classes = classnames_default()({
  19957. [`align${align}`]: align,
  19958. 'is-resized': width || height
  19959. });
  19960. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  19961. src: url,
  19962. alt: alt,
  19963. className: id ? `wp-image-${id}` : null,
  19964. width: width,
  19965. height: height
  19966. });
  19967. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  19968. className: classes
  19969. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  19970. href: href
  19971. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19972. tagName: "figcaption",
  19973. value: caption
  19974. }));
  19975. }
  19976. }, {
  19977. attributes: image_deprecated_blockAttributes,
  19978. save(_ref4) {
  19979. let {
  19980. attributes
  19981. } = _ref4;
  19982. const {
  19983. url,
  19984. alt,
  19985. caption,
  19986. align,
  19987. href,
  19988. width,
  19989. height,
  19990. id
  19991. } = attributes;
  19992. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  19993. src: url,
  19994. alt: alt,
  19995. className: id ? `wp-image-${id}` : null,
  19996. width: width,
  19997. height: height
  19998. });
  19999. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  20000. className: align ? `align${align}` : null
  20001. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  20002. href: href
  20003. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  20004. tagName: "figcaption",
  20005. value: caption
  20006. }));
  20007. }
  20008. }, {
  20009. attributes: image_deprecated_blockAttributes,
  20010. save(_ref5) {
  20011. let {
  20012. attributes
  20013. } = _ref5;
  20014. const {
  20015. url,
  20016. alt,
  20017. caption,
  20018. align,
  20019. href,
  20020. width,
  20021. height
  20022. } = attributes;
  20023. const extraImageProps = width || height ? {
  20024. width,
  20025. height
  20026. } : {};
  20027. const image = (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  20028. src: url,
  20029. alt: alt
  20030. }, extraImageProps));
  20031. let figureStyle = {};
  20032. if (width) {
  20033. figureStyle = {
  20034. width
  20035. };
  20036. } else if (align === 'left' || align === 'right') {
  20037. figureStyle = {
  20038. maxWidth: '50%'
  20039. };
  20040. }
  20041. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  20042. className: align ? `align${align}` : null,
  20043. style: figureStyle
  20044. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  20045. href: href
  20046. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  20047. tagName: "figcaption",
  20048. value: caption
  20049. }));
  20050. }
  20051. }];
  20052. /* harmony default export */ var image_deprecated = (image_deprecated_deprecated);
  20053. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
  20054. /**
  20055. * WordPress dependencies
  20056. */
  20057. const crop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20058. xmlns: "http://www.w3.org/2000/svg",
  20059. viewBox: "0 0 24 24"
  20060. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20061. d: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
  20062. }));
  20063. /* harmony default export */ var library_crop = (crop);
  20064. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
  20065. /**
  20066. * WordPress dependencies
  20067. */
  20068. const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20069. xmlns: "http://www.w3.org/2000/svg",
  20070. viewBox: "0 0 24 24"
  20071. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20072. d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
  20073. }));
  20074. /* harmony default export */ var library_upload = (upload);
  20075. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.js
  20076. /**
  20077. * WordPress dependencies
  20078. */
  20079. const overlayText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20080. xmlns: "http://www.w3.org/2000/svg",
  20081. viewBox: "0 0 24 24"
  20082. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20083. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"
  20084. }));
  20085. /* harmony default export */ var overlay_text = (overlayText);
  20086. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
  20087. /**
  20088. * WordPress dependencies
  20089. */
  20090. function useClientWidth(ref, dependencies) {
  20091. const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)();
  20092. function calculateClientWidth() {
  20093. var _ref$current;
  20094. setClientWidth((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientWidth);
  20095. }
  20096. (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
  20097. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20098. const {
  20099. defaultView
  20100. } = ref.current.ownerDocument;
  20101. defaultView.addEventListener('resize', calculateClientWidth);
  20102. return () => {
  20103. defaultView.removeEventListener('resize', calculateClientWidth);
  20104. };
  20105. }, []);
  20106. return clientWidth;
  20107. }
  20108. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
  20109. /**
  20110. * External dependencies
  20111. */
  20112. /**
  20113. * WordPress dependencies
  20114. */
  20115. /**
  20116. * Internal dependencies
  20117. */
  20118. /**
  20119. * Module constants
  20120. */
  20121. function Image(_ref) {
  20122. var _imageRef$current3, _attributes$className;
  20123. let {
  20124. temporaryURL,
  20125. attributes,
  20126. setAttributes,
  20127. isSelected,
  20128. insertBlocksAfter,
  20129. onReplace,
  20130. onSelectImage,
  20131. onSelectURL,
  20132. onUploadError,
  20133. containerRef,
  20134. context,
  20135. clientId,
  20136. isContentLocked
  20137. } = _ref;
  20138. const {
  20139. url = '',
  20140. alt,
  20141. caption,
  20142. align,
  20143. id,
  20144. href,
  20145. rel,
  20146. linkClass,
  20147. linkDestination,
  20148. title,
  20149. width,
  20150. height,
  20151. linkTarget,
  20152. sizeSlug
  20153. } = attributes;
  20154. const imageRef = (0,external_wp_element_namespaceObject.useRef)();
  20155. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  20156. const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url);
  20157. const {
  20158. allowResize = true
  20159. } = context;
  20160. const {
  20161. getBlock
  20162. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  20163. const {
  20164. image,
  20165. multiImageSelection
  20166. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  20167. const {
  20168. getMedia
  20169. } = select(external_wp_coreData_namespaceObject.store);
  20170. const {
  20171. getMultiSelectedBlockClientIds,
  20172. getBlockName
  20173. } = select(external_wp_blockEditor_namespaceObject.store);
  20174. const multiSelectedClientIds = getMultiSelectedBlockClientIds();
  20175. return {
  20176. image: id && isSelected ? getMedia(id, {
  20177. context: 'view'
  20178. }) : null,
  20179. multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/image')
  20180. };
  20181. }, [id, isSelected, clientId]);
  20182. const {
  20183. canInsertCover,
  20184. imageEditing,
  20185. imageSizes,
  20186. maxWidth,
  20187. mediaUpload
  20188. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  20189. const {
  20190. getBlockRootClientId,
  20191. getSettings,
  20192. canInsertBlockType
  20193. } = select(external_wp_blockEditor_namespaceObject.store);
  20194. const rootClientId = getBlockRootClientId(clientId);
  20195. const settings = (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
  20196. return { ...settings,
  20197. canInsertCover: canInsertBlockType('core/cover', rootClientId)
  20198. };
  20199. }, [clientId]);
  20200. const {
  20201. replaceBlocks,
  20202. toggleSelection
  20203. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  20204. const {
  20205. createErrorNotice,
  20206. createSuccessNotice
  20207. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  20208. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  20209. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  20210. const [{
  20211. loadedNaturalWidth,
  20212. loadedNaturalHeight
  20213. }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  20214. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  20215. const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)();
  20216. const clientWidth = useClientWidth(containerRef, [align]);
  20217. const isResizable = allowResize && !isContentLocked && !(isWideAligned && isLargeViewport);
  20218. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  20219. let {
  20220. slug
  20221. } = _ref2;
  20222. return (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', slug, 'source_url']);
  20223. }), _ref3 => {
  20224. let {
  20225. name,
  20226. slug
  20227. } = _ref3;
  20228. return {
  20229. value: slug,
  20230. label: name
  20231. };
  20232. }); // If an image is externally hosted, try to fetch the image data. This may
  20233. // fail if the image host doesn't allow CORS with the domain. If it works,
  20234. // we can enable a button in the toolbar to upload the image.
  20235. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20236. if (!isExternalImage(id, url) || !isSelected || externalBlob) {
  20237. return;
  20238. }
  20239. window.fetch(url).then(response => response.blob()).then(blob => setExternalBlob(blob)) // Do nothing, cannot upload.
  20240. .catch(() => {});
  20241. }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is
  20242. // done to preserve the behaviour of focussing the first tabbable element
  20243. // when a block is mounted. Previously, the image block would remount when
  20244. // the placeholder is removed. Maybe this behaviour could be removed.
  20245. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20246. if (url && !prevUrl && isSelected) {
  20247. captionRef.current.focus();
  20248. }
  20249. }, [url, prevUrl]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
  20250. // width and height. This resolves an issue in Safari where the loaded natural
  20251. // width and height is otherwise lost when switching between alignments.
  20252. // See: https://github.com/WordPress/gutenberg/pull/37210.
  20253. const {
  20254. naturalWidth,
  20255. naturalHeight
  20256. } = (0,external_wp_element_namespaceObject.useMemo)(() => {
  20257. var _imageRef$current, _imageRef$current2;
  20258. return {
  20259. naturalWidth: ((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth) || loadedNaturalWidth || undefined,
  20260. naturalHeight: ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight) || loadedNaturalHeight || undefined
  20261. };
  20262. }, [loadedNaturalWidth, loadedNaturalHeight, (_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.complete]);
  20263. function onResizeStart() {
  20264. toggleSelection(false);
  20265. }
  20266. function onResizeStop() {
  20267. toggleSelection(true);
  20268. }
  20269. function onImageError() {
  20270. // Check if there's an embed block that handles this URL, e.g., instagram URL.
  20271. // See: https://github.com/WordPress/gutenberg/pull/11472
  20272. const embedBlock = createUpgradedEmbedBlock({
  20273. attributes: {
  20274. url
  20275. }
  20276. });
  20277. if (undefined !== embedBlock) {
  20278. onReplace(embedBlock);
  20279. }
  20280. }
  20281. function onSetHref(props) {
  20282. setAttributes(props);
  20283. }
  20284. function onSetTitle(value) {
  20285. // This is the HTML title attribute, separate from the media object
  20286. // title.
  20287. setAttributes({
  20288. title: value
  20289. });
  20290. }
  20291. function updateAlt(newAlt) {
  20292. setAttributes({
  20293. alt: newAlt
  20294. });
  20295. }
  20296. function updateImage(newSizeSlug) {
  20297. const newUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
  20298. if (!newUrl) {
  20299. return null;
  20300. }
  20301. setAttributes({
  20302. url: newUrl,
  20303. width: undefined,
  20304. height: undefined,
  20305. sizeSlug: newSizeSlug
  20306. });
  20307. }
  20308. function uploadExternal() {
  20309. mediaUpload({
  20310. filesList: [externalBlob],
  20311. onFileChange(_ref4) {
  20312. let [img] = _ref4;
  20313. onSelectImage(img);
  20314. if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
  20315. return;
  20316. }
  20317. setExternalBlob();
  20318. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), {
  20319. type: 'snackbar'
  20320. });
  20321. },
  20322. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  20323. onError(message) {
  20324. createErrorNotice(message, {
  20325. type: 'snackbar'
  20326. });
  20327. }
  20328. });
  20329. }
  20330. function updateAlignment(nextAlign) {
  20331. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  20332. width: undefined,
  20333. height: undefined
  20334. } : {};
  20335. setAttributes({ ...extraUpdatedAttributes,
  20336. align: nextAlign
  20337. });
  20338. }
  20339. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20340. if (!isSelected) {
  20341. setIsEditingImage(false);
  20342. }
  20343. }, [isSelected]);
  20344. const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
  20345. const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;
  20346. function switchToCover() {
  20347. replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover'));
  20348. }
  20349. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20350. group: "block"
  20351. }, !isContentLocked && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  20352. value: align,
  20353. onChange: updateAlignment
  20354. }), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  20355. url: href || '',
  20356. onChangeUrl: onSetHref,
  20357. linkDestination: linkDestination,
  20358. mediaUrl: image && image.source_url || url,
  20359. mediaLink: image && image.link,
  20360. linkTarget: linkTarget,
  20361. linkClass: linkClass,
  20362. rel: rel
  20363. }), allowCrop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20364. onClick: () => setIsEditingImage(true),
  20365. icon: library_crop,
  20366. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  20367. }), externalBlob && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20368. onClick: uploadExternal,
  20369. icon: library_upload,
  20370. label: (0,external_wp_i18n_namespaceObject.__)('Upload external image')
  20371. }), !multiImageSelection && canInsertCover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20372. icon: overlay_text,
  20373. label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'),
  20374. onClick: switchToCover
  20375. })), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20376. group: "other"
  20377. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  20378. mediaId: id,
  20379. mediaURL: url,
  20380. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  20381. accept: "image/*",
  20382. onSelect: onSelectImage,
  20383. onSelectURL: onSelectURL,
  20384. onError: onUploadError
  20385. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  20386. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  20387. }, !multiImageSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  20388. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  20389. value: alt,
  20390. onChange: updateAlt,
  20391. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  20392. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  20393. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  20394. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  20395. onChangeImage: updateImage,
  20396. onChange: value => setAttributes(value),
  20397. slug: sizeSlug,
  20398. width: width,
  20399. height: height,
  20400. imageSizeOptions: imageSizeOptions,
  20401. isResizable: isResizable,
  20402. imageWidth: naturalWidth,
  20403. imageHeight: naturalHeight
  20404. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  20405. __experimentalGroup: "advanced"
  20406. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  20407. label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'),
  20408. value: title || '',
  20409. onChange: onSetTitle,
  20410. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  20411. href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
  20412. }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)')))
  20413. })));
  20414. const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
  20415. let defaultedAlt;
  20416. if (alt) {
  20417. defaultedAlt = alt;
  20418. } else if (filename) {
  20419. defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(
  20420. /* translators: %s: file name */
  20421. (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename);
  20422. } else {
  20423. defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute');
  20424. }
  20425. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  20426. const isRounded = (_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.includes('is-style-rounded');
  20427. const hasCustomBorder = !!borderProps.className || !(0,external_lodash_namespaceObject.isEmpty)(borderProps.style);
  20428. let img = // Disable reason: Image itself is not meant to be interactive, but
  20429. // should direct focus to block.
  20430. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  20431. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  20432. src: temporaryURL || url,
  20433. alt: defaultedAlt,
  20434. onError: () => onImageError(),
  20435. onLoad: event => {
  20436. var _event$target, _event$target2;
  20437. setLoadedNaturalSize({
  20438. loadedNaturalWidth: (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.naturalWidth,
  20439. loadedNaturalHeight: (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.naturalHeight
  20440. });
  20441. },
  20442. ref: imageRef,
  20443. className: borderProps.className,
  20444. style: borderProps.style
  20445. }), temporaryURL && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  20446. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  20447. ;
  20448. let imageWidthWithinContainer;
  20449. let imageHeightWithinContainer;
  20450. if (clientWidth && naturalWidth && naturalHeight) {
  20451. const exceedMaxWidth = naturalWidth > clientWidth;
  20452. const ratio = naturalHeight / naturalWidth;
  20453. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  20454. imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight;
  20455. }
  20456. if (canEditImage && isEditingImage) {
  20457. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  20458. borderProps: isRounded ? undefined : borderProps,
  20459. url: url,
  20460. width: width,
  20461. height: height,
  20462. clientWidth: clientWidth,
  20463. naturalHeight: naturalHeight,
  20464. naturalWidth: naturalWidth
  20465. });
  20466. } else if (!isResizable || !imageWidthWithinContainer) {
  20467. img = (0,external_wp_element_namespaceObject.createElement)("div", {
  20468. style: {
  20469. width,
  20470. height
  20471. }
  20472. }, img);
  20473. } else {
  20474. const currentWidth = width || imageWidthWithinContainer;
  20475. const currentHeight = height || imageHeightWithinContainer;
  20476. const ratio = naturalWidth / naturalHeight;
  20477. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;
  20478. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an
  20479. // explicit pixel value for the max-width. In absence of being able to
  20480. // set the content-width, this max-width is currently dictated by the
  20481. // vanilla editor style. The following variable adds a buffer to this
  20482. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  20483. // in most cases, allow you to scale the image beyond the width of the
  20484. // main column, though not infinitely.
  20485. // @todo It would be good to revisit this once a content-width variable
  20486. // becomes available.
  20487. const maxWidthBuffer = maxWidth * 2.5;
  20488. let showRightHandle = false;
  20489. let showLeftHandle = false;
  20490. /* eslint-disable no-lonely-if */
  20491. // See https://github.com/WordPress/gutenberg/issues/7584.
  20492. if (align === 'center') {
  20493. // When the image is centered, show both handles.
  20494. showRightHandle = true;
  20495. showLeftHandle = true;
  20496. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  20497. // In RTL mode the image is on the right by default.
  20498. // Show the right handle and hide the left handle only when it is
  20499. // aligned left. Otherwise always show the left handle.
  20500. if (align === 'left') {
  20501. showRightHandle = true;
  20502. } else {
  20503. showLeftHandle = true;
  20504. }
  20505. } else {
  20506. // Show the left handle and hide the right handle only when the
  20507. // image is aligned right. Otherwise always show the right handle.
  20508. if (align === 'right') {
  20509. showLeftHandle = true;
  20510. } else {
  20511. showRightHandle = true;
  20512. }
  20513. }
  20514. /* eslint-enable no-lonely-if */
  20515. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  20516. size: {
  20517. width: width !== null && width !== void 0 ? width : 'auto',
  20518. height: height && !hasCustomBorder ? height : 'auto'
  20519. },
  20520. showHandle: isSelected,
  20521. minWidth: minWidth,
  20522. maxWidth: maxWidthBuffer,
  20523. minHeight: minHeight,
  20524. maxHeight: maxWidthBuffer / ratio,
  20525. lockAspectRatio: true,
  20526. enable: {
  20527. top: false,
  20528. right: showRightHandle,
  20529. bottom: true,
  20530. left: showLeftHandle
  20531. },
  20532. onResizeStart: onResizeStart,
  20533. onResizeStop: (event, direction, elt, delta) => {
  20534. onResizeStop();
  20535. setAttributes({
  20536. width: parseInt(currentWidth + delta.width, 10),
  20537. height: parseInt(currentHeight + delta.height, 10)
  20538. });
  20539. }
  20540. }, img);
  20541. }
  20542. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  20543. id: id,
  20544. url: url,
  20545. naturalWidth: naturalWidth,
  20546. naturalHeight: naturalHeight,
  20547. clientWidth: clientWidth,
  20548. onSaveImage: imageAttributes => setAttributes(imageAttributes),
  20549. isEditing: isEditingImage,
  20550. onFinishEditing: () => setIsEditingImage(false)
  20551. }, !temporaryURL && controls, img, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  20552. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  20553. ref: captionRef,
  20554. tagName: "figcaption",
  20555. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  20556. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  20557. value: caption,
  20558. onChange: value => setAttributes({
  20559. caption: value
  20560. }),
  20561. inlineToolbar: true,
  20562. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  20563. }));
  20564. }
  20565. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
  20566. /**
  20567. * External dependencies
  20568. */
  20569. /**
  20570. * WordPress dependencies
  20571. */
  20572. /**
  20573. * Internal dependencies
  20574. */
  20575. // Much of this description is duplicated from MediaPlaceholder.
  20576. const placeholder = content => {
  20577. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  20578. className: "block-editor-media-placeholder",
  20579. withIllustration: true,
  20580. icon: library_image,
  20581. label: (0,external_wp_i18n_namespaceObject.__)('Image'),
  20582. instructions: (0,external_wp_i18n_namespaceObject.__)('Upload an image file, pick one from your media library, or add one with a URL.')
  20583. }, content);
  20584. };
  20585. /**
  20586. * Module constants
  20587. */
  20588. const edit_pickRelevantMediaFiles = (image, size) => {
  20589. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  20590. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', size, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
  20591. return imageProps;
  20592. };
  20593. /**
  20594. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily
  20595. * while the image is being uploaded and will not have an id yet allocated.
  20596. *
  20597. * @param {number=} id The id of the image.
  20598. * @param {string=} url The url of the image.
  20599. *
  20600. * @return {boolean} Is the URL a Blob URL
  20601. */
  20602. const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  20603. /**
  20604. * Is the url for the image hosted externally. An externally hosted image has no
  20605. * id and is not a blob url.
  20606. *
  20607. * @param {number=} id The id of the image.
  20608. * @param {string=} url The url of the image.
  20609. *
  20610. * @return {boolean} Is the url an externally hosted url?
  20611. */
  20612. const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url);
  20613. /**
  20614. * Checks if WP generated default image size. Size generation is skipped
  20615. * when the image is smaller than the said size.
  20616. *
  20617. * @param {Object} image
  20618. * @param {string} defaultSize
  20619. *
  20620. * @return {boolean} Whether or not it has default image size.
  20621. */
  20622. function hasDefaultSize(image, defaultSize) {
  20623. var _image$sizes$defaultS, _image$sizes, _image$media_details$, _image$media_details, _image$media_details$2;
  20624. return 'url' in ((_image$sizes$defaultS = image === null || image === void 0 ? void 0 : (_image$sizes = image.sizes) === null || _image$sizes === void 0 ? void 0 : _image$sizes[defaultSize]) !== null && _image$sizes$defaultS !== void 0 ? _image$sizes$defaultS : {}) || 'source_url' in ((_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : _image$media_details$2[defaultSize]) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : {});
  20625. }
  20626. function ImageEdit(_ref) {
  20627. let {
  20628. attributes,
  20629. setAttributes,
  20630. isSelected,
  20631. className,
  20632. insertBlocksAfter,
  20633. onReplace,
  20634. context,
  20635. clientId
  20636. } = _ref;
  20637. const {
  20638. url = '',
  20639. alt,
  20640. caption,
  20641. align,
  20642. id,
  20643. width,
  20644. height,
  20645. sizeSlug
  20646. } = attributes;
  20647. const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
  20648. const altRef = (0,external_wp_element_namespaceObject.useRef)();
  20649. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20650. altRef.current = alt;
  20651. }, [alt]);
  20652. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  20653. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20654. captionRef.current = caption;
  20655. }, [caption]);
  20656. const ref = (0,external_wp_element_namespaceObject.useRef)();
  20657. const {
  20658. imageDefaultSize,
  20659. mediaUpload,
  20660. isContentLocked
  20661. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  20662. const {
  20663. getSettings,
  20664. __unstableGetContentLockingParent
  20665. } = select(external_wp_blockEditor_namespaceObject.store);
  20666. const settings = getSettings();
  20667. return {
  20668. imageDefaultSize: settings.imageDefaultSize,
  20669. mediaUpload: settings.mediaUpload,
  20670. isContentLocked: !!__unstableGetContentLockingParent(clientId)
  20671. };
  20672. }, []);
  20673. const {
  20674. createErrorNotice
  20675. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  20676. function onUploadError(message) {
  20677. createErrorNotice(message, {
  20678. type: 'snackbar'
  20679. });
  20680. setAttributes({
  20681. src: undefined,
  20682. id: undefined,
  20683. url: undefined
  20684. });
  20685. setTemporaryURL(undefined);
  20686. }
  20687. function onSelectImage(media) {
  20688. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  20689. if (!media || !media.url) {
  20690. setAttributes({
  20691. url: undefined,
  20692. alt: undefined,
  20693. id: undefined,
  20694. title: undefined,
  20695. caption: undefined
  20696. });
  20697. return;
  20698. }
  20699. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  20700. setTemporaryURL(media.url);
  20701. return;
  20702. }
  20703. setTemporaryURL();
  20704. let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // If a caption text was meanwhile written by the user,
  20705. // make sure the text is not overwritten by empty captions.
  20706. if (captionRef.current && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  20707. const {
  20708. caption: omittedCaption,
  20709. ...restMediaAttributes
  20710. } = mediaAttributes;
  20711. mediaAttributes = restMediaAttributes;
  20712. }
  20713. let additionalAttributes; // Reset the dimension attributes if changing to a different image.
  20714. if (!media.id || media.id !== id) {
  20715. additionalAttributes = {
  20716. width: undefined,
  20717. height: undefined,
  20718. // Fallback to size "full" if there's no default image size.
  20719. // It means the image is smaller, and the block will use a full-size URL.
  20720. sizeSlug: hasDefaultSize(media, imageDefaultSize) ? imageDefaultSize : 'full'
  20721. };
  20722. } else {
  20723. // Keep the same url when selecting the same file, so "Image Size"
  20724. // option is not changed.
  20725. additionalAttributes = {
  20726. url
  20727. };
  20728. } // Check if default link setting should be used.
  20729. let linkDestination = attributes.linkDestination;
  20730. if (!linkDestination) {
  20731. // Use the WordPress option to determine the proper default.
  20732. // The constants used in Gutenberg do not match WP options so a little more complicated than ideal.
  20733. // TODO: fix this in a follow up PR, requires updating media-text and ui component.
  20734. switch (((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || constants_LINK_DESTINATION_NONE) {
  20735. case 'file':
  20736. case constants_LINK_DESTINATION_MEDIA:
  20737. linkDestination = constants_LINK_DESTINATION_MEDIA;
  20738. break;
  20739. case 'post':
  20740. case constants_LINK_DESTINATION_ATTACHMENT:
  20741. linkDestination = constants_LINK_DESTINATION_ATTACHMENT;
  20742. break;
  20743. case LINK_DESTINATION_CUSTOM:
  20744. linkDestination = LINK_DESTINATION_CUSTOM;
  20745. break;
  20746. case constants_LINK_DESTINATION_NONE:
  20747. linkDestination = constants_LINK_DESTINATION_NONE;
  20748. break;
  20749. }
  20750. } // Check if the image is linked to it's media.
  20751. let href;
  20752. switch (linkDestination) {
  20753. case constants_LINK_DESTINATION_MEDIA:
  20754. href = media.url;
  20755. break;
  20756. case constants_LINK_DESTINATION_ATTACHMENT:
  20757. href = media.link;
  20758. break;
  20759. }
  20760. mediaAttributes.href = href;
  20761. setAttributes({ ...mediaAttributes,
  20762. ...additionalAttributes,
  20763. linkDestination
  20764. });
  20765. }
  20766. function onSelectURL(newURL) {
  20767. if (newURL !== url) {
  20768. setAttributes({
  20769. url: newURL,
  20770. id: undefined,
  20771. width: undefined,
  20772. height: undefined,
  20773. sizeSlug: imageDefaultSize
  20774. });
  20775. }
  20776. }
  20777. function updateAlignment(nextAlign) {
  20778. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  20779. width: undefined,
  20780. height: undefined
  20781. } : {};
  20782. setAttributes({ ...extraUpdatedAttributes,
  20783. align: nextAlign
  20784. });
  20785. }
  20786. let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.
  20787. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20788. if (!isTemp) {
  20789. return;
  20790. }
  20791. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  20792. if (file) {
  20793. mediaUpload({
  20794. filesList: [file],
  20795. onFileChange: _ref2 => {
  20796. let [img] = _ref2;
  20797. onSelectImage(img);
  20798. },
  20799. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  20800. onError: message => {
  20801. isTemp = false;
  20802. onUploadError(message);
  20803. }
  20804. });
  20805. }
  20806. }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
  20807. // no longer temporary).
  20808. (0,external_wp_element_namespaceObject.useEffect)(() => {
  20809. if (isTemp) {
  20810. setTemporaryURL(url);
  20811. return;
  20812. }
  20813. (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL);
  20814. }, [isTemp, url]);
  20815. const isExternal = isExternalImage(id, url);
  20816. const src = isExternal ? url : undefined;
  20817. const mediaPreview = !!url && (0,external_wp_element_namespaceObject.createElement)("img", {
  20818. alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  20819. title: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  20820. className: 'edit-image-preview',
  20821. src: url
  20822. });
  20823. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  20824. const classes = classnames_default()(className, {
  20825. 'is-transient': temporaryURL,
  20826. 'is-resized': !!width || !!height,
  20827. [`size-${sizeSlug}`]: sizeSlug,
  20828. 'has-custom-border': !!borderProps.className || !(0,external_lodash_namespaceObject.isEmpty)(borderProps.style)
  20829. });
  20830. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  20831. ref,
  20832. className: classes
  20833. });
  20834. return (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (temporaryURL || url) && (0,external_wp_element_namespaceObject.createElement)(Image, {
  20835. temporaryURL: temporaryURL,
  20836. attributes: attributes,
  20837. setAttributes: setAttributes,
  20838. isSelected: isSelected,
  20839. insertBlocksAfter: insertBlocksAfter,
  20840. onReplace: onReplace,
  20841. onSelectImage: onSelectImage,
  20842. onSelectURL: onSelectURL,
  20843. onUploadError: onUploadError,
  20844. containerRef: ref,
  20845. context: context,
  20846. clientId: clientId,
  20847. isContentLocked: isContentLocked
  20848. }), !url && !isContentLocked && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20849. group: "block"
  20850. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  20851. value: align,
  20852. onChange: updateAlignment
  20853. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  20854. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  20855. icon: library_image
  20856. }),
  20857. onSelect: onSelectImage,
  20858. onSelectURL: onSelectURL,
  20859. onError: onUploadError,
  20860. placeholder: placeholder,
  20861. accept: "image/*",
  20862. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  20863. value: {
  20864. id,
  20865. src
  20866. },
  20867. mediaPreview: mediaPreview,
  20868. disableMediaButtons: temporaryURL || url
  20869. }));
  20870. }
  20871. /* harmony default export */ var image_edit = (ImageEdit);
  20872. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
  20873. /**
  20874. * External dependencies
  20875. */
  20876. /**
  20877. * WordPress dependencies
  20878. */
  20879. function image_save_save(_ref) {
  20880. let {
  20881. attributes
  20882. } = _ref;
  20883. const {
  20884. url,
  20885. alt,
  20886. caption,
  20887. align,
  20888. href,
  20889. rel,
  20890. linkClass,
  20891. width,
  20892. height,
  20893. id,
  20894. linkTarget,
  20895. sizeSlug,
  20896. title
  20897. } = attributes;
  20898. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  20899. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  20900. const classes = classnames_default()({
  20901. [`align${align}`]: align,
  20902. [`size-${sizeSlug}`]: sizeSlug,
  20903. 'is-resized': width || height,
  20904. 'has-custom-border': !!borderProps.className || !(0,external_lodash_namespaceObject.isEmpty)(borderProps.style)
  20905. });
  20906. const imageClasses = classnames_default()(borderProps.className, {
  20907. [`wp-image-${id}`]: !!id
  20908. });
  20909. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  20910. src: url,
  20911. alt: alt,
  20912. className: imageClasses || undefined,
  20913. style: borderProps.style,
  20914. width: width,
  20915. height: height,
  20916. title: title
  20917. });
  20918. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  20919. className: linkClass,
  20920. href: href,
  20921. target: linkTarget,
  20922. rel: newRel
  20923. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  20924. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  20925. tagName: "figcaption",
  20926. value: caption
  20927. }));
  20928. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  20929. className: classes
  20930. }), figure);
  20931. }
  20932. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
  20933. /**
  20934. * External dependencies
  20935. */
  20936. /**
  20937. * WordPress dependencies
  20938. */
  20939. function stripFirstImage(attributes, _ref) {
  20940. let {
  20941. shortcode
  20942. } = _ref;
  20943. const {
  20944. body
  20945. } = document.implementation.createHTMLDocument('');
  20946. body.innerHTML = shortcode.content;
  20947. let nodeToRemove = body.querySelector('img'); // If an image has parents, find the topmost node to remove.
  20948. while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) {
  20949. nodeToRemove = nodeToRemove.parentNode;
  20950. }
  20951. if (nodeToRemove) {
  20952. nodeToRemove.parentNode.removeChild(nodeToRemove);
  20953. }
  20954. return body.innerHTML.trim();
  20955. }
  20956. function getFirstAnchorAttributeFormHTML(html, attributeName) {
  20957. const {
  20958. body
  20959. } = document.implementation.createHTMLDocument('');
  20960. body.innerHTML = html;
  20961. const {
  20962. firstElementChild
  20963. } = body;
  20964. if (firstElementChild && firstElementChild.nodeName === 'A') {
  20965. return firstElementChild.getAttribute(attributeName) || undefined;
  20966. }
  20967. }
  20968. const imageSchema = {
  20969. img: {
  20970. attributes: ['src', 'alt', 'title'],
  20971. classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/]
  20972. }
  20973. };
  20974. const schema = _ref2 => {
  20975. let {
  20976. phrasingContentSchema
  20977. } = _ref2;
  20978. return {
  20979. figure: {
  20980. require: ['img'],
  20981. children: { ...imageSchema,
  20982. a: {
  20983. attributes: ['href', 'rel', 'target'],
  20984. children: imageSchema
  20985. },
  20986. figcaption: {
  20987. children: phrasingContentSchema
  20988. }
  20989. }
  20990. }
  20991. };
  20992. };
  20993. const image_transforms_transforms = {
  20994. from: [{
  20995. type: 'raw',
  20996. isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'),
  20997. schema,
  20998. transform: node => {
  20999. // Search both figure and image classes. Alignment could be
  21000. // set on either. ID is set on the image.
  21001. const className = node.className + ' ' + node.querySelector('img').className;
  21002. const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className);
  21003. const anchor = node.id === '' ? undefined : node.id;
  21004. const align = alignMatches ? alignMatches[1] : undefined;
  21005. const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className);
  21006. const id = idMatches ? Number(idMatches[1]) : undefined;
  21007. const anchorElement = node.querySelector('a');
  21008. const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined;
  21009. const href = anchorElement && anchorElement.href ? anchorElement.href : undefined;
  21010. const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined;
  21011. const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined;
  21012. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
  21013. align,
  21014. id,
  21015. linkDestination,
  21016. href,
  21017. rel,
  21018. linkClass,
  21019. anchor
  21020. });
  21021. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes);
  21022. }
  21023. }, {
  21024. // Note: when dragging and dropping multiple files onto a gallery this overrides the
  21025. // gallery transform in order to add new images to the gallery instead of
  21026. // creating a new gallery.
  21027. type: 'files',
  21028. isMatch(files) {
  21029. // The following check is intended to catch non-image files when dropped together with images.
  21030. if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
  21031. const {
  21032. createErrorNotice
  21033. } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
  21034. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  21035. id: 'gallery-transform-invalid-file',
  21036. type: 'snackbar'
  21037. });
  21038. }
  21039. return (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  21040. },
  21041. transform(files) {
  21042. const blocks = files.map(file => {
  21043. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  21044. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  21045. });
  21046. });
  21047. return blocks;
  21048. }
  21049. }, {
  21050. type: 'shortcode',
  21051. tag: 'caption',
  21052. attributes: {
  21053. url: {
  21054. type: 'string',
  21055. source: 'attribute',
  21056. attribute: 'src',
  21057. selector: 'img'
  21058. },
  21059. alt: {
  21060. type: 'string',
  21061. source: 'attribute',
  21062. attribute: 'alt',
  21063. selector: 'img'
  21064. },
  21065. caption: {
  21066. shortcode: stripFirstImage
  21067. },
  21068. href: {
  21069. shortcode: (attributes, _ref3) => {
  21070. let {
  21071. shortcode
  21072. } = _ref3;
  21073. return getFirstAnchorAttributeFormHTML(shortcode.content, 'href');
  21074. }
  21075. },
  21076. rel: {
  21077. shortcode: (attributes, _ref4) => {
  21078. let {
  21079. shortcode
  21080. } = _ref4;
  21081. return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel');
  21082. }
  21083. },
  21084. linkClass: {
  21085. shortcode: (attributes, _ref5) => {
  21086. let {
  21087. shortcode
  21088. } = _ref5;
  21089. return getFirstAnchorAttributeFormHTML(shortcode.content, 'class');
  21090. }
  21091. },
  21092. id: {
  21093. type: 'number',
  21094. shortcode: _ref6 => {
  21095. let {
  21096. named: {
  21097. id
  21098. }
  21099. } = _ref6;
  21100. if (!id) {
  21101. return;
  21102. }
  21103. return parseInt(id.replace('attachment_', ''), 10);
  21104. }
  21105. },
  21106. align: {
  21107. type: 'string',
  21108. shortcode: _ref7 => {
  21109. let {
  21110. named: {
  21111. align = 'alignnone'
  21112. }
  21113. } = _ref7;
  21114. return align.replace('align', '');
  21115. }
  21116. }
  21117. }
  21118. }]
  21119. };
  21120. /* harmony default export */ var image_transforms = (image_transforms_transforms);
  21121. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
  21122. /**
  21123. * WordPress dependencies
  21124. */
  21125. /**
  21126. * Internal dependencies
  21127. */
  21128. const image_metadata = {
  21129. $schema: "https://schemas.wp.org/trunk/block.json",
  21130. apiVersion: 2,
  21131. name: "core/image",
  21132. title: "Image",
  21133. category: "media",
  21134. usesContext: ["allowResize", "imageCrop", "fixedHeight"],
  21135. description: "Insert an image to make a visual statement.",
  21136. keywords: ["img", "photo", "picture"],
  21137. textdomain: "default",
  21138. attributes: {
  21139. align: {
  21140. type: "string"
  21141. },
  21142. url: {
  21143. type: "string",
  21144. source: "attribute",
  21145. selector: "img",
  21146. attribute: "src",
  21147. __experimentalRole: "content"
  21148. },
  21149. alt: {
  21150. type: "string",
  21151. source: "attribute",
  21152. selector: "img",
  21153. attribute: "alt",
  21154. "default": "",
  21155. __experimentalRole: "content"
  21156. },
  21157. caption: {
  21158. type: "string",
  21159. source: "html",
  21160. selector: "figcaption",
  21161. __experimentalRole: "content"
  21162. },
  21163. title: {
  21164. type: "string",
  21165. source: "attribute",
  21166. selector: "img",
  21167. attribute: "title",
  21168. __experimentalRole: "content"
  21169. },
  21170. href: {
  21171. type: "string",
  21172. source: "attribute",
  21173. selector: "figure > a",
  21174. attribute: "href",
  21175. __experimentalRole: "content"
  21176. },
  21177. rel: {
  21178. type: "string",
  21179. source: "attribute",
  21180. selector: "figure > a",
  21181. attribute: "rel"
  21182. },
  21183. linkClass: {
  21184. type: "string",
  21185. source: "attribute",
  21186. selector: "figure > a",
  21187. attribute: "class"
  21188. },
  21189. id: {
  21190. type: "number",
  21191. __experimentalRole: "content"
  21192. },
  21193. width: {
  21194. type: "number"
  21195. },
  21196. height: {
  21197. type: "number"
  21198. },
  21199. sizeSlug: {
  21200. type: "string"
  21201. },
  21202. linkDestination: {
  21203. type: "string"
  21204. },
  21205. linkTarget: {
  21206. type: "string",
  21207. source: "attribute",
  21208. selector: "figure > a",
  21209. attribute: "target"
  21210. }
  21211. },
  21212. supports: {
  21213. anchor: true,
  21214. color: {
  21215. __experimentalDuotone: "img, .components-placeholder",
  21216. text: false,
  21217. background: false
  21218. },
  21219. __experimentalBorder: {
  21220. color: true,
  21221. radius: true,
  21222. width: true,
  21223. __experimentalSelector: "img, .wp-block-image__crop-area",
  21224. __experimentalSkipSerialization: true,
  21225. __experimentalDefaultControls: {
  21226. color: true,
  21227. radius: true,
  21228. width: true
  21229. }
  21230. }
  21231. },
  21232. styles: [{
  21233. name: "default",
  21234. label: "Default",
  21235. isDefault: true
  21236. }, {
  21237. name: "rounded",
  21238. label: "Rounded"
  21239. }],
  21240. editorStyle: "wp-block-image-editor",
  21241. style: "wp-block-image"
  21242. };
  21243. const {
  21244. name: image_name
  21245. } = image_metadata;
  21246. const image_settings = {
  21247. icon: library_image,
  21248. example: {
  21249. attributes: {
  21250. sizeSlug: 'large',
  21251. url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',
  21252. // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.
  21253. caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.')
  21254. }
  21255. },
  21256. __experimentalLabel(attributes, _ref) {
  21257. let {
  21258. context
  21259. } = _ref;
  21260. if (context === 'accessibility') {
  21261. const {
  21262. caption,
  21263. alt,
  21264. url
  21265. } = attributes;
  21266. if (!url) {
  21267. return (0,external_wp_i18n_namespaceObject.__)('Empty');
  21268. }
  21269. if (!alt) {
  21270. return caption || '';
  21271. } // This is intended to be read by a screen reader.
  21272. // A period simply means a pause, no need to translate it.
  21273. return alt + (caption ? '. ' + caption : '');
  21274. }
  21275. },
  21276. getEditWrapperProps(attributes) {
  21277. return {
  21278. 'data-align': attributes.align
  21279. };
  21280. },
  21281. transforms: image_transforms,
  21282. edit: image_edit,
  21283. save: image_save_save,
  21284. deprecated: image_deprecated
  21285. };
  21286. const image_init = () => initBlock({
  21287. name: image_name,
  21288. metadata: image_metadata,
  21289. settings: image_settings
  21290. });
  21291. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
  21292. /**
  21293. * WordPress dependencies
  21294. */
  21295. const comment = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21296. viewBox: "0 0 24 24",
  21297. xmlns: "http://www.w3.org/2000/svg"
  21298. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21299. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
  21300. }));
  21301. /* harmony default export */ var library_comment = (comment);
  21302. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
  21303. /**
  21304. * WordPress dependencies
  21305. */
  21306. /**
  21307. * Minimum number of comments a user can show using this block.
  21308. *
  21309. * @type {number}
  21310. */
  21311. const MIN_COMMENTS = 1;
  21312. /**
  21313. * Maximum number of comments a user can show using this block.
  21314. *
  21315. * @type {number}
  21316. */
  21317. const MAX_COMMENTS = 100;
  21318. function LatestComments(_ref) {
  21319. let {
  21320. attributes,
  21321. setAttributes
  21322. } = _ref;
  21323. const {
  21324. commentsToShow,
  21325. displayAvatar,
  21326. displayDate,
  21327. displayExcerpt
  21328. } = attributes;
  21329. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  21330. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  21331. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21332. label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'),
  21333. checked: displayAvatar,
  21334. onChange: () => setAttributes({
  21335. displayAvatar: !displayAvatar
  21336. })
  21337. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21338. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  21339. checked: displayDate,
  21340. onChange: () => setAttributes({
  21341. displayDate: !displayDate
  21342. })
  21343. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21344. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  21345. checked: displayExcerpt,
  21346. onChange: () => setAttributes({
  21347. displayExcerpt: !displayExcerpt
  21348. })
  21349. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  21350. label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'),
  21351. value: commentsToShow,
  21352. onChange: value => setAttributes({
  21353. commentsToShow: value
  21354. }),
  21355. min: MIN_COMMENTS,
  21356. max: MAX_COMMENTS,
  21357. required: true
  21358. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  21359. block: "core/latest-comments",
  21360. attributes: attributes // The preview uses the site's locale to make it more true to how
  21361. // the block appears on the frontend. Setting the locale
  21362. // explicitly prevents any middleware from setting it to 'user'.
  21363. ,
  21364. urlQueryArgs: {
  21365. _locale: 'site'
  21366. }
  21367. })));
  21368. }
  21369. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  21370. /**
  21371. * WordPress dependencies
  21372. */
  21373. /**
  21374. * Internal dependencies
  21375. */
  21376. const latest_comments_metadata = {
  21377. $schema: "https://schemas.wp.org/trunk/block.json",
  21378. apiVersion: 2,
  21379. name: "core/latest-comments",
  21380. title: "Latest Comments",
  21381. category: "widgets",
  21382. description: "Display a list of your most recent comments.",
  21383. keywords: ["recent comments"],
  21384. textdomain: "default",
  21385. attributes: {
  21386. commentsToShow: {
  21387. type: "number",
  21388. "default": 5,
  21389. minimum: 1,
  21390. maximum: 100
  21391. },
  21392. displayAvatar: {
  21393. type: "boolean",
  21394. "default": true
  21395. },
  21396. displayDate: {
  21397. type: "boolean",
  21398. "default": true
  21399. },
  21400. displayExcerpt: {
  21401. type: "boolean",
  21402. "default": true
  21403. }
  21404. },
  21405. supports: {
  21406. align: true,
  21407. html: false
  21408. },
  21409. editorStyle: "wp-block-latest-comments-editor",
  21410. style: "wp-block-latest-comments"
  21411. };
  21412. const {
  21413. name: latest_comments_name
  21414. } = latest_comments_metadata;
  21415. const latest_comments_settings = {
  21416. icon: library_comment,
  21417. example: {},
  21418. edit: LatestComments
  21419. };
  21420. const latest_comments_init = () => initBlock({
  21421. name: latest_comments_name,
  21422. metadata: latest_comments_metadata,
  21423. settings: latest_comments_settings
  21424. });
  21425. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
  21426. /**
  21427. * WordPress dependencies
  21428. */
  21429. const postList = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21430. viewBox: "0 0 24 24",
  21431. xmlns: "http://www.w3.org/2000/svg"
  21432. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21433. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
  21434. }));
  21435. /* harmony default export */ var post_list = (postList);
  21436. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
  21437. /**
  21438. * Internal dependencies
  21439. */
  21440. const latest_posts_deprecated_metadata = {
  21441. $schema: "https://schemas.wp.org/trunk/block.json",
  21442. apiVersion: 2,
  21443. name: "core/latest-posts",
  21444. title: "Latest Posts",
  21445. category: "widgets",
  21446. description: "Display a list of your most recent posts.",
  21447. keywords: ["recent posts"],
  21448. textdomain: "default",
  21449. attributes: {
  21450. categories: {
  21451. type: "array",
  21452. items: {
  21453. type: "object"
  21454. }
  21455. },
  21456. selectedAuthor: {
  21457. type: "number"
  21458. },
  21459. postsToShow: {
  21460. type: "number",
  21461. "default": 5
  21462. },
  21463. displayPostContent: {
  21464. type: "boolean",
  21465. "default": false
  21466. },
  21467. displayPostContentRadio: {
  21468. type: "string",
  21469. "default": "excerpt"
  21470. },
  21471. excerptLength: {
  21472. type: "number",
  21473. "default": 55
  21474. },
  21475. displayAuthor: {
  21476. type: "boolean",
  21477. "default": false
  21478. },
  21479. displayPostDate: {
  21480. type: "boolean",
  21481. "default": false
  21482. },
  21483. postLayout: {
  21484. type: "string",
  21485. "default": "list"
  21486. },
  21487. columns: {
  21488. type: "number",
  21489. "default": 3
  21490. },
  21491. order: {
  21492. type: "string",
  21493. "default": "desc"
  21494. },
  21495. orderBy: {
  21496. type: "string",
  21497. "default": "date"
  21498. },
  21499. displayFeaturedImage: {
  21500. type: "boolean",
  21501. "default": false
  21502. },
  21503. featuredImageAlign: {
  21504. type: "string",
  21505. "enum": ["left", "center", "right"]
  21506. },
  21507. featuredImageSizeSlug: {
  21508. type: "string",
  21509. "default": "thumbnail"
  21510. },
  21511. featuredImageSizeWidth: {
  21512. type: "number",
  21513. "default": null
  21514. },
  21515. featuredImageSizeHeight: {
  21516. type: "number",
  21517. "default": null
  21518. },
  21519. addLinkToFeaturedImage: {
  21520. type: "boolean",
  21521. "default": false
  21522. }
  21523. },
  21524. supports: {
  21525. align: true,
  21526. html: false,
  21527. typography: {
  21528. fontSize: true,
  21529. lineHeight: true,
  21530. __experimentalFontFamily: true,
  21531. __experimentalFontWeight: true,
  21532. __experimentalFontStyle: true,
  21533. __experimentalTextTransform: true,
  21534. __experimentalTextDecoration: true,
  21535. __experimentalLetterSpacing: true,
  21536. __experimentalDefaultControls: {
  21537. fontSize: true
  21538. }
  21539. }
  21540. },
  21541. editorStyle: "wp-block-latest-posts-editor",
  21542. style: "wp-block-latest-posts"
  21543. };
  21544. const {
  21545. attributes: deprecated_attributes
  21546. } = latest_posts_deprecated_metadata;
  21547. /* harmony default export */ var latest_posts_deprecated = ([{
  21548. attributes: { ...deprecated_attributes,
  21549. categories: {
  21550. type: 'string'
  21551. }
  21552. },
  21553. supports: {
  21554. align: true,
  21555. html: false
  21556. },
  21557. migrate: oldAttributes => {
  21558. // This needs the full category object, not just the ID.
  21559. return { ...oldAttributes,
  21560. categories: [{
  21561. id: Number(oldAttributes.categories)
  21562. }]
  21563. };
  21564. },
  21565. isEligible: _ref => {
  21566. let {
  21567. categories
  21568. } = _ref;
  21569. return categories && 'string' === typeof categories;
  21570. },
  21571. save: () => null
  21572. }]);
  21573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
  21574. /**
  21575. * WordPress dependencies
  21576. */
  21577. const list = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21578. viewBox: "0 0 24 24",
  21579. xmlns: "http://www.w3.org/2000/svg"
  21580. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21581. d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"
  21582. }));
  21583. /* harmony default export */ var library_list = (list);
  21584. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
  21585. /**
  21586. * WordPress dependencies
  21587. */
  21588. const grid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21589. xmlns: "http://www.w3.org/2000/svg",
  21590. viewBox: "0 0 24 24"
  21591. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21592. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",
  21593. fillRule: "evenodd",
  21594. clipRule: "evenodd"
  21595. }));
  21596. /* harmony default export */ var library_grid = (grid);
  21597. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
  21598. const MIN_EXCERPT_LENGTH = 10;
  21599. const MAX_EXCERPT_LENGTH = 100;
  21600. const MAX_POSTS_COLUMNS = 6;
  21601. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
  21602. /**
  21603. * External dependencies
  21604. */
  21605. /**
  21606. * WordPress dependencies
  21607. */
  21608. /**
  21609. * Internal dependencies
  21610. */
  21611. /**
  21612. * Module Constants
  21613. */
  21614. const CATEGORIES_LIST_QUERY = {
  21615. per_page: -1,
  21616. context: 'view'
  21617. };
  21618. const USERS_LIST_QUERY = {
  21619. per_page: -1,
  21620. has_published_posts: ['post'],
  21621. context: 'view'
  21622. };
  21623. function getFeaturedImageDetails(post, size) {
  21624. var _image$media_details$, _image$media_details, _image$media_details$2, _image$media_details$3;
  21625. const image = (0,external_lodash_namespaceObject.get)(post, ['_embedded', 'wp:featuredmedia', '0']);
  21626. return {
  21627. url: (_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : (_image$media_details$3 = _image$media_details$2[size]) === null || _image$media_details$3 === void 0 ? void 0 : _image$media_details$3.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image === null || image === void 0 ? void 0 : image.source_url,
  21628. alt: image === null || image === void 0 ? void 0 : image.alt_text
  21629. };
  21630. }
  21631. function LatestPostsEdit(_ref) {
  21632. var _categoriesList$reduc;
  21633. let {
  21634. attributes,
  21635. setAttributes
  21636. } = _ref;
  21637. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit);
  21638. const {
  21639. postsToShow,
  21640. order,
  21641. orderBy,
  21642. categories,
  21643. selectedAuthor,
  21644. displayFeaturedImage,
  21645. displayPostContentRadio,
  21646. displayPostContent,
  21647. displayPostDate,
  21648. displayAuthor,
  21649. postLayout,
  21650. columns,
  21651. excerptLength,
  21652. featuredImageAlign,
  21653. featuredImageSizeSlug,
  21654. featuredImageSizeWidth,
  21655. featuredImageSizeHeight,
  21656. addLinkToFeaturedImage
  21657. } = attributes;
  21658. const {
  21659. imageSizes,
  21660. latestPosts,
  21661. defaultImageWidth,
  21662. defaultImageHeight,
  21663. categoriesList,
  21664. authorList
  21665. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  21666. const {
  21667. getEntityRecords,
  21668. getUsers
  21669. } = select(external_wp_coreData_namespaceObject.store);
  21670. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  21671. const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
  21672. const latestPostsQuery = (0,external_lodash_namespaceObject.pickBy)({
  21673. categories: catIds,
  21674. author: selectedAuthor,
  21675. order,
  21676. orderby: orderBy,
  21677. per_page: postsToShow,
  21678. _embed: 'wp:featuredmedia'
  21679. }, value => typeof value !== 'undefined');
  21680. return {
  21681. defaultImageWidth: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'width'], 0),
  21682. defaultImageHeight: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'height'], 0),
  21683. imageSizes: settings.imageSizes,
  21684. latestPosts: getEntityRecords('postType', 'post', latestPostsQuery),
  21685. categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY),
  21686. authorList: getUsers(USERS_LIST_QUERY)
  21687. };
  21688. }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); // If a user clicks to a link prevent redirection and show a warning.
  21689. const {
  21690. createWarningNotice,
  21691. removeNotice
  21692. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  21693. let noticeId;
  21694. const showRedirectionPreventedNotice = event => {
  21695. event.preventDefault(); // Remove previous warning if any, to show one at a time per block.
  21696. removeNotice(noticeId);
  21697. noticeId = `block-library/core/latest-posts/redirection-prevented/${instanceId}`;
  21698. createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), {
  21699. id: noticeId,
  21700. type: 'snackbar'
  21701. });
  21702. };
  21703. const imageSizeOptions = imageSizes.filter(_ref2 => {
  21704. let {
  21705. slug
  21706. } = _ref2;
  21707. return slug !== 'full';
  21708. }).map(_ref3 => {
  21709. let {
  21710. name,
  21711. slug
  21712. } = _ref3;
  21713. return {
  21714. value: slug,
  21715. label: name
  21716. };
  21717. });
  21718. const categorySuggestions = (_categoriesList$reduc = categoriesList === null || categoriesList === void 0 ? void 0 : categoriesList.reduce((accumulator, category) => ({ ...accumulator,
  21719. [category.name]: category
  21720. }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {};
  21721. const selectCategories = tokens => {
  21722. const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]);
  21723. if (hasNoSuggestion) {
  21724. return;
  21725. } // Categories that are already will be objects, while new additions will be strings (the name).
  21726. // allCategories nomalizes the array so that they are all objects.
  21727. const allCategories = tokens.map(token => {
  21728. return typeof token === 'string' ? categorySuggestions[token] : token;
  21729. }); // We do nothing if the category is not selected
  21730. // from suggestions.
  21731. if ((0,external_lodash_namespaceObject.includes)(allCategories, null)) {
  21732. return false;
  21733. }
  21734. setAttributes({
  21735. categories: allCategories
  21736. });
  21737. };
  21738. const hasPosts = !!(latestPosts !== null && latestPosts !== void 0 && latestPosts.length);
  21739. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  21740. title: (0,external_wp_i18n_namespaceObject.__)('Post content settings')
  21741. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21742. label: (0,external_wp_i18n_namespaceObject.__)('Post content'),
  21743. checked: displayPostContent,
  21744. onChange: value => setAttributes({
  21745. displayPostContent: value
  21746. })
  21747. }), displayPostContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, {
  21748. label: (0,external_wp_i18n_namespaceObject.__)('Show:'),
  21749. selected: displayPostContentRadio,
  21750. options: [{
  21751. label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
  21752. value: 'excerpt'
  21753. }, {
  21754. label: (0,external_wp_i18n_namespaceObject.__)('Full post'),
  21755. value: 'full_post'
  21756. }],
  21757. onChange: value => setAttributes({
  21758. displayPostContentRadio: value
  21759. })
  21760. }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  21761. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  21762. value: excerptLength,
  21763. onChange: value => setAttributes({
  21764. excerptLength: value
  21765. }),
  21766. min: MIN_EXCERPT_LENGTH,
  21767. max: MAX_EXCERPT_LENGTH
  21768. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  21769. title: (0,external_wp_i18n_namespaceObject.__)('Post meta settings')
  21770. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21771. label: (0,external_wp_i18n_namespaceObject.__)('Display author name'),
  21772. checked: displayAuthor,
  21773. onChange: value => setAttributes({
  21774. displayAuthor: value
  21775. })
  21776. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21777. label: (0,external_wp_i18n_namespaceObject.__)('Display post date'),
  21778. checked: displayPostDate,
  21779. onChange: value => setAttributes({
  21780. displayPostDate: value
  21781. })
  21782. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  21783. title: (0,external_wp_i18n_namespaceObject.__)('Featured image settings')
  21784. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21785. label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'),
  21786. checked: displayFeaturedImage,
  21787. onChange: value => setAttributes({
  21788. displayFeaturedImage: value
  21789. })
  21790. }), displayFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  21791. onChange: value => {
  21792. const newAttrs = {};
  21793. if (value.hasOwnProperty('width')) {
  21794. newAttrs.featuredImageSizeWidth = value.width;
  21795. }
  21796. if (value.hasOwnProperty('height')) {
  21797. newAttrs.featuredImageSizeHeight = value.height;
  21798. }
  21799. setAttributes(newAttrs);
  21800. },
  21801. slug: featuredImageSizeSlug,
  21802. width: featuredImageSizeWidth,
  21803. height: featuredImageSizeHeight,
  21804. imageWidth: defaultImageWidth,
  21805. imageHeight: defaultImageHeight,
  21806. imageSizeOptions: imageSizeOptions,
  21807. onChangeImage: value => setAttributes({
  21808. featuredImageSizeSlug: value,
  21809. featuredImageSizeWidth: undefined,
  21810. featuredImageSizeHeight: undefined
  21811. })
  21812. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  21813. className: "editor-latest-posts-image-alignment-control"
  21814. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  21815. value: featuredImageAlign,
  21816. onChange: value => setAttributes({
  21817. featuredImageAlign: value
  21818. }),
  21819. controls: ['left', 'center', 'right'],
  21820. isCollapsed: false
  21821. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21822. label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'),
  21823. checked: addLinkToFeaturedImage,
  21824. onChange: value => setAttributes({
  21825. addLinkToFeaturedImage: value
  21826. })
  21827. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  21828. title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering')
  21829. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
  21830. order,
  21831. orderBy,
  21832. numberOfItems: postsToShow,
  21833. onOrderChange: value => setAttributes({
  21834. order: value
  21835. }),
  21836. onOrderByChange: value => setAttributes({
  21837. orderBy: value
  21838. }),
  21839. onNumberOfItemsChange: value => setAttributes({
  21840. postsToShow: value
  21841. }),
  21842. categorySuggestions: categorySuggestions,
  21843. onCategoryChange: selectCategories,
  21844. selectedCategories: categories,
  21845. onAuthorChange: value => setAttributes({
  21846. selectedAuthor: '' !== value ? Number(value) : undefined
  21847. }),
  21848. authorList: authorList !== null && authorList !== void 0 ? authorList : [],
  21849. selectedAuthorId: selectedAuthor
  21850. }), postLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  21851. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  21852. value: columns,
  21853. onChange: value => setAttributes({
  21854. columns: value
  21855. }),
  21856. min: 2,
  21857. max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length),
  21858. required: true
  21859. })));
  21860. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  21861. className: classnames_default()({
  21862. 'wp-block-latest-posts__list': true,
  21863. 'is-grid': postLayout === 'grid',
  21864. 'has-dates': displayPostDate,
  21865. 'has-author': displayAuthor,
  21866. [`columns-${columns}`]: postLayout === 'grid'
  21867. })
  21868. });
  21869. if (!hasPosts) {
  21870. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  21871. icon: library_pin,
  21872. label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts')
  21873. }, !Array.isArray(latestPosts) ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.')));
  21874. } // Removing posts from display should be instant.
  21875. const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts;
  21876. const layoutControls = [{
  21877. icon: library_list,
  21878. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  21879. onClick: () => setAttributes({
  21880. postLayout: 'list'
  21881. }),
  21882. isActive: postLayout === 'list'
  21883. }, {
  21884. icon: library_grid,
  21885. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  21886. onClick: () => setAttributes({
  21887. postLayout: 'grid'
  21888. }),
  21889. isActive: postLayout === 'grid'
  21890. }];
  21891. const dateFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date;
  21892. return (0,external_wp_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  21893. controls: layoutControls
  21894. })), (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, displayPosts.map((post, i) => {
  21895. const titleTrimmed = post.title.rendered.trim();
  21896. let excerpt = post.excerpt.rendered;
  21897. const currentAuthor = authorList === null || authorList === void 0 ? void 0 : authorList.find(author => author.id === post.author);
  21898. const excerptElement = document.createElement('div');
  21899. excerptElement.innerHTML = excerpt;
  21900. excerpt = excerptElement.textContent || excerptElement.innerText || '';
  21901. const {
  21902. url: imageSourceUrl,
  21903. alt: featuredImageAlt
  21904. } = getFeaturedImageDetails(post, featuredImageSizeSlug);
  21905. const imageClasses = classnames_default()({
  21906. 'wp-block-latest-posts__featured-image': true,
  21907. [`align${featuredImageAlign}`]: !!featuredImageAlign
  21908. });
  21909. const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
  21910. const featuredImage = renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("img", {
  21911. src: imageSourceUrl,
  21912. alt: featuredImageAlt,
  21913. style: {
  21914. maxWidth: featuredImageSizeWidth,
  21915. maxHeight: featuredImageSizeHeight
  21916. }
  21917. });
  21918. const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
  21919. const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_i18n_namespaceObject.__)(' … '), (0,external_wp_element_namespaceObject.createElement)("a", {
  21920. href: post.link,
  21921. rel: "noopener noreferrer",
  21922. onClick: showRedirectionPreventedNotice
  21923. }, (0,external_wp_i18n_namespaceObject.__)('Read more'))) : excerpt;
  21924. return (0,external_wp_element_namespaceObject.createElement)("li", {
  21925. key: i
  21926. }, renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
  21927. className: imageClasses
  21928. }, addLinkToFeaturedImage ? (0,external_wp_element_namespaceObject.createElement)("a", {
  21929. className: "wp-block-latest-posts__post-title",
  21930. href: post.link,
  21931. rel: "noreferrer noopener",
  21932. onClick: showRedirectionPreventedNotice
  21933. }, featuredImage) : featuredImage), (0,external_wp_element_namespaceObject.createElement)("a", {
  21934. href: post.link,
  21935. rel: "noreferrer noopener",
  21936. dangerouslySetInnerHTML: !!titleTrimmed ? {
  21937. __html: titleTrimmed
  21938. } : undefined,
  21939. onClick: showRedirectionPreventedNotice
  21940. }, !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null), displayAuthor && currentAuthor && (0,external_wp_element_namespaceObject.createElement)("div", {
  21941. className: "wp-block-latest-posts__post-author"
  21942. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  21943. /* translators: byline. %s: current author. */
  21944. (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_wp_element_namespaceObject.createElement)("time", {
  21945. dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt),
  21946. className: "wp-block-latest-posts__post-date"
  21947. }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)("div", {
  21948. className: "wp-block-latest-posts__post-excerpt"
  21949. }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_wp_element_namespaceObject.createElement)("div", {
  21950. className: "wp-block-latest-posts__post-full-content",
  21951. dangerouslySetInnerHTML: {
  21952. __html: post.content.raw.trim()
  21953. }
  21954. }));
  21955. })));
  21956. }
  21957. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  21958. /**
  21959. * WordPress dependencies
  21960. */
  21961. /**
  21962. * Internal dependencies
  21963. */
  21964. const latest_posts_metadata = {
  21965. $schema: "https://schemas.wp.org/trunk/block.json",
  21966. apiVersion: 2,
  21967. name: "core/latest-posts",
  21968. title: "Latest Posts",
  21969. category: "widgets",
  21970. description: "Display a list of your most recent posts.",
  21971. keywords: ["recent posts"],
  21972. textdomain: "default",
  21973. attributes: {
  21974. categories: {
  21975. type: "array",
  21976. items: {
  21977. type: "object"
  21978. }
  21979. },
  21980. selectedAuthor: {
  21981. type: "number"
  21982. },
  21983. postsToShow: {
  21984. type: "number",
  21985. "default": 5
  21986. },
  21987. displayPostContent: {
  21988. type: "boolean",
  21989. "default": false
  21990. },
  21991. displayPostContentRadio: {
  21992. type: "string",
  21993. "default": "excerpt"
  21994. },
  21995. excerptLength: {
  21996. type: "number",
  21997. "default": 55
  21998. },
  21999. displayAuthor: {
  22000. type: "boolean",
  22001. "default": false
  22002. },
  22003. displayPostDate: {
  22004. type: "boolean",
  22005. "default": false
  22006. },
  22007. postLayout: {
  22008. type: "string",
  22009. "default": "list"
  22010. },
  22011. columns: {
  22012. type: "number",
  22013. "default": 3
  22014. },
  22015. order: {
  22016. type: "string",
  22017. "default": "desc"
  22018. },
  22019. orderBy: {
  22020. type: "string",
  22021. "default": "date"
  22022. },
  22023. displayFeaturedImage: {
  22024. type: "boolean",
  22025. "default": false
  22026. },
  22027. featuredImageAlign: {
  22028. type: "string",
  22029. "enum": ["left", "center", "right"]
  22030. },
  22031. featuredImageSizeSlug: {
  22032. type: "string",
  22033. "default": "thumbnail"
  22034. },
  22035. featuredImageSizeWidth: {
  22036. type: "number",
  22037. "default": null
  22038. },
  22039. featuredImageSizeHeight: {
  22040. type: "number",
  22041. "default": null
  22042. },
  22043. addLinkToFeaturedImage: {
  22044. type: "boolean",
  22045. "default": false
  22046. }
  22047. },
  22048. supports: {
  22049. align: true,
  22050. html: false,
  22051. typography: {
  22052. fontSize: true,
  22053. lineHeight: true,
  22054. __experimentalFontFamily: true,
  22055. __experimentalFontWeight: true,
  22056. __experimentalFontStyle: true,
  22057. __experimentalTextTransform: true,
  22058. __experimentalTextDecoration: true,
  22059. __experimentalLetterSpacing: true,
  22060. __experimentalDefaultControls: {
  22061. fontSize: true
  22062. }
  22063. }
  22064. },
  22065. editorStyle: "wp-block-latest-posts-editor",
  22066. style: "wp-block-latest-posts"
  22067. };
  22068. const {
  22069. name: latest_posts_name
  22070. } = latest_posts_metadata;
  22071. const latest_posts_settings = {
  22072. icon: post_list,
  22073. example: {},
  22074. edit: LatestPostsEdit,
  22075. deprecated: latest_posts_deprecated
  22076. };
  22077. const latest_posts_init = () => initBlock({
  22078. name: latest_posts_name,
  22079. metadata: latest_posts_metadata,
  22080. settings: latest_posts_settings
  22081. });
  22082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/utils.js
  22083. /**
  22084. * WordPress dependencies
  22085. */
  22086. function createListBlockFromDOMElement(listElement) {
  22087. var _listElement$getAttri;
  22088. const listAttributes = {
  22089. ordered: 'OL' === listElement.tagName,
  22090. anchor: listElement.id === '' ? undefined : listElement.id,
  22091. start: listElement.getAttribute('start') ? parseInt(listElement.getAttribute('start'), 10) : undefined,
  22092. reversed: listElement.hasAttribute('reversed') ? true : undefined,
  22093. type: (_listElement$getAttri = listElement.getAttribute('type')) !== null && _listElement$getAttri !== void 0 ? _listElement$getAttri : undefined
  22094. };
  22095. const innerBlocks = Array.from(listElement.children).map(listItem => {
  22096. const children = Array.from(listItem.childNodes).filter(node => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0);
  22097. children.reverse();
  22098. const [nestedList, ...nodes] = children;
  22099. const hasNestedList = (nestedList === null || nestedList === void 0 ? void 0 : nestedList.tagName) === 'UL' || (nestedList === null || nestedList === void 0 ? void 0 : nestedList.tagName) === 'OL';
  22100. if (!hasNestedList) {
  22101. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', {
  22102. content: listItem.innerHTML
  22103. });
  22104. }
  22105. const htmlNodes = nodes.map(node => {
  22106. if (node.nodeType === node.TEXT_NODE) {
  22107. return node.textContent;
  22108. }
  22109. return node.outerHTML;
  22110. });
  22111. htmlNodes.reverse();
  22112. const childAttributes = {
  22113. content: htmlNodes.join('').trim()
  22114. };
  22115. const childInnerBlocks = [createListBlockFromDOMElement(nestedList)];
  22116. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', childAttributes, childInnerBlocks);
  22117. });
  22118. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', listAttributes, innerBlocks);
  22119. }
  22120. function migrateToListV2(attributes) {
  22121. const {
  22122. values,
  22123. start,
  22124. reversed,
  22125. ordered,
  22126. type
  22127. } = attributes;
  22128. const list = document.createElement(ordered ? 'ol' : 'ul');
  22129. list.innerHTML = values;
  22130. if (start) {
  22131. list.setAttribute('start', start);
  22132. }
  22133. if (reversed) {
  22134. list.setAttribute('reversed', true);
  22135. }
  22136. if (type) {
  22137. list.setAttribute('type', type);
  22138. }
  22139. const [listBlock] = (0,external_wp_blocks_namespaceObject.rawHandler)({
  22140. HTML: list.outerHTML
  22141. });
  22142. return [listBlock.attributes, listBlock.innerBlocks];
  22143. }
  22144. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
  22145. /**
  22146. * WordPress dependencies
  22147. */
  22148. /**
  22149. * Internal dependencies
  22150. */
  22151. const v0 = {
  22152. attributes: {
  22153. ordered: {
  22154. type: 'boolean',
  22155. default: false,
  22156. __experimentalRole: 'content'
  22157. },
  22158. values: {
  22159. type: 'string',
  22160. source: 'html',
  22161. selector: 'ol,ul',
  22162. multiline: 'li',
  22163. __unstableMultilineWrapperTags: ['ol', 'ul'],
  22164. default: '',
  22165. __experimentalRole: 'content'
  22166. },
  22167. type: {
  22168. type: 'string'
  22169. },
  22170. start: {
  22171. type: 'number'
  22172. },
  22173. reversed: {
  22174. type: 'boolean'
  22175. },
  22176. placeholder: {
  22177. type: 'string'
  22178. }
  22179. },
  22180. supports: {
  22181. anchor: true,
  22182. className: false,
  22183. typography: {
  22184. fontSize: true,
  22185. __experimentalFontFamily: true
  22186. },
  22187. color: {
  22188. gradients: true,
  22189. link: true
  22190. },
  22191. __unstablePasteTextInline: true,
  22192. __experimentalSelector: 'ol,ul',
  22193. __experimentalSlashInserter: true
  22194. },
  22195. save(_ref) {
  22196. let {
  22197. attributes
  22198. } = _ref;
  22199. const {
  22200. ordered,
  22201. values,
  22202. type,
  22203. reversed,
  22204. start
  22205. } = attributes;
  22206. const TagName = ordered ? 'ol' : 'ul';
  22207. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  22208. type,
  22209. reversed,
  22210. start
  22211. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  22212. value: values,
  22213. multiline: "li"
  22214. }));
  22215. },
  22216. migrate: migrate_font_family,
  22217. isEligible(_ref2) {
  22218. var _style$typography;
  22219. let {
  22220. style
  22221. } = _ref2;
  22222. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  22223. }
  22224. };
  22225. const list_deprecated_v1 = {
  22226. attributes: {
  22227. ordered: {
  22228. type: 'boolean',
  22229. default: false,
  22230. __experimentalRole: 'content'
  22231. },
  22232. values: {
  22233. type: 'string',
  22234. source: 'html',
  22235. selector: 'ol,ul',
  22236. multiline: 'li',
  22237. __unstableMultilineWrapperTags: ['ol', 'ul'],
  22238. default: '',
  22239. __experimentalRole: 'content'
  22240. },
  22241. type: {
  22242. type: 'string'
  22243. },
  22244. start: {
  22245. type: 'number'
  22246. },
  22247. reversed: {
  22248. type: 'boolean'
  22249. },
  22250. placeholder: {
  22251. type: 'string'
  22252. }
  22253. },
  22254. supports: {
  22255. anchor: true,
  22256. className: false,
  22257. typography: {
  22258. fontSize: true,
  22259. __experimentalFontFamily: true,
  22260. lineHeight: true,
  22261. __experimentalFontStyle: true,
  22262. __experimentalFontWeight: true,
  22263. __experimentalLetterSpacing: true,
  22264. __experimentalTextTransform: true,
  22265. __experimentalDefaultControls: {
  22266. fontSize: true
  22267. }
  22268. },
  22269. color: {
  22270. gradients: true,
  22271. link: true,
  22272. __experimentalDefaultControls: {
  22273. background: true,
  22274. text: true
  22275. }
  22276. },
  22277. __unstablePasteTextInline: true,
  22278. __experimentalSelector: 'ol,ul',
  22279. __experimentalSlashInserter: true
  22280. },
  22281. save(_ref3) {
  22282. let {
  22283. attributes
  22284. } = _ref3;
  22285. const {
  22286. ordered,
  22287. values,
  22288. type,
  22289. reversed,
  22290. start
  22291. } = attributes;
  22292. const TagName = ordered ? 'ol' : 'ul';
  22293. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  22294. type,
  22295. reversed,
  22296. start
  22297. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  22298. value: values,
  22299. multiline: "li"
  22300. }));
  22301. },
  22302. migrate: migrateToListV2
  22303. };
  22304. /**
  22305. * New deprecations need to be placed first
  22306. * for them to have higher priority.
  22307. *
  22308. * Old deprecations may need to be updated as well.
  22309. *
  22310. * See block-deprecation.md
  22311. */
  22312. /* harmony default export */ var list_deprecated = ([list_deprecated_v1, v0]);
  22313. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
  22314. /**
  22315. * WordPress dependencies
  22316. */
  22317. const formatOutdentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22318. xmlns: "http://www.w3.org/2000/svg",
  22319. viewBox: "0 0 24 24"
  22320. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22321. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"
  22322. }));
  22323. /* harmony default export */ var format_outdent_rtl = (formatOutdentRTL);
  22324. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
  22325. /**
  22326. * WordPress dependencies
  22327. */
  22328. const formatOutdent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22329. xmlns: "http://www.w3.org/2000/svg",
  22330. viewBox: "0 0 24 24"
  22331. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22332. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"
  22333. }));
  22334. /* harmony default export */ var format_outdent = (formatOutdent);
  22335. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
  22336. /**
  22337. * WordPress dependencies
  22338. */
  22339. const formatListBulletsRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22340. xmlns: "http://www.w3.org/2000/svg",
  22341. viewBox: "0 0 24 24"
  22342. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22343. d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"
  22344. }));
  22345. /* harmony default export */ var format_list_bullets_rtl = (formatListBulletsRTL);
  22346. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
  22347. /**
  22348. * WordPress dependencies
  22349. */
  22350. const formatListBullets = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22351. xmlns: "http://www.w3.org/2000/svg",
  22352. viewBox: "0 0 24 24"
  22353. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22354. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
  22355. }));
  22356. /* harmony default export */ var format_list_bullets = (formatListBullets);
  22357. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
  22358. /**
  22359. * WordPress dependencies
  22360. */
  22361. const formatListNumberedRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22362. xmlns: "http://www.w3.org/2000/svg",
  22363. viewBox: "0 0 24 24"
  22364. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22365. d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"
  22366. }));
  22367. /* harmony default export */ var format_list_numbered_rtl = (formatListNumberedRTL);
  22368. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
  22369. /**
  22370. * WordPress dependencies
  22371. */
  22372. const formatListNumbered = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22373. xmlns: "http://www.w3.org/2000/svg",
  22374. viewBox: "0 0 24 24"
  22375. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22376. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"
  22377. }));
  22378. /* harmony default export */ var format_list_numbered = (formatListNumbered);
  22379. ;// CONCATENATED MODULE: external ["wp","deprecated"]
  22380. var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  22381. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  22382. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
  22383. /**
  22384. * WordPress dependencies
  22385. */
  22386. const OrderedListSettings = _ref => {
  22387. let {
  22388. setAttributes,
  22389. reversed,
  22390. start
  22391. } = _ref;
  22392. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  22393. title: (0,external_wp_i18n_namespaceObject.__)('Ordered list settings')
  22394. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  22395. label: (0,external_wp_i18n_namespaceObject.__)('Start value'),
  22396. type: "number",
  22397. onChange: value => {
  22398. const int = parseInt(value, 10);
  22399. setAttributes({
  22400. // It should be possible to unset the value,
  22401. // e.g. with an empty string.
  22402. start: isNaN(int) ? undefined : int
  22403. });
  22404. },
  22405. value: Number.isInteger(start) ? start.toString(10) : '',
  22406. step: "1"
  22407. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  22408. label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'),
  22409. checked: reversed || false,
  22410. onChange: value => {
  22411. setAttributes({
  22412. // Unset the attribute if not reversed.
  22413. reversed: value || undefined
  22414. });
  22415. }
  22416. })));
  22417. };
  22418. /* harmony default export */ var ordered_list_settings = (OrderedListSettings);
  22419. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/tag-name.js
  22420. /**
  22421. * WordPress dependencies
  22422. */
  22423. function TagName(props, ref) {
  22424. const {
  22425. ordered,
  22426. ...extraProps
  22427. } = props;
  22428. const Tag = ordered ? 'ol' : 'ul';
  22429. return (0,external_wp_element_namespaceObject.createElement)(Tag, _extends({
  22430. ref: ref
  22431. }, extraProps));
  22432. }
  22433. /* harmony default export */ var tag_name = ((0,external_wp_element_namespaceObject.forwardRef)(TagName));
  22434. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
  22435. /**
  22436. * WordPress dependencies
  22437. */
  22438. /**
  22439. * Internal dependencies
  22440. */
  22441. const list_edit_TEMPLATE = [['core/list-item']];
  22442. const NATIVE_MARGIN_SPACING = 8;
  22443. /**
  22444. * At the moment, deprecations don't handle create blocks from attributes
  22445. * (like when using CPT templates). For this reason, this hook is necessary
  22446. * to avoid breaking templates using the old list block format.
  22447. *
  22448. * @param {Object} attributes Block attributes.
  22449. * @param {string} clientId Block client ID.
  22450. */
  22451. function useMigrateOnLoad(attributes, clientId) {
  22452. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22453. const {
  22454. updateBlockAttributes,
  22455. replaceInnerBlocks
  22456. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22457. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22458. // As soon as the block is loaded, migrate it to the new version.
  22459. if (!attributes.values) {
  22460. return;
  22461. }
  22462. const [newAttributes, newInnerBlocks] = migrateToListV2(attributes);
  22463. external_wp_deprecated_default()('Value attribute on the list block', {
  22464. since: '6.0',
  22465. version: '6.5',
  22466. alternative: 'inner blocks'
  22467. });
  22468. registry.batch(() => {
  22469. updateBlockAttributes(clientId, newAttributes);
  22470. replaceInnerBlocks(clientId, newInnerBlocks);
  22471. });
  22472. }, [attributes.values]);
  22473. }
  22474. function useOutdentList(clientId) {
  22475. const {
  22476. canOutdent
  22477. } = (0,external_wp_data_namespaceObject.useSelect)(innerSelect => {
  22478. const {
  22479. getBlockRootClientId,
  22480. getBlock
  22481. } = innerSelect(external_wp_blockEditor_namespaceObject.store);
  22482. const parentId = getBlockRootClientId(clientId);
  22483. return {
  22484. canOutdent: !!parentId && getBlock(parentId).name === 'core/list-item'
  22485. };
  22486. }, [clientId]);
  22487. const {
  22488. replaceBlocks,
  22489. selectionChange
  22490. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22491. const {
  22492. getBlockRootClientId,
  22493. getBlockAttributes,
  22494. getBlock
  22495. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  22496. return [canOutdent, (0,external_wp_element_namespaceObject.useCallback)(() => {
  22497. const parentBlockId = getBlockRootClientId(clientId);
  22498. const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks.
  22499. const newParentBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', parentBlockAttributes);
  22500. const {
  22501. innerBlocks
  22502. } = getBlock(clientId); // Replace the parent block with a new parent block without inner blocks,
  22503. // and make the inner blocks siblings of the parent.
  22504. replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); // Select the last child of the list being outdent.
  22505. selectionChange(innerBlocks[innerBlocks.length - 1].clientId);
  22506. }, [clientId])];
  22507. }
  22508. function IndentUI(_ref) {
  22509. let {
  22510. clientId
  22511. } = _ref;
  22512. const [canOutdent, outdentList] = useOutdentList(clientId);
  22513. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  22514. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
  22515. title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
  22516. describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
  22517. disabled: !canOutdent,
  22518. onClick: outdentList
  22519. }));
  22520. }
  22521. function list_edit_Edit(_ref2) {
  22522. let {
  22523. attributes,
  22524. setAttributes,
  22525. clientId,
  22526. style
  22527. } = _ref2;
  22528. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ...(external_wp_element_namespaceObject.Platform.isNative && {
  22529. style
  22530. })
  22531. });
  22532. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  22533. allowedBlocks: ['core/list-item'],
  22534. template: list_edit_TEMPLATE,
  22535. templateLock: false,
  22536. templateInsertUpdatesSelection: true,
  22537. ...(external_wp_element_namespaceObject.Platform.isNative && {
  22538. marginVertical: NATIVE_MARGIN_SPACING,
  22539. marginHorizontal: NATIVE_MARGIN_SPACING,
  22540. useCompactList: true
  22541. })
  22542. });
  22543. useMigrateOnLoad(attributes, clientId);
  22544. const {
  22545. ordered,
  22546. type,
  22547. reversed,
  22548. start
  22549. } = attributes;
  22550. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  22551. group: "block"
  22552. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  22553. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
  22554. title: (0,external_wp_i18n_namespaceObject.__)('Unordered'),
  22555. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'),
  22556. isActive: ordered === false,
  22557. onClick: () => {
  22558. setAttributes({
  22559. ordered: false
  22560. });
  22561. }
  22562. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  22563. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
  22564. title: (0,external_wp_i18n_namespaceObject.__)('Ordered'),
  22565. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'),
  22566. isActive: ordered === true,
  22567. onClick: () => {
  22568. setAttributes({
  22569. ordered: true
  22570. });
  22571. }
  22572. }), (0,external_wp_element_namespaceObject.createElement)(IndentUI, {
  22573. clientId: clientId
  22574. }));
  22575. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(tag_name, _extends({
  22576. ordered: ordered,
  22577. reversed: reversed,
  22578. start: start,
  22579. type: type
  22580. }, innerBlocksProps)), controls, ordered && (0,external_wp_element_namespaceObject.createElement)(ordered_list_settings, {
  22581. setAttributes: setAttributes,
  22582. ordered: ordered,
  22583. reversed: reversed,
  22584. start: start
  22585. }));
  22586. }
  22587. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
  22588. /**
  22589. * WordPress dependencies
  22590. */
  22591. function list_save_save(_ref) {
  22592. let {
  22593. attributes
  22594. } = _ref;
  22595. const {
  22596. ordered,
  22597. type,
  22598. reversed,
  22599. start
  22600. } = attributes;
  22601. const TagName = ordered ? 'ol' : 'ul';
  22602. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  22603. type,
  22604. reversed,
  22605. start
  22606. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  22607. }
  22608. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
  22609. /**
  22610. * WordPress dependencies
  22611. */
  22612. /**
  22613. * Internal dependencies
  22614. */
  22615. function getListContentSchema(_ref) {
  22616. let {
  22617. phrasingContentSchema
  22618. } = _ref;
  22619. const listContentSchema = { ...phrasingContentSchema,
  22620. ul: {},
  22621. ol: {
  22622. attributes: ['type', 'start', 'reversed']
  22623. }
  22624. }; // Recursion is needed.
  22625. // Possible: ul > li > ul.
  22626. // Impossible: ul > ul.
  22627. ['ul', 'ol'].forEach(tag => {
  22628. listContentSchema[tag].children = {
  22629. li: {
  22630. children: listContentSchema
  22631. }
  22632. };
  22633. });
  22634. return listContentSchema;
  22635. }
  22636. function getListContentFlat(blocks) {
  22637. return blocks.flatMap(_ref2 => {
  22638. let {
  22639. name,
  22640. attributes,
  22641. innerBlocks = []
  22642. } = _ref2;
  22643. if (name === 'core/list-item') {
  22644. return [attributes.content, ...getListContentFlat(innerBlocks)];
  22645. }
  22646. return getListContentFlat(innerBlocks);
  22647. });
  22648. }
  22649. const list_transforms_transforms = {
  22650. from: [{
  22651. type: 'block',
  22652. isMultiBlock: true,
  22653. blocks: ['core/paragraph', 'core/heading'],
  22654. transform: blockAttributes => {
  22655. let childBlocks = [];
  22656. if (blockAttributes.length > 1) {
  22657. childBlocks = blockAttributes.map(_ref3 => {
  22658. let {
  22659. content
  22660. } = _ref3;
  22661. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', {
  22662. content
  22663. });
  22664. });
  22665. } else if (blockAttributes.length === 1) {
  22666. const value = (0,external_wp_richText_namespaceObject.create)({
  22667. html: blockAttributes[0].content
  22668. });
  22669. childBlocks = (0,external_wp_richText_namespaceObject.split)(value, '\n').map(result => {
  22670. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', {
  22671. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  22672. value: result
  22673. })
  22674. });
  22675. });
  22676. }
  22677. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  22678. anchor: blockAttributes.anchor
  22679. }, childBlocks);
  22680. }
  22681. }, {
  22682. type: 'raw',
  22683. selector: 'ol,ul',
  22684. schema: args => ({
  22685. ol: getListContentSchema(args).ol,
  22686. ul: getListContentSchema(args).ul
  22687. }),
  22688. transform: createListBlockFromDOMElement
  22689. }, ...['*', '-'].map(prefix => ({
  22690. type: 'prefix',
  22691. prefix,
  22692. transform(content) {
  22693. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', {
  22694. content
  22695. })]);
  22696. }
  22697. })), ...['1.', '1)'].map(prefix => ({
  22698. type: 'prefix',
  22699. prefix,
  22700. transform(content) {
  22701. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  22702. ordered: true
  22703. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', {
  22704. content
  22705. })]);
  22706. }
  22707. }))],
  22708. to: [...['core/paragraph', 'core/heading'].map(block => ({
  22709. type: 'block',
  22710. blocks: [block],
  22711. transform: (_attributes, childBlocks) => {
  22712. return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)(block, {
  22713. content
  22714. }));
  22715. }
  22716. })), {
  22717. type: 'block',
  22718. blocks: ['*'],
  22719. transform: (_attributes, childBlocks) => {
  22720. return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  22721. content
  22722. }));
  22723. }
  22724. }]
  22725. };
  22726. /* harmony default export */ var list_transforms = (list_transforms_transforms);
  22727. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
  22728. /**
  22729. * WordPress dependencies
  22730. */
  22731. /**
  22732. * Internal dependencies
  22733. */
  22734. const list_metadata = {
  22735. $schema: "https://schemas.wp.org/trunk/block.json",
  22736. apiVersion: 2,
  22737. name: "core/list",
  22738. title: "List",
  22739. category: "text",
  22740. description: "Create a bulleted or numbered list.",
  22741. keywords: ["bullet list", "ordered list", "numbered list"],
  22742. textdomain: "default",
  22743. attributes: {
  22744. ordered: {
  22745. type: "boolean",
  22746. "default": false,
  22747. __experimentalRole: "content"
  22748. },
  22749. values: {
  22750. type: "string",
  22751. source: "html",
  22752. selector: "ol,ul",
  22753. multiline: "li",
  22754. __unstableMultilineWrapperTags: ["ol", "ul"],
  22755. "default": "",
  22756. __experimentalRole: "content"
  22757. },
  22758. type: {
  22759. type: "string"
  22760. },
  22761. start: {
  22762. type: "number"
  22763. },
  22764. reversed: {
  22765. type: "boolean"
  22766. },
  22767. placeholder: {
  22768. type: "string"
  22769. }
  22770. },
  22771. supports: {
  22772. anchor: true,
  22773. className: false,
  22774. typography: {
  22775. fontSize: true,
  22776. lineHeight: true,
  22777. __experimentalFontFamily: true,
  22778. __experimentalFontWeight: true,
  22779. __experimentalFontStyle: true,
  22780. __experimentalTextTransform: true,
  22781. __experimentalTextDecoration: true,
  22782. __experimentalLetterSpacing: true,
  22783. __experimentalDefaultControls: {
  22784. fontSize: true
  22785. }
  22786. },
  22787. color: {
  22788. gradients: true,
  22789. link: true,
  22790. __experimentalDefaultControls: {
  22791. background: true,
  22792. text: true
  22793. }
  22794. },
  22795. spacing: {
  22796. margin: true,
  22797. padding: true
  22798. },
  22799. __unstablePasteTextInline: true,
  22800. __experimentalSelector: "ol,ul",
  22801. __experimentalSlashInserter: true
  22802. },
  22803. editorStyle: "wp-block-list-editor",
  22804. style: "wp-block-list"
  22805. };
  22806. const {
  22807. name: list_name
  22808. } = list_metadata;
  22809. const list_settings = {
  22810. icon: library_list,
  22811. example: {
  22812. innerBlocks: [{
  22813. name: 'core/list-item',
  22814. attributes: {
  22815. content: (0,external_wp_i18n_namespaceObject.__)('Alice.')
  22816. }
  22817. }, {
  22818. name: 'core/list-item',
  22819. attributes: {
  22820. content: (0,external_wp_i18n_namespaceObject.__)('The White Rabbit.')
  22821. }
  22822. }, {
  22823. name: 'core/list-item',
  22824. attributes: {
  22825. content: (0,external_wp_i18n_namespaceObject.__)('The Cheshire Cat.')
  22826. }
  22827. }, {
  22828. name: 'core/list-item',
  22829. attributes: {
  22830. content: (0,external_wp_i18n_namespaceObject.__)('The Mad Hatter.')
  22831. }
  22832. }, {
  22833. name: 'core/list-item',
  22834. attributes: {
  22835. content: (0,external_wp_i18n_namespaceObject.__)('The Queen of Hearts.')
  22836. }
  22837. }]
  22838. },
  22839. transforms: list_transforms,
  22840. edit: list_edit_Edit,
  22841. save: list_save_save,
  22842. deprecated: list_deprecated
  22843. };
  22844. const list_init = () => initBlock({
  22845. name: list_name,
  22846. metadata: list_metadata,
  22847. settings: list_settings
  22848. });
  22849. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-item.js
  22850. /**
  22851. * WordPress dependencies
  22852. */
  22853. const listItem = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22854. xmlns: "http://www.w3.org/2000/svg",
  22855. viewBox: "0 0 24 24"
  22856. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22857. d: "M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
  22858. }));
  22859. /* harmony default export */ var list_item = (listItem);
  22860. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
  22861. /**
  22862. * WordPress dependencies
  22863. */
  22864. const formatIndentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22865. xmlns: "http://www.w3.org/2000/svg",
  22866. viewBox: "0 0 24 24"
  22867. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22868. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"
  22869. }));
  22870. /* harmony default export */ var format_indent_rtl = (formatIndentRTL);
  22871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
  22872. /**
  22873. * WordPress dependencies
  22874. */
  22875. const formatIndent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  22876. xmlns: "http://www.w3.org/2000/svg",
  22877. viewBox: "0 0 24 24"
  22878. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  22879. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"
  22880. }));
  22881. /* harmony default export */ var format_indent = (formatIndent);
  22882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-indent-list-item.js
  22883. /**
  22884. * WordPress dependencies
  22885. */
  22886. function useIndentListItem(clientId) {
  22887. const canIndent = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlockIndex(clientId) > 0, [clientId]);
  22888. const {
  22889. replaceBlocks,
  22890. selectionChange,
  22891. multiSelect
  22892. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22893. const {
  22894. getBlock,
  22895. getPreviousBlockClientId,
  22896. getSelectionStart,
  22897. getSelectionEnd,
  22898. hasMultiSelection,
  22899. getMultiSelectedBlockClientIds
  22900. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  22901. return [canIndent, (0,external_wp_element_namespaceObject.useCallback)(() => {
  22902. var _newListItem$innerBlo;
  22903. const _hasMultiSelection = hasMultiSelection();
  22904. const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId];
  22905. const clonedBlocks = clientIds.map(_clientId => (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(_clientId)));
  22906. const previousSiblingId = getPreviousBlockClientId(clientId);
  22907. const newListItem = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(previousSiblingId)); // If the sibling has no innerBlocks, create a new `list` block.
  22908. if (!((_newListItem$innerBlo = newListItem.innerBlocks) !== null && _newListItem$innerBlo !== void 0 && _newListItem$innerBlo.length)) {
  22909. newListItem.innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/list')];
  22910. } // A list item usually has one `list`, but it's possible to have
  22911. // more. So we need to preserve the previous `list` blocks and
  22912. // merge the new blocks to the last `list`.
  22913. newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks); // We get the selection start/end here, because when
  22914. // we replace blocks, the selection is updated too.
  22915. const selectionStart = getSelectionStart();
  22916. const selectionEnd = getSelectionEnd(); // Replace the previous sibling of the block being indented and the indented blocks,
  22917. // with a new block whose attributes are equal to the ones of the previous sibling and
  22918. // whose descendants are the children of the previous sibling, followed by the indented blocks.
  22919. replaceBlocks([previousSiblingId, ...clientIds], [newListItem]);
  22920. if (!_hasMultiSelection) {
  22921. selectionChange(clonedBlocks[0].clientId, selectionEnd.attributeKey, selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, selectionEnd.offset);
  22922. } else {
  22923. multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId);
  22924. }
  22925. }, [clientId])];
  22926. }
  22927. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-outdent-list-item.js
  22928. /**
  22929. * External dependencies
  22930. */
  22931. /**
  22932. * WordPress dependencies
  22933. */
  22934. /**
  22935. * Internal dependencies
  22936. */
  22937. const {
  22938. name: listItemName
  22939. } = {
  22940. $schema: "https://schemas.wp.org/trunk/block.json",
  22941. apiVersion: 2,
  22942. name: "core/list-item",
  22943. title: "List item",
  22944. category: "text",
  22945. parent: ["core/list"],
  22946. description: "Create a list item.",
  22947. textdomain: "default",
  22948. attributes: {
  22949. placeholder: {
  22950. type: "string"
  22951. },
  22952. content: {
  22953. type: "string",
  22954. source: "html",
  22955. selector: "li",
  22956. "default": "",
  22957. __experimentalRole: "content"
  22958. }
  22959. },
  22960. supports: {
  22961. className: false,
  22962. __experimentalSelector: "li"
  22963. }
  22964. };
  22965. function useOutdentListItem(clientId) {
  22966. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22967. const {
  22968. canOutdent
  22969. } = (0,external_wp_data_namespaceObject.useSelect)(innerSelect => {
  22970. const {
  22971. getBlockRootClientId,
  22972. getBlockName
  22973. } = innerSelect(external_wp_blockEditor_namespaceObject.store);
  22974. const grandParentId = getBlockRootClientId(getBlockRootClientId(clientId));
  22975. const grandParentName = getBlockName(grandParentId);
  22976. const isListItem = grandParentName === listItemName;
  22977. return {
  22978. canOutdent: isListItem
  22979. };
  22980. }, [clientId]);
  22981. const {
  22982. moveBlocksToPosition,
  22983. removeBlock,
  22984. insertBlock,
  22985. updateBlockListSettings
  22986. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22987. const {
  22988. getBlockRootClientId,
  22989. getBlockName,
  22990. getBlockOrder,
  22991. getBlockIndex,
  22992. getSelectedBlockClientIds,
  22993. getBlock,
  22994. getBlockListSettings
  22995. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  22996. function getParentListItemId(id) {
  22997. const listId = getBlockRootClientId(id);
  22998. const parentListItemId = getBlockRootClientId(listId);
  22999. if (!parentListItemId) return;
  23000. if (getBlockName(parentListItemId) !== listItemName) return;
  23001. return parentListItemId;
  23002. }
  23003. return [canOutdent, (0,external_wp_element_namespaceObject.useCallback)(function () {
  23004. let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSelectedBlockClientIds();
  23005. clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
  23006. if (!clientIds.length) return;
  23007. const firstClientId = clientIds[0]; // Can't outdent if it's not a list item.
  23008. if (getBlockName(firstClientId) !== listItemName) return;
  23009. const parentListItemId = getParentListItemId(firstClientId); // Can't outdent if it's at the top level.
  23010. if (!parentListItemId) return;
  23011. const parentListId = getBlockRootClientId(firstClientId);
  23012. const lastClientId = clientIds[clientIds.length - 1];
  23013. const order = getBlockOrder(parentListId);
  23014. const followingListItems = order.slice(getBlockIndex(lastClientId) + 1);
  23015. registry.batch(() => {
  23016. if (followingListItems.length) {
  23017. let nestedListId = getBlockOrder(firstClientId)[0];
  23018. if (!nestedListId) {
  23019. const nestedListBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(parentListId), {}, []);
  23020. nestedListId = nestedListBlock.clientId;
  23021. insertBlock(nestedListBlock, 0, firstClientId, false); // Immediately update the block list settings, otherwise
  23022. // blocks can't be moved here due to canInsert checks.
  23023. updateBlockListSettings(nestedListId, getBlockListSettings(parentListId));
  23024. }
  23025. moveBlocksToPosition(followingListItems, parentListId, nestedListId);
  23026. }
  23027. moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1);
  23028. if (!getBlockOrder(parentListId).length) {
  23029. removeBlock(parentListId);
  23030. }
  23031. });
  23032. }, [])];
  23033. }
  23034. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-copy.js
  23035. /**
  23036. * WordPress dependencies
  23037. */
  23038. function useCopy(clientId) {
  23039. const {
  23040. getBlockRootClientId,
  23041. getBlockName,
  23042. getBlockAttributes
  23043. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  23044. return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
  23045. function onCopy(event) {
  23046. // The event propagates through all nested lists, so don't override
  23047. // when copying nested list items.
  23048. if (event.clipboardData.getData('__unstableWrapperBlockName')) {
  23049. return;
  23050. }
  23051. const rootClientId = getBlockRootClientId(clientId);
  23052. event.clipboardData.setData('__unstableWrapperBlockName', getBlockName(rootClientId));
  23053. event.clipboardData.setData('__unstableWrapperBlockAttributes', JSON.stringify(getBlockAttributes(rootClientId)));
  23054. }
  23055. node.addEventListener('copy', onCopy);
  23056. node.addEventListener('cut', onCopy);
  23057. return () => {
  23058. node.removeEventListener('copy', onCopy);
  23059. node.removeEventListener('cut', onCopy);
  23060. };
  23061. }, []);
  23062. }
  23063. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-enter.js
  23064. /**
  23065. * WordPress dependencies
  23066. */
  23067. /**
  23068. * Internal dependencies
  23069. */
  23070. function useEnter(props) {
  23071. const {
  23072. replaceBlocks,
  23073. selectionChange
  23074. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  23075. const {
  23076. getBlock,
  23077. getBlockRootClientId,
  23078. getBlockIndex
  23079. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  23080. const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
  23081. propsRef.current = props;
  23082. const [canOutdent, outdentListItem] = useOutdentListItem(propsRef.current.clientId);
  23083. return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
  23084. function onKeyDown(event) {
  23085. var _topParentListBlock$i;
  23086. if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
  23087. return;
  23088. }
  23089. const {
  23090. content,
  23091. clientId
  23092. } = propsRef.current;
  23093. if (content.length) {
  23094. return;
  23095. }
  23096. event.preventDefault();
  23097. if (canOutdent) {
  23098. outdentListItem();
  23099. return;
  23100. } // Here we are in top level list so we need to split.
  23101. const topParentListBlock = getBlock(getBlockRootClientId(clientId));
  23102. const blockIndex = getBlockIndex(clientId);
  23103. const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock,
  23104. innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex)
  23105. });
  23106. const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); // Last list item might contain a `list` block innerBlock
  23107. // In that case append remaining innerBlocks blocks.
  23108. const after = [...(((_topParentListBlock$i = topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]) === null || _topParentListBlock$i === void 0 ? void 0 : _topParentListBlock$i.innerBlocks) || []), ...topParentListBlock.innerBlocks.slice(blockIndex + 1)];
  23109. const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock,
  23110. innerBlocks: after
  23111. })] : [];
  23112. replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); // We manually change the selection here because we are replacing
  23113. // a different block than the selected one.
  23114. selectionChange(middle.clientId);
  23115. }
  23116. element.addEventListener('keydown', onKeyDown);
  23117. return () => {
  23118. element.removeEventListener('keydown', onKeyDown);
  23119. };
  23120. }, [canOutdent]);
  23121. }
  23122. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-space.js
  23123. /**
  23124. * WordPress dependencies
  23125. */
  23126. /**
  23127. * Internal dependencies
  23128. */
  23129. function useSpace(clientId) {
  23130. const {
  23131. getSelectionStart,
  23132. getSelectionEnd
  23133. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  23134. const [canIndent, indentListItem] = useIndentListItem(clientId);
  23135. return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
  23136. function onKeyDown(event) {
  23137. const {
  23138. keyCode,
  23139. shiftKey,
  23140. altKey,
  23141. metaKey,
  23142. ctrlKey
  23143. } = event;
  23144. if (event.defaultPrevented || !canIndent || keyCode !== external_wp_keycodes_namespaceObject.SPACE || // Only override when no modifiers are pressed.
  23145. shiftKey || altKey || metaKey || ctrlKey) {
  23146. return;
  23147. }
  23148. const selectionStart = getSelectionStart();
  23149. const selectionEnd = getSelectionEnd();
  23150. if (selectionStart.offset === 0 && selectionEnd.offset === 0) {
  23151. event.preventDefault();
  23152. indentListItem();
  23153. }
  23154. }
  23155. element.addEventListener('keydown', onKeyDown);
  23156. return () => {
  23157. element.removeEventListener('keydown', onKeyDown);
  23158. };
  23159. }, [canIndent, indentListItem]);
  23160. }
  23161. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-split.js
  23162. /**
  23163. * WordPress dependencies
  23164. */
  23165. function useSplit(clientId) {
  23166. // We can not rely on the isAfterOriginal parameter of the callback,
  23167. // because if the value after the split is empty isAfterOriginal is false
  23168. // while the value is in fact after the original. So to avoid that issue we use
  23169. // a flag where the first execution of the callback is false (it is the before value)
  23170. // and the second execution is true, it is the after value.
  23171. const isAfter = (0,external_wp_element_namespaceObject.useRef)(false);
  23172. const {
  23173. getBlock
  23174. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  23175. return (0,external_wp_element_namespaceObject.useCallback)(value => {
  23176. const block = getBlock(clientId);
  23177. if (isAfter.current) {
  23178. return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, {
  23179. content: value
  23180. });
  23181. }
  23182. isAfter.current = true;
  23183. return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, { ...block.attributes,
  23184. content: value
  23185. });
  23186. }, [clientId, getBlock]);
  23187. }
  23188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-merge.js
  23189. /**
  23190. * WordPress dependencies
  23191. */
  23192. /**
  23193. * Internal dependencies
  23194. */
  23195. const {
  23196. name: use_merge_listItemName
  23197. } = {
  23198. $schema: "https://schemas.wp.org/trunk/block.json",
  23199. apiVersion: 2,
  23200. name: "core/list-item",
  23201. title: "List item",
  23202. category: "text",
  23203. parent: ["core/list"],
  23204. description: "Create a list item.",
  23205. textdomain: "default",
  23206. attributes: {
  23207. placeholder: {
  23208. type: "string"
  23209. },
  23210. content: {
  23211. type: "string",
  23212. source: "html",
  23213. selector: "li",
  23214. "default": "",
  23215. __experimentalRole: "content"
  23216. }
  23217. },
  23218. supports: {
  23219. className: false,
  23220. __experimentalSelector: "li"
  23221. }
  23222. };
  23223. function useMerge(clientId, onMerge) {
  23224. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  23225. const {
  23226. getPreviousBlockClientId,
  23227. getNextBlockClientId,
  23228. getBlockOrder,
  23229. getBlockRootClientId,
  23230. getBlockName
  23231. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  23232. const {
  23233. mergeBlocks,
  23234. moveBlocksToPosition
  23235. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  23236. const [, outdentListItem] = useOutdentListItem(clientId);
  23237. function getTrailingId(id) {
  23238. const order = getBlockOrder(id);
  23239. if (!order.length) {
  23240. return id;
  23241. }
  23242. return getTrailingId(order[order.length - 1]);
  23243. }
  23244. function getParentListItemId(id) {
  23245. const listId = getBlockRootClientId(id);
  23246. const parentListItemId = getBlockRootClientId(listId);
  23247. if (!parentListItemId) return;
  23248. if (getBlockName(parentListItemId) !== use_merge_listItemName) return;
  23249. return parentListItemId;
  23250. }
  23251. /**
  23252. * Return the next list item with respect to the given list item. If none,
  23253. * return the next list item of the parent list item if it exists.
  23254. *
  23255. * @param {string} id A list item client ID.
  23256. * @return {string?} The client ID of the next list item.
  23257. */
  23258. function _getNextId(id) {
  23259. const next = getNextBlockClientId(id);
  23260. if (next) return next;
  23261. const parentListItemId = getParentListItemId(id);
  23262. if (!parentListItemId) return;
  23263. return _getNextId(parentListItemId);
  23264. }
  23265. /**
  23266. * Given a client ID, return the client ID of the list item on the next
  23267. * line, regardless of indentation level.
  23268. *
  23269. * @param {string} id The client ID of the current list item.
  23270. * @return {string?} The client ID of the next list item.
  23271. */
  23272. function getNextId(id) {
  23273. const order = getBlockOrder(id); // If the list item does not have a nested list, return the next list
  23274. // item.
  23275. if (!order.length) {
  23276. return _getNextId(id);
  23277. } // Get the first list item in the nested list.
  23278. return getBlockOrder(order[0])[0];
  23279. }
  23280. return forward => {
  23281. if (forward) {
  23282. const nextBlockClientId = getNextId(clientId);
  23283. if (!nextBlockClientId) {
  23284. onMerge(forward);
  23285. return;
  23286. }
  23287. if (getParentListItemId(nextBlockClientId)) {
  23288. outdentListItem(nextBlockClientId);
  23289. } else {
  23290. registry.batch(() => {
  23291. moveBlocksToPosition(getBlockOrder(nextBlockClientId), nextBlockClientId, getPreviousBlockClientId(nextBlockClientId));
  23292. mergeBlocks(clientId, nextBlockClientId);
  23293. });
  23294. }
  23295. } else {
  23296. // Merging is only done from the top level. For lowel levels, the
  23297. // list item is outdented instead.
  23298. const previousBlockClientId = getPreviousBlockClientId(clientId);
  23299. if (getParentListItemId(clientId)) {
  23300. outdentListItem(clientId);
  23301. } else if (previousBlockClientId) {
  23302. const trailingId = getTrailingId(previousBlockClientId);
  23303. registry.batch(() => {
  23304. moveBlocksToPosition(getBlockOrder(clientId), clientId, previousBlockClientId);
  23305. mergeBlocks(trailingId, clientId);
  23306. });
  23307. } else {
  23308. onMerge(forward);
  23309. }
  23310. }
  23311. };
  23312. }
  23313. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/utils.js
  23314. /**
  23315. * WordPress dependencies
  23316. */
  23317. /**
  23318. * Internal dependencies
  23319. */
  23320. const {
  23321. name: utils_listItemName
  23322. } = {
  23323. $schema: "https://schemas.wp.org/trunk/block.json",
  23324. apiVersion: 2,
  23325. name: "core/list-item",
  23326. title: "List item",
  23327. category: "text",
  23328. parent: ["core/list"],
  23329. description: "Create a list item.",
  23330. textdomain: "default",
  23331. attributes: {
  23332. placeholder: {
  23333. type: "string"
  23334. },
  23335. content: {
  23336. type: "string",
  23337. source: "html",
  23338. selector: "li",
  23339. "default": "",
  23340. __experimentalRole: "content"
  23341. }
  23342. },
  23343. supports: {
  23344. className: false,
  23345. __experimentalSelector: "li"
  23346. }
  23347. };
  23348. const {
  23349. name: listName
  23350. } = {
  23351. $schema: "https://schemas.wp.org/trunk/block.json",
  23352. apiVersion: 2,
  23353. name: "core/list",
  23354. title: "List",
  23355. category: "text",
  23356. description: "Create a bulleted or numbered list.",
  23357. keywords: ["bullet list", "ordered list", "numbered list"],
  23358. textdomain: "default",
  23359. attributes: {
  23360. ordered: {
  23361. type: "boolean",
  23362. "default": false,
  23363. __experimentalRole: "content"
  23364. },
  23365. values: {
  23366. type: "string",
  23367. source: "html",
  23368. selector: "ol,ul",
  23369. multiline: "li",
  23370. __unstableMultilineWrapperTags: ["ol", "ul"],
  23371. "default": "",
  23372. __experimentalRole: "content"
  23373. },
  23374. type: {
  23375. type: "string"
  23376. },
  23377. start: {
  23378. type: "number"
  23379. },
  23380. reversed: {
  23381. type: "boolean"
  23382. },
  23383. placeholder: {
  23384. type: "string"
  23385. }
  23386. },
  23387. supports: {
  23388. anchor: true,
  23389. className: false,
  23390. typography: {
  23391. fontSize: true,
  23392. lineHeight: true,
  23393. __experimentalFontFamily: true,
  23394. __experimentalFontWeight: true,
  23395. __experimentalFontStyle: true,
  23396. __experimentalTextTransform: true,
  23397. __experimentalTextDecoration: true,
  23398. __experimentalLetterSpacing: true,
  23399. __experimentalDefaultControls: {
  23400. fontSize: true
  23401. }
  23402. },
  23403. color: {
  23404. gradients: true,
  23405. link: true,
  23406. __experimentalDefaultControls: {
  23407. background: true,
  23408. text: true
  23409. }
  23410. },
  23411. spacing: {
  23412. margin: true,
  23413. padding: true
  23414. },
  23415. __unstablePasteTextInline: true,
  23416. __experimentalSelector: "ol,ul",
  23417. __experimentalSlashInserter: true
  23418. },
  23419. editorStyle: "wp-block-list-editor",
  23420. style: "wp-block-list"
  23421. };
  23422. function createListItem(listItemAttributes, listAttributes, children) {
  23423. return createBlock(utils_listItemName, listItemAttributes, !(children !== null && children !== void 0 && children.length) ? [] : [createBlock(listName, listAttributes, children)]);
  23424. }
  23425. function convertToListItems(blocks) {
  23426. const listItems = [];
  23427. for (let block of blocks) {
  23428. if (block.name === utils_listItemName) {
  23429. listItems.push(block);
  23430. } else if (block.name === listName) {
  23431. listItems.push(...block.innerBlocks);
  23432. } else if (block = (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, listName)) {
  23433. for (const {
  23434. innerBlocks
  23435. } of block) {
  23436. listItems.push(...innerBlocks);
  23437. }
  23438. }
  23439. }
  23440. return listItems;
  23441. }
  23442. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/edit.js
  23443. /**
  23444. * WordPress dependencies
  23445. */
  23446. /**
  23447. * Internal dependencies
  23448. */
  23449. function edit_IndentUI(_ref) {
  23450. let {
  23451. clientId
  23452. } = _ref;
  23453. const [canIndent, indentListItem] = useIndentListItem(clientId);
  23454. const [canOutdent, outdentListItem] = useOutdentListItem(clientId);
  23455. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  23456. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
  23457. title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
  23458. describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
  23459. disabled: !canOutdent,
  23460. onClick: () => outdentListItem()
  23461. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  23462. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
  23463. title: (0,external_wp_i18n_namespaceObject.__)('Indent'),
  23464. describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'),
  23465. isDisabled: !canIndent,
  23466. onClick: () => indentListItem()
  23467. }));
  23468. }
  23469. function ListItemEdit(_ref2) {
  23470. let {
  23471. attributes,
  23472. setAttributes,
  23473. onReplace,
  23474. clientId,
  23475. mergeBlocks
  23476. } = _ref2;
  23477. const {
  23478. placeholder,
  23479. content
  23480. } = attributes;
  23481. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  23482. ref: useCopy(clientId)
  23483. });
  23484. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  23485. allowedBlocks: ['core/list'],
  23486. __unstableDisableDropZone: true
  23487. });
  23488. const useEnterRef = useEnter({
  23489. content,
  23490. clientId
  23491. });
  23492. const useSpaceRef = useSpace(clientId);
  23493. const onSplit = useSplit(clientId);
  23494. const onMerge = useMerge(clientId, mergeBlocks);
  23495. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  23496. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]),
  23497. identifier: "content",
  23498. tagName: "div",
  23499. onChange: nextContent => setAttributes({
  23500. content: nextContent
  23501. }),
  23502. value: content,
  23503. "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'),
  23504. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'),
  23505. onSplit: onSplit,
  23506. onMerge: onMerge,
  23507. onReplace: function (blocks) {
  23508. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  23509. args[_key - 1] = arguments[_key];
  23510. }
  23511. onReplace(convertToListItems(blocks), ...args);
  23512. }
  23513. }), innerBlocksProps.children), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  23514. group: "block"
  23515. }, (0,external_wp_element_namespaceObject.createElement)(edit_IndentUI, {
  23516. clientId: clientId
  23517. })));
  23518. }
  23519. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/save.js
  23520. /**
  23521. * WordPress dependencies
  23522. */
  23523. function list_item_save_save(_ref) {
  23524. let {
  23525. attributes
  23526. } = _ref;
  23527. return (0,external_wp_element_namespaceObject.createElement)("li", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  23528. value: attributes.content
  23529. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  23530. }
  23531. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list-item/index.js
  23532. /**
  23533. * WordPress dependencies
  23534. */
  23535. /**
  23536. * Internal dependencies
  23537. */
  23538. const list_item_metadata = {
  23539. $schema: "https://schemas.wp.org/trunk/block.json",
  23540. apiVersion: 2,
  23541. name: "core/list-item",
  23542. title: "List item",
  23543. category: "text",
  23544. parent: ["core/list"],
  23545. description: "Create a list item.",
  23546. textdomain: "default",
  23547. attributes: {
  23548. placeholder: {
  23549. type: "string"
  23550. },
  23551. content: {
  23552. type: "string",
  23553. source: "html",
  23554. selector: "li",
  23555. "default": "",
  23556. __experimentalRole: "content"
  23557. }
  23558. },
  23559. supports: {
  23560. className: false,
  23561. __experimentalSelector: "li"
  23562. }
  23563. };
  23564. const {
  23565. name: list_item_name
  23566. } = list_item_metadata;
  23567. const list_item_settings = {
  23568. icon: list_item,
  23569. edit: ListItemEdit,
  23570. save: list_item_save_save,
  23571. merge(attributes, attributesToMerge) {
  23572. return { ...attributes,
  23573. content: attributes.content + attributesToMerge.content
  23574. };
  23575. }
  23576. };
  23577. const list_item_init = () => initBlock({
  23578. name: list_item_name,
  23579. metadata: list_item_metadata,
  23580. settings: list_item_settings
  23581. });
  23582. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
  23583. /**
  23584. * WordPress dependencies
  23585. */
  23586. const login = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23587. xmlns: "http://www.w3.org/2000/svg",
  23588. viewBox: "0 0 24 24"
  23589. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23590. d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"
  23591. }));
  23592. /* harmony default export */ var library_login = (login);
  23593. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
  23594. /**
  23595. * WordPress dependencies
  23596. */
  23597. function LoginOutEdit(_ref) {
  23598. let {
  23599. attributes,
  23600. setAttributes
  23601. } = _ref;
  23602. const {
  23603. displayLoginAsForm,
  23604. redirectToCurrent
  23605. } = attributes;
  23606. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  23607. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  23608. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23609. label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'),
  23610. checked: displayLoginAsForm,
  23611. onChange: () => setAttributes({
  23612. displayLoginAsForm: !displayLoginAsForm
  23613. })
  23614. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23615. label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'),
  23616. checked: redirectToCurrent,
  23617. onChange: () => setAttributes({
  23618. redirectToCurrent: !redirectToCurrent
  23619. })
  23620. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  23621. className: 'logged-in'
  23622. }), (0,external_wp_element_namespaceObject.createElement)("a", {
  23623. href: "#login-pseudo-link"
  23624. }, (0,external_wp_i18n_namespaceObject.__)('Log out'))));
  23625. }
  23626. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  23627. /**
  23628. * WordPress dependencies
  23629. */
  23630. /**
  23631. * Internal dependencies
  23632. */
  23633. const loginout_metadata = {
  23634. $schema: "https://schemas.wp.org/trunk/block.json",
  23635. apiVersion: 2,
  23636. name: "core/loginout",
  23637. title: "Login/out",
  23638. category: "theme",
  23639. description: "Show login & logout links.",
  23640. keywords: ["login", "logout", "form"],
  23641. textdomain: "default",
  23642. attributes: {
  23643. displayLoginAsForm: {
  23644. type: "boolean",
  23645. "default": false
  23646. },
  23647. redirectToCurrent: {
  23648. type: "boolean",
  23649. "default": true
  23650. }
  23651. },
  23652. supports: {
  23653. className: true,
  23654. typography: {
  23655. fontSize: false
  23656. }
  23657. }
  23658. };
  23659. const {
  23660. name: loginout_name
  23661. } = loginout_metadata;
  23662. const loginout_settings = {
  23663. icon: library_login,
  23664. edit: LoginOutEdit
  23665. };
  23666. const loginout_init = () => initBlock({
  23667. name: loginout_name,
  23668. metadata: loginout_metadata,
  23669. settings: loginout_settings
  23670. });
  23671. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
  23672. /**
  23673. * WordPress dependencies
  23674. */
  23675. const mediaAndText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23676. xmlns: "http://www.w3.org/2000/svg",
  23677. viewBox: "0 0 24 24"
  23678. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23679. d: "M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"
  23680. }));
  23681. /* harmony default export */ var media_and_text = (mediaAndText);
  23682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
  23683. const DEFAULT_MEDIA_SIZE_SLUG = 'full';
  23684. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
  23685. /**
  23686. * External dependencies
  23687. */
  23688. /**
  23689. * WordPress dependencies
  23690. */
  23691. /**
  23692. * Internal dependencies
  23693. */
  23694. const v1ToV5ImageFillStyles = (url, focalPoint) => {
  23695. return url ? {
  23696. backgroundImage: `url(${url})`,
  23697. backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
  23698. } : {};
  23699. };
  23700. const DEFAULT_MEDIA_WIDTH = 50;
  23701. const noop = () => {};
  23702. const media_text_deprecated_migrateCustomColors = attributes => {
  23703. if (!attributes.customBackgroundColor) {
  23704. return attributes;
  23705. }
  23706. const style = {
  23707. color: {
  23708. background: attributes.customBackgroundColor
  23709. }
  23710. };
  23711. const {
  23712. customBackgroundColor,
  23713. ...restAttributes
  23714. } = attributes;
  23715. return { ...restAttributes,
  23716. style
  23717. };
  23718. };
  23719. const baseAttributes = {
  23720. align: {
  23721. type: 'string',
  23722. default: 'wide'
  23723. },
  23724. mediaAlt: {
  23725. type: 'string',
  23726. source: 'attribute',
  23727. selector: 'figure img',
  23728. attribute: 'alt',
  23729. default: ''
  23730. },
  23731. mediaPosition: {
  23732. type: 'string',
  23733. default: 'left'
  23734. },
  23735. mediaId: {
  23736. type: 'number'
  23737. },
  23738. mediaType: {
  23739. type: 'string'
  23740. },
  23741. mediaWidth: {
  23742. type: 'number',
  23743. default: 50
  23744. },
  23745. isStackedOnMobile: {
  23746. type: 'boolean',
  23747. default: true
  23748. }
  23749. };
  23750. const v4ToV5BlockAttributes = { ...baseAttributes,
  23751. mediaUrl: {
  23752. type: 'string',
  23753. source: 'attribute',
  23754. selector: 'figure video,figure img',
  23755. attribute: 'src'
  23756. },
  23757. mediaLink: {
  23758. type: 'string'
  23759. },
  23760. linkDestination: {
  23761. type: 'string'
  23762. },
  23763. linkTarget: {
  23764. type: 'string',
  23765. source: 'attribute',
  23766. selector: 'figure a',
  23767. attribute: 'target'
  23768. },
  23769. href: {
  23770. type: 'string',
  23771. source: 'attribute',
  23772. selector: 'figure a',
  23773. attribute: 'href'
  23774. },
  23775. rel: {
  23776. type: 'string',
  23777. source: 'attribute',
  23778. selector: 'figure a',
  23779. attribute: 'rel'
  23780. },
  23781. linkClass: {
  23782. type: 'string',
  23783. source: 'attribute',
  23784. selector: 'figure a',
  23785. attribute: 'class'
  23786. },
  23787. mediaSizeSlug: {
  23788. type: 'string'
  23789. },
  23790. verticalAlignment: {
  23791. type: 'string'
  23792. },
  23793. imageFill: {
  23794. type: 'boolean'
  23795. },
  23796. focalPoint: {
  23797. type: 'object'
  23798. }
  23799. };
  23800. const v4ToV5Supports = {
  23801. anchor: true,
  23802. align: ['wide', 'full'],
  23803. html: false,
  23804. color: {
  23805. gradients: true,
  23806. link: true
  23807. }
  23808. };
  23809. const media_text_deprecated_v5 = {
  23810. attributes: v4ToV5BlockAttributes,
  23811. supports: v4ToV5Supports,
  23812. save(_ref) {
  23813. let {
  23814. attributes
  23815. } = _ref;
  23816. const {
  23817. isStackedOnMobile,
  23818. mediaAlt,
  23819. mediaPosition,
  23820. mediaType,
  23821. mediaUrl,
  23822. mediaWidth,
  23823. mediaId,
  23824. verticalAlignment,
  23825. imageFill,
  23826. focalPoint,
  23827. linkClass,
  23828. href,
  23829. linkTarget,
  23830. rel
  23831. } = attributes;
  23832. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  23833. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  23834. const imageClasses = classnames_default()({
  23835. [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
  23836. [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  23837. });
  23838. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  23839. src: mediaUrl,
  23840. alt: mediaAlt,
  23841. className: imageClasses || null
  23842. });
  23843. if (href) {
  23844. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  23845. className: linkClass,
  23846. href: href,
  23847. target: linkTarget,
  23848. rel: newRel
  23849. }, image);
  23850. }
  23851. const mediaTypeRenders = {
  23852. image: () => image,
  23853. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  23854. controls: true,
  23855. src: mediaUrl
  23856. })
  23857. };
  23858. const className = classnames_default()({
  23859. 'has-media-on-the-right': 'right' === mediaPosition,
  23860. 'is-stacked-on-mobile': isStackedOnMobile,
  23861. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  23862. 'is-image-fill': imageFill
  23863. });
  23864. const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {};
  23865. let gridTemplateColumns;
  23866. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  23867. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  23868. }
  23869. const style = {
  23870. gridTemplateColumns
  23871. };
  23872. if ('right' === mediaPosition) {
  23873. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  23874. className,
  23875. style
  23876. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  23877. className: 'wp-block-media-text__content'
  23878. })), (0,external_wp_element_namespaceObject.createElement)("figure", {
  23879. className: "wp-block-media-text__media",
  23880. style: backgroundStyles
  23881. }, (mediaTypeRenders[mediaType] || noop)()));
  23882. }
  23883. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  23884. className,
  23885. style
  23886. }), (0,external_wp_element_namespaceObject.createElement)("figure", {
  23887. className: "wp-block-media-text__media",
  23888. style: backgroundStyles
  23889. }, (mediaTypeRenders[mediaType] || noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  23890. className: 'wp-block-media-text__content'
  23891. })));
  23892. }
  23893. }; // Version with CSS grid
  23894. const media_text_deprecated_v4 = {
  23895. attributes: v4ToV5BlockAttributes,
  23896. supports: v4ToV5Supports,
  23897. save(_ref2) {
  23898. let {
  23899. attributes
  23900. } = _ref2;
  23901. const {
  23902. isStackedOnMobile,
  23903. mediaAlt,
  23904. mediaPosition,
  23905. mediaType,
  23906. mediaUrl,
  23907. mediaWidth,
  23908. mediaId,
  23909. verticalAlignment,
  23910. imageFill,
  23911. focalPoint,
  23912. linkClass,
  23913. href,
  23914. linkTarget,
  23915. rel
  23916. } = attributes;
  23917. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  23918. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  23919. const imageClasses = classnames_default()({
  23920. [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
  23921. [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  23922. });
  23923. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  23924. src: mediaUrl,
  23925. alt: mediaAlt,
  23926. className: imageClasses || null
  23927. });
  23928. if (href) {
  23929. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  23930. className: linkClass,
  23931. href: href,
  23932. target: linkTarget,
  23933. rel: newRel
  23934. }, image);
  23935. }
  23936. const mediaTypeRenders = {
  23937. image: () => image,
  23938. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  23939. controls: true,
  23940. src: mediaUrl
  23941. })
  23942. };
  23943. const className = classnames_default()({
  23944. 'has-media-on-the-right': 'right' === mediaPosition,
  23945. 'is-stacked-on-mobile': isStackedOnMobile,
  23946. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  23947. 'is-image-fill': imageFill
  23948. });
  23949. const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {};
  23950. let gridTemplateColumns;
  23951. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  23952. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  23953. }
  23954. const style = {
  23955. gridTemplateColumns
  23956. };
  23957. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  23958. className,
  23959. style
  23960. }), (0,external_wp_element_namespaceObject.createElement)("figure", {
  23961. className: "wp-block-media-text__media",
  23962. style: backgroundStyles
  23963. }, (mediaTypeRenders[mediaType] || noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  23964. className: 'wp-block-media-text__content'
  23965. })));
  23966. }
  23967. };
  23968. const media_text_deprecated_v3 = {
  23969. attributes: { ...baseAttributes,
  23970. backgroundColor: {
  23971. type: 'string'
  23972. },
  23973. customBackgroundColor: {
  23974. type: 'string'
  23975. },
  23976. mediaLink: {
  23977. type: 'string'
  23978. },
  23979. linkDestination: {
  23980. type: 'string'
  23981. },
  23982. linkTarget: {
  23983. type: 'string',
  23984. source: 'attribute',
  23985. selector: 'figure a',
  23986. attribute: 'target'
  23987. },
  23988. href: {
  23989. type: 'string',
  23990. source: 'attribute',
  23991. selector: 'figure a',
  23992. attribute: 'href'
  23993. },
  23994. rel: {
  23995. type: 'string',
  23996. source: 'attribute',
  23997. selector: 'figure a',
  23998. attribute: 'rel'
  23999. },
  24000. linkClass: {
  24001. type: 'string',
  24002. source: 'attribute',
  24003. selector: 'figure a',
  24004. attribute: 'class'
  24005. },
  24006. verticalAlignment: {
  24007. type: 'string'
  24008. },
  24009. imageFill: {
  24010. type: 'boolean'
  24011. },
  24012. focalPoint: {
  24013. type: 'object'
  24014. }
  24015. },
  24016. migrate: media_text_deprecated_migrateCustomColors,
  24017. save(_ref3) {
  24018. let {
  24019. attributes
  24020. } = _ref3;
  24021. const {
  24022. backgroundColor,
  24023. customBackgroundColor,
  24024. isStackedOnMobile,
  24025. mediaAlt,
  24026. mediaPosition,
  24027. mediaType,
  24028. mediaUrl,
  24029. mediaWidth,
  24030. mediaId,
  24031. verticalAlignment,
  24032. imageFill,
  24033. focalPoint,
  24034. linkClass,
  24035. href,
  24036. linkTarget,
  24037. rel
  24038. } = attributes;
  24039. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  24040. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  24041. src: mediaUrl,
  24042. alt: mediaAlt,
  24043. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  24044. });
  24045. if (href) {
  24046. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  24047. className: linkClass,
  24048. href: href,
  24049. target: linkTarget,
  24050. rel: newRel
  24051. }, image);
  24052. }
  24053. const mediaTypeRenders = {
  24054. image: () => image,
  24055. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  24056. controls: true,
  24057. src: mediaUrl
  24058. })
  24059. };
  24060. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  24061. const className = classnames_default()({
  24062. 'has-media-on-the-right': 'right' === mediaPosition,
  24063. 'has-background': backgroundClass || customBackgroundColor,
  24064. [backgroundClass]: backgroundClass,
  24065. 'is-stacked-on-mobile': isStackedOnMobile,
  24066. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  24067. 'is-image-fill': imageFill
  24068. });
  24069. const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {};
  24070. let gridTemplateColumns;
  24071. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  24072. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  24073. }
  24074. const style = {
  24075. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  24076. gridTemplateColumns
  24077. };
  24078. return (0,external_wp_element_namespaceObject.createElement)("div", {
  24079. className: className,
  24080. style: style
  24081. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  24082. className: "wp-block-media-text__media",
  24083. style: backgroundStyles
  24084. }, (mediaTypeRenders[mediaType] || noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  24085. className: "wp-block-media-text__content"
  24086. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  24087. }
  24088. };
  24089. const media_text_deprecated_v2 = {
  24090. attributes: { ...baseAttributes,
  24091. backgroundColor: {
  24092. type: 'string'
  24093. },
  24094. customBackgroundColor: {
  24095. type: 'string'
  24096. },
  24097. mediaUrl: {
  24098. type: 'string',
  24099. source: 'attribute',
  24100. selector: 'figure video,figure img',
  24101. attribute: 'src'
  24102. },
  24103. verticalAlignment: {
  24104. type: 'string'
  24105. },
  24106. imageFill: {
  24107. type: 'boolean'
  24108. },
  24109. focalPoint: {
  24110. type: 'object'
  24111. }
  24112. },
  24113. migrate: media_text_deprecated_migrateCustomColors,
  24114. save(_ref4) {
  24115. let {
  24116. attributes
  24117. } = _ref4;
  24118. const {
  24119. backgroundColor,
  24120. customBackgroundColor,
  24121. isStackedOnMobile,
  24122. mediaAlt,
  24123. mediaPosition,
  24124. mediaType,
  24125. mediaUrl,
  24126. mediaWidth,
  24127. mediaId,
  24128. verticalAlignment,
  24129. imageFill,
  24130. focalPoint
  24131. } = attributes;
  24132. const mediaTypeRenders = {
  24133. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  24134. src: mediaUrl,
  24135. alt: mediaAlt,
  24136. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  24137. }),
  24138. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  24139. controls: true,
  24140. src: mediaUrl
  24141. })
  24142. };
  24143. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  24144. const className = classnames_default()({
  24145. 'has-media-on-the-right': 'right' === mediaPosition,
  24146. [backgroundClass]: backgroundClass,
  24147. 'is-stacked-on-mobile': isStackedOnMobile,
  24148. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  24149. 'is-image-fill': imageFill
  24150. });
  24151. const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {};
  24152. let gridTemplateColumns;
  24153. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  24154. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  24155. }
  24156. const style = {
  24157. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  24158. gridTemplateColumns
  24159. };
  24160. return (0,external_wp_element_namespaceObject.createElement)("div", {
  24161. className: className,
  24162. style: style
  24163. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  24164. className: "wp-block-media-text__media",
  24165. style: backgroundStyles
  24166. }, (mediaTypeRenders[mediaType] || noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  24167. className: "wp-block-media-text__content"
  24168. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  24169. }
  24170. };
  24171. const media_text_deprecated_v1 = {
  24172. attributes: { ...baseAttributes,
  24173. backgroundColor: {
  24174. type: 'string'
  24175. },
  24176. customBackgroundColor: {
  24177. type: 'string'
  24178. },
  24179. mediaUrl: {
  24180. type: 'string',
  24181. source: 'attribute',
  24182. selector: 'figure video,figure img',
  24183. attribute: 'src'
  24184. }
  24185. },
  24186. save(_ref5) {
  24187. let {
  24188. attributes
  24189. } = _ref5;
  24190. const {
  24191. backgroundColor,
  24192. customBackgroundColor,
  24193. isStackedOnMobile,
  24194. mediaAlt,
  24195. mediaPosition,
  24196. mediaType,
  24197. mediaUrl,
  24198. mediaWidth
  24199. } = attributes;
  24200. const mediaTypeRenders = {
  24201. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  24202. src: mediaUrl,
  24203. alt: mediaAlt
  24204. }),
  24205. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  24206. controls: true,
  24207. src: mediaUrl
  24208. })
  24209. };
  24210. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  24211. const className = classnames_default()({
  24212. 'has-media-on-the-right': 'right' === mediaPosition,
  24213. [backgroundClass]: backgroundClass,
  24214. 'is-stacked-on-mobile': isStackedOnMobile
  24215. });
  24216. let gridTemplateColumns;
  24217. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  24218. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  24219. }
  24220. const style = {
  24221. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  24222. gridTemplateColumns
  24223. };
  24224. return (0,external_wp_element_namespaceObject.createElement)("div", {
  24225. className: className,
  24226. style: style
  24227. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  24228. className: "wp-block-media-text__media"
  24229. }, (mediaTypeRenders[mediaType] || noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  24230. className: "wp-block-media-text__content"
  24231. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  24232. }
  24233. };
  24234. /* harmony default export */ var media_text_deprecated = ([media_text_deprecated_v5, media_text_deprecated_v4, media_text_deprecated_v3, media_text_deprecated_v2, media_text_deprecated_v1]);
  24235. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js
  24236. /**
  24237. * WordPress dependencies
  24238. */
  24239. const pullLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24240. xmlns: "http://www.w3.org/2000/svg",
  24241. viewBox: "0 0 24 24"
  24242. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24243. d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
  24244. }));
  24245. /* harmony default export */ var pull_left = (pullLeft);
  24246. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
  24247. /**
  24248. * WordPress dependencies
  24249. */
  24250. const pullRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24251. xmlns: "http://www.w3.org/2000/svg",
  24252. viewBox: "0 0 24 24"
  24253. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24254. d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
  24255. }));
  24256. /* harmony default export */ var pull_right = (pullRight);
  24257. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
  24258. /**
  24259. * WordPress dependencies
  24260. */
  24261. /* harmony default export */ var media_container_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  24262. xmlns: "http://www.w3.org/2000/svg",
  24263. viewBox: "0 0 24 24"
  24264. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  24265. d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
  24266. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  24267. d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
  24268. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  24269. d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
  24270. })));
  24271. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
  24272. /**
  24273. * External dependencies
  24274. */
  24275. /**
  24276. * WordPress dependencies
  24277. */
  24278. /**
  24279. * Internal dependencies
  24280. */
  24281. /**
  24282. * Constants
  24283. */
  24284. const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  24285. const media_container_noop = () => {};
  24286. function imageFillStyles(url, focalPoint) {
  24287. return url ? {
  24288. backgroundImage: `url(${url})`,
  24289. backgroundPosition: focalPoint ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : `50% 50%`
  24290. } : {};
  24291. }
  24292. const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
  24293. let {
  24294. isSelected,
  24295. isStackedOnMobile,
  24296. ...props
  24297. } = _ref;
  24298. const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
  24299. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  24300. ref: ref,
  24301. showHandle: isSelected && (!isMobile || !isStackedOnMobile)
  24302. }, props));
  24303. });
  24304. function ToolbarEditButton(_ref2) {
  24305. let {
  24306. mediaId,
  24307. mediaUrl,
  24308. onSelectMedia
  24309. } = _ref2;
  24310. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  24311. group: "other"
  24312. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  24313. mediaId: mediaId,
  24314. mediaURL: mediaUrl,
  24315. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  24316. accept: "image/*,video/*",
  24317. onSelect: onSelectMedia
  24318. }));
  24319. }
  24320. function PlaceholderContainer(_ref3) {
  24321. let {
  24322. className,
  24323. mediaUrl,
  24324. onSelectMedia
  24325. } = _ref3;
  24326. const {
  24327. createErrorNotice
  24328. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  24329. const onUploadError = message => {
  24330. createErrorNotice(message, {
  24331. type: 'snackbar'
  24332. });
  24333. };
  24334. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  24335. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  24336. icon: media_container_icon
  24337. }),
  24338. labels: {
  24339. title: (0,external_wp_i18n_namespaceObject.__)('Media area')
  24340. },
  24341. className: className,
  24342. onSelect: onSelectMedia,
  24343. accept: "image/*,video/*",
  24344. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  24345. onError: onUploadError,
  24346. disableMediaButtons: mediaUrl
  24347. });
  24348. }
  24349. function MediaContainer(props, ref) {
  24350. const {
  24351. className,
  24352. commitWidthChange,
  24353. focalPoint,
  24354. imageFill,
  24355. isSelected,
  24356. isStackedOnMobile,
  24357. mediaAlt,
  24358. mediaId,
  24359. mediaPosition,
  24360. mediaType,
  24361. mediaUrl,
  24362. mediaWidth,
  24363. onSelectMedia,
  24364. onWidthChange,
  24365. isContentLocked
  24366. } = props;
  24367. const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl);
  24368. const {
  24369. toggleSelection
  24370. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  24371. if (mediaUrl) {
  24372. const onResizeStart = () => {
  24373. toggleSelection(false);
  24374. };
  24375. const onResize = (event, direction, elt) => {
  24376. onWidthChange(parseInt(elt.style.width));
  24377. };
  24378. const onResizeStop = (event, direction, elt) => {
  24379. toggleSelection(true);
  24380. commitWidthChange(parseInt(elt.style.width));
  24381. };
  24382. const enablePositions = {
  24383. right: !isContentLocked && mediaPosition === 'left',
  24384. left: !isContentLocked && mediaPosition === 'right'
  24385. };
  24386. const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  24387. const mediaTypeRenderers = {
  24388. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  24389. src: mediaUrl,
  24390. alt: mediaAlt
  24391. }),
  24392. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  24393. controls: true,
  24394. src: mediaUrl
  24395. })
  24396. };
  24397. return (0,external_wp_element_namespaceObject.createElement)(ResizableBoxContainer, {
  24398. as: "figure",
  24399. className: classnames_default()(className, 'editor-media-container__resizer', {
  24400. 'is-transient': isTemporaryMedia
  24401. }),
  24402. style: backgroundStyles,
  24403. size: {
  24404. width: mediaWidth + '%'
  24405. },
  24406. minWidth: "10%",
  24407. maxWidth: "100%",
  24408. enable: enablePositions,
  24409. onResizeStart: onResizeStart,
  24410. onResize: onResize,
  24411. onResizeStop: onResizeStop,
  24412. axis: "x",
  24413. isSelected: isSelected,
  24414. isStackedOnMobile: isStackedOnMobile,
  24415. ref: ref
  24416. }, (0,external_wp_element_namespaceObject.createElement)(ToolbarEditButton, {
  24417. onSelectMedia: onSelectMedia,
  24418. mediaUrl: mediaUrl,
  24419. mediaId: mediaId
  24420. }), (mediaTypeRenderers[mediaType] || media_container_noop)(), isTemporaryMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props));
  24421. }
  24422. return (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props);
  24423. }
  24424. /* harmony default export */ var media_container = ((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer));
  24425. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
  24426. /**
  24427. * External dependencies
  24428. */
  24429. /**
  24430. * WordPress dependencies
  24431. */
  24432. /**
  24433. * Internal dependencies
  24434. */
  24435. /**
  24436. * Constants
  24437. */
  24438. const media_text_edit_TEMPLATE = [['core/paragraph', {
  24439. placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder')
  24440. }]]; // this limits the resize to a safe zone to avoid making broken layouts
  24441. const WIDTH_CONSTRAINT_PERCENTAGE = 15;
  24442. const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE));
  24443. const edit_LINK_DESTINATION_MEDIA = 'media';
  24444. const edit_LINK_DESTINATION_ATTACHMENT = 'attachment';
  24445. function getImageSourceUrlBySizeSlug(image, slug) {
  24446. var _image$media_details, _image$media_details$, _image$media_details$2;
  24447. // eslint-disable-next-line camelcase
  24448. return image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$ = _image$media_details.sizes) === null || _image$media_details$ === void 0 ? void 0 : (_image$media_details$2 = _image$media_details$[slug]) === null || _image$media_details$2 === void 0 ? void 0 : _image$media_details$2.source_url;
  24449. }
  24450. function edit_attributesFromMedia(_ref) {
  24451. let {
  24452. attributes: {
  24453. linkDestination,
  24454. href
  24455. },
  24456. setAttributes
  24457. } = _ref;
  24458. return media => {
  24459. if (!media || !media.url) {
  24460. setAttributes({
  24461. mediaAlt: undefined,
  24462. mediaId: undefined,
  24463. mediaType: undefined,
  24464. mediaUrl: undefined,
  24465. mediaLink: undefined,
  24466. href: undefined,
  24467. focalPoint: undefined
  24468. });
  24469. return;
  24470. }
  24471. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  24472. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  24473. }
  24474. let mediaType;
  24475. let src; // For media selections originated from a file upload.
  24476. if (media.media_type) {
  24477. if (media.media_type === 'image') {
  24478. mediaType = 'image';
  24479. } else {
  24480. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  24481. // video contain the media type of 'file' in the object returned from the rest api.
  24482. mediaType = 'video';
  24483. }
  24484. } else {
  24485. // For media selections originated from existing files in the media library.
  24486. mediaType = media.type;
  24487. }
  24488. if (mediaType === 'image') {
  24489. var _media$sizes, _media$sizes$large, _media$media_details, _media$media_details$, _media$media_details$2;
  24490. // Try the "large" size URL, falling back to the "full" size URL below.
  24491. src = ((_media$sizes = media.sizes) === null || _media$sizes === void 0 ? void 0 : (_media$sizes$large = _media$sizes.large) === null || _media$sizes$large === void 0 ? void 0 : _media$sizes$large.url) || ( // eslint-disable-next-line camelcase
  24492. (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.large) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url);
  24493. }
  24494. let newHref = href;
  24495. if (linkDestination === edit_LINK_DESTINATION_MEDIA) {
  24496. // Update the media link.
  24497. newHref = media.url;
  24498. } // Check if the image is linked to the attachment page.
  24499. if (linkDestination === edit_LINK_DESTINATION_ATTACHMENT) {
  24500. // Update the media link.
  24501. newHref = media.link;
  24502. }
  24503. setAttributes({
  24504. mediaAlt: media.alt,
  24505. mediaId: media.id,
  24506. mediaType,
  24507. mediaUrl: src || media.url,
  24508. mediaLink: media.link || undefined,
  24509. href: newHref,
  24510. focalPoint: undefined
  24511. });
  24512. };
  24513. }
  24514. function MediaTextEdit(_ref2) {
  24515. let {
  24516. attributes,
  24517. isSelected,
  24518. setAttributes,
  24519. clientId
  24520. } = _ref2;
  24521. const {
  24522. focalPoint,
  24523. href,
  24524. imageFill,
  24525. isStackedOnMobile,
  24526. linkClass,
  24527. linkDestination,
  24528. linkTarget,
  24529. mediaAlt,
  24530. mediaId,
  24531. mediaPosition,
  24532. mediaType,
  24533. mediaUrl,
  24534. mediaWidth,
  24535. rel,
  24536. verticalAlignment
  24537. } = attributes;
  24538. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  24539. const {
  24540. imageSizes,
  24541. image,
  24542. isContentLocked
  24543. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24544. var _getSettings;
  24545. const {
  24546. __unstableGetContentLockingParent,
  24547. getSettings
  24548. } = select(external_wp_blockEditor_namespaceObject.store);
  24549. return {
  24550. isContentLocked: !!__unstableGetContentLockingParent(clientId),
  24551. image: mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, {
  24552. context: 'view'
  24553. }) : null,
  24554. imageSizes: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.imageSizes
  24555. };
  24556. }, [isSelected, mediaId, clientId]);
  24557. const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)();
  24558. const imperativeFocalPointPreview = value => {
  24559. const {
  24560. style
  24561. } = refMediaContainer.current.resizable;
  24562. const {
  24563. x,
  24564. y
  24565. } = value;
  24566. style.backgroundPosition = `${x * 100}% ${y * 100}%`;
  24567. };
  24568. const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  24569. const onSelectMedia = edit_attributesFromMedia({
  24570. attributes,
  24571. setAttributes
  24572. });
  24573. const onSetHref = props => {
  24574. setAttributes(props);
  24575. };
  24576. const onWidthChange = width => {
  24577. setTemporaryMediaWidth(applyWidthConstraints(width));
  24578. };
  24579. const commitWidthChange = width => {
  24580. setAttributes({
  24581. mediaWidth: applyWidthConstraints(width)
  24582. });
  24583. setTemporaryMediaWidth(applyWidthConstraints(width));
  24584. };
  24585. const classNames = classnames_default()({
  24586. 'has-media-on-the-right': 'right' === mediaPosition,
  24587. 'is-selected': isSelected,
  24588. 'is-stacked-on-mobile': isStackedOnMobile,
  24589. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  24590. 'is-image-fill': imageFill
  24591. });
  24592. const widthString = `${temporaryMediaWidth || mediaWidth}%`;
  24593. const gridTemplateColumns = 'right' === mediaPosition ? `1fr ${widthString}` : `${widthString} 1fr`;
  24594. const style = {
  24595. gridTemplateColumns,
  24596. msGridColumns: gridTemplateColumns
  24597. };
  24598. const onMediaAltChange = newMediaAlt => {
  24599. setAttributes({
  24600. mediaAlt: newMediaAlt
  24601. });
  24602. };
  24603. const onVerticalAlignmentChange = alignment => {
  24604. setAttributes({
  24605. verticalAlignment: alignment
  24606. });
  24607. };
  24608. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref3 => {
  24609. let {
  24610. slug
  24611. } = _ref3;
  24612. return getImageSourceUrlBySizeSlug(image, slug);
  24613. }), _ref4 => {
  24614. let {
  24615. name,
  24616. slug
  24617. } = _ref4;
  24618. return {
  24619. value: slug,
  24620. label: name
  24621. };
  24622. });
  24623. const updateImage = newMediaSizeSlug => {
  24624. const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug);
  24625. if (!newUrl) {
  24626. return null;
  24627. }
  24628. setAttributes({
  24629. mediaUrl: newUrl,
  24630. mediaSizeSlug: newMediaSizeSlug
  24631. });
  24632. };
  24633. const mediaTextGeneralSettings = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  24634. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  24635. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  24636. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  24637. checked: isStackedOnMobile,
  24638. onChange: () => setAttributes({
  24639. isStackedOnMobile: !isStackedOnMobile
  24640. })
  24641. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  24642. label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
  24643. checked: imageFill,
  24644. onChange: () => setAttributes({
  24645. imageFill: !imageFill
  24646. })
  24647. }), imageFill && mediaUrl && mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  24648. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  24649. url: mediaUrl,
  24650. value: focalPoint,
  24651. onChange: value => setAttributes({
  24652. focalPoint: value
  24653. }),
  24654. onDragStart: imperativeFocalPointPreview,
  24655. onDrag: imperativeFocalPointPreview
  24656. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  24657. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  24658. value: mediaAlt,
  24659. onChange: onMediaAltChange,
  24660. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  24661. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  24662. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  24663. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  24664. onChangeImage: updateImage,
  24665. slug: mediaSizeSlug,
  24666. imageSizeOptions: imageSizeOptions,
  24667. isResizable: false,
  24668. imageSizeHelp: (0,external_wp_i18n_namespaceObject.__)('Select which image size to load.')
  24669. }), mediaUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  24670. label: (0,external_wp_i18n_namespaceObject.__)('Media width'),
  24671. value: temporaryMediaWidth || mediaWidth,
  24672. onChange: commitWidthChange,
  24673. min: WIDTH_CONSTRAINT_PERCENTAGE,
  24674. max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
  24675. }));
  24676. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  24677. className: classNames,
  24678. style
  24679. });
  24680. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  24681. className: 'wp-block-media-text__content'
  24682. }, {
  24683. template: media_text_edit_TEMPLATE
  24684. });
  24685. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  24686. group: "block"
  24687. }, !isContentLocked && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
  24688. onChange: onVerticalAlignmentChange,
  24689. value: verticalAlignment
  24690. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24691. icon: pull_left,
  24692. title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'),
  24693. isActive: mediaPosition === 'left',
  24694. onClick: () => setAttributes({
  24695. mediaPosition: 'left'
  24696. })
  24697. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24698. icon: pull_right,
  24699. title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'),
  24700. isActive: mediaPosition === 'right',
  24701. onClick: () => setAttributes({
  24702. mediaPosition: 'right'
  24703. })
  24704. })), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  24705. url: href || '',
  24706. onChangeUrl: onSetHref,
  24707. linkDestination: linkDestination,
  24708. mediaType: mediaType,
  24709. mediaUrl: image && image.source_url,
  24710. mediaLink: image && image.link,
  24711. linkTarget: linkTarget,
  24712. linkClass: linkClass,
  24713. rel: rel
  24714. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, mediaPosition === 'right' && (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps), (0,external_wp_element_namespaceObject.createElement)(media_container, {
  24715. className: "wp-block-media-text__media",
  24716. onSelectMedia: onSelectMedia,
  24717. onWidthChange: onWidthChange,
  24718. commitWidthChange: commitWidthChange,
  24719. ref: refMediaContainer,
  24720. focalPoint,
  24721. imageFill,
  24722. isSelected,
  24723. isStackedOnMobile,
  24724. mediaAlt,
  24725. mediaId,
  24726. mediaPosition,
  24727. mediaType,
  24728. mediaUrl,
  24729. mediaWidth,
  24730. isContentLocked
  24731. }), mediaPosition !== 'right' && (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  24732. }
  24733. /* harmony default export */ var media_text_edit = (MediaTextEdit);
  24734. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
  24735. /**
  24736. * External dependencies
  24737. */
  24738. /**
  24739. * WordPress dependencies
  24740. */
  24741. /**
  24742. * Internal dependencies
  24743. */
  24744. const save_DEFAULT_MEDIA_WIDTH = 50;
  24745. const save_noop = () => {};
  24746. function media_text_save_save(_ref) {
  24747. let {
  24748. attributes
  24749. } = _ref;
  24750. const {
  24751. isStackedOnMobile,
  24752. mediaAlt,
  24753. mediaPosition,
  24754. mediaType,
  24755. mediaUrl,
  24756. mediaWidth,
  24757. mediaId,
  24758. verticalAlignment,
  24759. imageFill,
  24760. focalPoint,
  24761. linkClass,
  24762. href,
  24763. linkTarget,
  24764. rel
  24765. } = attributes;
  24766. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  24767. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  24768. const imageClasses = classnames_default()({
  24769. [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
  24770. [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  24771. });
  24772. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  24773. src: mediaUrl,
  24774. alt: mediaAlt,
  24775. className: imageClasses || null
  24776. });
  24777. if (href) {
  24778. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  24779. className: linkClass,
  24780. href: href,
  24781. target: linkTarget,
  24782. rel: newRel
  24783. }, image);
  24784. }
  24785. const mediaTypeRenders = {
  24786. image: () => image,
  24787. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  24788. controls: true,
  24789. src: mediaUrl
  24790. })
  24791. };
  24792. const className = classnames_default()({
  24793. 'has-media-on-the-right': 'right' === mediaPosition,
  24794. 'is-stacked-on-mobile': isStackedOnMobile,
  24795. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  24796. 'is-image-fill': imageFill
  24797. });
  24798. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  24799. let gridTemplateColumns;
  24800. if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) {
  24801. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  24802. }
  24803. const style = {
  24804. gridTemplateColumns
  24805. };
  24806. if ('right' === mediaPosition) {
  24807. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  24808. className,
  24809. style
  24810. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  24811. className: 'wp-block-media-text__content'
  24812. })), (0,external_wp_element_namespaceObject.createElement)("figure", {
  24813. className: "wp-block-media-text__media",
  24814. style: backgroundStyles
  24815. }, (mediaTypeRenders[mediaType] || save_noop)()));
  24816. }
  24817. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  24818. className,
  24819. style
  24820. }), (0,external_wp_element_namespaceObject.createElement)("figure", {
  24821. className: "wp-block-media-text__media",
  24822. style: backgroundStyles
  24823. }, (mediaTypeRenders[mediaType] || save_noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  24824. className: 'wp-block-media-text__content'
  24825. })));
  24826. }
  24827. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
  24828. /**
  24829. * WordPress dependencies
  24830. */
  24831. const media_text_transforms_transforms = {
  24832. from: [{
  24833. type: 'block',
  24834. blocks: ['core/image'],
  24835. transform: _ref => {
  24836. let {
  24837. alt,
  24838. url,
  24839. id,
  24840. anchor
  24841. } = _ref;
  24842. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  24843. mediaAlt: alt,
  24844. mediaId: id,
  24845. mediaUrl: url,
  24846. mediaType: 'image',
  24847. anchor
  24848. });
  24849. }
  24850. }, {
  24851. type: 'block',
  24852. blocks: ['core/video'],
  24853. transform: _ref2 => {
  24854. let {
  24855. src,
  24856. id,
  24857. anchor
  24858. } = _ref2;
  24859. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  24860. mediaId: id,
  24861. mediaUrl: src,
  24862. mediaType: 'video',
  24863. anchor
  24864. });
  24865. }
  24866. }, {
  24867. type: 'block',
  24868. blocks: ['core/cover'],
  24869. transform: (_ref3, innerBlocks) => {
  24870. let {
  24871. align,
  24872. alt,
  24873. anchor,
  24874. backgroundType,
  24875. customGradient,
  24876. customOverlayColor,
  24877. gradient,
  24878. id,
  24879. overlayColor,
  24880. url
  24881. } = _ref3;
  24882. let additionalAttributes = {};
  24883. if (customGradient) {
  24884. additionalAttributes = {
  24885. style: {
  24886. color: {
  24887. gradient: customGradient
  24888. }
  24889. }
  24890. };
  24891. } else if (customOverlayColor) {
  24892. additionalAttributes = {
  24893. style: {
  24894. color: {
  24895. background: customOverlayColor
  24896. }
  24897. }
  24898. };
  24899. }
  24900. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  24901. align,
  24902. anchor,
  24903. backgroundColor: overlayColor,
  24904. gradient,
  24905. mediaAlt: alt,
  24906. mediaId: id,
  24907. mediaType: backgroundType,
  24908. mediaUrl: url,
  24909. ...additionalAttributes
  24910. }, innerBlocks);
  24911. }
  24912. }],
  24913. to: [{
  24914. type: 'block',
  24915. blocks: ['core/image'],
  24916. isMatch: _ref4 => {
  24917. let {
  24918. mediaType,
  24919. mediaUrl
  24920. } = _ref4;
  24921. return !mediaUrl || mediaType === 'image';
  24922. },
  24923. transform: _ref5 => {
  24924. let {
  24925. mediaAlt,
  24926. mediaId,
  24927. mediaUrl,
  24928. anchor
  24929. } = _ref5;
  24930. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  24931. alt: mediaAlt,
  24932. id: mediaId,
  24933. url: mediaUrl,
  24934. anchor
  24935. });
  24936. }
  24937. }, {
  24938. type: 'block',
  24939. blocks: ['core/video'],
  24940. isMatch: _ref6 => {
  24941. let {
  24942. mediaType,
  24943. mediaUrl
  24944. } = _ref6;
  24945. return !mediaUrl || mediaType === 'video';
  24946. },
  24947. transform: _ref7 => {
  24948. let {
  24949. mediaId,
  24950. mediaUrl,
  24951. anchor
  24952. } = _ref7;
  24953. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  24954. id: mediaId,
  24955. src: mediaUrl,
  24956. anchor
  24957. });
  24958. }
  24959. }, {
  24960. type: 'block',
  24961. blocks: ['core/cover'],
  24962. transform: (_ref8, innerBlocks) => {
  24963. var _style$color, _style$color2, _style$color3;
  24964. let {
  24965. align,
  24966. anchor,
  24967. backgroundColor,
  24968. focalPoint,
  24969. gradient,
  24970. mediaAlt,
  24971. mediaId,
  24972. mediaType,
  24973. mediaUrl,
  24974. style,
  24975. textColor
  24976. } = _ref8;
  24977. const additionalAttributes = {};
  24978. if (style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient) {
  24979. additionalAttributes.customGradient = style.color.gradient;
  24980. } else if (style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background) {
  24981. additionalAttributes.customOverlayColor = style.color.background;
  24982. }
  24983. const coverAttributes = {
  24984. align,
  24985. alt: mediaAlt,
  24986. anchor,
  24987. backgroundType: mediaType,
  24988. dimRatio: !!mediaUrl ? 50 : 100,
  24989. focalPoint,
  24990. gradient,
  24991. id: mediaId,
  24992. overlayColor: backgroundColor,
  24993. url: mediaUrl,
  24994. ...additionalAttributes
  24995. };
  24996. const customTextColor = style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.text; // Attempt to maintain any text color selection.
  24997. // Cover block's do not opt into color block support so we
  24998. // cannot directly copy the color attributes across.
  24999. if (!textColor && !customTextColor) {
  25000. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, innerBlocks);
  25001. }
  25002. const coloredInnerBlocks = innerBlocks.map(innerBlock => {
  25003. var _innerStyle$color;
  25004. const {
  25005. attributes: {
  25006. style: innerStyle
  25007. }
  25008. } = innerBlock; // Only apply the media and text color if the inner block
  25009. // doesn't set its own color block support selection.
  25010. if (innerBlock.attributes.textColor || innerStyle !== null && innerStyle !== void 0 && (_innerStyle$color = innerStyle.color) !== null && _innerStyle$color !== void 0 && _innerStyle$color.text) {
  25011. return innerBlock;
  25012. }
  25013. const newAttributes = {
  25014. textColor
  25015. }; // Only add or extend inner block's style object if we have
  25016. // a custom text color from the media & text block.
  25017. if (customTextColor) {
  25018. newAttributes.style = { ...innerStyle,
  25019. color: { ...(innerStyle === null || innerStyle === void 0 ? void 0 : innerStyle.color),
  25020. text: customTextColor
  25021. }
  25022. };
  25023. }
  25024. return (0,external_wp_blocks_namespaceObject.createBlock)(innerBlock.name, { ...innerBlock.attributes,
  25025. ...newAttributes
  25026. }, innerBlock.innerBlocks);
  25027. });
  25028. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, coloredInnerBlocks);
  25029. }
  25030. }]
  25031. };
  25032. /* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);
  25033. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  25034. /**
  25035. * WordPress dependencies
  25036. */
  25037. /**
  25038. * Internal dependencies
  25039. */
  25040. const media_text_metadata = {
  25041. $schema: "https://schemas.wp.org/trunk/block.json",
  25042. apiVersion: 2,
  25043. name: "core/media-text",
  25044. title: "Media & Text",
  25045. category: "media",
  25046. description: "Set media and words side-by-side for a richer layout.",
  25047. keywords: ["image", "video"],
  25048. textdomain: "default",
  25049. attributes: {
  25050. align: {
  25051. type: "string",
  25052. "default": "wide"
  25053. },
  25054. mediaAlt: {
  25055. type: "string",
  25056. source: "attribute",
  25057. selector: "figure img",
  25058. attribute: "alt",
  25059. "default": "",
  25060. __experimentalRole: "content"
  25061. },
  25062. mediaPosition: {
  25063. type: "string",
  25064. "default": "left"
  25065. },
  25066. mediaId: {
  25067. type: "number",
  25068. __experimentalRole: "content"
  25069. },
  25070. mediaUrl: {
  25071. type: "string",
  25072. source: "attribute",
  25073. selector: "figure video,figure img",
  25074. attribute: "src",
  25075. __experimentalRole: "content"
  25076. },
  25077. mediaLink: {
  25078. type: "string"
  25079. },
  25080. linkDestination: {
  25081. type: "string"
  25082. },
  25083. linkTarget: {
  25084. type: "string",
  25085. source: "attribute",
  25086. selector: "figure a",
  25087. attribute: "target"
  25088. },
  25089. href: {
  25090. type: "string",
  25091. source: "attribute",
  25092. selector: "figure a",
  25093. attribute: "href",
  25094. __experimentalRole: "content"
  25095. },
  25096. rel: {
  25097. type: "string",
  25098. source: "attribute",
  25099. selector: "figure a",
  25100. attribute: "rel"
  25101. },
  25102. linkClass: {
  25103. type: "string",
  25104. source: "attribute",
  25105. selector: "figure a",
  25106. attribute: "class"
  25107. },
  25108. mediaType: {
  25109. type: "string",
  25110. __experimentalRole: "content"
  25111. },
  25112. mediaWidth: {
  25113. type: "number",
  25114. "default": 50
  25115. },
  25116. mediaSizeSlug: {
  25117. type: "string"
  25118. },
  25119. isStackedOnMobile: {
  25120. type: "boolean",
  25121. "default": true
  25122. },
  25123. verticalAlignment: {
  25124. type: "string"
  25125. },
  25126. imageFill: {
  25127. type: "boolean"
  25128. },
  25129. focalPoint: {
  25130. type: "object"
  25131. }
  25132. },
  25133. supports: {
  25134. anchor: true,
  25135. align: ["wide", "full"],
  25136. html: false,
  25137. color: {
  25138. gradients: true,
  25139. link: true,
  25140. __experimentalDefaultControls: {
  25141. background: true,
  25142. text: true
  25143. }
  25144. },
  25145. spacing: {
  25146. margin: true,
  25147. padding: true
  25148. },
  25149. typography: {
  25150. fontSize: true,
  25151. lineHeight: true,
  25152. __experimentalFontFamily: true,
  25153. __experimentalFontWeight: true,
  25154. __experimentalFontStyle: true,
  25155. __experimentalTextTransform: true,
  25156. __experimentalTextDecoration: true,
  25157. __experimentalLetterSpacing: true,
  25158. __experimentalDefaultControls: {
  25159. fontSize: true
  25160. }
  25161. }
  25162. },
  25163. editorStyle: "wp-block-media-text-editor",
  25164. style: "wp-block-media-text"
  25165. };
  25166. const {
  25167. name: media_text_name
  25168. } = media_text_metadata;
  25169. const media_text_settings = {
  25170. icon: media_and_text,
  25171. example: {
  25172. viewportWidth: 601,
  25173. // Columns collapse "@media (max-width: 600px)".
  25174. attributes: {
  25175. mediaType: 'image',
  25176. mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg'
  25177. },
  25178. innerBlocks: [{
  25179. name: 'core/paragraph',
  25180. attributes: {
  25181. content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.')
  25182. }
  25183. }, {
  25184. name: 'core/paragraph',
  25185. attributes: {
  25186. content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)')
  25187. }
  25188. }]
  25189. },
  25190. transforms: media_text_transforms,
  25191. edit: media_text_edit,
  25192. save: media_text_save_save,
  25193. deprecated: media_text_deprecated
  25194. };
  25195. const media_text_init = () => initBlock({
  25196. name: media_text_name,
  25197. metadata: media_text_metadata,
  25198. settings: media_text_settings
  25199. });
  25200. ;// CONCATENATED MODULE: external ["wp","dom"]
  25201. var external_wp_dom_namespaceObject = window["wp"]["dom"];
  25202. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
  25203. /**
  25204. * WordPress dependencies
  25205. */
  25206. function MissingBlockWarning(_ref) {
  25207. let {
  25208. attributes,
  25209. convertToHTML
  25210. } = _ref;
  25211. const {
  25212. originalName,
  25213. originalUndelimitedContent
  25214. } = attributes;
  25215. const hasContent = !!originalUndelimitedContent;
  25216. const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
  25217. const actions = [];
  25218. let messageHTML;
  25219. if (hasContent && hasHTMLBlock) {
  25220. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  25221. /* translators: %s: block name */
  25222. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName);
  25223. actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  25224. key: "convert",
  25225. onClick: convertToHTML,
  25226. variant: "primary"
  25227. }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
  25228. } else {
  25229. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  25230. /* translators: %s: block name */
  25231. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName);
  25232. }
  25233. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  25234. className: 'has-warning'
  25235. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  25236. actions: actions
  25237. }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
  25238. }
  25239. const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => {
  25240. let {
  25241. clientId,
  25242. attributes
  25243. } = _ref2;
  25244. const {
  25245. replaceBlock
  25246. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  25247. return {
  25248. convertToHTML() {
  25249. replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  25250. content: attributes.originalUndelimitedContent
  25251. }));
  25252. }
  25253. };
  25254. })(MissingBlockWarning);
  25255. /* harmony default export */ var missing_edit = (MissingEdit);
  25256. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
  25257. /**
  25258. * WordPress dependencies
  25259. */
  25260. function missing_save_save(_ref) {
  25261. let {
  25262. attributes
  25263. } = _ref;
  25264. // Preserve the missing block's content.
  25265. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent);
  25266. }
  25267. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  25268. /**
  25269. * WordPress dependencies
  25270. */
  25271. /**
  25272. * Internal dependencies
  25273. */
  25274. const missing_metadata = {
  25275. $schema: "https://schemas.wp.org/trunk/block.json",
  25276. apiVersion: 2,
  25277. name: "core/missing",
  25278. title: "Unsupported",
  25279. category: "text",
  25280. description: "Your site doesn\u2019t include support for this block.",
  25281. textdomain: "default",
  25282. attributes: {
  25283. originalName: {
  25284. type: "string"
  25285. },
  25286. originalUndelimitedContent: {
  25287. type: "string"
  25288. },
  25289. originalContent: {
  25290. type: "string",
  25291. source: "html"
  25292. }
  25293. },
  25294. supports: {
  25295. className: false,
  25296. customClassName: false,
  25297. inserter: false,
  25298. html: false,
  25299. reusable: false
  25300. }
  25301. };
  25302. const {
  25303. name: missing_name
  25304. } = missing_metadata;
  25305. const missing_settings = {
  25306. name: missing_name,
  25307. __experimentalLabel(attributes, _ref) {
  25308. let {
  25309. context
  25310. } = _ref;
  25311. if (context === 'accessibility') {
  25312. const {
  25313. originalName
  25314. } = attributes;
  25315. const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined;
  25316. if (originalBlockType) {
  25317. return originalBlockType.settings.title || originalName;
  25318. }
  25319. return '';
  25320. }
  25321. },
  25322. edit: missing_edit,
  25323. save: missing_save_save
  25324. };
  25325. const missing_init = () => initBlock({
  25326. name: missing_name,
  25327. metadata: missing_metadata,
  25328. settings: missing_settings
  25329. });
  25330. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
  25331. /**
  25332. * WordPress dependencies
  25333. */
  25334. const more = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25335. viewBox: "0 0 24 24",
  25336. xmlns: "http://www.w3.org/2000/svg"
  25337. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25338. d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
  25339. }));
  25340. /* harmony default export */ var library_more = (more);
  25341. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
  25342. /**
  25343. * WordPress dependencies
  25344. */
  25345. const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more');
  25346. function MoreEdit(_ref) {
  25347. let {
  25348. attributes: {
  25349. customText,
  25350. noTeaser
  25351. },
  25352. insertBlocksAfter,
  25353. setAttributes
  25354. } = _ref;
  25355. const onChangeInput = event => {
  25356. setAttributes({
  25357. customText: event.target.value !== '' ? event.target.value : undefined
  25358. });
  25359. };
  25360. const onKeyDown = _ref2 => {
  25361. let {
  25362. keyCode
  25363. } = _ref2;
  25364. if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  25365. insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]);
  25366. }
  25367. };
  25368. const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.');
  25369. const toggleHideExcerpt = () => setAttributes({
  25370. noTeaser: !noTeaser
  25371. });
  25372. const style = {
  25373. width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
  25374. };
  25375. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  25376. label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'),
  25377. checked: !!noTeaser,
  25378. onChange: toggleHideExcerpt,
  25379. help: getHideExcerptHelp
  25380. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("input", {
  25381. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Read more link text'),
  25382. type: "text",
  25383. value: customText,
  25384. placeholder: DEFAULT_TEXT,
  25385. onChange: onChangeInput,
  25386. onKeyDown: onKeyDown,
  25387. style: style
  25388. })));
  25389. }
  25390. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
  25391. /**
  25392. * WordPress dependencies
  25393. */
  25394. function more_save_save(_ref) {
  25395. let {
  25396. attributes: {
  25397. customText,
  25398. noTeaser
  25399. }
  25400. } = _ref;
  25401. const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
  25402. const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
  25403. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, [moreTag, noTeaserTag].filter(Boolean).join('\n'));
  25404. }
  25405. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
  25406. /**
  25407. * WordPress dependencies
  25408. */
  25409. const more_transforms_transforms = {
  25410. from: [{
  25411. type: 'raw',
  25412. schema: {
  25413. 'wp-block': {
  25414. attributes: ['data-block']
  25415. }
  25416. },
  25417. isMatch: node => node.dataset && node.dataset.block === 'core/more',
  25418. transform(node) {
  25419. const {
  25420. customText,
  25421. noTeaser
  25422. } = node.dataset;
  25423. const attrs = {}; // Don't copy unless defined and not an empty string.
  25424. if (customText) {
  25425. attrs.customText = customText;
  25426. } // Special handling for boolean.
  25427. if (noTeaser === '') {
  25428. attrs.noTeaser = true;
  25429. }
  25430. return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs);
  25431. }
  25432. }]
  25433. };
  25434. /* harmony default export */ var more_transforms = (more_transforms_transforms);
  25435. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
  25436. /**
  25437. * WordPress dependencies
  25438. */
  25439. /**
  25440. * Internal dependencies
  25441. */
  25442. const more_metadata = {
  25443. $schema: "https://schemas.wp.org/trunk/block.json",
  25444. apiVersion: 2,
  25445. name: "core/more",
  25446. title: "More",
  25447. category: "design",
  25448. description: "Content before this block will be shown in the excerpt on your archives page.",
  25449. keywords: ["read more"],
  25450. textdomain: "default",
  25451. attributes: {
  25452. customText: {
  25453. type: "string"
  25454. },
  25455. noTeaser: {
  25456. type: "boolean",
  25457. "default": false
  25458. }
  25459. },
  25460. supports: {
  25461. customClassName: false,
  25462. className: false,
  25463. html: false,
  25464. multiple: false
  25465. },
  25466. editorStyle: "wp-block-more-editor"
  25467. };
  25468. const {
  25469. name: more_name
  25470. } = more_metadata;
  25471. const more_settings = {
  25472. icon: library_more,
  25473. example: {},
  25474. __experimentalLabel(attributes, _ref) {
  25475. let {
  25476. context
  25477. } = _ref;
  25478. if (context === 'accessibility') {
  25479. return attributes.customText;
  25480. }
  25481. },
  25482. transforms: more_transforms,
  25483. edit: MoreEdit,
  25484. save: more_save_save
  25485. };
  25486. const more_init = () => initBlock({
  25487. name: more_name,
  25488. metadata: more_metadata,
  25489. settings: more_settings
  25490. });
  25491. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
  25492. /**
  25493. * WordPress dependencies
  25494. */
  25495. const navigation = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25496. viewBox: "0 0 24 24",
  25497. xmlns: "http://www.w3.org/2000/svg"
  25498. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25499. d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
  25500. }));
  25501. /* harmony default export */ var library_navigation = (navigation);
  25502. ;// CONCATENATED MODULE: external ["wp","a11y"]
  25503. var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
  25504. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  25505. /**
  25506. * WordPress dependencies
  25507. */
  25508. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  25509. /**
  25510. * Return an SVG icon.
  25511. *
  25512. * @param {IconProps} props icon is the SVG component to render
  25513. * size is a number specifiying the icon size in pixels
  25514. * Other props will be passed to wrapped SVG component
  25515. *
  25516. * @return {JSX.Element} Icon component
  25517. */
  25518. function Icon(_ref) {
  25519. let {
  25520. icon,
  25521. size = 24,
  25522. ...props
  25523. } = _ref;
  25524. return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
  25525. width: size,
  25526. height: size,
  25527. ...props
  25528. });
  25529. }
  25530. /* harmony default export */ var build_module_icon = (Icon);
  25531. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  25532. /**
  25533. * WordPress dependencies
  25534. */
  25535. const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25536. xmlns: "http://www.w3.org/2000/svg",
  25537. viewBox: "0 0 24 24"
  25538. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25539. 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"
  25540. }));
  25541. /* harmony default export */ var library_close = (close_close);
  25542. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
  25543. /**
  25544. * WordPress dependencies
  25545. */
  25546. function useNavigationMenu(ref) {
  25547. const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('navigation', ref);
  25548. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  25549. const {
  25550. canCreate,
  25551. canUpdate,
  25552. canDelete,
  25553. isResolving,
  25554. hasResolved
  25555. } = permissions;
  25556. const {
  25557. navigationMenus,
  25558. isResolvingNavigationMenus,
  25559. hasResolvedNavigationMenus
  25560. } = selectNavigationMenus(select, ref);
  25561. const {
  25562. navigationMenu,
  25563. isNavigationMenuResolved,
  25564. isNavigationMenuMissing
  25565. } = selectExistingMenu(select, ref);
  25566. return {
  25567. navigationMenus,
  25568. isResolvingNavigationMenus,
  25569. hasResolvedNavigationMenus,
  25570. navigationMenu,
  25571. isNavigationMenuResolved,
  25572. isNavigationMenuMissing,
  25573. canSwitchNavigationMenu: ref ? (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1 : (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 0,
  25574. canUserCreateNavigationMenu: canCreate,
  25575. isResolvingCanUserCreateNavigationMenu: isResolving,
  25576. hasResolvedCanUserCreateNavigationMenu: hasResolved,
  25577. canUserUpdateNavigationMenu: canUpdate,
  25578. hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolved : undefined,
  25579. canUserDeleteNavigationMenu: canDelete,
  25580. hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolved : undefined
  25581. };
  25582. }, [ref, permissions]);
  25583. }
  25584. function selectNavigationMenus(select) {
  25585. const {
  25586. getEntityRecords,
  25587. hasFinishedResolution,
  25588. isResolving
  25589. } = select(external_wp_coreData_namespaceObject.store);
  25590. const args = ['postType', 'wp_navigation', {
  25591. per_page: -1,
  25592. status: ['publish', 'draft']
  25593. }];
  25594. return {
  25595. navigationMenus: getEntityRecords(...args),
  25596. isResolvingNavigationMenus: isResolving('getEntityRecords', args),
  25597. hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', args)
  25598. };
  25599. }
  25600. function selectExistingMenu(select, ref) {
  25601. if (!ref) {
  25602. return {
  25603. isNavigationMenuResolved: false,
  25604. isNavigationMenuMissing: true
  25605. };
  25606. }
  25607. const {
  25608. getEntityRecord,
  25609. getEditedEntityRecord,
  25610. hasFinishedResolution
  25611. } = select(external_wp_coreData_namespaceObject.store);
  25612. const args = ['postType', 'wp_navigation', ref];
  25613. const navigationMenu = getEntityRecord(...args);
  25614. const editedNavigationMenu = getEditedEntityRecord(...args);
  25615. const hasResolvedNavigationMenu = hasFinishedResolution('getEditedEntityRecord', args); // Only published Navigation posts are considered valid.
  25616. // Draft Navigation posts are valid only on the editor,
  25617. // requiring a post update to publish to show in frontend.
  25618. // To achieve that, index.php must reflect this validation only for published.
  25619. const isNavigationMenuPublishedOrDraft = editedNavigationMenu.status === 'publish' || editedNavigationMenu.status === 'draft';
  25620. return {
  25621. isNavigationMenuResolved: hasResolvedNavigationMenu,
  25622. isNavigationMenuMissing: hasResolvedNavigationMenu && (!navigationMenu || !isNavigationMenuPublishedOrDraft),
  25623. // getEditedEntityRecord will return the post regardless of status.
  25624. // Therefore if the found post is not published then we should ignore it.
  25625. navigationMenu: isNavigationMenuPublishedOrDraft ? editedNavigationMenu : null
  25626. };
  25627. }
  25628. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
  25629. /**
  25630. * WordPress dependencies
  25631. */
  25632. /**
  25633. * @typedef {Object} NavigationEntitiesData
  25634. * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page".
  25635. * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving.
  25636. * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving.
  25637. * @property {Array|undefined} menus - a collection of Menu entity objects.
  25638. * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving.
  25639. * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving.
  25640. * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId.
  25641. * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving.
  25642. * @property {boolean} hasPages - indicates whether there is currently any data for pages.
  25643. * @property {boolean} hasMenus - indicates whether there is currently any data for menus.
  25644. */
  25645. /**
  25646. * Manages fetching and resolution state for all entities required
  25647. * for the Navigation block.
  25648. *
  25649. * @param {number} menuId the menu for which to retrieve menuItem data.
  25650. * @return { NavigationEntitiesData } the entity data.
  25651. */
  25652. function useNavigationEntities(menuId) {
  25653. const {
  25654. records: menus,
  25655. isResolving: isResolvingMenus,
  25656. hasResolved: hasResolvedMenus
  25657. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menu', {
  25658. per_page: -1,
  25659. context: 'view'
  25660. });
  25661. const {
  25662. records: pages,
  25663. isResolving: isResolvingPages,
  25664. hasResolved: hasResolvedPages
  25665. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
  25666. parent: 0,
  25667. order: 'asc',
  25668. orderby: 'id',
  25669. per_page: -1,
  25670. context: 'view'
  25671. });
  25672. const {
  25673. records: menuItems,
  25674. hasResolved: hasResolvedMenuItems
  25675. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menuItem', {
  25676. menus: menuId,
  25677. per_page: -1,
  25678. context: 'view'
  25679. }, {
  25680. enabled: !!menuId
  25681. });
  25682. return {
  25683. pages,
  25684. isResolvingPages,
  25685. hasResolvedPages,
  25686. hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length),
  25687. menus,
  25688. isResolvingMenus,
  25689. hasResolvedMenus,
  25690. hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length),
  25691. menuItems,
  25692. hasResolvedMenuItems
  25693. };
  25694. }
  25695. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js
  25696. /**
  25697. * WordPress dependencies
  25698. */
  25699. const PlaceholderPreview = _ref => {
  25700. let {
  25701. isVisible = true
  25702. } = _ref;
  25703. return (0,external_wp_element_namespaceObject.createElement)("div", {
  25704. "aria-hidden": !isVisible ? true : undefined,
  25705. className: "wp-block-navigation-placeholder__preview"
  25706. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  25707. className: "wp-block-navigation-placeholder__actions__indicator"
  25708. }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  25709. icon: library_navigation
  25710. }), (0,external_wp_i18n_namespaceObject.__)('Navigation')));
  25711. };
  25712. /* harmony default export */ var placeholder_preview = (PlaceholderPreview);
  25713. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
  25714. /**
  25715. * WordPress dependencies
  25716. */
  25717. const chevronUp = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25718. viewBox: "0 0 24 24",
  25719. xmlns: "http://www.w3.org/2000/svg"
  25720. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25721. d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"
  25722. }));
  25723. /* harmony default export */ var chevron_up = (chevronUp);
  25724. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
  25725. /**
  25726. * WordPress dependencies
  25727. */
  25728. const chevronDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25729. viewBox: "0 0 24 24",
  25730. xmlns: "http://www.w3.org/2000/svg"
  25731. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25732. d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
  25733. }));
  25734. /* harmony default export */ var chevron_down = (chevronDown);
  25735. ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
  25736. var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
  25737. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
  25738. /**
  25739. * WordPress dependencies
  25740. */
  25741. /**
  25742. * Internal dependencies
  25743. */
  25744. function NavigationMenuSelector(_ref) {
  25745. let {
  25746. currentMenuId,
  25747. onSelectNavigationMenu,
  25748. onSelectClassicMenu,
  25749. onCreateNew,
  25750. actionLabel,
  25751. createNavigationMenuIsSuccess,
  25752. createNavigationMenuIsError,
  25753. toggleProps = {}
  25754. } = _ref;
  25755. /* translators: %s: The name of a menu. */
  25756. const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'");
  25757. const [selectorLabel, setSelectorLabel] = (0,external_wp_element_namespaceObject.useState)('');
  25758. const [isPressed, setIsPressed] = (0,external_wp_element_namespaceObject.useState)(false);
  25759. const [enableOptions, setEnableOptions] = (0,external_wp_element_namespaceObject.useState)(false);
  25760. const [isCreatingMenu, setIsCreatingMenu] = (0,external_wp_element_namespaceObject.useState)(false);
  25761. actionLabel = actionLabel || createActionLabel;
  25762. const {
  25763. menus: classicMenus
  25764. } = useNavigationEntities();
  25765. const {
  25766. navigationMenus,
  25767. hasResolvedNavigationMenus,
  25768. isNavigationMenuResolved,
  25769. canUserCreateNavigationMenu,
  25770. canSwitchNavigationMenu
  25771. } = useNavigationMenu();
  25772. const [currentTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  25773. const shouldEnableMenuSelector = (canSwitchNavigationMenu || canUserCreateNavigationMenu) && hasResolvedNavigationMenus && !isCreatingMenu;
  25774. const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => {
  25775. return (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(_ref2 => {
  25776. let {
  25777. id,
  25778. title
  25779. } = _ref2;
  25780. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title.rendered);
  25781. if (id === currentMenuId && !isCreatingMenu) {
  25782. setSelectorLabel(currentTitle);
  25783. setEnableOptions(shouldEnableMenuSelector);
  25784. }
  25785. return {
  25786. value: id,
  25787. label,
  25788. ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label)
  25789. };
  25790. })) || [];
  25791. }, [currentTitle, currentMenuId, navigationMenus, createNavigationMenuIsSuccess, isNavigationMenuResolved, hasResolvedNavigationMenus]);
  25792. const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
  25793. const hasClassicMenus = !!(classicMenus !== null && classicMenus !== void 0 && classicMenus.length);
  25794. const showNavigationMenus = !!canSwitchNavigationMenu;
  25795. const showClassicMenus = !!canUserCreateNavigationMenu;
  25796. const noMenuSelected = hasNavigationMenus && !currentMenuId;
  25797. const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus;
  25798. const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null;
  25799. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25800. if (!hasResolvedNavigationMenus) {
  25801. setSelectorLabel((0,external_wp_i18n_namespaceObject.__)('Loading …'));
  25802. } else if (noMenuSelected || noBlockMenus || menuUnavailable) {
  25803. setSelectorLabel((0,external_wp_i18n_namespaceObject.__)('Select menu'));
  25804. setEnableOptions(shouldEnableMenuSelector);
  25805. }
  25806. if (isCreatingMenu && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) {
  25807. setIsCreatingMenu(false);
  25808. }
  25809. }, [currentMenuId, hasNavigationMenus, hasResolvedNavigationMenus, createNavigationMenuIsSuccess, isNavigationMenuResolved]);
  25810. toggleProps = { ...toggleProps,
  25811. className: 'wp-block-navigation__navigation-selector-button',
  25812. children: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  25813. as: "span"
  25814. }, (0,external_wp_i18n_namespaceObject.__)('Select Menu')), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  25815. icon: isPressed ? chevron_up : chevron_down,
  25816. className: "wp-block-navigation__navigation-selector-button__icon"
  25817. })),
  25818. isBusy: !enableOptions,
  25819. disabled: !enableOptions,
  25820. __experimentalIsFocusable: true,
  25821. onClick: () => {
  25822. setIsPressed(!isPressed);
  25823. }
  25824. };
  25825. if (!hasNavigationMenus && !hasClassicMenus) {
  25826. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  25827. className: "wp-block-navigation__navigation-selector-button--createnew",
  25828. isBusy: !enableOptions,
  25829. disabled: !enableOptions,
  25830. __experimentalIsFocusable: true,
  25831. onClick: () => {
  25832. onCreateNew();
  25833. setIsCreatingMenu(true);
  25834. setSelectorLabel((0,external_wp_i18n_namespaceObject.__)('Loading …'));
  25835. setEnableOptions(false);
  25836. }
  25837. }, (0,external_wp_i18n_namespaceObject.__)('Create new menu'));
  25838. }
  25839. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
  25840. className: "wp-block-navigation__navigation-selector",
  25841. label: selectorLabel,
  25842. text: selectorLabel,
  25843. icon: null,
  25844. toggleProps: toggleProps
  25845. }, _ref3 => {
  25846. let {
  25847. onClose
  25848. } = _ref3;
  25849. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  25850. label: (0,external_wp_i18n_namespaceObject.__)('Menus')
  25851. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
  25852. value: currentMenuId,
  25853. onSelect: menuId => {
  25854. onSelectNavigationMenu(menuId);
  25855. },
  25856. choices: menuChoices
  25857. })), showClassicMenus && hasClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  25858. label: (0,external_wp_i18n_namespaceObject.__)('Import Classic Menus')
  25859. }, classicMenus === null || classicMenus === void 0 ? void 0 : classicMenus.map(menu => {
  25860. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name);
  25861. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  25862. onClick: () => {
  25863. setSelectorLabel((0,external_wp_i18n_namespaceObject.__)('Loading …'));
  25864. setEnableOptions(false);
  25865. onSelectClassicMenu(menu);
  25866. onClose();
  25867. },
  25868. key: menu.id,
  25869. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label)
  25870. }, label);
  25871. })), canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  25872. label: (0,external_wp_i18n_namespaceObject.__)('Tools')
  25873. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  25874. onClick: () => {
  25875. onClose();
  25876. onCreateNew();
  25877. setIsCreatingMenu(true);
  25878. setSelectorLabel((0,external_wp_i18n_namespaceObject.__)('Loading …'));
  25879. setEnableOptions(false);
  25880. }
  25881. }, (0,external_wp_i18n_namespaceObject.__)('Create new menu'))));
  25882. });
  25883. }
  25884. /* harmony default export */ var navigation_menu_selector = (NavigationMenuSelector);
  25885. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
  25886. /**
  25887. * WordPress dependencies
  25888. */
  25889. /**
  25890. * Internal dependencies
  25891. */
  25892. function NavigationPlaceholder(_ref) {
  25893. let {
  25894. isSelected,
  25895. currentMenuId,
  25896. clientId,
  25897. canUserCreateNavigationMenu = false,
  25898. isResolvingCanUserCreateNavigationMenu,
  25899. onSelectNavigationMenu,
  25900. onSelectClassicMenu,
  25901. onCreateEmpty
  25902. } = _ref;
  25903. const {
  25904. isResolvingMenus,
  25905. hasResolvedMenus
  25906. } = useNavigationEntities();
  25907. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25908. if (!isSelected) {
  25909. return;
  25910. }
  25911. if (isResolvingMenus) {
  25912. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading Navigation block setup options.'));
  25913. }
  25914. if (hasResolvedMenus) {
  25915. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.'));
  25916. }
  25917. }, [isResolvingMenus, isSelected]);
  25918. const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu;
  25919. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  25920. className: "wp-block-navigation-placeholder"
  25921. }, (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
  25922. isVisible: !isSelected
  25923. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  25924. "aria-hidden": !isSelected ? true : undefined,
  25925. className: "wp-block-navigation-placeholder__controls"
  25926. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  25927. className: "wp-block-navigation-placeholder__actions"
  25928. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  25929. className: "wp-block-navigation-placeholder__actions__indicator"
  25930. }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  25931. icon: library_navigation
  25932. }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  25933. currentMenuId: currentMenuId,
  25934. clientId: clientId,
  25935. onSelectNavigationMenu: onSelectNavigationMenu,
  25936. onSelectClassicMenu: onSelectClassicMenu,
  25937. toggleProps: {
  25938. variant: 'tertiary',
  25939. iconPosition: 'right',
  25940. className: 'wp-block-navigation-placeholder__actions__dropdown'
  25941. }
  25942. }), (0,external_wp_element_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  25943. variant: "tertiary",
  25944. onClick: onCreateEmpty
  25945. }, (0,external_wp_i18n_namespaceObject.__)('Start empty'))))));
  25946. }
  25947. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/menu.js
  25948. /**
  25949. * WordPress dependencies
  25950. */
  25951. const menu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25952. xmlns: "http://www.w3.org/2000/svg",
  25953. viewBox: "0 0 24 24"
  25954. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25955. d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"
  25956. }));
  25957. /* harmony default export */ var library_menu = (menu);
  25958. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js
  25959. /**
  25960. * WordPress dependencies
  25961. */
  25962. function OverlayMenuIcon(_ref) {
  25963. let {
  25964. icon
  25965. } = _ref;
  25966. if (icon === 'menu') {
  25967. return (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  25968. icon: library_menu
  25969. });
  25970. }
  25971. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25972. xmlns: "http://www.w3.org/2000/svg",
  25973. viewBox: "0 0 24 24",
  25974. width: "24",
  25975. height: "24",
  25976. "aria-hidden": "true",
  25977. focusable: "false"
  25978. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  25979. x: "4",
  25980. y: "7.5",
  25981. width: "16",
  25982. height: "1.5"
  25983. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  25984. x: "4",
  25985. y: "15",
  25986. width: "16",
  25987. height: "1.5"
  25988. }));
  25989. }
  25990. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js
  25991. /**
  25992. * External dependencies
  25993. */
  25994. /**
  25995. * WordPress dependencies
  25996. */
  25997. /**
  25998. * Internal dependencies
  25999. */
  26000. function ResponsiveWrapper(_ref) {
  26001. let {
  26002. children,
  26003. id,
  26004. isOpen,
  26005. isResponsive,
  26006. onToggle,
  26007. isHiddenByDefault,
  26008. overlayBackgroundColor,
  26009. overlayTextColor,
  26010. hasIcon,
  26011. icon
  26012. } = _ref;
  26013. if (!isResponsive) {
  26014. return children;
  26015. }
  26016. const responsiveContainerClasses = classnames_default()('wp-block-navigation__responsive-container', {
  26017. 'has-text-color': !!overlayTextColor.color || !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.class),
  26018. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
  26019. 'has-background': !!overlayBackgroundColor.color || (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.class),
  26020. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug),
  26021. 'is-menu-open': isOpen,
  26022. 'hidden-by-default': isHiddenByDefault
  26023. });
  26024. const styles = {
  26025. color: !(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug) && (overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.color),
  26026. backgroundColor: !(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug) && (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.color) && overlayBackgroundColor.color
  26027. };
  26028. const openButtonClasses = classnames_default()('wp-block-navigation__responsive-container-open', {
  26029. 'always-shown': isHiddenByDefault
  26030. });
  26031. const modalId = `${id}-modal`;
  26032. const dialogProps = {
  26033. className: 'wp-block-navigation__responsive-dialog',
  26034. ...(isOpen && {
  26035. role: 'dialog',
  26036. 'aria-modal': true,
  26037. 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu')
  26038. })
  26039. };
  26040. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26041. "aria-haspopup": "true",
  26042. "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Open menu'),
  26043. className: openButtonClasses,
  26044. onClick: () => onToggle(true)
  26045. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, {
  26046. icon: icon
  26047. }), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", {
  26048. className: "wp-block-navigation__toggle_button_label"
  26049. }, (0,external_wp_i18n_namespaceObject.__)('Menu'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  26050. className: responsiveContainerClasses,
  26051. style: styles,
  26052. id: modalId
  26053. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  26054. className: "wp-block-navigation__responsive-close",
  26055. tabIndex: "-1"
  26056. }, (0,external_wp_element_namespaceObject.createElement)("div", dialogProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26057. className: "wp-block-navigation__responsive-container-close",
  26058. "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close menu'),
  26059. onClick: () => onToggle(false)
  26060. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  26061. icon: library_close
  26062. }), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", {
  26063. className: "wp-block-navigation__toggle_button_label"
  26064. }, (0,external_wp_i18n_namespaceObject.__)('Close'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  26065. className: "wp-block-navigation__responsive-container-content",
  26066. id: `${modalId}-content`
  26067. }, children)))));
  26068. }
  26069. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
  26070. /**
  26071. * WordPress dependencies
  26072. */
  26073. /**
  26074. * Internal dependencies
  26075. */
  26076. const inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  26077. const inner_blocks_DEFAULT_BLOCK = {
  26078. name: 'core/navigation-link'
  26079. };
  26080. const LAYOUT = {
  26081. type: 'default',
  26082. alignments: []
  26083. };
  26084. function NavigationInnerBlocks(_ref) {
  26085. let {
  26086. clientId,
  26087. hasCustomPlaceholder,
  26088. orientation
  26089. } = _ref;
  26090. const {
  26091. isImmediateParentOfSelectedBlock,
  26092. selectedBlockHasChildren,
  26093. isSelected
  26094. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  26095. const {
  26096. getBlockCount,
  26097. hasSelectedInnerBlock,
  26098. getSelectedBlockClientId
  26099. } = select(external_wp_blockEditor_namespaceObject.store);
  26100. const selectedBlockId = getSelectedBlockClientId();
  26101. return {
  26102. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  26103. selectedBlockHasChildren: !!getBlockCount(selectedBlockId),
  26104. // This prop is already available but computing it here ensures it's
  26105. // fresh compared to isImmediateParentOfSelectedBlock.
  26106. isSelected: selectedBlockId === clientId
  26107. };
  26108. }, [clientId]);
  26109. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation');
  26110. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  26111. let {
  26112. name
  26113. } = _ref2;
  26114. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  26115. }), [blocks]); // When the block is selected itself or has a top level item selected that
  26116. // doesn't itself have children, show the standard appender. Else show no
  26117. // appender.
  26118. const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren;
  26119. const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), []);
  26120. const hasMenuItems = !!(blocks !== null && blocks !== void 0 && blocks.length); // If there is a `ref` attribute pointing to a `wp_navigation` but
  26121. // that menu has no **items** (i.e. empty) then show a placeholder.
  26122. // The block must also be selected else the placeholder will display
  26123. // alongside the appender.
  26124. const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected;
  26125. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  26126. className: 'wp-block-navigation__container'
  26127. }, {
  26128. value: blocks,
  26129. onInput,
  26130. onChange,
  26131. allowedBlocks: inner_blocks_ALLOWED_BLOCKS,
  26132. __experimentalDefaultBlock: inner_blocks_DEFAULT_BLOCK,
  26133. __experimentalDirectInsert: shouldDirectInsert,
  26134. orientation,
  26135. // As an exception to other blocks which feature nesting, show
  26136. // the block appender even when a child block is selected.
  26137. // This should be a temporary fix, to be replaced by improvements to
  26138. // the sibling inserter.
  26139. // See https://github.com/WordPress/gutenberg/issues/37572.
  26140. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  26141. parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
  26142. // Template lock set to false here so that the Nav
  26143. // Block on the experimental menus screen does not
  26144. // inherit templateLock={ 'all' }.
  26145. templateLock: false,
  26146. __experimentalLayout: LAYOUT,
  26147. placeholder: showPlaceholder ? placeholder : undefined
  26148. });
  26149. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  26150. }
  26151. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
  26152. /**
  26153. * WordPress dependencies
  26154. */
  26155. function NavigationMenuNameControl() {
  26156. const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  26157. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  26158. label: (0,external_wp_i18n_namespaceObject.__)('Menu name'),
  26159. value: title,
  26160. onChange: updateTitle
  26161. });
  26162. }
  26163. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
  26164. /**
  26165. * Generates a template part Id based on slug and theme inputs.
  26166. *
  26167. * @param {string} theme the template part's theme.
  26168. * @param {string} slug the template part's slug
  26169. * @return {string|null} the template part's Id.
  26170. */
  26171. function createTemplatePartId(theme, slug) {
  26172. return theme && slug ? theme + '//' + slug : null;
  26173. }
  26174. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
  26175. /**
  26176. * WordPress dependencies
  26177. */
  26178. /**
  26179. * Internal dependencies
  26180. */
  26181. // TODO: this util should perhaps be refactored somewhere like core-data.
  26182. function useTemplatePartAreaLabel(clientId) {
  26183. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  26184. // Use the lack of a clientId as an opportunity to bypass the rest
  26185. // of this hook.
  26186. if (!clientId) {
  26187. return;
  26188. }
  26189. const {
  26190. getBlock,
  26191. getBlockParentsByBlockName
  26192. } = select(external_wp_blockEditor_namespaceObject.store);
  26193. const withAscendingResults = true;
  26194. const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);
  26195. if (!(parentTemplatePartClientIds !== null && parentTemplatePartClientIds !== void 0 && parentTemplatePartClientIds.length)) {
  26196. return;
  26197. } // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  26198. // Blocks can be loaded into a *non-post* block editor.
  26199. // This code is lifted from this file:
  26200. // packages/block-library/src/template-part/edit/advanced-controls.js
  26201. /* eslint-disable @wordpress/data-no-store-string-literals */
  26202. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  26203. /* eslint-enable @wordpress/data-no-store-string-literals */
  26204. const {
  26205. getEditedEntityRecord
  26206. } = select(external_wp_coreData_namespaceObject.store);
  26207. for (const templatePartClientId of parentTemplatePartClientIds) {
  26208. const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead
  26209. // on the entity.
  26210. const {
  26211. theme,
  26212. slug
  26213. } = templatePartBlock.attributes;
  26214. const templatePartEntityId = createTemplatePartId(theme, slug);
  26215. const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); // Look up the `label` for the area in the defined areas so
  26216. // that an internationalized label can be used.
  26217. if (templatePartEntity !== null && templatePartEntity !== void 0 && templatePartEntity.area) {
  26218. var _definedAreas$find;
  26219. return (_definedAreas$find = definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)) === null || _definedAreas$find === void 0 ? void 0 : _definedAreas$find.label;
  26220. }
  26221. }
  26222. }, [clientId]);
  26223. }
  26224. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
  26225. /**
  26226. * WordPress dependencies
  26227. */
  26228. /**
  26229. * Internal dependencies
  26230. */
  26231. const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  26232. status: 'draft',
  26233. per_page: -1
  26234. }];
  26235. const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', {
  26236. per_page: -1,
  26237. status: 'publish'
  26238. }];
  26239. function useGenerateDefaultNavigationTitle(clientId) {
  26240. // The block will be disabled in a block preview, use this as a way of
  26241. // avoiding the side-effects of this component for block previews.
  26242. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id
  26243. // arg to bypass the expensive `useTemplateArea` code. The hook will return
  26244. // early.
  26245. const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId);
  26246. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  26247. return (0,external_wp_element_namespaceObject.useCallback)(async () => {
  26248. // Ensure other navigation menus have loaded so an
  26249. // accurate name can be created.
  26250. if (isDisabled) {
  26251. return '';
  26252. }
  26253. const {
  26254. getEntityRecords
  26255. } = registry.resolveSelect(external_wp_coreData_namespaceObject.store);
  26256. const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
  26257. const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  26258. (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : // translators: 'navigation' as in website navigation.
  26259. (0,external_wp_i18n_namespaceObject.__)('Navigation'); // Determine how many menus start with the automatic title.
  26260. const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => {
  26261. var _menu$title, _menu$title$raw;
  26262. return menu !== null && menu !== void 0 && (_menu$title = menu.title) !== null && _menu$title !== void 0 && (_menu$title$raw = _menu$title.raw) !== null && _menu$title$raw !== void 0 && _menu$title$raw.startsWith(title) ? count + 1 : count;
  26263. }, 0); // Append a number to the end of the title if a menu with
  26264. // the same name exists.
  26265. const titleWithCount = matchingMenuTitleCount > 0 ? `${title} ${matchingMenuTitleCount + 1}` : title;
  26266. return titleWithCount || '';
  26267. }, [isDisabled, area]);
  26268. }
  26269. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
  26270. /**
  26271. * WordPress dependencies
  26272. */
  26273. /**
  26274. * Internal dependencies
  26275. */
  26276. const CREATE_NAVIGATION_MENU_SUCCESS = 'success';
  26277. const CREATE_NAVIGATION_MENU_ERROR = 'error';
  26278. const CREATE_NAVIGATION_MENU_PENDING = 'pending';
  26279. const CREATE_NAVIGATION_MENU_IDLE = 'idle';
  26280. function useCreateNavigationMenu(clientId) {
  26281. let postStatus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'publish';
  26282. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE);
  26283. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
  26284. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  26285. const {
  26286. saveEntityRecord
  26287. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  26288. const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates
  26289. // a new navigation menu when the user completes the final step.
  26290. const create = (0,external_wp_element_namespaceObject.useCallback)(async function () {
  26291. let title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  26292. let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  26293. // Guard against creating Navigations without a title.
  26294. // Note you can pass no title, but if one is passed it must be
  26295. // a string otherwise the title may end up being empty.
  26296. if (title && typeof title !== 'string') {
  26297. setError('Invalid title supplied when creating Navigation Menu.');
  26298. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  26299. throw new Error(`Value of supplied title argument was not a string.`);
  26300. }
  26301. setStatus(CREATE_NAVIGATION_MENU_PENDING);
  26302. setValue(null);
  26303. setError(null);
  26304. if (!title) {
  26305. title = await generateDefaultTitle().catch(err => {
  26306. setError(err === null || err === void 0 ? void 0 : err.message);
  26307. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  26308. throw new Error('Failed to create title when saving new Navigation Menu.', {
  26309. cause: err
  26310. });
  26311. });
  26312. }
  26313. const record = {
  26314. title,
  26315. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  26316. status: postStatus
  26317. }; // Return affords ability to await on this function directly
  26318. return saveEntityRecord('postType', 'wp_navigation', record).then(response => {
  26319. setValue(response);
  26320. setStatus(CREATE_NAVIGATION_MENU_SUCCESS);
  26321. return response;
  26322. }).catch(err => {
  26323. setError(err === null || err === void 0 ? void 0 : err.message);
  26324. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  26325. throw new Error('Unable to save new Navigation Menu', {
  26326. cause: err
  26327. });
  26328. });
  26329. }, [external_wp_blocks_namespaceObject.serialize, saveEntityRecord]);
  26330. return {
  26331. create,
  26332. status,
  26333. value,
  26334. error,
  26335. isIdle: status === CREATE_NAVIGATION_MENU_IDLE,
  26336. isPending: status === CREATE_NAVIGATION_MENU_PENDING,
  26337. isSuccess: status === CREATE_NAVIGATION_MENU_SUCCESS,
  26338. isError: status === CREATE_NAVIGATION_MENU_ERROR
  26339. };
  26340. }
  26341. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
  26342. /**
  26343. * WordPress dependencies
  26344. */
  26345. /**
  26346. * Internal dependencies
  26347. */
  26348. const EMPTY_OBJECT = {};
  26349. const unsaved_inner_blocks_DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  26350. status: 'draft',
  26351. per_page: -1
  26352. }];
  26353. const unsaved_inner_blocks_DEFAULT_BLOCK = {
  26354. name: 'core/navigation-link'
  26355. };
  26356. const unsaved_inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  26357. function UnsavedInnerBlocks(_ref) {
  26358. let {
  26359. blocks,
  26360. clientId,
  26361. hasSavedUnsavedInnerBlocks,
  26362. onSave,
  26363. hasSelection
  26364. } = _ref;
  26365. const originalBlocks = (0,external_wp_element_namespaceObject.useRef)();
  26366. (0,external_wp_element_namespaceObject.useEffect)(() => {
  26367. // Initially store the uncontrolled inner blocks for
  26368. // dirty state comparison.
  26369. if (!(originalBlocks !== null && originalBlocks !== void 0 && originalBlocks.current)) {
  26370. originalBlocks.current = blocks;
  26371. }
  26372. }, [blocks]); // If the current inner blocks object is different in any way
  26373. // from the original inner blocks from the post content then the
  26374. // user has made changes to the inner blocks. At this point the inner
  26375. // blocks can be considered "dirty".
  26376. // We also make sure the current innerBlocks had a chance to be set.
  26377. const innerBlocksAreDirty = !!originalBlocks.current && blocks !== originalBlocks.current;
  26378. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  26379. let {
  26380. name
  26381. } = _ref2;
  26382. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  26383. }), [blocks]); // The block will be disabled in a block preview, use this as a way of
  26384. // avoiding the side-effects of this component for block previews.
  26385. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  26386. const savingLock = (0,external_wp_element_namespaceObject.useRef)(false);
  26387. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  26388. className: 'wp-block-navigation__container'
  26389. }, {
  26390. renderAppender: hasSelection ? undefined : false,
  26391. allowedBlocks: unsaved_inner_blocks_ALLOWED_BLOCKS,
  26392. __experimentalDefaultBlock: unsaved_inner_blocks_DEFAULT_BLOCK,
  26393. __experimentalDirectInsert: shouldDirectInsert
  26394. });
  26395. const {
  26396. isSaving,
  26397. draftNavigationMenus,
  26398. hasResolvedDraftNavigationMenus
  26399. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  26400. if (isDisabled) {
  26401. return EMPTY_OBJECT;
  26402. }
  26403. const {
  26404. getEntityRecords,
  26405. hasFinishedResolution,
  26406. isSavingEntityRecord
  26407. } = select(external_wp_coreData_namespaceObject.store);
  26408. return {
  26409. isSaving: isSavingEntityRecord('postType', 'wp_navigation'),
  26410. draftNavigationMenus: getEntityRecords(...unsaved_inner_blocks_DRAFT_MENU_PARAMS),
  26411. hasResolvedDraftNavigationMenus: hasFinishedResolution('getEntityRecords', unsaved_inner_blocks_DRAFT_MENU_PARAMS)
  26412. };
  26413. }, [isDisabled]);
  26414. const {
  26415. hasResolvedNavigationMenus,
  26416. navigationMenus
  26417. } = useNavigationMenu();
  26418. const {
  26419. create: createNavigationMenu
  26420. } = useCreateNavigationMenu(clientId); // Automatically save the uncontrolled blocks.
  26421. (0,external_wp_element_namespaceObject.useEffect)(() => {
  26422. // The block will be disabled when used in a BlockPreview.
  26423. // In this case avoid automatic creation of a wp_navigation post.
  26424. // Otherwise the user will be spammed with lots of menus!
  26425. //
  26426. // Also ensure other navigation menus have loaded so an
  26427. // accurate name can be created.
  26428. //
  26429. // Don't try saving when another save is already
  26430. // in progress.
  26431. //
  26432. // And finally only create the menu when the block is selected,
  26433. // which is an indication they want to start editing.
  26434. if (isDisabled || hasSavedUnsavedInnerBlocks || isSaving || savingLock.current || !hasResolvedDraftNavigationMenus || !hasResolvedNavigationMenus || !hasSelection || !innerBlocksAreDirty) {
  26435. return;
  26436. }
  26437. savingLock.current = true;
  26438. createNavigationMenu(null, blocks).then(menu => {
  26439. onSave(menu);
  26440. savingLock.current = false;
  26441. });
  26442. }, [isDisabled, isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, draftNavigationMenus, navigationMenus, hasSelection, createNavigationMenu, blocks]);
  26443. const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div';
  26444. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Wrapper, innerBlocksProps), isSaving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  26445. }
  26446. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
  26447. /**
  26448. * WordPress dependencies
  26449. */
  26450. function NavigationMenuDeleteControl(_ref) {
  26451. let {
  26452. onDelete
  26453. } = _ref;
  26454. const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
  26455. const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
  26456. const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  26457. const {
  26458. deleteEntityRecord
  26459. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  26460. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26461. className: "wp-block-navigation-delete-menu-button",
  26462. variant: "secondary",
  26463. isDestructive: true,
  26464. onClick: () => {
  26465. setIsConfirmModalVisible(true);
  26466. }
  26467. }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  26468. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  26469. /* translators: %s: the name of a menu to delete */
  26470. (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title),
  26471. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  26472. onRequestClose: () => setIsConfirmModalVisible(false)
  26473. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  26474. justify: "flex-end"
  26475. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26476. variant: "secondary",
  26477. onClick: () => {
  26478. setIsConfirmModalVisible(false);
  26479. }
  26480. }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26481. variant: "primary",
  26482. onClick: () => {
  26483. deleteEntityRecord('postType', 'wp_navigation', id, {
  26484. force: true
  26485. });
  26486. onDelete(title);
  26487. }
  26488. }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))));
  26489. }
  26490. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
  26491. /**
  26492. * WordPress dependencies
  26493. */
  26494. function useNavigationNotice() {
  26495. let {
  26496. name,
  26497. message = ''
  26498. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  26499. const noticeRef = (0,external_wp_element_namespaceObject.useRef)();
  26500. const {
  26501. createWarningNotice,
  26502. removeNotice
  26503. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  26504. const showNotice = customMsg => {
  26505. if (noticeRef.current) {
  26506. return;
  26507. }
  26508. noticeRef.current = name;
  26509. createWarningNotice(customMsg || message, {
  26510. id: noticeRef.current,
  26511. type: 'snackbar'
  26512. });
  26513. };
  26514. const hideNotice = () => {
  26515. if (!noticeRef.current) {
  26516. return;
  26517. }
  26518. removeNotice(noticeRef.current);
  26519. noticeRef.current = null;
  26520. };
  26521. return [showNotice, hideNotice];
  26522. }
  26523. /* harmony default export */ var use_navigation_notice = (useNavigationNotice);
  26524. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-preview.js
  26525. /**
  26526. * WordPress dependencies
  26527. */
  26528. /**
  26529. * Internal dependencies
  26530. */
  26531. function OverlayMenuPreview(_ref) {
  26532. let {
  26533. setAttributes,
  26534. hasIcon,
  26535. icon
  26536. } = _ref;
  26537. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  26538. label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'),
  26539. help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button opening the overlay menu.'),
  26540. onChange: value => setAttributes({
  26541. hasIcon: value
  26542. }),
  26543. checked: hasIcon
  26544. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  26545. label: (0,external_wp_i18n_namespaceObject.__)('Icon'),
  26546. value: icon,
  26547. onChange: value => setAttributes({
  26548. icon: value
  26549. }),
  26550. isBlock: true
  26551. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  26552. value: "handle",
  26553. "aria-label": (0,external_wp_i18n_namespaceObject.__)('handle'),
  26554. label: (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, {
  26555. icon: "handle"
  26556. })
  26557. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  26558. value: "menu",
  26559. "aria-label": (0,external_wp_i18n_namespaceObject.__)('menu'),
  26560. label: (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, {
  26561. icon: "menu"
  26562. })
  26563. })));
  26564. }
  26565. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
  26566. /**
  26567. * WordPress dependencies
  26568. */
  26569. /**
  26570. * Convert a flat menu item structure to a nested blocks structure.
  26571. *
  26572. * @param {Object[]} menuItems An array of menu items.
  26573. *
  26574. * @return {WPBlock[]} An array of blocks.
  26575. */
  26576. function menuItemsToBlocks(menuItems) {
  26577. if (!menuItems) {
  26578. return null;
  26579. }
  26580. const menuTree = createDataTree(menuItems);
  26581. const blocks = mapMenuItemsToBlocks(menuTree);
  26582. return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
  26583. }
  26584. /**
  26585. * A recursive function that maps menu item nodes to blocks.
  26586. *
  26587. * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
  26588. * @param {number} level An integer representing the nesting level.
  26589. * @return {Object} Object containing innerBlocks and mapping.
  26590. */
  26591. function mapMenuItemsToBlocks(menuItems) {
  26592. let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  26593. let mapping = {}; // The menuItem should be in menu_order sort order.
  26594. const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order);
  26595. const innerBlocks = sortedItems.map(menuItem => {
  26596. var _menuItem$children, _menuItem$children2;
  26597. if (menuItem.type === 'block') {
  26598. const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
  26599. if (!block) {
  26600. return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
  26601. content: menuItem.content
  26602. });
  26603. }
  26604. return block;
  26605. }
  26606. const blockType = (_menuItem$children = menuItem.children) !== null && _menuItem$children !== void 0 && _menuItem$children.length ? 'core/navigation-submenu' : 'core/navigation-link';
  26607. const attributes = menuItemToBlockAttributes(menuItem, blockType, level); // If there are children recurse to build those nested blocks.
  26608. const {
  26609. innerBlocks: nestedBlocks = [],
  26610. // alias to avoid shadowing
  26611. mapping: nestedMapping = {} // alias to avoid shadowing
  26612. } = (_menuItem$children2 = menuItem.children) !== null && _menuItem$children2 !== void 0 && _menuItem$children2.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; // Update parent mapping with nested mapping.
  26613. mapping = { ...mapping,
  26614. ...nestedMapping
  26615. }; // Create block with nested "innerBlocks".
  26616. const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
  26617. mapping[menuItem.id] = block.clientId;
  26618. return block;
  26619. });
  26620. return {
  26621. innerBlocks,
  26622. mapping
  26623. };
  26624. }
  26625. /**
  26626. * A WP nav_menu_item object.
  26627. * For more documentation on the individual fields present on a menu item please see:
  26628. * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
  26629. *
  26630. * Changes made here should also be mirrored in packages/edit-navigation/src/store/utils.js.
  26631. *
  26632. * @typedef WPNavMenuItem
  26633. *
  26634. * @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
  26635. * @property {Array} xfn the XFN relationships expressed in the link of this menu item.
  26636. * @property {Array} classes the HTML class attributes for this menu item.
  26637. * @property {string} attr_title the HTML title attribute for this menu item.
  26638. * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
  26639. * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
  26640. * @property {string} description The description of this menu item.
  26641. * @property {string} url The URL to which this menu item points.
  26642. * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
  26643. * @property {string} target The target attribute of the link element for this menu item.
  26644. */
  26645. /**
  26646. * Convert block attributes to menu item.
  26647. *
  26648. * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
  26649. * @param {string} blockType The block type.
  26650. * @param {number} level An integer representing the nesting level.
  26651. * @return {Object} the block attributes converted from the WPNavMenuItem item.
  26652. */
  26653. function menuItemToBlockAttributes(_ref, blockType, level) {
  26654. var _object;
  26655. let {
  26656. title: menuItemTitleField,
  26657. xfn,
  26658. classes,
  26659. // eslint-disable-next-line camelcase
  26660. attr_title,
  26661. object,
  26662. // eslint-disable-next-line camelcase
  26663. object_id,
  26664. description,
  26665. url,
  26666. type: menuItemTypeField,
  26667. target
  26668. } = _ref;
  26669. // For historical reasons, the `core/navigation-link` variation type is `tag`
  26670. // whereas WP Core expects `post_tag` as the `object` type.
  26671. // To avoid writing a block migration we perform a conversion here.
  26672. // See also inverse equivalent in `blockAttributesToMenuItem`.
  26673. if (object && object === 'post_tag') {
  26674. object = 'tag';
  26675. }
  26676. return {
  26677. label: (menuItemTitleField === null || menuItemTitleField === void 0 ? void 0 : menuItemTitleField.rendered) || '',
  26678. ...(((_object = object) === null || _object === void 0 ? void 0 : _object.length) && {
  26679. type: object
  26680. }),
  26681. kind: (menuItemTypeField === null || menuItemTypeField === void 0 ? void 0 : menuItemTypeField.replace('_', '-')) || 'custom',
  26682. url: url || '',
  26683. ...((xfn === null || xfn === void 0 ? void 0 : xfn.length) && xfn.join(' ').trim() && {
  26684. rel: xfn.join(' ').trim()
  26685. }),
  26686. ...((classes === null || classes === void 0 ? void 0 : classes.length) && classes.join(' ').trim() && {
  26687. className: classes.join(' ').trim()
  26688. }),
  26689. /* eslint-disable camelcase */
  26690. ...((attr_title === null || attr_title === void 0 ? void 0 : attr_title.length) && {
  26691. title: attr_title
  26692. }),
  26693. ...(object_id && 'custom' !== object && {
  26694. id: object_id
  26695. }),
  26696. /* eslint-enable camelcase */
  26697. ...((description === null || description === void 0 ? void 0 : description.length) && {
  26698. description
  26699. }),
  26700. ...(target === '_blank' && {
  26701. opensInNewTab: true
  26702. }),
  26703. ...(blockType === 'core/navigation-submenu' && {
  26704. isTopLevelItem: level === 0
  26705. }),
  26706. ...(blockType === 'core/navigation-link' && {
  26707. isTopLevelLink: level === 0
  26708. })
  26709. };
  26710. }
  26711. /**
  26712. * Creates a nested, hierarchical tree representation from unstructured data that
  26713. * has an inherent relationship defined between individual items.
  26714. *
  26715. * For example, by default, each element in the dataset should have an `id` and
  26716. * `parent` property where the `parent` property indicates a relationship between
  26717. * the current item and another item with a matching `id` properties.
  26718. *
  26719. * This is useful for building linked lists of data from flat data structures.
  26720. *
  26721. * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
  26722. * @param {string} id the property which uniquely identifies each entry within the array.
  26723. * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
  26724. * @return {Array} a nested array of parent/child relationships
  26725. */
  26726. function createDataTree(dataset) {
  26727. let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  26728. let relation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent';
  26729. const hashTable = Object.create(null);
  26730. const dataTree = [];
  26731. for (const data of dataset) {
  26732. hashTable[data[id]] = { ...data,
  26733. children: []
  26734. };
  26735. if (data[relation]) {
  26736. hashTable[data[relation]] = hashTable[data[relation]] || {};
  26737. hashTable[data[relation]].children = hashTable[data[relation]].children || [];
  26738. hashTable[data[relation]].children.push(hashTable[data[id]]);
  26739. } else {
  26740. dataTree.push(hashTable[data[id]]);
  26741. }
  26742. }
  26743. return dataTree;
  26744. }
  26745. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
  26746. /**
  26747. * WordPress dependencies
  26748. */
  26749. /**
  26750. * Internal dependencies
  26751. */
  26752. const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
  26753. const CLASSIC_MENU_CONVERSION_ERROR = 'error';
  26754. const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
  26755. const CLASSIC_MENU_CONVERSION_IDLE = 'idle';
  26756. function useConvertClassicToBlockMenu(clientId) {
  26757. /*
  26758. * The wp_navigation post is created as a draft so the changes on the frontend and
  26759. * the site editor are not permanent without a save interaction done by the user.
  26760. */
  26761. const {
  26762. create: createNavigationMenu
  26763. } = useCreateNavigationMenu(clientId, 'draft');
  26764. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  26765. const {
  26766. editEntityRecord
  26767. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  26768. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
  26769. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  26770. async function convertClassicMenuToBlockMenu(menuId, menuName) {
  26771. let navigationMenu;
  26772. let classicMenuItems; // 1. Fetch the classic Menu items.
  26773. try {
  26774. classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
  26775. menus: menuId,
  26776. per_page: -1,
  26777. context: 'view'
  26778. });
  26779. } catch (err) {
  26780. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  26781. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
  26782. cause: err
  26783. });
  26784. } // Handle offline response which resolves to `null`.
  26785. if (classicMenuItems === null) {
  26786. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  26787. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
  26788. } // 2. Convert the classic items into blocks.
  26789. const {
  26790. innerBlocks
  26791. } = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
  26792. try {
  26793. navigationMenu = await createNavigationMenu(menuName, innerBlocks);
  26794. /**
  26795. * Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'.
  26796. * This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty".
  26797. * The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_,
  26798. * without user interaction.
  26799. * If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft.
  26800. */
  26801. await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, {
  26802. status: 'publish'
  26803. }, {
  26804. throwOnError: true
  26805. });
  26806. } catch (err) {
  26807. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  26808. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  26809. cause: err
  26810. });
  26811. }
  26812. return navigationMenu;
  26813. }
  26814. const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName) => {
  26815. if (!menuId || !menuName) {
  26816. setError('Unable to convert menu. Missing menu details.');
  26817. setStatus(CLASSIC_MENU_CONVERSION_ERROR);
  26818. return;
  26819. }
  26820. setStatus(CLASSIC_MENU_CONVERSION_PENDING);
  26821. setError(null);
  26822. return await convertClassicMenuToBlockMenu(menuId, menuName).then(navigationMenu => {
  26823. setStatus(CLASSIC_MENU_CONVERSION_SUCCESS);
  26824. return navigationMenu;
  26825. }).catch(err => {
  26826. setError(err === null || err === void 0 ? void 0 : err.message);
  26827. setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Rethrow error for debugging.
  26828. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  26829. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  26830. cause: err
  26831. });
  26832. });
  26833. }, []);
  26834. return {
  26835. convert,
  26836. status,
  26837. error
  26838. };
  26839. }
  26840. /* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
  26841. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js
  26842. /**
  26843. * WordPress dependencies
  26844. */
  26845. const EMPTY_ARRAY = [];
  26846. function useInnerBlocks(clientId) {
  26847. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  26848. const {
  26849. getBlock,
  26850. getBlocks,
  26851. hasSelectedInnerBlock
  26852. } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled
  26853. // inner blocks, while `getBlocks` does. It might be more stable to
  26854. // introduce a selector like `getUncontrolledInnerBlocks`, just in
  26855. // case `getBlock` is fixed.
  26856. const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks;
  26857. const _hasUncontrolledInnerBlocks = !!(_uncontrolledInnerBlocks !== null && _uncontrolledInnerBlocks !== void 0 && _uncontrolledInnerBlocks.length);
  26858. const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? EMPTY_ARRAY : getBlocks(clientId);
  26859. return {
  26860. innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks,
  26861. hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks,
  26862. uncontrolledInnerBlocks: _uncontrolledInnerBlocks,
  26863. controlledInnerBlocks: _controlledInnerBlocks,
  26864. isInnerBlockSelected: hasSelectedInnerBlock(clientId, true)
  26865. };
  26866. }, [clientId]);
  26867. }
  26868. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/utils.js
  26869. function getComputedStyle(node) {
  26870. return node.ownerDocument.defaultView.getComputedStyle(node);
  26871. }
  26872. function detectColors(colorsDetectionElement, setColor, setBackground) {
  26873. if (!colorsDetectionElement) {
  26874. return;
  26875. }
  26876. setColor(getComputedStyle(colorsDetectionElement).color);
  26877. let backgroundColorNode = colorsDetectionElement;
  26878. let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  26879. while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
  26880. backgroundColorNode = backgroundColorNode.parentNode;
  26881. backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  26882. }
  26883. setBackground(backgroundColor);
  26884. }
  26885. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
  26886. /**
  26887. * External dependencies
  26888. */
  26889. /**
  26890. * WordPress dependencies
  26891. */
  26892. /**
  26893. * Internal dependencies
  26894. */
  26895. function Navigation(_ref) {
  26896. var _attributes$style, _attributes$style$typ;
  26897. let {
  26898. attributes,
  26899. setAttributes,
  26900. clientId,
  26901. isSelected,
  26902. className,
  26903. backgroundColor,
  26904. setBackgroundColor,
  26905. textColor,
  26906. setTextColor,
  26907. overlayBackgroundColor,
  26908. setOverlayBackgroundColor,
  26909. overlayTextColor,
  26910. setOverlayTextColor,
  26911. // These props are used by the navigation editor to override specific
  26912. // navigation block settings.
  26913. hasSubmenuIndicatorSetting = true,
  26914. hasColorSettings = true,
  26915. customPlaceholder: CustomPlaceholder = null
  26916. } = _ref;
  26917. const {
  26918. openSubmenusOnClick,
  26919. overlayMenu,
  26920. showSubmenuIcon,
  26921. layout: {
  26922. justifyContent,
  26923. orientation = 'horizontal',
  26924. flexWrap = 'wrap'
  26925. } = {},
  26926. hasIcon,
  26927. icon = 'handle'
  26928. } = attributes;
  26929. const ref = attributes.ref;
  26930. const setRef = postId => {
  26931. setAttributes({
  26932. ref: postId
  26933. });
  26934. };
  26935. const recursionId = `navigationMenu/${ref}`;
  26936. const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.__experimentalUseHasRecursion)(recursionId);
  26937. const {
  26938. editEntityRecord
  26939. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); // Preload classic menus, so that they don't suddenly pop-in when viewing
  26940. // the Select Menu dropdown.
  26941. useNavigationEntities();
  26942. const [showNavigationMenuStatusNotice, hideNavigationMenuStatusNotice] = use_navigation_notice({
  26943. name: 'block-library/core/navigation/status'
  26944. });
  26945. const [showClassicMenuConversionNotice, hideClassicMenuConversionNotice] = use_navigation_notice({
  26946. name: 'block-library/core/navigation/classic-menu-conversion'
  26947. });
  26948. const [showMenuAutoPublishDraftNotice, hideMenuAutoPublishDraftNotice] = use_navigation_notice({
  26949. name: 'block-library/core/navigation/auto-publish-draft'
  26950. });
  26951. const [showNavigationMenuPermissionsNotice, hideNavigationMenuPermissionsNotice] = use_navigation_notice({
  26952. name: 'block-library/core/navigation/permissions/update'
  26953. });
  26954. const {
  26955. create: createNavigationMenu,
  26956. status: createNavigationMenuStatus,
  26957. error: createNavigationMenuError,
  26958. value: createNavigationMenuPost,
  26959. isPending: isCreatingNavigationMenu,
  26960. isSuccess: createNavigationMenuIsSuccess,
  26961. isError: createNavigationMenuIsError
  26962. } = useCreateNavigationMenu(clientId);
  26963. const createUntitledEmptyNavigationMenu = () => {
  26964. createNavigationMenu('');
  26965. };
  26966. (0,external_wp_element_namespaceObject.useEffect)(() => {
  26967. hideNavigationMenuStatusNotice();
  26968. if (isCreatingNavigationMenu) {
  26969. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`));
  26970. }
  26971. if (createNavigationMenuIsSuccess) {
  26972. handleUpdateMenu(createNavigationMenuPost.id, {
  26973. focusNavigationBlock: true
  26974. });
  26975. showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`));
  26976. }
  26977. if (createNavigationMenuIsError) {
  26978. showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.'));
  26979. }
  26980. }, [createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost]);
  26981. const {
  26982. hasUncontrolledInnerBlocks,
  26983. uncontrolledInnerBlocks,
  26984. isInnerBlockSelected,
  26985. innerBlocks
  26986. } = useInnerBlocks(clientId);
  26987. const hasSubmenus = !!innerBlocks.find(block => block.name === 'core/navigation-submenu');
  26988. const {
  26989. replaceInnerBlocks,
  26990. selectBlock,
  26991. __unstableMarkNextChangeAsNotPersistent
  26992. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  26993. const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = (0,external_wp_element_namespaceObject.useState)(false);
  26994. const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false);
  26995. const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false);
  26996. const {
  26997. hasResolvedNavigationMenus,
  26998. isNavigationMenuResolved,
  26999. isNavigationMenuMissing,
  27000. navigationMenus,
  27001. navigationMenu,
  27002. canUserUpdateNavigationMenu,
  27003. hasResolvedCanUserUpdateNavigationMenu,
  27004. canUserDeleteNavigationMenu,
  27005. hasResolvedCanUserDeleteNavigationMenu,
  27006. canUserCreateNavigationMenu,
  27007. isResolvingCanUserCreateNavigationMenu,
  27008. hasResolvedCanUserCreateNavigationMenu
  27009. } = useNavigationMenu(ref);
  27010. const navMenuResolvedButMissing = hasResolvedNavigationMenus && isNavigationMenuMissing; // Attempt to retrieve and prioritize any existing navigation menu unless:
  27011. // - the are uncontrolled inner blocks already present in the block.
  27012. // - the user is creating a new menu.
  27013. // - there are no menus to choose from.
  27014. // This attempts to pick the first menu if there is a single Navigation Post. If more
  27015. // than 1 exists then use the most recent.
  27016. // The aim is for the block to "just work" from a user perspective using existing data.
  27017. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27018. if (hasUncontrolledInnerBlocks || isCreatingNavigationMenu || ref || !(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length)) {
  27019. return;
  27020. }
  27021. navigationMenus.sort((menuA, menuB) => {
  27022. const menuADate = new Date(menuA.date);
  27023. const menuBDate = new Date(menuB.date);
  27024. return menuADate.getTime() < menuBDate.getTime();
  27025. }); // Only autofallback to published menus.
  27026. const fallbackNavigationMenus = navigationMenus.filter(menu => menu.status === 'publish');
  27027. if (fallbackNavigationMenus.length === 0) return;
  27028. /**
  27029. * This fallback displays (both in editor and on front)
  27030. * a list of pages only if no menu (user assigned or
  27031. * automatically picked) is available.
  27032. * The fallback should not request a save (entity dirty state)
  27033. * nor to be undoable, hence why it is marked as non persistent
  27034. */
  27035. __unstableMarkNextChangeAsNotPersistent();
  27036. setRef(fallbackNavigationMenus[0].id);
  27037. }, [navigationMenus]);
  27038. const navRef = (0,external_wp_element_namespaceObject.useRef)();
  27039. const {
  27040. convert: convertClassicMenu,
  27041. status: classicMenuConversionStatus,
  27042. error: classicMenuConversionError
  27043. } = use_convert_classic_menu_to_block_menu(clientId);
  27044. const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; // The standard HTML5 tag for the block wrapper.
  27045. const TagName = 'nav'; // "placeholder" shown if:
  27046. // - there is no ref attribute pointing to a Navigation Post.
  27047. // - there is no classic menu conversion process in progress.
  27048. // - there is no menu creation process in progress.
  27049. // - there are no uncontrolled blocks.
  27050. const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && !hasUncontrolledInnerBlocks;
  27051. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27052. if (isPlaceholder && !ref) {
  27053. /**
  27054. * this fallback only displays (both in editor and on front)
  27055. * the list of pages block if no menu is available as a fallback.
  27056. * We don't want the fallback to request a save,
  27057. * nor to be undoable, hence we mark it non persistent.
  27058. */
  27059. __unstableMarkNextChangeAsNotPersistent();
  27060. replaceInnerBlocks(clientId, [(0,external_wp_blocks_namespaceObject.createBlock)('core/page-list')]);
  27061. }
  27062. }, [clientId, isPlaceholder, ref]);
  27063. const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; // "loading" state:
  27064. // - there is a menu creation process in progress.
  27065. // - there is a classic menu conversion process in progress.
  27066. // OR:
  27067. // - there is a ref attribute pointing to a Navigation Post
  27068. // - the Navigation Post isn't available (hasn't resolved) yet.
  27069. const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu);
  27070. const textDecoration = (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$typ = _attributes$style.typography) === null || _attributes$style$typ === void 0 ? void 0 : _attributes$style$typ.textDecoration;
  27071. const hasBlockOverlay = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockOverlayActive)(clientId);
  27072. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27073. ref: navRef,
  27074. className: classnames_default()(className, {
  27075. 'items-justified-right': justifyContent === 'right',
  27076. 'items-justified-space-between': justifyContent === 'space-between',
  27077. 'items-justified-left': justifyContent === 'left',
  27078. 'items-justified-center': justifyContent === 'center',
  27079. 'is-vertical': orientation === 'vertical',
  27080. 'no-wrap': flexWrap === 'nowrap',
  27081. 'is-responsive': 'never' !== overlayMenu,
  27082. 'has-text-color': !!textColor.color || !!(textColor !== null && textColor !== void 0 && textColor.class),
  27083. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
  27084. 'has-background': !!backgroundColor.color || backgroundColor.class,
  27085. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug),
  27086. [`has-text-decoration-${textDecoration}`]: textDecoration,
  27087. 'block-editor-block-content-overlay': hasBlockOverlay
  27088. }),
  27089. style: {
  27090. color: !(textColor !== null && textColor !== void 0 && textColor.slug) && (textColor === null || textColor === void 0 ? void 0 : textColor.color),
  27091. backgroundColor: !(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug) && (backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.color)
  27092. }
  27093. }); // Turn on contrast checker for web only since it's not supported on mobile yet.
  27094. const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web';
  27095. const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  27096. const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
  27097. const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  27098. const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)();
  27099. const handleUpdateMenu = function (menuId) {
  27100. let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  27101. focusNavigationBlock: false
  27102. };
  27103. const {
  27104. focusNavigationBlock
  27105. } = options;
  27106. setRef(menuId);
  27107. if (focusNavigationBlock) {
  27108. selectBlock(clientId);
  27109. }
  27110. };
  27111. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27112. hideClassicMenuConversionNotice();
  27113. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) {
  27114. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.'));
  27115. }
  27116. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) {
  27117. showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.'));
  27118. }
  27119. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
  27120. showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.'));
  27121. }
  27122. }, [classicMenuConversionStatus, classicMenuConversionError]); // Spacer block needs orientation from context. This is a patch until
  27123. // https://github.com/WordPress/gutenberg/issues/36197 is addressed.
  27124. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27125. if (orientation) {
  27126. __unstableMarkNextChangeAsNotPersistent();
  27127. setAttributes({
  27128. orientation
  27129. });
  27130. }
  27131. }, [orientation]);
  27132. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27133. var _navRef$current;
  27134. if (!enableContrastChecking) {
  27135. return;
  27136. }
  27137. detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor);
  27138. const subMenuElement = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');
  27139. if (subMenuElement) {
  27140. detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor);
  27141. }
  27142. });
  27143. (0,external_wp_element_namespaceObject.useEffect)(() => {
  27144. if (!isSelected && !isInnerBlockSelected) {
  27145. hideNavigationMenuPermissionsNotice();
  27146. }
  27147. if (isSelected || isInnerBlockSelected) {
  27148. if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) {
  27149. showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.'));
  27150. }
  27151. if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) {
  27152. showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.'));
  27153. }
  27154. }
  27155. }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref]);
  27156. const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu;
  27157. const isResponsive = 'never' !== overlayMenu;
  27158. const overlayMenuPreviewClasses = classnames_default()('wp-block-navigation__overlay-menu-preview', {
  27159. open: overlayMenuPreview
  27160. }); // Prompt the user to publish the menu they have set as a draft
  27161. const isDraftNavigationMenu = (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.status) === 'draft';
  27162. (0,external_wp_element_namespaceObject.useEffect)(async () => {
  27163. hideMenuAutoPublishDraftNotice();
  27164. if (!isDraftNavigationMenu) return;
  27165. try {
  27166. await editEntityRecord('postType', 'wp_navigation', navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.id, {
  27167. status: 'publish'
  27168. }, {
  27169. throwOnError: true
  27170. });
  27171. } catch {
  27172. showMenuAutoPublishDraftNotice((0,external_wp_i18n_namespaceObject.__)('Error ocurred while publishing the navigation menu.'));
  27173. }
  27174. }, [isDraftNavigationMenu, navigationMenu]);
  27175. const stylingInspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27176. title: (0,external_wp_i18n_namespaceObject.__)('Display')
  27177. }, isResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27178. className: overlayMenuPreviewClasses,
  27179. onClick: () => {
  27180. setOverlayMenuPreview(!overlayMenuPreview);
  27181. }
  27182. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, {
  27183. icon: icon
  27184. }), (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  27185. icon: library_close
  27186. })), !hasIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Menu')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Close')))), overlayMenuPreview && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuPreview, {
  27187. setAttributes: setAttributes,
  27188. hasIcon: hasIcon,
  27189. icon: icon
  27190. })), (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  27191. label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'),
  27192. value: overlayMenu,
  27193. help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'),
  27194. onChange: value => setAttributes({
  27195. overlayMenu: value
  27196. }),
  27197. isBlock: true,
  27198. hideLabelFromVision: true
  27199. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  27200. value: "never",
  27201. label: (0,external_wp_i18n_namespaceObject.__)('Off')
  27202. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  27203. value: "mobile",
  27204. label: (0,external_wp_i18n_namespaceObject.__)('Mobile')
  27205. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  27206. value: "always",
  27207. label: (0,external_wp_i18n_namespaceObject.__)('Always')
  27208. })), hasSubmenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27209. checked: openSubmenusOnClick,
  27210. onChange: value => {
  27211. setAttributes({
  27212. openSubmenusOnClick: value,
  27213. ...(value && {
  27214. showSubmenuIcon: true
  27215. }) // Make sure arrows are shown when we toggle this on.
  27216. });
  27217. },
  27218. label: (0,external_wp_i18n_namespaceObject.__)('Open on click')
  27219. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27220. checked: showSubmenuIcon,
  27221. onChange: value => {
  27222. setAttributes({
  27223. showSubmenuIcon: value
  27224. });
  27225. },
  27226. disabled: attributes.openSubmenusOnClick,
  27227. label: (0,external_wp_i18n_namespaceObject.__)('Show arrow')
  27228. }))), hasColorSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
  27229. __experimentalHasMultipleOrigins: true,
  27230. __experimentalIsRenderedInSidebar: true,
  27231. title: (0,external_wp_i18n_namespaceObject.__)('Color'),
  27232. initialOpen: false,
  27233. colorSettings: [{
  27234. value: textColor.color,
  27235. onChange: setTextColor,
  27236. label: (0,external_wp_i18n_namespaceObject.__)('Text')
  27237. }, {
  27238. value: backgroundColor.color,
  27239. onChange: setBackgroundColor,
  27240. label: (0,external_wp_i18n_namespaceObject.__)('Background')
  27241. }, {
  27242. value: overlayTextColor.color,
  27243. onChange: setOverlayTextColor,
  27244. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text')
  27245. }, {
  27246. value: overlayBackgroundColor.color,
  27247. onChange: setOverlayBackgroundColor,
  27248. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background')
  27249. }]
  27250. }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  27251. backgroundColor: detectedBackgroundColor,
  27252. textColor: detectedColor
  27253. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  27254. backgroundColor: detectedOverlayBackgroundColor,
  27255. textColor: detectedOverlayColor
  27256. })))); // If the block has inner blocks, but no menu id, then these blocks are either:
  27257. // - inserted via a pattern.
  27258. // - inserted directly via Code View (or otherwise).
  27259. // - from an older version of navigation block added before the block used a wp_navigation entity.
  27260. // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks,
  27261. // that automatically saves the menu as an entity when changes are made to the inner blocks.
  27262. const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable;
  27263. if (hasUnsavedBlocks) {
  27264. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27265. title: (0,external_wp_i18n_namespaceObject.__)('Menu')
  27266. }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  27267. currentMenuId: ref,
  27268. clientId: clientId,
  27269. onSelectNavigationMenu: menuId => {
  27270. handleUpdateMenu(menuId);
  27271. },
  27272. onSelectClassicMenu: async classicMenu => {
  27273. const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name);
  27274. if (navMenu) {
  27275. handleUpdateMenu(navMenu.id, {
  27276. focusNavigationBlock: true
  27277. });
  27278. }
  27279. },
  27280. onCreateNew: createUntitledEmptyNavigationMenu,
  27281. createNavigationMenuIsSuccess: createNavigationMenuIsSuccess
  27282. /* translators: %s: The name of a menu. */
  27283. ,
  27284. actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'")
  27285. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27286. variant: "link",
  27287. disabled: !hasManagePermissions || !hasResolvedNavigationMenus,
  27288. href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
  27289. post_type: 'wp_navigation'
  27290. })
  27291. }, (0,external_wp_i18n_namespaceObject.__)('Manage menus')))), stylingInspectorControls, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  27292. id: clientId,
  27293. onToggle: setResponsiveMenuVisibility,
  27294. isOpen: isResponsiveMenuOpen,
  27295. hasIcon: hasIcon,
  27296. icon: icon,
  27297. isResponsive: 'never' !== overlayMenu,
  27298. isHiddenByDefault: 'always' === overlayMenu,
  27299. overlayBackgroundColor: overlayBackgroundColor,
  27300. overlayTextColor: overlayTextColor
  27301. }, (0,external_wp_element_namespaceObject.createElement)(UnsavedInnerBlocks, {
  27302. blocks: uncontrolledInnerBlocks,
  27303. clientId: clientId,
  27304. navigationMenus: navigationMenus,
  27305. hasSelection: isSelected || isInnerBlockSelected,
  27306. hasSavedUnsavedInnerBlocks: hasSavedUnsavedInnerBlocks,
  27307. onSave: post => {
  27308. // Set some state used as a guard to prevent the creation of multiple posts.
  27309. setHasSavedUnsavedInnerBlocks(true); // Switch to using the wp_navigation entity.
  27310. setRef(post.id);
  27311. showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)(`New Navigation Menu created.`));
  27312. }
  27313. })));
  27314. } // Show a warning if the selected menu is no longer available.
  27315. // TODO - the user should be able to select a new one?
  27316. if (ref && isNavigationMenuMissing) {
  27317. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27318. title: (0,external_wp_i18n_namespaceObject.__)('Menu')
  27319. }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  27320. currentMenuId: null,
  27321. clientId: clientId,
  27322. onSelectNavigationMenu: menuId => {
  27323. handleUpdateMenu(menuId);
  27324. },
  27325. onSelectClassicMenu: async classicMenu => {
  27326. const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name);
  27327. if (navMenu) {
  27328. handleUpdateMenu(navMenu.id, {
  27329. focusNavigationBlock: true
  27330. });
  27331. }
  27332. },
  27333. onCreateNew: createUntitledEmptyNavigationMenu,
  27334. createNavigationMenuIsSuccess: createNavigationMenuIsSuccess
  27335. /* translators: %s: The name of a menu. */
  27336. ,
  27337. actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'")
  27338. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27339. variant: "link",
  27340. disabled: !hasManagePermissions || !hasResolvedNavigationMenus,
  27341. href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
  27342. post_type: 'wp_navigation'
  27343. })
  27344. }, (0,external_wp_i18n_namespaceObject.__)('Manage menus')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27345. onClick: createUntitledEmptyNavigationMenu,
  27346. variant: "link"
  27347. }, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?'))));
  27348. }
  27349. if (isEntityAvailable && hasAlreadyRendered) {
  27350. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  27351. }
  27352. const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder;
  27353. /**
  27354. * Historically the navigation block has supported custom placeholders.
  27355. * Even though the current UX tries as hard as possible not to
  27356. * end up in a placeholder state, the block continues to support
  27357. * this extensibility point, via a CustomPlaceholder.
  27358. * When CustomPlaceholder is present it becomes the default fallback
  27359. * for an empty navigation block, instead of the default fallbacks.
  27360. *
  27361. */
  27362. if (isPlaceholder && CustomPlaceholder) {
  27363. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(PlaceholderComponent, {
  27364. isSelected: isSelected,
  27365. currentMenuId: ref,
  27366. clientId: clientId,
  27367. canUserCreateNavigationMenu: canUserCreateNavigationMenu,
  27368. isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu,
  27369. onSelectNavigationMenu: menuId => {
  27370. handleUpdateMenu(menuId);
  27371. },
  27372. onSelectClassicMenu: async classicMenu => {
  27373. const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name);
  27374. if (navMenu) {
  27375. handleUpdateMenu(navMenu.id, {
  27376. focusNavigationBlock: true
  27377. });
  27378. }
  27379. },
  27380. onCreateEmpty: createUntitledEmptyNavigationMenu
  27381. }));
  27382. }
  27383. return (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
  27384. kind: "postType",
  27385. type: "wp_navigation",
  27386. id: ref
  27387. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalRecursionProvider, {
  27388. uniqueId: recursionId
  27389. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27390. title: (0,external_wp_i18n_namespaceObject.__)('Menu')
  27391. }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  27392. currentMenuId: ref,
  27393. clientId: clientId,
  27394. onSelectNavigationMenu: menuId => {
  27395. handleUpdateMenu(menuId);
  27396. },
  27397. onSelectClassicMenu: async classicMenu => {
  27398. const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name);
  27399. if (navMenu) {
  27400. handleUpdateMenu(navMenu.id, {
  27401. focusNavigationBlock: true
  27402. });
  27403. }
  27404. },
  27405. onCreateNew: createUntitledEmptyNavigationMenu,
  27406. createNavigationMenuIsSuccess: createNavigationMenuIsSuccess,
  27407. createNavigationMenuIsError: createNavigationMenuIsError
  27408. /* translators: %s: The name of a menu. */
  27409. ,
  27410. actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'")
  27411. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  27412. variant: "link",
  27413. disabled: !hasManagePermissions || !hasResolvedNavigationMenus,
  27414. href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
  27415. post_type: 'wp_navigation'
  27416. })
  27417. }, (0,external_wp_i18n_namespaceObject.__)('Manage menus')))), stylingInspectorControls, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  27418. __experimentalGroup: "advanced"
  27419. }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
  27420. onDelete: function () {
  27421. let deletedMenuTitle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  27422. replaceInnerBlocks(clientId, []);
  27423. showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  27424. (0,external_wp_i18n_namespaceObject.__)('Navigation menu %s successfully deleted.'), deletedMenuTitle));
  27425. }
  27426. })), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
  27427. className: "wp-block-navigation__loading-indicator"
  27428. })), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  27429. id: clientId,
  27430. onToggle: setResponsiveMenuVisibility,
  27431. label: (0,external_wp_i18n_namespaceObject.__)('Menu'),
  27432. hasIcon: hasIcon,
  27433. icon: icon,
  27434. isOpen: isResponsiveMenuOpen,
  27435. isResponsive: isResponsive,
  27436. isHiddenByDefault: 'always' === overlayMenu,
  27437. overlayBackgroundColor: overlayBackgroundColor,
  27438. overlayTextColor: overlayTextColor
  27439. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(NavigationInnerBlocks, {
  27440. clientId: clientId,
  27441. hasCustomPlaceholder: !!CustomPlaceholder,
  27442. orientation: orientation
  27443. })))));
  27444. }
  27445. /* harmony default export */ var navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
  27446. textColor: 'color'
  27447. }, {
  27448. backgroundColor: 'color'
  27449. }, {
  27450. overlayBackgroundColor: 'color'
  27451. }, {
  27452. overlayTextColor: 'color'
  27453. })(Navigation));
  27454. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
  27455. /**
  27456. * WordPress dependencies
  27457. */
  27458. function navigation_save_save(_ref) {
  27459. let {
  27460. attributes
  27461. } = _ref;
  27462. if (attributes.ref) {
  27463. // Avoid rendering inner blocks when a ref is defined.
  27464. // When this id is defined the inner blocks are loaded from the
  27465. // `wp_navigation` entity rather than the hard-coded block html.
  27466. return;
  27467. }
  27468. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27469. }
  27470. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
  27471. /**
  27472. * External dependencies
  27473. */
  27474. /**
  27475. * WordPress dependencies
  27476. */
  27477. /**
  27478. * Internal dependencies
  27479. */
  27480. const TYPOGRAPHY_PRESET_DEPRECATION_MAP = {
  27481. fontStyle: 'var:preset|font-style|',
  27482. fontWeight: 'var:preset|font-weight|',
  27483. textDecoration: 'var:preset|text-decoration|',
  27484. textTransform: 'var:preset|text-transform|'
  27485. };
  27486. const migrateIdToRef = _ref => {
  27487. let {
  27488. navigationMenuId,
  27489. ...attributes
  27490. } = _ref;
  27491. return { ...attributes,
  27492. ref: navigationMenuId
  27493. };
  27494. };
  27495. const deprecated_migrateWithLayout = attributes => {
  27496. if (!!attributes.layout) {
  27497. return attributes;
  27498. }
  27499. const {
  27500. itemsJustification,
  27501. orientation,
  27502. ...updatedAttributes
  27503. } = attributes;
  27504. if (itemsJustification || orientation) {
  27505. Object.assign(updatedAttributes, {
  27506. layout: {
  27507. type: 'flex',
  27508. ...(itemsJustification && {
  27509. justifyContent: itemsJustification
  27510. }),
  27511. ...(orientation && {
  27512. orientation
  27513. })
  27514. }
  27515. });
  27516. }
  27517. return updatedAttributes;
  27518. };
  27519. const navigation_deprecated_v6 = {
  27520. attributes: {
  27521. navigationMenuId: {
  27522. type: 'number'
  27523. },
  27524. textColor: {
  27525. type: 'string'
  27526. },
  27527. customTextColor: {
  27528. type: 'string'
  27529. },
  27530. rgbTextColor: {
  27531. type: 'string'
  27532. },
  27533. backgroundColor: {
  27534. type: 'string'
  27535. },
  27536. customBackgroundColor: {
  27537. type: 'string'
  27538. },
  27539. rgbBackgroundColor: {
  27540. type: 'string'
  27541. },
  27542. showSubmenuIcon: {
  27543. type: 'boolean',
  27544. default: true
  27545. },
  27546. openSubmenusOnClick: {
  27547. type: 'boolean',
  27548. default: false
  27549. },
  27550. overlayMenu: {
  27551. type: 'string',
  27552. default: 'mobile'
  27553. },
  27554. __unstableLocation: {
  27555. type: 'string'
  27556. },
  27557. overlayBackgroundColor: {
  27558. type: 'string'
  27559. },
  27560. customOverlayBackgroundColor: {
  27561. type: 'string'
  27562. },
  27563. overlayTextColor: {
  27564. type: 'string'
  27565. },
  27566. customOverlayTextColor: {
  27567. type: 'string'
  27568. }
  27569. },
  27570. supports: {
  27571. align: ['wide', 'full'],
  27572. anchor: true,
  27573. html: false,
  27574. inserter: true,
  27575. typography: {
  27576. fontSize: true,
  27577. lineHeight: true,
  27578. __experimentalFontStyle: true,
  27579. __experimentalFontWeight: true,
  27580. __experimentalTextTransform: true,
  27581. __experimentalFontFamily: true,
  27582. __experimentalTextDecoration: true,
  27583. __experimentalDefaultControls: {
  27584. fontSize: true
  27585. }
  27586. },
  27587. spacing: {
  27588. blockGap: true,
  27589. units: ['px', 'em', 'rem', 'vh', 'vw'],
  27590. __experimentalDefaultControls: {
  27591. blockGap: true
  27592. }
  27593. },
  27594. __experimentalLayout: {
  27595. allowSwitching: false,
  27596. allowInheriting: false,
  27597. default: {
  27598. type: 'flex'
  27599. }
  27600. }
  27601. },
  27602. save() {
  27603. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27604. },
  27605. isEligible: _ref2 => {
  27606. let {
  27607. navigationMenuId
  27608. } = _ref2;
  27609. return !!navigationMenuId;
  27610. },
  27611. migrate: migrateIdToRef
  27612. };
  27613. const navigation_deprecated_v5 = {
  27614. attributes: {
  27615. navigationMenuId: {
  27616. type: 'number'
  27617. },
  27618. orientation: {
  27619. type: 'string',
  27620. default: 'horizontal'
  27621. },
  27622. textColor: {
  27623. type: 'string'
  27624. },
  27625. customTextColor: {
  27626. type: 'string'
  27627. },
  27628. rgbTextColor: {
  27629. type: 'string'
  27630. },
  27631. backgroundColor: {
  27632. type: 'string'
  27633. },
  27634. customBackgroundColor: {
  27635. type: 'string'
  27636. },
  27637. rgbBackgroundColor: {
  27638. type: 'string'
  27639. },
  27640. itemsJustification: {
  27641. type: 'string'
  27642. },
  27643. showSubmenuIcon: {
  27644. type: 'boolean',
  27645. default: true
  27646. },
  27647. openSubmenusOnClick: {
  27648. type: 'boolean',
  27649. default: false
  27650. },
  27651. overlayMenu: {
  27652. type: 'string',
  27653. default: 'never'
  27654. },
  27655. __unstableLocation: {
  27656. type: 'string'
  27657. },
  27658. overlayBackgroundColor: {
  27659. type: 'string'
  27660. },
  27661. customOverlayBackgroundColor: {
  27662. type: 'string'
  27663. },
  27664. overlayTextColor: {
  27665. type: 'string'
  27666. },
  27667. customOverlayTextColor: {
  27668. type: 'string'
  27669. }
  27670. },
  27671. supports: {
  27672. align: ['wide', 'full'],
  27673. anchor: true,
  27674. html: false,
  27675. inserter: true,
  27676. typography: {
  27677. fontSize: true,
  27678. lineHeight: true,
  27679. __experimentalFontStyle: true,
  27680. __experimentalFontWeight: true,
  27681. __experimentalTextTransform: true,
  27682. __experimentalFontFamily: true,
  27683. __experimentalTextDecoration: true,
  27684. __experimentalDefaultControls: {
  27685. fontSize: true
  27686. }
  27687. },
  27688. spacing: {
  27689. blockGap: true,
  27690. units: ['px', 'em', 'rem', 'vh', 'vw'],
  27691. __experimentalDefaultControls: {
  27692. blockGap: true
  27693. }
  27694. }
  27695. },
  27696. save() {
  27697. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27698. },
  27699. isEligible: _ref3 => {
  27700. let {
  27701. itemsJustification,
  27702. orientation
  27703. } = _ref3;
  27704. return !!itemsJustification || !!orientation;
  27705. },
  27706. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout)
  27707. };
  27708. const navigation_deprecated_v4 = {
  27709. attributes: {
  27710. orientation: {
  27711. type: 'string',
  27712. default: 'horizontal'
  27713. },
  27714. textColor: {
  27715. type: 'string'
  27716. },
  27717. customTextColor: {
  27718. type: 'string'
  27719. },
  27720. rgbTextColor: {
  27721. type: 'string'
  27722. },
  27723. backgroundColor: {
  27724. type: 'string'
  27725. },
  27726. customBackgroundColor: {
  27727. type: 'string'
  27728. },
  27729. rgbBackgroundColor: {
  27730. type: 'string'
  27731. },
  27732. itemsJustification: {
  27733. type: 'string'
  27734. },
  27735. showSubmenuIcon: {
  27736. type: 'boolean',
  27737. default: true
  27738. },
  27739. openSubmenusOnClick: {
  27740. type: 'boolean',
  27741. default: false
  27742. },
  27743. overlayMenu: {
  27744. type: 'string',
  27745. default: 'never'
  27746. },
  27747. __unstableLocation: {
  27748. type: 'string'
  27749. },
  27750. overlayBackgroundColor: {
  27751. type: 'string'
  27752. },
  27753. customOverlayBackgroundColor: {
  27754. type: 'string'
  27755. },
  27756. overlayTextColor: {
  27757. type: 'string'
  27758. },
  27759. customOverlayTextColor: {
  27760. type: 'string'
  27761. }
  27762. },
  27763. supports: {
  27764. align: ['wide', 'full'],
  27765. anchor: true,
  27766. html: false,
  27767. inserter: true,
  27768. typography: {
  27769. fontSize: true,
  27770. lineHeight: true,
  27771. __experimentalFontStyle: true,
  27772. __experimentalFontWeight: true,
  27773. __experimentalTextTransform: true,
  27774. __experimentalFontFamily: true,
  27775. __experimentalTextDecoration: true
  27776. },
  27777. spacing: {
  27778. blockGap: true,
  27779. units: ['px', 'em', 'rem', 'vh', 'vw'],
  27780. __experimentalDefaultControls: {
  27781. blockGap: true
  27782. }
  27783. }
  27784. },
  27785. save() {
  27786. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27787. },
  27788. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
  27789. isEligible(_ref4) {
  27790. var _style$typography;
  27791. let {
  27792. style
  27793. } = _ref4;
  27794. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  27795. }
  27796. };
  27797. const migrateIsResponsive = function (attributes) {
  27798. delete attributes.isResponsive;
  27799. return { ...attributes,
  27800. overlayMenu: 'mobile'
  27801. };
  27802. };
  27803. const migrateTypographyPresets = function (attributes) {
  27804. return { ...attributes,
  27805. style: { ...attributes.style,
  27806. typography: (0,external_lodash_namespaceObject.mapValues)(attributes.style.typography, (value, key) => {
  27807. const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key];
  27808. if (prefix && value.startsWith(prefix)) {
  27809. const newValue = value.slice(prefix.length);
  27810. if ('textDecoration' === key && 'strikethrough' === newValue) {
  27811. return 'line-through';
  27812. }
  27813. return newValue;
  27814. }
  27815. return value;
  27816. })
  27817. }
  27818. };
  27819. };
  27820. const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, // Remove `isResponsive` attribute.
  27821. {
  27822. attributes: {
  27823. orientation: {
  27824. type: 'string',
  27825. default: 'horizontal'
  27826. },
  27827. textColor: {
  27828. type: 'string'
  27829. },
  27830. customTextColor: {
  27831. type: 'string'
  27832. },
  27833. rgbTextColor: {
  27834. type: 'string'
  27835. },
  27836. backgroundColor: {
  27837. type: 'string'
  27838. },
  27839. customBackgroundColor: {
  27840. type: 'string'
  27841. },
  27842. rgbBackgroundColor: {
  27843. type: 'string'
  27844. },
  27845. itemsJustification: {
  27846. type: 'string'
  27847. },
  27848. showSubmenuIcon: {
  27849. type: 'boolean',
  27850. default: true
  27851. },
  27852. openSubmenusOnClick: {
  27853. type: 'boolean',
  27854. default: false
  27855. },
  27856. isResponsive: {
  27857. type: 'boolean',
  27858. default: 'false'
  27859. },
  27860. __unstableLocation: {
  27861. type: 'string'
  27862. },
  27863. overlayBackgroundColor: {
  27864. type: 'string'
  27865. },
  27866. customOverlayBackgroundColor: {
  27867. type: 'string'
  27868. },
  27869. overlayTextColor: {
  27870. type: 'string'
  27871. },
  27872. customOverlayTextColor: {
  27873. type: 'string'
  27874. }
  27875. },
  27876. supports: {
  27877. align: ['wide', 'full'],
  27878. anchor: true,
  27879. html: false,
  27880. inserter: true,
  27881. typography: {
  27882. fontSize: true,
  27883. lineHeight: true,
  27884. __experimentalFontStyle: true,
  27885. __experimentalFontWeight: true,
  27886. __experimentalTextTransform: true,
  27887. __experimentalFontFamily: true,
  27888. __experimentalTextDecoration: true
  27889. }
  27890. },
  27891. isEligible(attributes) {
  27892. return attributes.isResponsive;
  27893. },
  27894. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
  27895. save() {
  27896. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27897. }
  27898. }, {
  27899. attributes: {
  27900. orientation: {
  27901. type: 'string'
  27902. },
  27903. textColor: {
  27904. type: 'string'
  27905. },
  27906. customTextColor: {
  27907. type: 'string'
  27908. },
  27909. rgbTextColor: {
  27910. type: 'string'
  27911. },
  27912. backgroundColor: {
  27913. type: 'string'
  27914. },
  27915. customBackgroundColor: {
  27916. type: 'string'
  27917. },
  27918. rgbBackgroundColor: {
  27919. type: 'string'
  27920. },
  27921. itemsJustification: {
  27922. type: 'string'
  27923. },
  27924. showSubmenuIcon: {
  27925. type: 'boolean',
  27926. default: true
  27927. }
  27928. },
  27929. supports: {
  27930. align: ['wide', 'full'],
  27931. anchor: true,
  27932. html: false,
  27933. inserter: true,
  27934. fontSize: true,
  27935. __experimentalFontStyle: true,
  27936. __experimentalFontWeight: true,
  27937. __experimentalTextTransform: true,
  27938. color: true,
  27939. __experimentalFontFamily: true,
  27940. __experimentalTextDecoration: true
  27941. },
  27942. save() {
  27943. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  27944. },
  27945. isEligible(attributes) {
  27946. if (!attributes.style || !attributes.style.typography) {
  27947. return false;
  27948. }
  27949. for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) {
  27950. const attributeValue = attributes.style.typography[styleAttribute];
  27951. if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) {
  27952. return true;
  27953. }
  27954. }
  27955. return false;
  27956. },
  27957. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
  27958. }, {
  27959. attributes: {
  27960. className: {
  27961. type: 'string'
  27962. },
  27963. textColor: {
  27964. type: 'string'
  27965. },
  27966. rgbTextColor: {
  27967. type: 'string'
  27968. },
  27969. backgroundColor: {
  27970. type: 'string'
  27971. },
  27972. rgbBackgroundColor: {
  27973. type: 'string'
  27974. },
  27975. fontSize: {
  27976. type: 'string'
  27977. },
  27978. customFontSize: {
  27979. type: 'number'
  27980. },
  27981. itemsJustification: {
  27982. type: 'string'
  27983. },
  27984. showSubmenuIcon: {
  27985. type: 'boolean'
  27986. }
  27987. },
  27988. isEligible(attribute) {
  27989. return attribute.rgbTextColor || attribute.rgbBackgroundColor;
  27990. },
  27991. supports: {
  27992. align: ['wide', 'full'],
  27993. anchor: true,
  27994. html: false,
  27995. inserter: true
  27996. },
  27997. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => {
  27998. const {
  27999. rgbTextColor,
  28000. rgbBackgroundColor,
  28001. ...restAttributes
  28002. } = attributes;
  28003. return { ...restAttributes,
  28004. customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor,
  28005. customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor
  28006. };
  28007. }),
  28008. save() {
  28009. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  28010. }
  28011. }];
  28012. /* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);
  28013. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  28014. /**
  28015. * WordPress dependencies
  28016. */
  28017. /**
  28018. * Internal dependencies
  28019. */
  28020. const navigation_metadata = {
  28021. $schema: "https://schemas.wp.org/trunk/block.json",
  28022. apiVersion: 2,
  28023. name: "core/navigation",
  28024. title: "Navigation",
  28025. category: "theme",
  28026. description: "A collection of blocks that allow visitors to get around your site.",
  28027. keywords: ["menu", "navigation", "links"],
  28028. textdomain: "default",
  28029. attributes: {
  28030. ref: {
  28031. type: "number"
  28032. },
  28033. textColor: {
  28034. type: "string"
  28035. },
  28036. customTextColor: {
  28037. type: "string"
  28038. },
  28039. rgbTextColor: {
  28040. type: "string"
  28041. },
  28042. backgroundColor: {
  28043. type: "string"
  28044. },
  28045. customBackgroundColor: {
  28046. type: "string"
  28047. },
  28048. rgbBackgroundColor: {
  28049. type: "string"
  28050. },
  28051. showSubmenuIcon: {
  28052. type: "boolean",
  28053. "default": true
  28054. },
  28055. openSubmenusOnClick: {
  28056. type: "boolean",
  28057. "default": false
  28058. },
  28059. overlayMenu: {
  28060. type: "string",
  28061. "default": "mobile"
  28062. },
  28063. icon: {
  28064. type: "string",
  28065. "default": "handle"
  28066. },
  28067. hasIcon: {
  28068. type: "boolean",
  28069. "default": true
  28070. },
  28071. __unstableLocation: {
  28072. type: "string"
  28073. },
  28074. overlayBackgroundColor: {
  28075. type: "string"
  28076. },
  28077. customOverlayBackgroundColor: {
  28078. type: "string"
  28079. },
  28080. overlayTextColor: {
  28081. type: "string"
  28082. },
  28083. customOverlayTextColor: {
  28084. type: "string"
  28085. },
  28086. maxNestingLevel: {
  28087. type: "number",
  28088. "default": 5
  28089. }
  28090. },
  28091. providesContext: {
  28092. textColor: "textColor",
  28093. customTextColor: "customTextColor",
  28094. backgroundColor: "backgroundColor",
  28095. customBackgroundColor: "customBackgroundColor",
  28096. overlayTextColor: "overlayTextColor",
  28097. customOverlayTextColor: "customOverlayTextColor",
  28098. overlayBackgroundColor: "overlayBackgroundColor",
  28099. customOverlayBackgroundColor: "customOverlayBackgroundColor",
  28100. fontSize: "fontSize",
  28101. customFontSize: "customFontSize",
  28102. showSubmenuIcon: "showSubmenuIcon",
  28103. openSubmenusOnClick: "openSubmenusOnClick",
  28104. style: "style",
  28105. orientation: "orientation",
  28106. maxNestingLevel: "maxNestingLevel"
  28107. },
  28108. supports: {
  28109. align: ["wide", "full"],
  28110. html: false,
  28111. inserter: true,
  28112. typography: {
  28113. fontSize: true,
  28114. lineHeight: true,
  28115. __experimentalFontStyle: true,
  28116. __experimentalFontWeight: true,
  28117. __experimentalTextTransform: true,
  28118. __experimentalFontFamily: true,
  28119. __experimentalLetterSpacing: true,
  28120. __experimentalTextDecoration: true,
  28121. __experimentalSkipSerialization: ["textDecoration"],
  28122. __experimentalDefaultControls: {
  28123. fontSize: true
  28124. }
  28125. },
  28126. spacing: {
  28127. blockGap: true,
  28128. units: ["px", "em", "rem", "vh", "vw"],
  28129. __experimentalDefaultControls: {
  28130. blockGap: true
  28131. }
  28132. },
  28133. __experimentalLayout: {
  28134. allowSwitching: false,
  28135. allowInheriting: false,
  28136. allowVerticalAlignment: false,
  28137. "default": {
  28138. type: "flex"
  28139. }
  28140. },
  28141. __experimentalStyle: {
  28142. elements: {
  28143. link: {
  28144. color: {
  28145. text: "inherit"
  28146. }
  28147. }
  28148. }
  28149. }
  28150. },
  28151. viewScript: ["file:./view.min.js", "file:./view-modal.min.js"],
  28152. editorStyle: "wp-block-navigation-editor",
  28153. style: "wp-block-navigation"
  28154. };
  28155. const {
  28156. name: navigation_name
  28157. } = navigation_metadata;
  28158. const navigation_settings = {
  28159. icon: library_navigation,
  28160. example: {
  28161. innerBlocks: [{
  28162. name: 'core/navigation-link',
  28163. attributes: {
  28164. // translators: 'Home' as in a website's home page.
  28165. label: (0,external_wp_i18n_namespaceObject.__)('Home'),
  28166. url: 'https://make.wordpress.org/'
  28167. }
  28168. }, {
  28169. name: 'core/navigation-link',
  28170. attributes: {
  28171. // translators: 'About' as in a website's about page.
  28172. label: (0,external_wp_i18n_namespaceObject.__)('About'),
  28173. url: 'https://make.wordpress.org/'
  28174. }
  28175. }, {
  28176. name: 'core/navigation-link',
  28177. attributes: {
  28178. // translators: 'Contact' as in a website's contact page.
  28179. label: (0,external_wp_i18n_namespaceObject.__)('Contact'),
  28180. url: 'https://make.wordpress.org/'
  28181. }
  28182. }]
  28183. },
  28184. edit: navigation_edit,
  28185. save: navigation_save_save,
  28186. deprecated: navigation_deprecated
  28187. };
  28188. const navigation_init = () => initBlock({
  28189. name: navigation_name,
  28190. metadata: navigation_metadata,
  28191. settings: navigation_settings
  28192. });
  28193. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
  28194. /**
  28195. * WordPress dependencies
  28196. */
  28197. const customLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28198. xmlns: "https://www.w3.org/2000/svg",
  28199. viewBox: "0 0 24 24"
  28200. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28201. d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"
  28202. }));
  28203. /* harmony default export */ var custom_link = (customLink);
  28204. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
  28205. /**
  28206. * WordPress dependencies
  28207. */
  28208. const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28209. xmlns: "http://www.w3.org/2000/svg",
  28210. viewBox: "0 0 24 24"
  28211. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28212. d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
  28213. }));
  28214. /* harmony default export */ var add_submenu = (addSubmenu);
  28215. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
  28216. /**
  28217. * External dependencies
  28218. */
  28219. /**
  28220. * WordPress dependencies
  28221. */
  28222. /**
  28223. * Internal dependencies
  28224. */
  28225. const {
  28226. name: edit_name
  28227. } = {
  28228. $schema: "https://schemas.wp.org/trunk/block.json",
  28229. apiVersion: 2,
  28230. name: "core/navigation-link",
  28231. title: "Custom Link",
  28232. category: "design",
  28233. parent: ["core/navigation"],
  28234. description: "Add a page, link, or another item to your navigation.",
  28235. textdomain: "default",
  28236. attributes: {
  28237. label: {
  28238. type: "string"
  28239. },
  28240. type: {
  28241. type: "string"
  28242. },
  28243. description: {
  28244. type: "string"
  28245. },
  28246. rel: {
  28247. type: "string"
  28248. },
  28249. id: {
  28250. type: "number"
  28251. },
  28252. opensInNewTab: {
  28253. type: "boolean",
  28254. "default": false
  28255. },
  28256. url: {
  28257. type: "string"
  28258. },
  28259. title: {
  28260. type: "string"
  28261. },
  28262. kind: {
  28263. type: "string"
  28264. },
  28265. isTopLevelLink: {
  28266. type: "boolean"
  28267. }
  28268. },
  28269. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  28270. supports: {
  28271. reusable: false,
  28272. html: false,
  28273. __experimentalSlashInserter: true,
  28274. typography: {
  28275. fontSize: true,
  28276. lineHeight: true,
  28277. __experimentalFontFamily: true,
  28278. __experimentalFontWeight: true,
  28279. __experimentalFontStyle: true,
  28280. __experimentalTextTransform: true,
  28281. __experimentalTextDecoration: true,
  28282. __experimentalLetterSpacing: true,
  28283. __experimentalDefaultControls: {
  28284. fontSize: true
  28285. }
  28286. }
  28287. },
  28288. editorStyle: "wp-block-navigation-link-editor",
  28289. style: "wp-block-navigation-link"
  28290. };
  28291. /**
  28292. * A React hook to determine if it's dragging within the target element.
  28293. *
  28294. * @typedef {import('@wordpress/element').RefObject} RefObject
  28295. *
  28296. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  28297. *
  28298. * @return {boolean} Is dragging within the target element.
  28299. */
  28300. const useIsDraggingWithin = elementRef => {
  28301. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  28302. (0,external_wp_element_namespaceObject.useEffect)(() => {
  28303. const {
  28304. ownerDocument
  28305. } = elementRef.current;
  28306. function handleDragStart(event) {
  28307. // Check the first time when the dragging starts.
  28308. handleDragEnter(event);
  28309. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  28310. function handleDragEnd() {
  28311. setIsDraggingWithin(false);
  28312. }
  28313. function handleDragEnter(event) {
  28314. // Check if the current target is inside the item element.
  28315. if (elementRef.current.contains(event.target)) {
  28316. setIsDraggingWithin(true);
  28317. } else {
  28318. setIsDraggingWithin(false);
  28319. }
  28320. } // Bind these events to the document to catch all drag events.
  28321. // Ideally, we can also use `event.relatedTarget`, but sadly that
  28322. // doesn't work in Safari.
  28323. ownerDocument.addEventListener('dragstart', handleDragStart);
  28324. ownerDocument.addEventListener('dragend', handleDragEnd);
  28325. ownerDocument.addEventListener('dragenter', handleDragEnter);
  28326. return () => {
  28327. ownerDocument.removeEventListener('dragstart', handleDragStart);
  28328. ownerDocument.removeEventListener('dragend', handleDragEnd);
  28329. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  28330. };
  28331. }, []);
  28332. return isDraggingWithin;
  28333. };
  28334. /**
  28335. * Given the Link block's type attribute, return the query params to give to
  28336. * /wp/v2/search.
  28337. *
  28338. * @param {string} type Link block's type attribute.
  28339. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  28340. * @return {{ type?: string, subtype?: string }} Search query params.
  28341. */
  28342. function getSuggestionsQuery(type, kind) {
  28343. switch (type) {
  28344. case 'post':
  28345. case 'page':
  28346. return {
  28347. type: 'post',
  28348. subtype: type
  28349. };
  28350. case 'category':
  28351. return {
  28352. type: 'term',
  28353. subtype: 'category'
  28354. };
  28355. case 'tag':
  28356. return {
  28357. type: 'term',
  28358. subtype: 'post_tag'
  28359. };
  28360. case 'post_format':
  28361. return {
  28362. type: 'post-format'
  28363. };
  28364. default:
  28365. if (kind === 'taxonomy') {
  28366. return {
  28367. type: 'term',
  28368. subtype: type
  28369. };
  28370. }
  28371. if (kind === 'post-type') {
  28372. return {
  28373. type: 'post',
  28374. subtype: type
  28375. };
  28376. }
  28377. return {};
  28378. }
  28379. }
  28380. /**
  28381. * Determine the colors for a menu.
  28382. *
  28383. * Order of priority is:
  28384. * 1: Overlay custom colors (if submenu)
  28385. * 2: Overlay theme colors (if submenu)
  28386. * 3: Custom colors
  28387. * 4: Theme colors
  28388. * 5: Global styles
  28389. *
  28390. * @param {Object} context
  28391. * @param {boolean} isSubMenu
  28392. */
  28393. function getColors(context, isSubMenu) {
  28394. var _style$color, _style$color2;
  28395. const {
  28396. textColor,
  28397. customTextColor,
  28398. backgroundColor,
  28399. customBackgroundColor,
  28400. overlayTextColor,
  28401. customOverlayTextColor,
  28402. overlayBackgroundColor,
  28403. customOverlayBackgroundColor,
  28404. style
  28405. } = context;
  28406. const colors = {};
  28407. if (isSubMenu && !!customOverlayTextColor) {
  28408. colors.customTextColor = customOverlayTextColor;
  28409. } else if (isSubMenu && !!overlayTextColor) {
  28410. colors.textColor = overlayTextColor;
  28411. } else if (!!customTextColor) {
  28412. colors.customTextColor = customTextColor;
  28413. } else if (!!textColor) {
  28414. colors.textColor = textColor;
  28415. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  28416. colors.customTextColor = style.color.text;
  28417. }
  28418. if (isSubMenu && !!customOverlayBackgroundColor) {
  28419. colors.customBackgroundColor = customOverlayBackgroundColor;
  28420. } else if (isSubMenu && !!overlayBackgroundColor) {
  28421. colors.backgroundColor = overlayBackgroundColor;
  28422. } else if (!!customBackgroundColor) {
  28423. colors.customBackgroundColor = customBackgroundColor;
  28424. } else if (!!backgroundColor) {
  28425. colors.backgroundColor = backgroundColor;
  28426. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  28427. colors.customTextColor = style.color.background;
  28428. }
  28429. return colors;
  28430. }
  28431. /**
  28432. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  28433. */
  28434. /**
  28435. * Navigation Link Block Attributes
  28436. *
  28437. * @typedef {Object} WPNavigationLinkBlockAttributes
  28438. *
  28439. * @property {string} [label] Link text.
  28440. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  28441. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  28442. * @property {string} [rel] The relationship of the linked URL.
  28443. * @property {number} [id] A post or term id.
  28444. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  28445. * @property {string} [url] Link href.
  28446. * @property {string} [title] Link title attribute.
  28447. */
  28448. /**
  28449. * Link Control onChange handler that updates block attributes when a setting is changed.
  28450. *
  28451. * @param {Object} updatedValue New block attributes to update.
  28452. * @param {Function} setAttributes Block attribute update function.
  28453. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  28454. *
  28455. */
  28456. const updateNavigationLinkBlockAttributes = function () {
  28457. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  28458. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  28459. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  28460. const {
  28461. label: originalLabel = '',
  28462. kind: originalKind = '',
  28463. type: originalType = ''
  28464. } = blockAttributes;
  28465. const {
  28466. title: newLabel = '',
  28467. // the title of any provided Post.
  28468. url: newUrl = '',
  28469. opensInNewTab,
  28470. id,
  28471. kind: newKind = originalKind,
  28472. type: newType = originalType
  28473. } = updatedValue;
  28474. const newLabelWithoutHttp = newLabel.replace(/http(s?):\/\//gi, '');
  28475. const newUrlWithoutHttp = newUrl.replace(/http(s?):\/\//gi, '');
  28476. const useNewLabel = newLabel && newLabel !== originalLabel && // LinkControl without the title field relies
  28477. // on the check below. Specifically, it assumes that
  28478. // the URL is the same as a title.
  28479. // This logic a) looks suspicious and b) should really
  28480. // live in the LinkControl and not here. It's a great
  28481. // candidate for future refactoring.
  28482. newLabelWithoutHttp !== newUrlWithoutHttp; // Unfortunately this causes the escaping model to be inverted.
  28483. // The escaped content is stored in the block attributes (and ultimately in the database),
  28484. // and then the raw data is "recovered" when outputting into the DOM.
  28485. // It would be preferable to store the **raw** data in the block attributes and escape it in JS.
  28486. // Why? Because there isn't one way to escape data. Depending on the context, you need to do
  28487. // different transforms. It doesn't make sense to me to choose one of them for the purposes of storage.
  28488. // See also:
  28489. // - https://github.com/WordPress/gutenberg/pull/41063
  28490. // - https://github.com/WordPress/gutenberg/pull/18617.
  28491. const label = useNewLabel ? (0,external_lodash_namespaceObject.escape)(newLabel) : originalLabel || (0,external_lodash_namespaceObject.escape)(newUrlWithoutHttp); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  28492. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  28493. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  28494. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  28495. const kind = isCustomLink ? 'custom' : newKind;
  28496. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  28497. ...(newUrl && {
  28498. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(newUrl))
  28499. }),
  28500. ...(label && {
  28501. label
  28502. }),
  28503. ...(undefined !== opensInNewTab && {
  28504. opensInNewTab
  28505. }),
  28506. ...(id && Number.isInteger(id) && {
  28507. id
  28508. }),
  28509. ...(kind && {
  28510. kind
  28511. }),
  28512. ...(type && type !== 'URL' && {
  28513. type
  28514. })
  28515. });
  28516. };
  28517. const useIsInvalidLink = (kind, type, id) => {
  28518. const isPostType = kind === 'post-type' || type === 'post' || type === 'page';
  28519. const hasId = Number.isInteger(id);
  28520. const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28521. var _getEntityRecord;
  28522. if (!isPostType) {
  28523. return null;
  28524. }
  28525. const {
  28526. getEntityRecord
  28527. } = select(external_wp_coreData_namespaceObject.store);
  28528. return (_getEntityRecord = getEntityRecord('postType', type, id)) === null || _getEntityRecord === void 0 ? void 0 : _getEntityRecord.status;
  28529. }, [isPostType, type, id]); // Check Navigation Link validity if:
  28530. // 1. Link is 'post-type'.
  28531. // 2. It has an id.
  28532. // 3. It's neither null, nor undefined, as valid items might be either of those while loading.
  28533. // If those conditions are met, check if
  28534. // 1. The post status is published.
  28535. // 2. The Navigation Link item has no label.
  28536. // If either of those is true, invalidate.
  28537. const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus;
  28538. const isDraft = 'draft' === postStatus;
  28539. return [isInvalid, isDraft];
  28540. };
  28541. function getMissingText(type) {
  28542. let missingText = '';
  28543. switch (type) {
  28544. case 'post':
  28545. /* translators: label for missing post in navigation link block */
  28546. missingText = (0,external_wp_i18n_namespaceObject.__)('Select post');
  28547. break;
  28548. case 'page':
  28549. /* translators: label for missing page in navigation link block */
  28550. missingText = (0,external_wp_i18n_namespaceObject.__)('Select page');
  28551. break;
  28552. case 'category':
  28553. /* translators: label for missing category in navigation link block */
  28554. missingText = (0,external_wp_i18n_namespaceObject.__)('Select category');
  28555. break;
  28556. case 'tag':
  28557. /* translators: label for missing tag in navigation link block */
  28558. missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag');
  28559. break;
  28560. default:
  28561. /* translators: label for missing values in navigation link block */
  28562. missingText = (0,external_wp_i18n_namespaceObject.__)('Add link');
  28563. }
  28564. return missingText;
  28565. }
  28566. /**
  28567. * Removes HTML from a given string.
  28568. * Note the does not provide XSS protection or otherwise attempt
  28569. * to filter strings with malicious intent.
  28570. *
  28571. * See also: https://github.com/WordPress/gutenberg/pull/35539
  28572. *
  28573. * @param {string} html the string from which HTML should be removed.
  28574. * @return {string} the "cleaned" string.
  28575. */
  28576. function navStripHTML(html) {
  28577. const doc = document.implementation.createHTMLDocument('');
  28578. doc.body.innerHTML = html;
  28579. return doc.body.textContent || '';
  28580. }
  28581. /**
  28582. * Add transforms to Link Control
  28583. */
  28584. function LinkControlTransforms(_ref) {
  28585. let {
  28586. clientId,
  28587. replace
  28588. } = _ref;
  28589. const {
  28590. getBlock,
  28591. blockTransforms
  28592. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28593. const {
  28594. getBlock: _getBlock,
  28595. getBlockRootClientId,
  28596. getBlockTransformItems
  28597. } = select(external_wp_blockEditor_namespaceObject.store);
  28598. return {
  28599. getBlock: _getBlock,
  28600. blockTransforms: getBlockTransformItems(_getBlock(clientId), getBlockRootClientId(clientId))
  28601. };
  28602. }, [clientId]);
  28603. const featuredBlocks = ['core/site-logo', 'core/social-links', 'core/search'];
  28604. const transforms = blockTransforms.filter(item => {
  28605. return featuredBlocks.includes(item.name);
  28606. });
  28607. if (!(transforms !== null && transforms !== void 0 && transforms.length)) {
  28608. return null;
  28609. }
  28610. return (0,external_wp_element_namespaceObject.createElement)("div", {
  28611. className: "link-control-transform"
  28612. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  28613. className: "link-control-transform__subheading"
  28614. }, (0,external_wp_i18n_namespaceObject.__)('Transform')), (0,external_wp_element_namespaceObject.createElement)("div", {
  28615. className: "link-control-transform__items"
  28616. }, transforms.map((item, index) => {
  28617. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  28618. key: `transform-${index}`,
  28619. onClick: () => replace(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), item.name)),
  28620. className: "link-control-transform__item"
  28621. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  28622. icon: item.icon
  28623. }), item.title);
  28624. })));
  28625. }
  28626. function NavigationLinkEdit(_ref2) {
  28627. let {
  28628. attributes,
  28629. isSelected,
  28630. setAttributes,
  28631. insertBlocksAfter,
  28632. mergeBlocks,
  28633. onReplace,
  28634. context,
  28635. clientId
  28636. } = _ref2;
  28637. const {
  28638. id,
  28639. label,
  28640. type,
  28641. opensInNewTab,
  28642. url,
  28643. description,
  28644. rel,
  28645. title,
  28646. kind
  28647. } = attributes;
  28648. const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id);
  28649. const {
  28650. maxNestingLevel
  28651. } = context;
  28652. const link = {
  28653. url,
  28654. opensInNewTab,
  28655. title: label && navStripHTML(label) // don't allow HTML to display inside the <LinkControl>
  28656. };
  28657. const {
  28658. saveEntityRecord
  28659. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  28660. const {
  28661. replaceBlock,
  28662. __unstableMarkNextChangeAsNotPersistent
  28663. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  28664. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Use internal state instead of a ref to make sure that the component
  28665. // re-renders when the popover's anchor updates.
  28666. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
  28667. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  28668. const isDraggingWithin = useIsDraggingWithin(listItemRef);
  28669. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add link…');
  28670. const ref = (0,external_wp_element_namespaceObject.useRef)();
  28671. const pagesPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('pages');
  28672. const postsPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('posts');
  28673. const {
  28674. innerBlocks,
  28675. isAtMaxNesting,
  28676. isTopLevelLink,
  28677. isParentOfSelectedBlock,
  28678. hasChildren
  28679. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28680. const {
  28681. getBlocks,
  28682. getBlockCount,
  28683. getBlockName,
  28684. getBlockRootClientId,
  28685. hasSelectedInnerBlock,
  28686. getBlockParentsByBlockName
  28687. } = select(external_wp_blockEditor_namespaceObject.store);
  28688. return {
  28689. innerBlocks: getBlocks(clientId),
  28690. isAtMaxNesting: getBlockParentsByBlockName(clientId, [edit_name, 'core/navigation-submenu']).length >= maxNestingLevel,
  28691. isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation',
  28692. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  28693. hasChildren: !!getBlockCount(clientId)
  28694. };
  28695. }, [clientId]);
  28696. (0,external_wp_element_namespaceObject.useEffect)(() => {
  28697. // This side-effect should not create an undo level as those should
  28698. // only be created via user interactions. Mark this change as
  28699. // not persistent to avoid undo level creation.
  28700. // See https://github.com/WordPress/gutenberg/issues/34564.
  28701. __unstableMarkNextChangeAsNotPersistent();
  28702. setAttributes({
  28703. isTopLevelLink
  28704. });
  28705. }, [isTopLevelLink]);
  28706. /**
  28707. * Transform to submenu block.
  28708. */
  28709. function transformToSubmenu() {
  28710. const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
  28711. replaceBlock(clientId, newSubmenu);
  28712. }
  28713. (0,external_wp_element_namespaceObject.useEffect)(() => {
  28714. // Show the LinkControl on mount if the URL is empty
  28715. // ( When adding a new menu item)
  28716. // This can't be done in the useState call because it conflicts
  28717. // with the autofocus behavior of the BlockListBlock component.
  28718. if (!url) {
  28719. setIsLinkOpen(true);
  28720. } // If block has inner blocks, transform to Submenu.
  28721. if (hasChildren) {
  28722. transformToSubmenu();
  28723. }
  28724. }, []);
  28725. /**
  28726. * The hook shouldn't be necessary but due to a focus loss happening
  28727. * when selecting a suggestion in the link popover, we force close on block unselection.
  28728. */
  28729. (0,external_wp_element_namespaceObject.useEffect)(() => {
  28730. if (!isSelected) {
  28731. setIsLinkOpen(false);
  28732. }
  28733. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  28734. (0,external_wp_element_namespaceObject.useEffect)(() => {
  28735. if (isLinkOpen && url) {
  28736. // Does this look like a URL and have something TLD-ish?
  28737. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  28738. // Focus and select the label text.
  28739. selectLabelText();
  28740. } else {
  28741. // Focus it (but do not select).
  28742. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  28743. }
  28744. }
  28745. }, [url]);
  28746. /**
  28747. * Focus the Link label text and select it.
  28748. */
  28749. function selectLabelText() {
  28750. ref.current.focus();
  28751. const {
  28752. ownerDocument
  28753. } = ref.current;
  28754. const {
  28755. defaultView
  28756. } = ownerDocument;
  28757. const selection = defaultView.getSelection();
  28758. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  28759. range.selectNodeContents(ref.current);
  28760. selection.removeAllRanges();
  28761. selection.addRange(range);
  28762. }
  28763. /**
  28764. * Removes the current link if set.
  28765. */
  28766. function removeLink() {
  28767. // Reset all attributes that comprise the link.
  28768. setAttributes({
  28769. url: '',
  28770. label: '',
  28771. id: '',
  28772. kind: '',
  28773. type: ''
  28774. }); // Close the link editing UI.
  28775. setIsLinkOpen(false);
  28776. }
  28777. let userCanCreate = false;
  28778. if (!type || type === 'page') {
  28779. userCanCreate = pagesPermissions.canCreate;
  28780. } else if (type === 'post') {
  28781. userCanCreate = postsPermissions.canCreate;
  28782. }
  28783. async function handleCreate(pageTitle) {
  28784. const postType = type || 'page';
  28785. const page = await saveEntityRecord('postType', postType, {
  28786. title: pageTitle,
  28787. status: 'draft'
  28788. });
  28789. return {
  28790. id: page.id,
  28791. type: postType,
  28792. // Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities)
  28793. // is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code.
  28794. // Ideally in the future we will update both APIs to utilise the "raw" form of the title which is better suited to edit contexts.
  28795. // e.g.
  28796. // - title.raw = "Yes & No"
  28797. // - title.rendered = "Yes &#038; No"
  28798. // - decodeEntities( title.rendered ) = "Yes & No"
  28799. // See:
  28800. // - https://github.com/WordPress/gutenberg/pull/41063
  28801. // - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218
  28802. title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered),
  28803. url: page.link,
  28804. kind: 'post-type'
  28805. };
  28806. }
  28807. const {
  28808. textColor,
  28809. customTextColor,
  28810. backgroundColor,
  28811. customBackgroundColor
  28812. } = getColors(context, !isTopLevelLink);
  28813. function onKeyDown(event) {
  28814. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  28815. setIsLinkOpen(true);
  28816. }
  28817. }
  28818. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28819. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]),
  28820. className: classnames_default()('wp-block-navigation-item', {
  28821. 'is-editing': isSelected || isParentOfSelectedBlock,
  28822. 'is-dragging-within': isDraggingWithin,
  28823. 'has-link': !!url,
  28824. 'has-child': hasChildren,
  28825. 'has-text-color': !!textColor || !!customTextColor,
  28826. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  28827. 'has-background': !!backgroundColor || customBackgroundColor,
  28828. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
  28829. }),
  28830. style: {
  28831. color: !textColor && customTextColor,
  28832. backgroundColor: !backgroundColor && customBackgroundColor
  28833. },
  28834. onKeyDown
  28835. });
  28836. if (!url || isInvalid || isDraft) {
  28837. blockProps.onClick = () => setIsLinkOpen(true);
  28838. }
  28839. const classes = classnames_default()('wp-block-navigation-item__content', {
  28840. 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft
  28841. });
  28842. const missingText = getMissingText(type);
  28843. /* translators: Whether the navigation link is Invalid or a Draft. */
  28844. const placeholderText = `(${isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`;
  28845. const tooltipText = isInvalid || isDraft ? (0,external_wp_i18n_namespaceObject.__)('This item has been deleted, or is a draft') : (0,external_wp_i18n_namespaceObject.__)('This item is missing a link');
  28846. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  28847. name: "link",
  28848. icon: library_link,
  28849. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  28850. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  28851. onClick: () => setIsLinkOpen(true)
  28852. }), !isAtMaxNesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  28853. name: "submenu",
  28854. icon: add_submenu,
  28855. title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'),
  28856. onClick: transformToSubmenu
  28857. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  28858. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  28859. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  28860. value: description || '',
  28861. onChange: descriptionValue => {
  28862. setAttributes({
  28863. description: descriptionValue
  28864. });
  28865. },
  28866. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  28867. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  28868. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  28869. value: title || '',
  28870. onChange: titleValue => {
  28871. setAttributes({
  28872. title: titleValue
  28873. });
  28874. },
  28875. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  28876. autoComplete: "off"
  28877. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  28878. value: rel || '',
  28879. onChange: relValue => {
  28880. setAttributes({
  28881. rel: relValue
  28882. });
  28883. },
  28884. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  28885. autoComplete: "off"
  28886. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  28887. className: classes
  28888. }, !url ? (0,external_wp_element_namespaceObject.createElement)("div", {
  28889. className: "wp-block-navigation-link__placeholder-text"
  28890. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  28891. position: "top center",
  28892. text: tooltipText
  28893. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null, missingText), (0,external_wp_element_namespaceObject.createElement)("span", {
  28894. className: "wp-block-navigation-link__missing_text-tooltip"
  28895. }, tooltipText)))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isInvalid && !isDraft && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28896. ref: ref,
  28897. identifier: "label",
  28898. className: "wp-block-navigation-item__label",
  28899. value: label,
  28900. onChange: labelValue => setAttributes({
  28901. label: labelValue
  28902. }),
  28903. onMerge: mergeBlocks,
  28904. onReplace: onReplace,
  28905. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')),
  28906. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  28907. placeholder: itemLabelPlaceholder,
  28908. withoutInteractiveFormatting: true,
  28909. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  28910. onClick: () => {
  28911. if (!url) {
  28912. setIsLinkOpen(true);
  28913. }
  28914. }
  28915. }), description && (0,external_wp_element_namespaceObject.createElement)("span", {
  28916. className: "wp-block-navigation-item__description"
  28917. }, description)), (isInvalid || isDraft) && (0,external_wp_element_namespaceObject.createElement)("div", {
  28918. className: "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label"
  28919. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.KeyboardShortcuts, {
  28920. shortcuts: {
  28921. enter: () => isSelected && setIsLinkOpen(true)
  28922. }
  28923. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  28924. position: "top center",
  28925. text: tooltipText
  28926. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", {
  28927. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text')
  28928. }, // Some attributes are stored in an escaped form. It's a legacy issue.
  28929. // Ideally they would be stored in a raw, unescaped form.
  28930. // Unescape is used here to "recover" the escaped characters
  28931. // so they display without encoding.
  28932. // See `updateNavigationLinkBlockAttributes` for more details.
  28933. `${(0,external_lodash_namespaceObject.unescape)(label)} ${placeholderText}`.trim()), (0,external_wp_element_namespaceObject.createElement)("span", {
  28934. className: "wp-block-navigation-link__missing_text-tooltip"
  28935. }, tooltipText))))), isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  28936. position: "bottom center",
  28937. onClose: () => setIsLinkOpen(false),
  28938. anchor: popoverAnchor,
  28939. shift: true
  28940. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  28941. hasTextControl: true,
  28942. hasRichPreviews: true,
  28943. className: "wp-block-navigation-link__inline-link-input",
  28944. value: link,
  28945. showInitialSuggestions: true,
  28946. withCreateSuggestion: userCanCreate,
  28947. createSuggestion: handleCreate,
  28948. createSuggestionButtonText: searchTerm => {
  28949. let format;
  28950. if (type === 'post') {
  28951. /* translators: %s: search term. */
  28952. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  28953. } else {
  28954. /* translators: %s: search term. */
  28955. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  28956. }
  28957. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  28958. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  28959. });
  28960. },
  28961. noDirectEntry: !!type,
  28962. noURLSuggestion: !!type,
  28963. suggestionsQuery: getSuggestionsQuery(type, kind),
  28964. onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  28965. onRemove: removeLink,
  28966. renderControlBottom: !url ? () => (0,external_wp_element_namespaceObject.createElement)(LinkControlTransforms, {
  28967. clientId: clientId,
  28968. replace: replaceBlock
  28969. }) : null
  28970. })))));
  28971. }
  28972. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
  28973. /**
  28974. * WordPress dependencies
  28975. */
  28976. function navigation_link_save_save() {
  28977. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  28978. }
  28979. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
  28980. /**
  28981. * WordPress dependencies
  28982. */
  28983. const postContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28984. xmlns: "https://www.w3.org/2000/svg",
  28985. viewBox: "0 0 24 24"
  28986. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28987. d: "M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
  28988. }));
  28989. /* harmony default export */ var post_content = (postContent);
  28990. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
  28991. /**
  28992. * WordPress dependencies
  28993. */
  28994. const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28995. xmlns: "http://www.w3.org/2000/svg",
  28996. viewBox: "0 0 24 24"
  28997. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28998. d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
  28999. }));
  29000. /* harmony default export */ var library_page = (page);
  29001. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
  29002. /**
  29003. * WordPress dependencies
  29004. */
  29005. const tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29006. xmlns: "http://www.w3.org/2000/svg",
  29007. viewBox: "0 0 24 24"
  29008. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29009. d: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
  29010. }));
  29011. /* harmony default export */ var library_tag = (tag);
  29012. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
  29013. /**
  29014. * WordPress dependencies
  29015. */
  29016. const customPostType = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29017. xmlns: "http://www.w3.org/2000/svg",
  29018. viewBox: "0 0 24 24"
  29019. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29020. d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"
  29021. }));
  29022. /* harmony default export */ var custom_post_type = (customPostType);
  29023. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
  29024. /**
  29025. * WordPress dependencies
  29026. */
  29027. function getIcon(variationName) {
  29028. switch (variationName) {
  29029. case 'post':
  29030. return post_content;
  29031. case 'page':
  29032. return library_page;
  29033. case 'tag':
  29034. return library_tag;
  29035. case 'category':
  29036. return library_category;
  29037. default:
  29038. return custom_post_type;
  29039. }
  29040. }
  29041. function enhanceNavigationLinkVariations(settings, name) {
  29042. if (name !== 'core/navigation-link') {
  29043. return settings;
  29044. } // Otherwise decorate server passed variations with an icon and isActive function.
  29045. if (settings.variations) {
  29046. const isActive = (blockAttributes, variationAttributes) => {
  29047. return blockAttributes.type === variationAttributes.type;
  29048. };
  29049. const variations = settings.variations.map(variation => {
  29050. return { ...variation,
  29051. ...(!variation.icon && {
  29052. icon: getIcon(variation.name)
  29053. }),
  29054. ...(!variation.isActive && {
  29055. isActive
  29056. })
  29057. };
  29058. });
  29059. return { ...settings,
  29060. variations
  29061. };
  29062. }
  29063. return settings;
  29064. }
  29065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
  29066. /**
  29067. * WordPress dependencies
  29068. */
  29069. const navigation_link_transforms_transforms = {
  29070. from: [{
  29071. type: 'block',
  29072. blocks: ['core/site-logo'],
  29073. transform: () => {
  29074. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  29075. }
  29076. }, {
  29077. type: 'block',
  29078. blocks: ['core/spacer'],
  29079. transform: () => {
  29080. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  29081. }
  29082. }, {
  29083. type: 'block',
  29084. blocks: ['core/home-link'],
  29085. transform: () => {
  29086. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  29087. }
  29088. }, {
  29089. type: 'block',
  29090. blocks: ['core/social-links'],
  29091. transform: () => {
  29092. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  29093. }
  29094. }, {
  29095. type: 'block',
  29096. blocks: ['core/search'],
  29097. transform: () => {
  29098. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  29099. }
  29100. }],
  29101. to: [{
  29102. type: 'block',
  29103. blocks: ['core/navigation-submenu'],
  29104. transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
  29105. }, {
  29106. type: 'block',
  29107. blocks: ['core/spacer'],
  29108. transform: () => {
  29109. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  29110. }
  29111. }, {
  29112. type: 'block',
  29113. blocks: ['core/site-logo'],
  29114. transform: () => {
  29115. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  29116. }
  29117. }, {
  29118. type: 'block',
  29119. blocks: ['core/home-link'],
  29120. transform: () => {
  29121. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  29122. }
  29123. }, {
  29124. type: 'block',
  29125. blocks: ['core/social-links'],
  29126. transform: () => {
  29127. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  29128. }
  29129. }, {
  29130. type: 'block',
  29131. blocks: ['core/search'],
  29132. transform: () => {
  29133. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', {
  29134. showLabel: false,
  29135. buttonUseIcon: true,
  29136. buttonPosition: 'button-inside'
  29137. });
  29138. }
  29139. }]
  29140. };
  29141. /* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);
  29142. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  29143. /**
  29144. * WordPress dependencies
  29145. */
  29146. /**
  29147. * Internal dependencies
  29148. */
  29149. const navigation_link_metadata = {
  29150. $schema: "https://schemas.wp.org/trunk/block.json",
  29151. apiVersion: 2,
  29152. name: "core/navigation-link",
  29153. title: "Custom Link",
  29154. category: "design",
  29155. parent: ["core/navigation"],
  29156. description: "Add a page, link, or another item to your navigation.",
  29157. textdomain: "default",
  29158. attributes: {
  29159. label: {
  29160. type: "string"
  29161. },
  29162. type: {
  29163. type: "string"
  29164. },
  29165. description: {
  29166. type: "string"
  29167. },
  29168. rel: {
  29169. type: "string"
  29170. },
  29171. id: {
  29172. type: "number"
  29173. },
  29174. opensInNewTab: {
  29175. type: "boolean",
  29176. "default": false
  29177. },
  29178. url: {
  29179. type: "string"
  29180. },
  29181. title: {
  29182. type: "string"
  29183. },
  29184. kind: {
  29185. type: "string"
  29186. },
  29187. isTopLevelLink: {
  29188. type: "boolean"
  29189. }
  29190. },
  29191. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  29192. supports: {
  29193. reusable: false,
  29194. html: false,
  29195. __experimentalSlashInserter: true,
  29196. typography: {
  29197. fontSize: true,
  29198. lineHeight: true,
  29199. __experimentalFontFamily: true,
  29200. __experimentalFontWeight: true,
  29201. __experimentalFontStyle: true,
  29202. __experimentalTextTransform: true,
  29203. __experimentalTextDecoration: true,
  29204. __experimentalLetterSpacing: true,
  29205. __experimentalDefaultControls: {
  29206. fontSize: true
  29207. }
  29208. }
  29209. },
  29210. editorStyle: "wp-block-navigation-link-editor",
  29211. style: "wp-block-navigation-link"
  29212. };
  29213. const {
  29214. name: navigation_link_name
  29215. } = navigation_link_metadata;
  29216. const navigation_link_settings = {
  29217. icon: custom_link,
  29218. __experimentalLabel: _ref => {
  29219. let {
  29220. label
  29221. } = _ref;
  29222. return label;
  29223. },
  29224. merge(leftAttributes, _ref2) {
  29225. let {
  29226. label: rightLabel = ''
  29227. } = _ref2;
  29228. return { ...leftAttributes,
  29229. label: leftAttributes.label + rightLabel
  29230. };
  29231. },
  29232. edit: NavigationLinkEdit,
  29233. save: navigation_link_save_save,
  29234. example: {
  29235. attributes: {
  29236. label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'),
  29237. url: 'https://example.com'
  29238. }
  29239. },
  29240. deprecated: [{
  29241. isEligible(attributes) {
  29242. return attributes.nofollow;
  29243. },
  29244. attributes: {
  29245. label: {
  29246. type: 'string'
  29247. },
  29248. type: {
  29249. type: 'string'
  29250. },
  29251. nofollow: {
  29252. type: 'boolean'
  29253. },
  29254. description: {
  29255. type: 'string'
  29256. },
  29257. id: {
  29258. type: 'number'
  29259. },
  29260. opensInNewTab: {
  29261. type: 'boolean',
  29262. default: false
  29263. },
  29264. url: {
  29265. type: 'string'
  29266. }
  29267. },
  29268. migrate(_ref3) {
  29269. let {
  29270. nofollow,
  29271. ...rest
  29272. } = _ref3;
  29273. return {
  29274. rel: nofollow ? 'nofollow' : '',
  29275. ...rest
  29276. };
  29277. },
  29278. save() {
  29279. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  29280. }
  29281. }],
  29282. transforms: navigation_link_transforms
  29283. };
  29284. const navigation_link_init = () => {
  29285. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
  29286. return initBlock({
  29287. name: navigation_link_name,
  29288. metadata: navigation_link_metadata,
  29289. settings: navigation_link_settings
  29290. });
  29291. };
  29292. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js
  29293. /**
  29294. * WordPress dependencies
  29295. */
  29296. const removeSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29297. xmlns: "http://www.w3.org/2000/svg",
  29298. viewBox: "0 0 24 24"
  29299. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29300. fillRule: "evenodd",
  29301. clipRule: "evenodd",
  29302. d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"
  29303. }));
  29304. /* harmony default export */ var remove_submenu = (removeSubmenu);
  29305. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
  29306. /**
  29307. * WordPress dependencies
  29308. */
  29309. const ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  29310. xmlns: "http://www.w3.org/2000/svg",
  29311. width: "12",
  29312. height: "12",
  29313. viewBox: "0 0 12 12",
  29314. fill: "none"
  29315. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  29316. d: "M1.50002 4L6.00002 8L10.5 4",
  29317. strokeWidth: "1.5"
  29318. }));
  29319. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
  29320. /**
  29321. * External dependencies
  29322. */
  29323. /**
  29324. * WordPress dependencies
  29325. */
  29326. /**
  29327. * Internal dependencies
  29328. */
  29329. const {
  29330. name: navigation_submenu_edit_name
  29331. } = {
  29332. $schema: "https://schemas.wp.org/trunk/block.json",
  29333. apiVersion: 2,
  29334. name: "core/navigation-submenu",
  29335. title: "Submenu",
  29336. category: "design",
  29337. parent: ["core/navigation"],
  29338. description: "Add a submenu to your navigation.",
  29339. textdomain: "default",
  29340. attributes: {
  29341. label: {
  29342. type: "string"
  29343. },
  29344. type: {
  29345. type: "string"
  29346. },
  29347. description: {
  29348. type: "string"
  29349. },
  29350. rel: {
  29351. type: "string"
  29352. },
  29353. id: {
  29354. type: "number"
  29355. },
  29356. opensInNewTab: {
  29357. type: "boolean",
  29358. "default": false
  29359. },
  29360. url: {
  29361. type: "string"
  29362. },
  29363. title: {
  29364. type: "string"
  29365. },
  29366. kind: {
  29367. type: "string"
  29368. },
  29369. isTopLevelItem: {
  29370. type: "boolean"
  29371. }
  29372. },
  29373. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  29374. supports: {
  29375. reusable: false,
  29376. html: false
  29377. },
  29378. editorStyle: "wp-block-navigation-submenu-editor",
  29379. style: "wp-block-navigation-submenu"
  29380. };
  29381. const navigation_submenu_edit_ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu'];
  29382. const edit_DEFAULT_BLOCK = {
  29383. name: 'core/navigation-link'
  29384. };
  29385. /**
  29386. * A React hook to determine if it's dragging within the target element.
  29387. *
  29388. * @typedef {import('@wordpress/element').RefObject} RefObject
  29389. *
  29390. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  29391. *
  29392. * @return {boolean} Is dragging within the target element.
  29393. */
  29394. const edit_useIsDraggingWithin = elementRef => {
  29395. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  29396. (0,external_wp_element_namespaceObject.useEffect)(() => {
  29397. const {
  29398. ownerDocument
  29399. } = elementRef.current;
  29400. function handleDragStart(event) {
  29401. // Check the first time when the dragging starts.
  29402. handleDragEnter(event);
  29403. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  29404. function handleDragEnd() {
  29405. setIsDraggingWithin(false);
  29406. }
  29407. function handleDragEnter(event) {
  29408. // Check if the current target is inside the item element.
  29409. if (elementRef.current.contains(event.target)) {
  29410. setIsDraggingWithin(true);
  29411. } else {
  29412. setIsDraggingWithin(false);
  29413. }
  29414. } // Bind these events to the document to catch all drag events.
  29415. // Ideally, we can also use `event.relatedTarget`, but sadly that
  29416. // doesn't work in Safari.
  29417. ownerDocument.addEventListener('dragstart', handleDragStart);
  29418. ownerDocument.addEventListener('dragend', handleDragEnd);
  29419. ownerDocument.addEventListener('dragenter', handleDragEnter);
  29420. return () => {
  29421. ownerDocument.removeEventListener('dragstart', handleDragStart);
  29422. ownerDocument.removeEventListener('dragend', handleDragEnd);
  29423. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  29424. };
  29425. }, []);
  29426. return isDraggingWithin;
  29427. };
  29428. /**
  29429. * Given the Link block's type attribute, return the query params to give to
  29430. * /wp/v2/search.
  29431. *
  29432. * @param {string} type Link block's type attribute.
  29433. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  29434. * @return {{ type?: string, subtype?: string }} Search query params.
  29435. */
  29436. function edit_getSuggestionsQuery(type, kind) {
  29437. switch (type) {
  29438. case 'post':
  29439. case 'page':
  29440. return {
  29441. type: 'post',
  29442. subtype: type
  29443. };
  29444. case 'category':
  29445. return {
  29446. type: 'term',
  29447. subtype: 'category'
  29448. };
  29449. case 'tag':
  29450. return {
  29451. type: 'term',
  29452. subtype: 'post_tag'
  29453. };
  29454. case 'post_format':
  29455. return {
  29456. type: 'post-format'
  29457. };
  29458. default:
  29459. if (kind === 'taxonomy') {
  29460. return {
  29461. type: 'term',
  29462. subtype: type
  29463. };
  29464. }
  29465. if (kind === 'post-type') {
  29466. return {
  29467. type: 'post',
  29468. subtype: type
  29469. };
  29470. }
  29471. return {};
  29472. }
  29473. }
  29474. /**
  29475. * Determine the colors for a menu.
  29476. *
  29477. * Order of priority is:
  29478. * 1: Overlay custom colors (if submenu)
  29479. * 2: Overlay theme colors (if submenu)
  29480. * 3: Custom colors
  29481. * 4: Theme colors
  29482. * 5: Global styles
  29483. *
  29484. * @param {Object} context
  29485. * @param {boolean} isSubMenu
  29486. */
  29487. function edit_getColors(context, isSubMenu) {
  29488. var _style$color, _style$color2;
  29489. const {
  29490. textColor,
  29491. customTextColor,
  29492. backgroundColor,
  29493. customBackgroundColor,
  29494. overlayTextColor,
  29495. customOverlayTextColor,
  29496. overlayBackgroundColor,
  29497. customOverlayBackgroundColor,
  29498. style
  29499. } = context;
  29500. const colors = {};
  29501. if (isSubMenu && !!customOverlayTextColor) {
  29502. colors.customTextColor = customOverlayTextColor;
  29503. } else if (isSubMenu && !!overlayTextColor) {
  29504. colors.textColor = overlayTextColor;
  29505. } else if (!!customTextColor) {
  29506. colors.customTextColor = customTextColor;
  29507. } else if (!!textColor) {
  29508. colors.textColor = textColor;
  29509. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  29510. colors.customTextColor = style.color.text;
  29511. }
  29512. if (isSubMenu && !!customOverlayBackgroundColor) {
  29513. colors.customBackgroundColor = customOverlayBackgroundColor;
  29514. } else if (isSubMenu && !!overlayBackgroundColor) {
  29515. colors.backgroundColor = overlayBackgroundColor;
  29516. } else if (!!customBackgroundColor) {
  29517. colors.customBackgroundColor = customBackgroundColor;
  29518. } else if (!!backgroundColor) {
  29519. colors.backgroundColor = backgroundColor;
  29520. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  29521. colors.customTextColor = style.color.background;
  29522. }
  29523. return colors;
  29524. }
  29525. /**
  29526. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  29527. */
  29528. /**
  29529. * Navigation Link Block Attributes
  29530. *
  29531. * @typedef {Object} WPNavigationLinkBlockAttributes
  29532. *
  29533. * @property {string} [label] Link text.
  29534. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  29535. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  29536. * @property {string} [rel] The relationship of the linked URL.
  29537. * @property {number} [id] A post or term id.
  29538. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  29539. * @property {string} [url] Link href.
  29540. * @property {string} [title] Link title attribute.
  29541. */
  29542. /**
  29543. * Link Control onChange handler that updates block attributes when a setting is changed.
  29544. *
  29545. * @param {Object} updatedValue New block attributes to update.
  29546. * @param {Function} setAttributes Block attribute update function.
  29547. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  29548. *
  29549. */
  29550. const edit_updateNavigationLinkBlockAttributes = function () {
  29551. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  29552. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  29553. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  29554. const {
  29555. label: originalLabel = '',
  29556. kind: originalKind = '',
  29557. type: originalType = ''
  29558. } = blockAttributes;
  29559. const {
  29560. title = '',
  29561. url = '',
  29562. opensInNewTab,
  29563. id,
  29564. kind: newKind = originalKind,
  29565. type: newType = originalType
  29566. } = updatedValue;
  29567. const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
  29568. const normalizedURL = url.replace(/http(s?):\/\//gi, '');
  29569. const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
  29570. const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  29571. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  29572. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  29573. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  29574. const kind = isCustomLink ? 'custom' : newKind;
  29575. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  29576. ...(url && {
  29577. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
  29578. }),
  29579. ...(label && {
  29580. label
  29581. }),
  29582. ...(undefined !== opensInNewTab && {
  29583. opensInNewTab
  29584. }),
  29585. ...(id && Number.isInteger(id) && {
  29586. id
  29587. }),
  29588. ...(kind && {
  29589. kind
  29590. }),
  29591. ...(type && type !== 'URL' && {
  29592. type
  29593. })
  29594. });
  29595. };
  29596. function NavigationSubmenuEdit(_ref) {
  29597. let {
  29598. attributes,
  29599. isSelected,
  29600. setAttributes,
  29601. mergeBlocks,
  29602. onReplace,
  29603. context,
  29604. clientId
  29605. } = _ref;
  29606. const {
  29607. label,
  29608. type,
  29609. opensInNewTab,
  29610. url,
  29611. description,
  29612. rel,
  29613. title,
  29614. kind
  29615. } = attributes;
  29616. const link = {
  29617. url,
  29618. opensInNewTab
  29619. };
  29620. const {
  29621. showSubmenuIcon,
  29622. maxNestingLevel,
  29623. openSubmenusOnClick
  29624. } = context;
  29625. const {
  29626. saveEntityRecord
  29627. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  29628. const {
  29629. __unstableMarkNextChangeAsNotPersistent,
  29630. replaceBlock
  29631. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  29632. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Use internal state instead of a ref to make sure that the component
  29633. // re-renders when the popover's anchor updates.
  29634. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
  29635. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  29636. const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);
  29637. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…');
  29638. const ref = (0,external_wp_element_namespaceObject.useRef)();
  29639. const pagesPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('pages');
  29640. const postsPermissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)('posts');
  29641. const {
  29642. isAtMaxNesting,
  29643. isTopLevelItem,
  29644. isParentOfSelectedBlock,
  29645. isImmediateParentOfSelectedBlock,
  29646. hasChildren,
  29647. selectedBlockHasChildren,
  29648. onlyDescendantIsEmptyLink
  29649. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  29650. const {
  29651. hasSelectedInnerBlock,
  29652. getSelectedBlockClientId,
  29653. getBlockParentsByBlockName,
  29654. getBlock,
  29655. getBlockCount,
  29656. getBlockOrder
  29657. } = select(external_wp_blockEditor_namespaceObject.store);
  29658. let _onlyDescendantIsEmptyLink;
  29659. const selectedBlockId = getSelectedBlockClientId();
  29660. const selectedBlockChildren = getBlockOrder(selectedBlockId); // Check for a single descendant in the submenu. If that block
  29661. // is a link block in a "placeholder" state with no label then
  29662. // we can consider as an "empty" link.
  29663. if ((selectedBlockChildren === null || selectedBlockChildren === void 0 ? void 0 : selectedBlockChildren.length) === 1) {
  29664. var _singleBlock$attribut;
  29665. const singleBlock = getBlock(selectedBlockChildren[0]);
  29666. _onlyDescendantIsEmptyLink = (singleBlock === null || singleBlock === void 0 ? void 0 : singleBlock.name) === 'core/navigation-link' && !(singleBlock !== null && singleBlock !== void 0 && (_singleBlock$attribut = singleBlock.attributes) !== null && _singleBlock$attribut !== void 0 && _singleBlock$attribut.label);
  29667. }
  29668. return {
  29669. isAtMaxNesting: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length >= maxNestingLevel,
  29670. isTopLevelItem: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length === 0,
  29671. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  29672. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  29673. hasChildren: !!getBlockCount(clientId),
  29674. selectedBlockHasChildren: !!(selectedBlockChildren !== null && selectedBlockChildren !== void 0 && selectedBlockChildren.length),
  29675. onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
  29676. };
  29677. }, [clientId]); // Show the LinkControl on mount if the URL is empty
  29678. // ( When adding a new menu item)
  29679. // This can't be done in the useState call because it conflicts
  29680. // with the autofocus behavior of the BlockListBlock component.
  29681. (0,external_wp_element_namespaceObject.useEffect)(() => {
  29682. if (!openSubmenusOnClick && !url) {
  29683. setIsLinkOpen(true);
  29684. }
  29685. }, []); // Store the colors from context as attributes for rendering.
  29686. (0,external_wp_element_namespaceObject.useEffect)(() => {
  29687. // This side-effect should not create an undo level as those should
  29688. // only be created via user interactions. Mark this change as
  29689. // not persistent to avoid undo level creation.
  29690. // See https://github.com/WordPress/gutenberg/issues/34564.
  29691. __unstableMarkNextChangeAsNotPersistent();
  29692. setAttributes({
  29693. isTopLevelItem
  29694. });
  29695. }, [isTopLevelItem]);
  29696. /**
  29697. * The hook shouldn't be necessary but due to a focus loss happening
  29698. * when selecting a suggestion in the link popover, we force close on block unselection.
  29699. */
  29700. (0,external_wp_element_namespaceObject.useEffect)(() => {
  29701. if (!isSelected) {
  29702. setIsLinkOpen(false);
  29703. }
  29704. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  29705. (0,external_wp_element_namespaceObject.useEffect)(() => {
  29706. if (isLinkOpen && url) {
  29707. // Does this look like a URL and have something TLD-ish?
  29708. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  29709. // Focus and select the label text.
  29710. selectLabelText();
  29711. } else {
  29712. // Focus it (but do not select).
  29713. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  29714. }
  29715. }
  29716. }, [url]);
  29717. /**
  29718. * Focus the Link label text and select it.
  29719. */
  29720. function selectLabelText() {
  29721. ref.current.focus();
  29722. const {
  29723. ownerDocument
  29724. } = ref.current;
  29725. const {
  29726. defaultView
  29727. } = ownerDocument;
  29728. const selection = defaultView.getSelection();
  29729. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  29730. range.selectNodeContents(ref.current);
  29731. selection.removeAllRanges();
  29732. selection.addRange(range);
  29733. }
  29734. let userCanCreate = false;
  29735. if (!type || type === 'page') {
  29736. userCanCreate = pagesPermissions.canCreate;
  29737. } else if (type === 'post') {
  29738. userCanCreate = postsPermissions.canCreate;
  29739. }
  29740. async function handleCreate(pageTitle) {
  29741. const postType = type || 'page';
  29742. const page = await saveEntityRecord('postType', postType, {
  29743. title: pageTitle,
  29744. status: 'draft'
  29745. });
  29746. return {
  29747. id: page.id,
  29748. type: postType,
  29749. title: page.title.rendered,
  29750. url: page.link,
  29751. kind: 'post-type'
  29752. };
  29753. }
  29754. const {
  29755. textColor,
  29756. customTextColor,
  29757. backgroundColor,
  29758. customBackgroundColor
  29759. } = edit_getColors(context, !isTopLevelItem);
  29760. function onKeyDown(event) {
  29761. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  29762. setIsLinkOpen(true);
  29763. }
  29764. }
  29765. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29766. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]),
  29767. className: classnames_default()('wp-block-navigation-item', {
  29768. 'is-editing': isSelected || isParentOfSelectedBlock,
  29769. 'is-dragging-within': isDraggingWithin,
  29770. 'has-link': !!url,
  29771. 'has-child': hasChildren,
  29772. 'has-text-color': !!textColor || !!customTextColor,
  29773. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  29774. 'has-background': !!backgroundColor || customBackgroundColor,
  29775. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor,
  29776. 'open-on-click': openSubmenusOnClick
  29777. }),
  29778. style: {
  29779. color: !textColor && customTextColor,
  29780. backgroundColor: !backgroundColor && customBackgroundColor
  29781. },
  29782. onKeyDown
  29783. }); // Always use overlay colors for submenus.
  29784. const innerBlocksColors = edit_getColors(context, true);
  29785. const allowedBlocks = isAtMaxNesting ? (0,external_lodash_namespaceObject.without)(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu') : navigation_submenu_edit_ALLOWED_BLOCKS;
  29786. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  29787. className: classnames_default()('wp-block-navigation__submenu-container', {
  29788. 'is-parent-of-selected-block': isParentOfSelectedBlock,
  29789. 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
  29790. [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor,
  29791. 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor),
  29792. [`has-${innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor
  29793. }),
  29794. style: {
  29795. color: innerBlocksColors.customTextColor,
  29796. backgroundColor: innerBlocksColors.customBackgroundColor
  29797. }
  29798. }, {
  29799. allowedBlocks,
  29800. __experimentalDefaultBlock: edit_DEFAULT_BLOCK,
  29801. __experimentalDirectInsert: true,
  29802. // Ensure block toolbar is not too far removed from item
  29803. // being edited.
  29804. // see: https://github.com/WordPress/gutenberg/pull/34615.
  29805. __experimentalCaptureToolbars: true,
  29806. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  29807. hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
  29808. });
  29809. const ParentElement = openSubmenusOnClick ? 'button' : 'a';
  29810. function transformToLink() {
  29811. const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes);
  29812. replaceBlock(clientId, newLinkBlock);
  29813. }
  29814. const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink;
  29815. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  29816. name: "link",
  29817. icon: library_link,
  29818. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  29819. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  29820. onClick: () => setIsLinkOpen(true)
  29821. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  29822. name: "revert",
  29823. icon: remove_submenu,
  29824. title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'),
  29825. onClick: transformToLink,
  29826. className: "wp-block-navigation__submenu__revert",
  29827. isDisabled: !canConvertToLink
  29828. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  29829. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  29830. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  29831. value: description || '',
  29832. onChange: descriptionValue => {
  29833. setAttributes({
  29834. description: descriptionValue
  29835. });
  29836. },
  29837. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  29838. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  29839. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29840. value: title || '',
  29841. onChange: titleValue => {
  29842. setAttributes({
  29843. title: titleValue
  29844. });
  29845. },
  29846. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  29847. autoComplete: "off"
  29848. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29849. value: rel || '',
  29850. onChange: relValue => {
  29851. setAttributes({
  29852. rel: relValue
  29853. });
  29854. },
  29855. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  29856. autoComplete: "off"
  29857. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(ParentElement, {
  29858. className: "wp-block-navigation-item__content"
  29859. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  29860. ref: ref,
  29861. identifier: "label",
  29862. className: "wp-block-navigation-item__label",
  29863. value: label,
  29864. onChange: labelValue => setAttributes({
  29865. label: labelValue
  29866. }),
  29867. onMerge: mergeBlocks,
  29868. onReplace: onReplace,
  29869. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  29870. placeholder: itemLabelPlaceholder,
  29871. withoutInteractiveFormatting: true,
  29872. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  29873. onClick: () => {
  29874. if (!openSubmenusOnClick && !url) {
  29875. setIsLinkOpen(true);
  29876. }
  29877. }
  29878. }), !openSubmenusOnClick && isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  29879. position: "bottom center",
  29880. onClose: () => setIsLinkOpen(false),
  29881. anchor: popoverAnchor,
  29882. shift: true
  29883. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  29884. className: "wp-block-navigation-link__inline-link-input",
  29885. value: link,
  29886. showInitialSuggestions: true,
  29887. withCreateSuggestion: userCanCreate,
  29888. createSuggestion: handleCreate,
  29889. createSuggestionButtonText: searchTerm => {
  29890. let format;
  29891. if (type === 'post') {
  29892. /* translators: %s: search term. */
  29893. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  29894. } else {
  29895. /* translators: %s: search term. */
  29896. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  29897. }
  29898. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  29899. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  29900. });
  29901. },
  29902. noDirectEntry: !!type,
  29903. noURLSuggestion: !!type,
  29904. suggestionsQuery: edit_getSuggestionsQuery(type, kind),
  29905. onChange: updatedValue => edit_updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  29906. onRemove: () => {
  29907. setAttributes({
  29908. url: ''
  29909. });
  29910. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
  29911. }
  29912. }))), (showSubmenuIcon || openSubmenusOnClick) && (0,external_wp_element_namespaceObject.createElement)("span", {
  29913. className: "wp-block-navigation__submenu-icon"
  29914. }, (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  29915. }
  29916. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
  29917. /**
  29918. * WordPress dependencies
  29919. */
  29920. function navigation_submenu_save_save() {
  29921. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  29922. }
  29923. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
  29924. /**
  29925. * WordPress dependencies
  29926. */
  29927. const navigation_submenu_transforms_transforms = {
  29928. to: [{
  29929. type: 'block',
  29930. blocks: ['core/navigation-link'],
  29931. isMatch: (attributes, block) => {
  29932. var _block$innerBlocks;
  29933. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.length) === 0;
  29934. },
  29935. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
  29936. }, {
  29937. type: 'block',
  29938. blocks: ['core/spacer'],
  29939. isMatch: (attributes, block) => {
  29940. var _block$innerBlocks2;
  29941. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks2 = block.innerBlocks) === null || _block$innerBlocks2 === void 0 ? void 0 : _block$innerBlocks2.length) === 0;
  29942. },
  29943. transform: () => {
  29944. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  29945. }
  29946. }, {
  29947. type: 'block',
  29948. blocks: ['core/site-logo'],
  29949. isMatch: (attributes, block) => {
  29950. var _block$innerBlocks3;
  29951. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks3 = block.innerBlocks) === null || _block$innerBlocks3 === void 0 ? void 0 : _block$innerBlocks3.length) === 0;
  29952. },
  29953. transform: () => {
  29954. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  29955. }
  29956. }, {
  29957. type: 'block',
  29958. blocks: ['core/home-link'],
  29959. isMatch: (attributes, block) => {
  29960. var _block$innerBlocks4;
  29961. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks4 = block.innerBlocks) === null || _block$innerBlocks4 === void 0 ? void 0 : _block$innerBlocks4.length) === 0;
  29962. },
  29963. transform: () => {
  29964. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  29965. }
  29966. }, {
  29967. type: 'block',
  29968. blocks: ['core/social-links'],
  29969. isMatch: (attributes, block) => {
  29970. var _block$innerBlocks5;
  29971. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks5 = block.innerBlocks) === null || _block$innerBlocks5 === void 0 ? void 0 : _block$innerBlocks5.length) === 0;
  29972. },
  29973. transform: () => {
  29974. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  29975. }
  29976. }, {
  29977. type: 'block',
  29978. blocks: ['core/search'],
  29979. isMatch: (attributes, block) => {
  29980. var _block$innerBlocks6;
  29981. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks6 = block.innerBlocks) === null || _block$innerBlocks6 === void 0 ? void 0 : _block$innerBlocks6.length) === 0;
  29982. },
  29983. transform: () => {
  29984. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search');
  29985. }
  29986. }]
  29987. };
  29988. /* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);
  29989. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  29990. /**
  29991. * WordPress dependencies
  29992. */
  29993. /**
  29994. * Internal dependencies
  29995. */
  29996. const navigation_submenu_metadata = {
  29997. $schema: "https://schemas.wp.org/trunk/block.json",
  29998. apiVersion: 2,
  29999. name: "core/navigation-submenu",
  30000. title: "Submenu",
  30001. category: "design",
  30002. parent: ["core/navigation"],
  30003. description: "Add a submenu to your navigation.",
  30004. textdomain: "default",
  30005. attributes: {
  30006. label: {
  30007. type: "string"
  30008. },
  30009. type: {
  30010. type: "string"
  30011. },
  30012. description: {
  30013. type: "string"
  30014. },
  30015. rel: {
  30016. type: "string"
  30017. },
  30018. id: {
  30019. type: "number"
  30020. },
  30021. opensInNewTab: {
  30022. type: "boolean",
  30023. "default": false
  30024. },
  30025. url: {
  30026. type: "string"
  30027. },
  30028. title: {
  30029. type: "string"
  30030. },
  30031. kind: {
  30032. type: "string"
  30033. },
  30034. isTopLevelItem: {
  30035. type: "boolean"
  30036. }
  30037. },
  30038. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  30039. supports: {
  30040. reusable: false,
  30041. html: false
  30042. },
  30043. editorStyle: "wp-block-navigation-submenu-editor",
  30044. style: "wp-block-navigation-submenu"
  30045. };
  30046. const {
  30047. name: navigation_submenu_name
  30048. } = navigation_submenu_metadata;
  30049. const navigation_submenu_settings = {
  30050. icon: add_submenu,
  30051. __experimentalLabel: _ref => {
  30052. let {
  30053. label
  30054. } = _ref;
  30055. return label;
  30056. },
  30057. edit: NavigationSubmenuEdit,
  30058. save: navigation_submenu_save_save,
  30059. transforms: navigation_submenu_transforms
  30060. };
  30061. const navigation_submenu_init = () => initBlock({
  30062. name: navigation_submenu_name,
  30063. metadata: navigation_submenu_metadata,
  30064. settings: navigation_submenu_settings
  30065. });
  30066. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
  30067. /**
  30068. * WordPress dependencies
  30069. */
  30070. const pageBreak = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30071. xmlns: "http://www.w3.org/2000/svg",
  30072. viewBox: "0 0 24 24"
  30073. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30074. d: "M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"
  30075. }));
  30076. /* harmony default export */ var page_break = (pageBreak);
  30077. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
  30078. /**
  30079. * WordPress dependencies
  30080. */
  30081. function NextPageEdit() {
  30082. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break')));
  30083. }
  30084. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
  30085. /**
  30086. * WordPress dependencies
  30087. */
  30088. function nextpage_save_save() {
  30089. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
  30090. }
  30091. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
  30092. /**
  30093. * WordPress dependencies
  30094. */
  30095. const nextpage_transforms_transforms = {
  30096. from: [{
  30097. type: 'raw',
  30098. schema: {
  30099. 'wp-block': {
  30100. attributes: ['data-block']
  30101. }
  30102. },
  30103. isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',
  30104. transform() {
  30105. return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {});
  30106. }
  30107. }]
  30108. };
  30109. /* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);
  30110. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  30111. /**
  30112. * WordPress dependencies
  30113. */
  30114. /**
  30115. * Internal dependencies
  30116. */
  30117. const nextpage_metadata = {
  30118. $schema: "https://schemas.wp.org/trunk/block.json",
  30119. apiVersion: 2,
  30120. name: "core/nextpage",
  30121. title: "Page Break",
  30122. category: "design",
  30123. description: "Separate your content into a multi-page experience.",
  30124. keywords: ["next page", "pagination"],
  30125. parent: ["core/post-content"],
  30126. textdomain: "default",
  30127. supports: {
  30128. customClassName: false,
  30129. className: false,
  30130. html: false
  30131. },
  30132. editorStyle: "wp-block-nextpage-editor"
  30133. };
  30134. const {
  30135. name: nextpage_name
  30136. } = nextpage_metadata;
  30137. const nextpage_settings = {
  30138. icon: page_break,
  30139. example: {},
  30140. transforms: nextpage_transforms,
  30141. edit: NextPageEdit,
  30142. save: nextpage_save_save
  30143. };
  30144. const nextpage_init = () => initBlock({
  30145. name: nextpage_name,
  30146. metadata: nextpage_metadata,
  30147. settings: nextpage_settings
  30148. });
  30149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
  30150. /**
  30151. * WordPress dependencies
  30152. */
  30153. const PatternEdit = _ref => {
  30154. let {
  30155. attributes,
  30156. clientId
  30157. } = _ref;
  30158. const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
  30159. const {
  30160. replaceBlocks,
  30161. __unstableMarkNextChangeAsNotPersistent
  30162. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
  30163. // This adds the Pattern's contents to the post.
  30164. // This change won't be saved.
  30165. // It will continue to pull from the pattern file unless changes are made to its respective template part.
  30166. (0,external_wp_element_namespaceObject.useEffect)(() => {
  30167. if (selectedPattern !== null && selectedPattern !== void 0 && selectedPattern.blocks) {
  30168. __unstableMarkNextChangeAsNotPersistent();
  30169. replaceBlocks(clientId, selectedPattern.blocks);
  30170. }
  30171. }, [selectedPattern === null || selectedPattern === void 0 ? void 0 : selectedPattern.blocks]);
  30172. const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  30173. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  30174. };
  30175. /* harmony default export */ var pattern_edit = (PatternEdit);
  30176. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  30177. /**
  30178. * Internal dependencies
  30179. */
  30180. const pattern_metadata = {
  30181. $schema: "https://schemas.wp.org/trunk/block.json",
  30182. apiVersion: 2,
  30183. name: "core/pattern",
  30184. title: "Pattern",
  30185. category: "theme",
  30186. description: "Show a block pattern.",
  30187. supports: {
  30188. html: false,
  30189. inserter: false
  30190. },
  30191. textdomain: "default",
  30192. attributes: {
  30193. slug: {
  30194. type: "string"
  30195. }
  30196. }
  30197. };
  30198. const {
  30199. name: pattern_name
  30200. } = pattern_metadata;
  30201. const pattern_settings = {
  30202. edit: pattern_edit
  30203. };
  30204. const pattern_init = () => initBlock({
  30205. name: pattern_name,
  30206. metadata: pattern_metadata,
  30207. settings: pattern_settings
  30208. });
  30209. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
  30210. /**
  30211. * WordPress dependencies
  30212. */
  30213. const pages = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30214. xmlns: "http://www.w3.org/2000/svg",
  30215. viewBox: "0 0 24 24"
  30216. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30217. d: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
  30218. }));
  30219. /* harmony default export */ var library_pages = (pages);
  30220. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
  30221. /**
  30222. * WordPress dependencies
  30223. */
  30224. const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
  30225. const MAX_PAGE_COUNT = 100;
  30226. const convertSelectedBlockToNavigationLinks = _ref => {
  30227. let {
  30228. pages,
  30229. clientId,
  30230. replaceBlock,
  30231. createBlock
  30232. } = _ref;
  30233. return () => {
  30234. if (!pages) {
  30235. return;
  30236. }
  30237. const linkMap = {};
  30238. const navigationLinks = [];
  30239. pages.forEach(_ref2 => {
  30240. var _linkMap$id$innerBloc, _linkMap$id;
  30241. let {
  30242. id,
  30243. title,
  30244. link: url,
  30245. type,
  30246. parent
  30247. } = _ref2;
  30248. // See if a placeholder exists. This is created if children appear before parents in list.
  30249. const innerBlocks = (_linkMap$id$innerBloc = (_linkMap$id = linkMap[id]) === null || _linkMap$id === void 0 ? void 0 : _linkMap$id.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
  30250. linkMap[id] = createBlock('core/navigation-link', {
  30251. id,
  30252. label: title.rendered,
  30253. url,
  30254. type,
  30255. kind: 'post-type'
  30256. }, innerBlocks);
  30257. if (!parent) {
  30258. navigationLinks.push(linkMap[id]);
  30259. } else {
  30260. if (!linkMap[parent]) {
  30261. // Use a placeholder if the child appears before parent in list.
  30262. linkMap[parent] = {
  30263. innerBlocks: []
  30264. };
  30265. }
  30266. const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
  30267. parentLinkInnerBlocks.push(linkMap[id]);
  30268. }
  30269. }); // Transform all links with innerBlocks into Submenus. This can't be done
  30270. // sooner because page objects have no information on their children.
  30271. const transformSubmenus = listOfLinks => {
  30272. listOfLinks.forEach((block, index, listOfLinksArray) => {
  30273. const {
  30274. attributes,
  30275. innerBlocks
  30276. } = block;
  30277. if (innerBlocks.length !== 0) {
  30278. transformSubmenus(innerBlocks);
  30279. const transformedBlock = createBlock('core/navigation-submenu', attributes, innerBlocks);
  30280. listOfLinksArray[index] = transformedBlock;
  30281. }
  30282. });
  30283. };
  30284. transformSubmenus(navigationLinks);
  30285. replaceBlock(clientId, navigationLinks);
  30286. };
  30287. };
  30288. function ConvertToLinksModal(_ref3) {
  30289. let {
  30290. onClose,
  30291. clientId
  30292. } = _ref3;
  30293. const {
  30294. records: pages,
  30295. hasResolved: pagesFinished
  30296. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
  30297. per_page: MAX_PAGE_COUNT,
  30298. _fields: PAGE_FIELDS,
  30299. // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
  30300. // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
  30301. // sort.
  30302. orderby: 'menu_order',
  30303. order: 'asc'
  30304. });
  30305. const {
  30306. replaceBlock
  30307. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  30308. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  30309. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  30310. onRequestClose: onClose,
  30311. title: (0,external_wp_i18n_namespaceObject.__)('Convert to links'),
  30312. className: 'wp-block-page-list-modal',
  30313. aria: {
  30314. describedby: 'wp-block-page-list-modal__description'
  30315. }
  30316. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  30317. id: 'wp-block-page-list-modal__description'
  30318. }, (0,external_wp_i18n_namespaceObject.__)('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), (0,external_wp_element_namespaceObject.createElement)("div", {
  30319. className: "wp-block-page-list-modal-buttons"
  30320. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  30321. variant: "tertiary",
  30322. onClick: onClose
  30323. }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  30324. variant: "primary",
  30325. disabled: !pagesFinished,
  30326. onClick: convertSelectedBlockToNavigationLinks({
  30327. pages,
  30328. replaceBlock,
  30329. clientId,
  30330. createBlock: external_wp_blocks_namespaceObject.createBlock
  30331. })
  30332. }, (0,external_wp_i18n_namespaceObject.__)('Convert'))));
  30333. }
  30334. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
  30335. /**
  30336. * WordPress dependencies
  30337. */
  30338. const icons_ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  30339. xmlns: "http://www.w3.org/2000/svg",
  30340. width: "12",
  30341. height: "12",
  30342. viewBox: "0 0 12 12",
  30343. fill: "none"
  30344. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  30345. d: "M1.50002 4L6.00002 8L10.5 4",
  30346. strokeWidth: "1.5"
  30347. }));
  30348. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
  30349. /**
  30350. * External dependencies
  30351. */
  30352. /**
  30353. * WordPress dependencies
  30354. */
  30355. /**
  30356. * Internal dependencies
  30357. */
  30358. // We only show the edit option when page count is <= MAX_PAGE_COUNT
  30359. // Performance of Navigation Links is not good past this value.
  30360. const edit_MAX_PAGE_COUNT = 100;
  30361. function PageListEdit(_ref) {
  30362. var _context$style;
  30363. let {
  30364. context,
  30365. clientId
  30366. } = _ref;
  30367. const {
  30368. pagesByParentId,
  30369. totalPages,
  30370. hasResolvedPages
  30371. } = usePageData();
  30372. const isNavigationChild = ('showSubmenuIcon' in context);
  30373. const allowConvertToLinks = isNavigationChild && totalPages <= edit_MAX_PAGE_COUNT;
  30374. const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  30375. const openModal = () => setOpen(true);
  30376. const closeModal = () => setOpen(false);
  30377. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  30378. className: classnames_default()('wp-block-page-list', {
  30379. 'has-text-color': !!context.textColor,
  30380. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
  30381. 'has-background': !!context.backgroundColor,
  30382. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
  30383. }),
  30384. style: { ...((_context$style = context.style) === null || _context$style === void 0 ? void 0 : _context$style.color)
  30385. }
  30386. });
  30387. const getBlockContent = () => {
  30388. if (!hasResolvedPages) {
  30389. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  30390. }
  30391. if (totalPages === null) {
  30392. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  30393. status: 'warning',
  30394. isDismissible: false
  30395. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')));
  30396. }
  30397. if (totalPages === 0) {
  30398. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  30399. status: 'info',
  30400. isDismissible: false
  30401. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')));
  30402. }
  30403. if (totalPages > 0) {
  30404. return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  30405. context: context,
  30406. pagesByParentId: pagesByParentId
  30407. }));
  30408. }
  30409. };
  30410. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, allowConvertToLinks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  30411. group: "other"
  30412. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30413. title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
  30414. onClick: openModal
  30415. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), allowConvertToLinks && isOpen && (0,external_wp_element_namespaceObject.createElement)(ConvertToLinksModal, {
  30416. onClose: closeModal,
  30417. clientId: clientId
  30418. }), getBlockContent());
  30419. }
  30420. function useFrontPageId() {
  30421. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  30422. const canReadSettings = select(external_wp_coreData_namespaceObject.store).canUser('read', 'settings');
  30423. if (!canReadSettings) {
  30424. return undefined;
  30425. }
  30426. const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
  30427. return (site === null || site === void 0 ? void 0 : site.show_on_front) === 'page' && (site === null || site === void 0 ? void 0 : site.page_on_front);
  30428. }, []);
  30429. }
  30430. function usePageData() {
  30431. const {
  30432. records: pages,
  30433. hasResolved: hasResolvedPages
  30434. } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
  30435. orderby: 'menu_order',
  30436. order: 'asc',
  30437. _fields: ['id', 'link', 'parent', 'title', 'menu_order'],
  30438. per_page: -1,
  30439. context: 'view'
  30440. });
  30441. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  30442. var _pages$length;
  30443. // TODO: Once the REST API supports passing multiple values to
  30444. // 'orderby', this can be removed.
  30445. // https://core.trac.wordpress.org/ticket/39037
  30446. const sortedPages = [...(pages !== null && pages !== void 0 ? pages : [])].sort((a, b) => {
  30447. if (a.menu_order === b.menu_order) {
  30448. return a.title.rendered.localeCompare(b.title.rendered);
  30449. }
  30450. return a.menu_order - b.menu_order;
  30451. });
  30452. const pagesByParentId = sortedPages.reduce((accumulator, page) => {
  30453. const {
  30454. parent
  30455. } = page;
  30456. if (accumulator.has(parent)) {
  30457. accumulator.get(parent).push(page);
  30458. } else {
  30459. accumulator.set(parent, [page]);
  30460. }
  30461. return accumulator;
  30462. }, new Map());
  30463. return {
  30464. pagesByParentId,
  30465. hasResolvedPages,
  30466. totalPages: (_pages$length = pages === null || pages === void 0 ? void 0 : pages.length) !== null && _pages$length !== void 0 ? _pages$length : null
  30467. };
  30468. }, [pages, hasResolvedPages]);
  30469. }
  30470. const PageItems = (0,external_wp_element_namespaceObject.memo)(function PageItems(_ref2) {
  30471. let {
  30472. context,
  30473. pagesByParentId,
  30474. parentId = 0,
  30475. depth = 0
  30476. } = _ref2;
  30477. const pages = pagesByParentId.get(parentId);
  30478. const frontPageId = useFrontPageId();
  30479. if (!(pages !== null && pages !== void 0 && pages.length)) {
  30480. return [];
  30481. }
  30482. return pages.map(page => {
  30483. var _page$title, _page$title2;
  30484. const hasChildren = pagesByParentId.has(page.id);
  30485. const isNavigationChild = ('showSubmenuIcon' in context);
  30486. return (0,external_wp_element_namespaceObject.createElement)("li", {
  30487. key: page.id,
  30488. className: classnames_default()('wp-block-pages-list__item', {
  30489. 'has-child': hasChildren,
  30490. 'wp-block-navigation-item': isNavigationChild,
  30491. 'open-on-click': context.openSubmenusOnClick,
  30492. 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
  30493. 'menu-item-home': page.id === frontPageId
  30494. })
  30495. }, hasChildren && context.openSubmenusOnClick ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("button", {
  30496. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
  30497. "aria-expanded": "false"
  30498. }, (_page$title = page.title) === null || _page$title === void 0 ? void 0 : _page$title.rendered), (0,external_wp_element_namespaceObject.createElement)("span", {
  30499. className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
  30500. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_wp_element_namespaceObject.createElement)("a", {
  30501. className: classnames_default()('wp-block-pages-list__item__link', {
  30502. 'wp-block-navigation-item__content': isNavigationChild
  30503. }),
  30504. href: page.link
  30505. }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  30506. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
  30507. "aria-expanded": "false"
  30508. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("ul", {
  30509. className: classnames_default()('submenu-container', {
  30510. 'wp-block-navigation__submenu-container': isNavigationChild
  30511. })
  30512. }, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  30513. context: context,
  30514. pagesByParentId: pagesByParentId,
  30515. parentId: page.id,
  30516. depth: depth + 1
  30517. }))));
  30518. });
  30519. });
  30520. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  30521. /**
  30522. * WordPress dependencies
  30523. */
  30524. /**
  30525. * Internal dependencies
  30526. */
  30527. const page_list_metadata = {
  30528. $schema: "https://schemas.wp.org/trunk/block.json",
  30529. apiVersion: 2,
  30530. name: "core/page-list",
  30531. title: "Page List",
  30532. category: "widgets",
  30533. description: "Display a list of all pages.",
  30534. keywords: ["menu", "navigation"],
  30535. textdomain: "default",
  30536. attributes: {},
  30537. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
  30538. supports: {
  30539. reusable: false,
  30540. html: false
  30541. },
  30542. editorStyle: "wp-block-page-list-editor",
  30543. style: "wp-block-page-list"
  30544. };
  30545. const {
  30546. name: page_list_name
  30547. } = page_list_metadata;
  30548. const page_list_settings = {
  30549. icon: library_pages,
  30550. example: {},
  30551. edit: PageListEdit
  30552. };
  30553. const page_list_init = () => initBlock({
  30554. name: page_list_name,
  30555. metadata: page_list_metadata,
  30556. settings: page_list_settings
  30557. });
  30558. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
  30559. /**
  30560. * WordPress dependencies
  30561. */
  30562. const paragraph = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30563. xmlns: "http://www.w3.org/2000/svg",
  30564. viewBox: "0 0 24 24"
  30565. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30566. d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"
  30567. }));
  30568. /* harmony default export */ var library_paragraph = (paragraph);
  30569. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
  30570. /**
  30571. * External dependencies
  30572. */
  30573. /**
  30574. * WordPress dependencies
  30575. */
  30576. const deprecated_supports = {
  30577. className: false
  30578. };
  30579. const paragraph_deprecated_blockAttributes = {
  30580. align: {
  30581. type: 'string'
  30582. },
  30583. content: {
  30584. type: 'string',
  30585. source: 'html',
  30586. selector: 'p',
  30587. default: ''
  30588. },
  30589. dropCap: {
  30590. type: 'boolean',
  30591. default: false
  30592. },
  30593. placeholder: {
  30594. type: 'string'
  30595. },
  30596. textColor: {
  30597. type: 'string'
  30598. },
  30599. backgroundColor: {
  30600. type: 'string'
  30601. },
  30602. fontSize: {
  30603. type: 'string'
  30604. },
  30605. direction: {
  30606. type: 'string',
  30607. enum: ['ltr', 'rtl']
  30608. },
  30609. style: {
  30610. type: 'object'
  30611. }
  30612. };
  30613. const migrateCustomColorsAndFontSizes = attributes => {
  30614. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) {
  30615. return attributes;
  30616. }
  30617. const style = {};
  30618. if (attributes.customTextColor || attributes.customBackgroundColor) {
  30619. style.color = {};
  30620. }
  30621. if (attributes.customTextColor) {
  30622. style.color.text = attributes.customTextColor;
  30623. }
  30624. if (attributes.customBackgroundColor) {
  30625. style.color.background = attributes.customBackgroundColor;
  30626. }
  30627. if (attributes.customFontSize) {
  30628. style.typography = {
  30629. fontSize: attributes.customFontSize
  30630. };
  30631. }
  30632. const {
  30633. customTextColor,
  30634. customBackgroundColor,
  30635. customFontSize,
  30636. ...restAttributes
  30637. } = attributes;
  30638. return { ...restAttributes,
  30639. style
  30640. };
  30641. };
  30642. const {
  30643. style,
  30644. ...restBlockAttributes
  30645. } = paragraph_deprecated_blockAttributes;
  30646. const paragraph_deprecated_deprecated = [{
  30647. supports: deprecated_supports,
  30648. attributes: { ...restBlockAttributes,
  30649. customTextColor: {
  30650. type: 'string'
  30651. },
  30652. customBackgroundColor: {
  30653. type: 'string'
  30654. },
  30655. customFontSize: {
  30656. type: 'number'
  30657. }
  30658. },
  30659. migrate: migrateCustomColorsAndFontSizes,
  30660. save(_ref) {
  30661. let {
  30662. attributes
  30663. } = _ref;
  30664. const {
  30665. align,
  30666. content,
  30667. dropCap,
  30668. backgroundColor,
  30669. textColor,
  30670. customBackgroundColor,
  30671. customTextColor,
  30672. fontSize,
  30673. customFontSize,
  30674. direction
  30675. } = attributes;
  30676. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  30677. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  30678. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  30679. const className = classnames_default()({
  30680. 'has-text-color': textColor || customTextColor,
  30681. 'has-background': backgroundColor || customBackgroundColor,
  30682. 'has-drop-cap': dropCap,
  30683. [`has-text-align-${align}`]: align,
  30684. [fontSizeClass]: fontSizeClass,
  30685. [textClass]: textClass,
  30686. [backgroundClass]: backgroundClass
  30687. });
  30688. const styles = {
  30689. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  30690. color: textClass ? undefined : customTextColor,
  30691. fontSize: fontSizeClass ? undefined : customFontSize
  30692. };
  30693. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30694. tagName: "p",
  30695. style: styles,
  30696. className: className ? className : undefined,
  30697. value: content,
  30698. dir: direction
  30699. });
  30700. }
  30701. }, {
  30702. supports: deprecated_supports,
  30703. attributes: { ...restBlockAttributes,
  30704. customTextColor: {
  30705. type: 'string'
  30706. },
  30707. customBackgroundColor: {
  30708. type: 'string'
  30709. },
  30710. customFontSize: {
  30711. type: 'number'
  30712. }
  30713. },
  30714. migrate: migrateCustomColorsAndFontSizes,
  30715. save(_ref2) {
  30716. let {
  30717. attributes
  30718. } = _ref2;
  30719. const {
  30720. align,
  30721. content,
  30722. dropCap,
  30723. backgroundColor,
  30724. textColor,
  30725. customBackgroundColor,
  30726. customTextColor,
  30727. fontSize,
  30728. customFontSize,
  30729. direction
  30730. } = attributes;
  30731. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  30732. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  30733. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  30734. const className = classnames_default()({
  30735. 'has-text-color': textColor || customTextColor,
  30736. 'has-background': backgroundColor || customBackgroundColor,
  30737. 'has-drop-cap': dropCap,
  30738. [fontSizeClass]: fontSizeClass,
  30739. [textClass]: textClass,
  30740. [backgroundClass]: backgroundClass
  30741. });
  30742. const styles = {
  30743. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  30744. color: textClass ? undefined : customTextColor,
  30745. fontSize: fontSizeClass ? undefined : customFontSize,
  30746. textAlign: align
  30747. };
  30748. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30749. tagName: "p",
  30750. style: styles,
  30751. className: className ? className : undefined,
  30752. value: content,
  30753. dir: direction
  30754. });
  30755. }
  30756. }, {
  30757. supports: deprecated_supports,
  30758. attributes: { ...restBlockAttributes,
  30759. customTextColor: {
  30760. type: 'string'
  30761. },
  30762. customBackgroundColor: {
  30763. type: 'string'
  30764. },
  30765. customFontSize: {
  30766. type: 'number'
  30767. },
  30768. width: {
  30769. type: 'string'
  30770. }
  30771. },
  30772. migrate: migrateCustomColorsAndFontSizes,
  30773. save(_ref3) {
  30774. let {
  30775. attributes
  30776. } = _ref3;
  30777. const {
  30778. width,
  30779. align,
  30780. content,
  30781. dropCap,
  30782. backgroundColor,
  30783. textColor,
  30784. customBackgroundColor,
  30785. customTextColor,
  30786. fontSize,
  30787. customFontSize
  30788. } = attributes;
  30789. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  30790. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  30791. const fontSizeClass = fontSize && `is-${fontSize}-text`;
  30792. const className = classnames_default()({
  30793. [`align${width}`]: width,
  30794. 'has-background': backgroundColor || customBackgroundColor,
  30795. 'has-drop-cap': dropCap,
  30796. [fontSizeClass]: fontSizeClass,
  30797. [textClass]: textClass,
  30798. [backgroundClass]: backgroundClass
  30799. });
  30800. const styles = {
  30801. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  30802. color: textClass ? undefined : customTextColor,
  30803. fontSize: fontSizeClass ? undefined : customFontSize,
  30804. textAlign: align
  30805. };
  30806. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30807. tagName: "p",
  30808. style: styles,
  30809. className: className ? className : undefined,
  30810. value: content
  30811. });
  30812. }
  30813. }, {
  30814. supports: deprecated_supports,
  30815. attributes: { ...restBlockAttributes,
  30816. fontSize: {
  30817. type: 'number'
  30818. }
  30819. },
  30820. save(_ref4) {
  30821. let {
  30822. attributes
  30823. } = _ref4;
  30824. const {
  30825. width,
  30826. align,
  30827. content,
  30828. dropCap,
  30829. backgroundColor,
  30830. textColor,
  30831. fontSize
  30832. } = attributes;
  30833. const className = classnames_default()({
  30834. [`align${width}`]: width,
  30835. 'has-background': backgroundColor,
  30836. 'has-drop-cap': dropCap
  30837. });
  30838. const styles = {
  30839. backgroundColor,
  30840. color: textColor,
  30841. fontSize,
  30842. textAlign: align
  30843. };
  30844. return (0,external_wp_element_namespaceObject.createElement)("p", {
  30845. style: styles,
  30846. className: className ? className : undefined
  30847. }, content);
  30848. },
  30849. migrate(attributes) {
  30850. return migrateCustomColorsAndFontSizes({ ...attributes,
  30851. customFontSize: Number.isFinite(attributes.fontSize) ? attributes.fontSize : undefined,
  30852. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  30853. customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
  30854. });
  30855. }
  30856. }, {
  30857. supports: deprecated_supports,
  30858. attributes: { ...paragraph_deprecated_blockAttributes,
  30859. content: {
  30860. type: 'string',
  30861. source: 'html',
  30862. default: ''
  30863. }
  30864. },
  30865. save(_ref5) {
  30866. let {
  30867. attributes
  30868. } = _ref5;
  30869. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  30870. },
  30871. migrate(attributes) {
  30872. return attributes;
  30873. }
  30874. }];
  30875. /* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);
  30876. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
  30877. /**
  30878. * WordPress dependencies
  30879. */
  30880. const formatLtr = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30881. xmlns: "http://www.w3.org/2000/svg",
  30882. viewBox: "-2 -2 24 24"
  30883. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30884. d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
  30885. }));
  30886. /* harmony default export */ var format_ltr = (formatLtr);
  30887. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/use-enter.js
  30888. /**
  30889. * WordPress dependencies
  30890. */
  30891. function useOnEnter(props) {
  30892. const {
  30893. batch
  30894. } = (0,external_wp_data_namespaceObject.useRegistry)();
  30895. const {
  30896. moveBlocksToPosition,
  30897. replaceInnerBlocks,
  30898. duplicateBlocks,
  30899. insertBlock
  30900. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  30901. const {
  30902. getBlockRootClientId,
  30903. getBlockIndex,
  30904. getBlockOrder,
  30905. getBlockName,
  30906. getBlock,
  30907. getNextBlockClientId
  30908. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  30909. const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
  30910. propsRef.current = props;
  30911. return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
  30912. function onKeyDown(event) {
  30913. if (event.defaultPrevented) {
  30914. return;
  30915. }
  30916. if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
  30917. return;
  30918. }
  30919. const {
  30920. content,
  30921. clientId
  30922. } = propsRef.current; // The paragraph should be empty.
  30923. if (content.length) {
  30924. return;
  30925. }
  30926. const wrapperClientId = getBlockRootClientId(clientId);
  30927. if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) {
  30928. return;
  30929. }
  30930. const order = getBlockOrder(wrapperClientId);
  30931. event.preventDefault();
  30932. const position = order.indexOf(clientId); // If it is the last block, exit.
  30933. if (position === order.length - 1) {
  30934. moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(wrapperClientId), getBlockIndex(wrapperClientId) + 1);
  30935. return;
  30936. } // If it is in the middle, split the block in two.
  30937. const wrapperBlock = getBlock(wrapperClientId);
  30938. batch(() => {
  30939. duplicateBlocks([wrapperClientId]);
  30940. const blockIndex = getBlockIndex(wrapperClientId);
  30941. replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position));
  30942. replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1));
  30943. insertBlock((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'), blockIndex + 1, getBlockRootClientId(wrapperClientId), true);
  30944. });
  30945. }
  30946. element.addEventListener('keydown', onKeyDown);
  30947. return () => {
  30948. element.removeEventListener('keydown', onKeyDown);
  30949. };
  30950. }, []);
  30951. }
  30952. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
  30953. /**
  30954. * External dependencies
  30955. */
  30956. /**
  30957. * WordPress dependencies
  30958. */
  30959. /**
  30960. * Internal dependencies
  30961. */
  30962. const paragraph_edit_name = 'core/paragraph';
  30963. function ParagraphRTLControl(_ref) {
  30964. let {
  30965. direction,
  30966. setDirection
  30967. } = _ref;
  30968. return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30969. icon: format_ltr,
  30970. title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
  30971. isActive: direction === 'ltr',
  30972. onClick: () => {
  30973. setDirection(direction === 'ltr' ? undefined : 'ltr');
  30974. }
  30975. });
  30976. }
  30977. function ParagraphBlock(_ref2) {
  30978. let {
  30979. attributes,
  30980. mergeBlocks,
  30981. onReplace,
  30982. onRemove,
  30983. setAttributes,
  30984. clientId
  30985. } = _ref2;
  30986. const {
  30987. align,
  30988. content,
  30989. direction,
  30990. dropCap,
  30991. placeholder
  30992. } = attributes;
  30993. const isDropCapFeatureEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.dropCap');
  30994. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  30995. ref: useOnEnter({
  30996. clientId,
  30997. content
  30998. }),
  30999. className: classnames_default()({
  31000. 'has-drop-cap': dropCap,
  31001. [`has-text-align-${align}`]: align
  31002. }),
  31003. style: {
  31004. direction
  31005. }
  31006. });
  31007. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  31008. group: "block"
  31009. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  31010. value: align,
  31011. onChange: newAlign => setAttributes({
  31012. align: newAlign
  31013. })
  31014. }), (0,external_wp_element_namespaceObject.createElement)(ParagraphRTLControl, {
  31015. direction: direction,
  31016. setDirection: newDirection => setAttributes({
  31017. direction: newDirection
  31018. })
  31019. })), isDropCapFeatureEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  31020. __experimentalGroup: "typography"
  31021. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  31022. hasValue: () => !!dropCap,
  31023. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  31024. onDeselect: () => setAttributes({
  31025. dropCap: undefined
  31026. }),
  31027. resetAllFilter: () => ({
  31028. dropCap: undefined
  31029. }),
  31030. panelId: clientId
  31031. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31032. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  31033. checked: !!dropCap,
  31034. onChange: () => setAttributes({
  31035. dropCap: !dropCap
  31036. }),
  31037. help: dropCap ? (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.') : (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.')
  31038. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  31039. identifier: "content",
  31040. tagName: "p"
  31041. }, blockProps, {
  31042. value: content,
  31043. onChange: newContent => setAttributes({
  31044. content: newContent
  31045. }),
  31046. onSplit: (value, isOriginal) => {
  31047. let newAttributes;
  31048. if (isOriginal || value) {
  31049. newAttributes = { ...attributes,
  31050. content: value
  31051. };
  31052. }
  31053. const block = (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);
  31054. if (isOriginal) {
  31055. block.clientId = clientId;
  31056. }
  31057. return block;
  31058. },
  31059. onMerge: mergeBlocks,
  31060. onReplace: onReplace,
  31061. onRemove: onRemove,
  31062. "aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
  31063. "data-empty": content ? false : true,
  31064. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
  31065. "data-custom-placeholder": placeholder ? true : undefined,
  31066. __unstableEmbedURLOnPaste: true,
  31067. __unstableAllowPrefixTransformations: true
  31068. })));
  31069. }
  31070. /* harmony default export */ var paragraph_edit = (ParagraphBlock);
  31071. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
  31072. /**
  31073. * External dependencies
  31074. */
  31075. /**
  31076. * WordPress dependencies
  31077. */
  31078. function paragraph_save_save(_ref) {
  31079. let {
  31080. attributes
  31081. } = _ref;
  31082. const {
  31083. align,
  31084. content,
  31085. dropCap,
  31086. direction
  31087. } = attributes;
  31088. const className = classnames_default()({
  31089. 'has-drop-cap': dropCap,
  31090. [`has-text-align-${align}`]: align
  31091. });
  31092. return (0,external_wp_element_namespaceObject.createElement)("p", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  31093. className,
  31094. dir: direction
  31095. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  31096. value: content
  31097. }));
  31098. }
  31099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
  31100. /**
  31101. * WordPress dependencies
  31102. */
  31103. /**
  31104. * Internal dependencies
  31105. */
  31106. const {
  31107. name: paragraph_transforms_name
  31108. } = {
  31109. $schema: "https://schemas.wp.org/trunk/block.json",
  31110. apiVersion: 2,
  31111. name: "core/paragraph",
  31112. title: "Paragraph",
  31113. category: "text",
  31114. description: "Start with the basic building block of all narrative.",
  31115. keywords: ["text"],
  31116. textdomain: "default",
  31117. attributes: {
  31118. align: {
  31119. type: "string"
  31120. },
  31121. content: {
  31122. type: "string",
  31123. source: "html",
  31124. selector: "p",
  31125. "default": "",
  31126. __experimentalRole: "content"
  31127. },
  31128. dropCap: {
  31129. type: "boolean",
  31130. "default": false
  31131. },
  31132. placeholder: {
  31133. type: "string"
  31134. },
  31135. direction: {
  31136. type: "string",
  31137. "enum": ["ltr", "rtl"]
  31138. }
  31139. },
  31140. supports: {
  31141. anchor: true,
  31142. className: false,
  31143. color: {
  31144. gradients: true,
  31145. link: true,
  31146. __experimentalDefaultControls: {
  31147. background: true,
  31148. text: true
  31149. }
  31150. },
  31151. spacing: {
  31152. margin: true,
  31153. padding: true
  31154. },
  31155. typography: {
  31156. fontSize: true,
  31157. lineHeight: true,
  31158. __experimentalFontFamily: true,
  31159. __experimentalTextDecoration: true,
  31160. __experimentalFontStyle: true,
  31161. __experimentalFontWeight: true,
  31162. __experimentalLetterSpacing: true,
  31163. __experimentalTextTransform: true,
  31164. __experimentalDefaultControls: {
  31165. fontSize: true
  31166. }
  31167. },
  31168. __experimentalSelector: "p",
  31169. __unstablePasteTextInline: true
  31170. },
  31171. editorStyle: "wp-block-paragraph-editor",
  31172. style: "wp-block-paragraph"
  31173. };
  31174. const paragraph_transforms_transforms = {
  31175. from: [{
  31176. type: 'raw',
  31177. // Paragraph is a fallback and should be matched last.
  31178. priority: 20,
  31179. selector: 'p',
  31180. schema: _ref => {
  31181. let {
  31182. phrasingContentSchema,
  31183. isPaste
  31184. } = _ref;
  31185. return {
  31186. p: {
  31187. children: phrasingContentSchema,
  31188. attributes: isPaste ? [] : ['style', 'id']
  31189. }
  31190. };
  31191. },
  31192. transform(node) {
  31193. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
  31194. const {
  31195. textAlign
  31196. } = node.style || {};
  31197. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  31198. attributes.align = textAlign;
  31199. }
  31200. return (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
  31201. }
  31202. }]
  31203. };
  31204. /* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);
  31205. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  31206. /**
  31207. * External dependencies
  31208. */
  31209. /**
  31210. * WordPress dependencies
  31211. */
  31212. /**
  31213. * Internal dependencies
  31214. */
  31215. const paragraph_metadata = {
  31216. $schema: "https://schemas.wp.org/trunk/block.json",
  31217. apiVersion: 2,
  31218. name: "core/paragraph",
  31219. title: "Paragraph",
  31220. category: "text",
  31221. description: "Start with the basic building block of all narrative.",
  31222. keywords: ["text"],
  31223. textdomain: "default",
  31224. attributes: {
  31225. align: {
  31226. type: "string"
  31227. },
  31228. content: {
  31229. type: "string",
  31230. source: "html",
  31231. selector: "p",
  31232. "default": "",
  31233. __experimentalRole: "content"
  31234. },
  31235. dropCap: {
  31236. type: "boolean",
  31237. "default": false
  31238. },
  31239. placeholder: {
  31240. type: "string"
  31241. },
  31242. direction: {
  31243. type: "string",
  31244. "enum": ["ltr", "rtl"]
  31245. }
  31246. },
  31247. supports: {
  31248. anchor: true,
  31249. className: false,
  31250. color: {
  31251. gradients: true,
  31252. link: true,
  31253. __experimentalDefaultControls: {
  31254. background: true,
  31255. text: true
  31256. }
  31257. },
  31258. spacing: {
  31259. margin: true,
  31260. padding: true
  31261. },
  31262. typography: {
  31263. fontSize: true,
  31264. lineHeight: true,
  31265. __experimentalFontFamily: true,
  31266. __experimentalTextDecoration: true,
  31267. __experimentalFontStyle: true,
  31268. __experimentalFontWeight: true,
  31269. __experimentalLetterSpacing: true,
  31270. __experimentalTextTransform: true,
  31271. __experimentalDefaultControls: {
  31272. fontSize: true
  31273. }
  31274. },
  31275. __experimentalSelector: "p",
  31276. __unstablePasteTextInline: true
  31277. },
  31278. editorStyle: "wp-block-paragraph-editor",
  31279. style: "wp-block-paragraph"
  31280. };
  31281. const {
  31282. name: paragraph_name
  31283. } = paragraph_metadata;
  31284. const paragraph_settings = {
  31285. icon: library_paragraph,
  31286. example: {
  31287. attributes: {
  31288. content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
  31289. style: {
  31290. typography: {
  31291. fontSize: 28
  31292. }
  31293. },
  31294. dropCap: true
  31295. }
  31296. },
  31297. __experimentalLabel(attributes, _ref) {
  31298. let {
  31299. context
  31300. } = _ref;
  31301. if (context === 'accessibility') {
  31302. const {
  31303. content
  31304. } = attributes;
  31305. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
  31306. }
  31307. },
  31308. transforms: paragraph_transforms,
  31309. deprecated: paragraph_deprecated,
  31310. merge(attributes, attributesToMerge) {
  31311. return {
  31312. content: (attributes.content || '') + (attributesToMerge.content || '')
  31313. };
  31314. },
  31315. edit: paragraph_edit,
  31316. save: paragraph_save_save
  31317. };
  31318. const paragraph_init = () => initBlock({
  31319. name: paragraph_name,
  31320. metadata: paragraph_metadata,
  31321. settings: paragraph_settings
  31322. });
  31323. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
  31324. /**
  31325. * WordPress dependencies
  31326. */
  31327. const postAuthor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  31328. viewBox: "0 0 24 24",
  31329. xmlns: "http://www.w3.org/2000/svg"
  31330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  31331. d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
  31332. fillRule: "evenodd",
  31333. clipRule: "evenodd"
  31334. }));
  31335. /* harmony default export */ var post_author = (postAuthor);
  31336. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
  31337. /**
  31338. * External dependencies
  31339. */
  31340. /**
  31341. * WordPress dependencies
  31342. */
  31343. function PostAuthorEdit(_ref) {
  31344. let {
  31345. isSelected,
  31346. context: {
  31347. postType,
  31348. postId,
  31349. queryId
  31350. },
  31351. attributes,
  31352. setAttributes
  31353. } = _ref;
  31354. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  31355. const {
  31356. authorId,
  31357. authorDetails,
  31358. authors
  31359. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31360. var _getEditedEntityRecor;
  31361. const {
  31362. getEditedEntityRecord,
  31363. getUser,
  31364. getUsers
  31365. } = select(external_wp_coreData_namespaceObject.store);
  31366. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  31367. return {
  31368. authorId: _authorId,
  31369. authorDetails: _authorId ? getUser(_authorId) : null,
  31370. authors: getUsers({
  31371. who: 'authors'
  31372. })
  31373. };
  31374. }, [postType, postId]);
  31375. const {
  31376. editEntityRecord
  31377. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  31378. const {
  31379. textAlign,
  31380. showAvatar,
  31381. showBio,
  31382. byline
  31383. } = attributes;
  31384. const avatarSizes = [];
  31385. if (authorDetails) {
  31386. Object.keys(authorDetails.avatar_urls).forEach(size => {
  31387. avatarSizes.push({
  31388. value: size,
  31389. label: `${size} x ${size}`
  31390. });
  31391. });
  31392. }
  31393. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  31394. className: classnames_default()({
  31395. [`has-text-align-${textAlign}`]: textAlign
  31396. })
  31397. });
  31398. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31399. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  31400. }, !!postId && !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  31401. label: (0,external_wp_i18n_namespaceObject.__)('Author'),
  31402. value: authorId,
  31403. options: authors.map(_ref2 => {
  31404. let {
  31405. id,
  31406. name
  31407. } = _ref2;
  31408. return {
  31409. value: id,
  31410. label: name
  31411. };
  31412. }),
  31413. onChange: nextAuthorId => {
  31414. editEntityRecord('postType', postType, postId, {
  31415. author: nextAuthorId
  31416. });
  31417. }
  31418. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31419. label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
  31420. checked: showAvatar,
  31421. onChange: () => setAttributes({
  31422. showAvatar: !showAvatar
  31423. })
  31424. }), showAvatar && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  31425. label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
  31426. value: attributes.avatarSize,
  31427. options: avatarSizes,
  31428. onChange: size => {
  31429. setAttributes({
  31430. avatarSize: Number(size)
  31431. });
  31432. }
  31433. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31434. label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
  31435. checked: showBio,
  31436. onChange: () => setAttributes({
  31437. showBio: !showBio
  31438. })
  31439. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  31440. group: "block"
  31441. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  31442. value: textAlign,
  31443. onChange: nextAlign => {
  31444. setAttributes({
  31445. textAlign: nextAlign
  31446. });
  31447. }
  31448. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, showAvatar && authorDetails && (0,external_wp_element_namespaceObject.createElement)("div", {
  31449. className: "wp-block-post-author__avatar"
  31450. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  31451. width: attributes.avatarSize,
  31452. src: authorDetails.avatar_urls[attributes.avatarSize],
  31453. alt: authorDetails.name
  31454. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  31455. className: "wp-block-post-author__content"
  31456. }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  31457. className: "wp-block-post-author__byline",
  31458. multiline: false,
  31459. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
  31460. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
  31461. value: byline,
  31462. onChange: value => setAttributes({
  31463. byline: value
  31464. })
  31465. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  31466. className: "wp-block-post-author__name"
  31467. }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || (0,external_wp_i18n_namespaceObject.__)('Post Author')), showBio && (0,external_wp_element_namespaceObject.createElement)("p", {
  31468. className: "wp-block-post-author__bio",
  31469. dangerouslySetInnerHTML: {
  31470. __html: authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description
  31471. }
  31472. }))));
  31473. }
  31474. /* harmony default export */ var post_author_edit = (PostAuthorEdit);
  31475. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  31476. /**
  31477. * WordPress dependencies
  31478. */
  31479. /**
  31480. * Internal dependencies
  31481. */
  31482. const post_author_metadata = {
  31483. $schema: "https://schemas.wp.org/trunk/block.json",
  31484. apiVersion: 2,
  31485. name: "core/post-author",
  31486. title: "Post Author",
  31487. category: "theme",
  31488. description: "Display post author details such as name, avatar, and bio.",
  31489. textdomain: "default",
  31490. attributes: {
  31491. textAlign: {
  31492. type: "string"
  31493. },
  31494. avatarSize: {
  31495. type: "number",
  31496. "default": 48
  31497. },
  31498. showAvatar: {
  31499. type: "boolean",
  31500. "default": true
  31501. },
  31502. showBio: {
  31503. type: "boolean"
  31504. },
  31505. byline: {
  31506. type: "string"
  31507. }
  31508. },
  31509. usesContext: ["postType", "postId", "queryId"],
  31510. supports: {
  31511. html: false,
  31512. spacing: {
  31513. margin: true,
  31514. padding: true
  31515. },
  31516. typography: {
  31517. fontSize: true,
  31518. lineHeight: true,
  31519. __experimentalFontFamily: true,
  31520. __experimentalFontWeight: true,
  31521. __experimentalFontStyle: true,
  31522. __experimentalTextTransform: true,
  31523. __experimentalTextDecoration: true,
  31524. __experimentalLetterSpacing: true,
  31525. __experimentalDefaultControls: {
  31526. fontSize: true
  31527. }
  31528. },
  31529. color: {
  31530. gradients: true,
  31531. link: true,
  31532. __experimentalDuotone: ".wp-block-post-author__avatar img",
  31533. __experimentalDefaultControls: {
  31534. background: true,
  31535. text: true
  31536. }
  31537. }
  31538. },
  31539. editorStyle: "wp-block-post-author-editor",
  31540. style: "wp-block-post-author"
  31541. };
  31542. const {
  31543. name: post_author_name
  31544. } = post_author_metadata;
  31545. const post_author_settings = {
  31546. icon: post_author,
  31547. edit: post_author_edit
  31548. };
  31549. const post_author_init = () => initBlock({
  31550. name: post_author_name,
  31551. metadata: post_author_metadata,
  31552. settings: post_author_settings
  31553. });
  31554. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/edit.js
  31555. /**
  31556. * External dependencies
  31557. */
  31558. /**
  31559. * WordPress dependencies
  31560. */
  31561. function PostAuthorNameEdit(_ref) {
  31562. let {
  31563. context: {
  31564. postType,
  31565. postId
  31566. },
  31567. attributes: {
  31568. textAlign,
  31569. isLink,
  31570. linkTarget
  31571. },
  31572. setAttributes
  31573. } = _ref;
  31574. const {
  31575. authorName
  31576. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31577. var _getEditedEntityRecor;
  31578. const {
  31579. getEditedEntityRecord,
  31580. getUser
  31581. } = select(external_wp_coreData_namespaceObject.store);
  31582. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  31583. return {
  31584. authorName: _authorId ? getUser(_authorId) : null
  31585. };
  31586. }, [postType, postId]);
  31587. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  31588. className: classnames_default()({
  31589. [`has-text-align-${textAlign}`]: textAlign
  31590. })
  31591. });
  31592. const displayName = (authorName === null || authorName === void 0 ? void 0 : authorName.name) || (0,external_wp_i18n_namespaceObject.__)('Author Name');
  31593. const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  31594. href: "#author-pseudo-link",
  31595. onClick: event => event.preventDefault(),
  31596. className: "wp-block-post-author-name__link"
  31597. }, displayName) : displayName;
  31598. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  31599. group: "block"
  31600. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  31601. value: textAlign,
  31602. onChange: nextAlign => {
  31603. setAttributes({
  31604. textAlign: nextAlign
  31605. });
  31606. }
  31607. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31608. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  31609. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31610. label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'),
  31611. onChange: () => setAttributes({
  31612. isLink: !isLink
  31613. }),
  31614. checked: isLink
  31615. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  31616. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  31617. onChange: value => setAttributes({
  31618. linkTarget: value ? '_blank' : '_self'
  31619. }),
  31620. checked: linkTarget === '_blank'
  31621. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, " ", displayAuthor, " "));
  31622. }
  31623. /* harmony default export */ var post_author_name_edit = (PostAuthorNameEdit);
  31624. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/transforms.js
  31625. /**
  31626. * WordPress dependencies
  31627. */
  31628. const post_author_name_transforms_transforms = {
  31629. from: [{
  31630. type: 'block',
  31631. blocks: ['core/post-author'],
  31632. transform: _ref => {
  31633. let {
  31634. textAlign
  31635. } = _ref;
  31636. return (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author-name', {
  31637. textAlign
  31638. });
  31639. }
  31640. }],
  31641. to: [{
  31642. type: 'block',
  31643. blocks: ['core/post-author'],
  31644. transform: _ref2 => {
  31645. let {
  31646. textAlign
  31647. } = _ref2;
  31648. return (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author', {
  31649. textAlign
  31650. });
  31651. }
  31652. }]
  31653. };
  31654. /* harmony default export */ var post_author_name_transforms = (post_author_name_transforms_transforms);
  31655. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js
  31656. /**
  31657. * WordPress dependencies
  31658. */
  31659. /**
  31660. * Internal dependencies
  31661. */
  31662. const post_author_name_metadata = {
  31663. $schema: "https://schemas.wp.org/trunk/block.json",
  31664. apiVersion: 2,
  31665. __experimental: true,
  31666. name: "core/post-author-name",
  31667. title: "Post Author Name",
  31668. category: "theme",
  31669. description: "The author name.",
  31670. textdomain: "default",
  31671. attributes: {
  31672. textAlign: {
  31673. type: "string"
  31674. },
  31675. isLink: {
  31676. type: "boolean",
  31677. "default": false
  31678. },
  31679. linkTarget: {
  31680. type: "string",
  31681. "default": "_self"
  31682. }
  31683. },
  31684. usesContext: ["postType", "postId"],
  31685. supports: {
  31686. html: false,
  31687. spacing: {
  31688. margin: true,
  31689. padding: true
  31690. },
  31691. color: {
  31692. gradients: true,
  31693. link: true,
  31694. __experimentalDefaultControls: {
  31695. background: true,
  31696. text: true,
  31697. link: true
  31698. }
  31699. },
  31700. typography: {
  31701. fontSize: true,
  31702. lineHeight: true,
  31703. __experimentalFontFamily: true,
  31704. __experimentalFontWeight: true,
  31705. __experimentalFontStyle: true,
  31706. __experimentalTextTransform: true,
  31707. __experimentalTextDecoration: true,
  31708. __experimentalLetterSpacing: true,
  31709. __experimentalDefaultControls: {
  31710. fontSize: true
  31711. }
  31712. }
  31713. }
  31714. };
  31715. const {
  31716. name: post_author_name_name
  31717. } = post_author_name_metadata;
  31718. const post_author_name_settings = {
  31719. icon: post_author,
  31720. transforms: post_author_name_transforms,
  31721. edit: post_author_name_edit
  31722. };
  31723. const post_author_name_init = () => initBlock({
  31724. name: post_author_name_name,
  31725. metadata: post_author_name_metadata,
  31726. settings: post_author_name_settings
  31727. });
  31728. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js
  31729. /**
  31730. * External dependencies
  31731. */
  31732. /**
  31733. * WordPress dependencies
  31734. */
  31735. function PostAuthorBiographyEdit(_ref) {
  31736. let {
  31737. context: {
  31738. postType,
  31739. postId
  31740. },
  31741. attributes: {
  31742. textAlign
  31743. },
  31744. setAttributes
  31745. } = _ref;
  31746. const {
  31747. authorDetails
  31748. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31749. var _getEditedEntityRecor;
  31750. const {
  31751. getEditedEntityRecord,
  31752. getUser
  31753. } = select(external_wp_coreData_namespaceObject.store);
  31754. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  31755. return {
  31756. authorDetails: _authorId ? getUser(_authorId) : null
  31757. };
  31758. }, [postType, postId]);
  31759. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  31760. className: classnames_default()({
  31761. [`has-text-align-${textAlign}`]: textAlign
  31762. })
  31763. });
  31764. const displayAuthorBiography = (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description) || (0,external_wp_i18n_namespaceObject.__)('Author Biography');
  31765. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  31766. group: "block"
  31767. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  31768. value: textAlign,
  31769. onChange: nextAlign => {
  31770. setAttributes({
  31771. textAlign: nextAlign
  31772. });
  31773. }
  31774. })), (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  31775. dangerouslySetInnerHTML: {
  31776. __html: displayAuthorBiography
  31777. }
  31778. })));
  31779. }
  31780. /* harmony default export */ var post_author_biography_edit = (PostAuthorBiographyEdit);
  31781. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  31782. /**
  31783. * WordPress dependencies
  31784. */
  31785. /**
  31786. * Internal dependencies
  31787. */
  31788. const post_author_biography_metadata = {
  31789. $schema: "https://schemas.wp.org/trunk/block.json",
  31790. apiVersion: 2,
  31791. name: "core/post-author-biography",
  31792. title: "Post Author Biography",
  31793. category: "theme",
  31794. description: "The author biography.",
  31795. textdomain: "default",
  31796. attributes: {
  31797. textAlign: {
  31798. type: "string"
  31799. }
  31800. },
  31801. usesContext: ["postType", "postId"],
  31802. supports: {
  31803. spacing: {
  31804. margin: true,
  31805. padding: true
  31806. },
  31807. color: {
  31808. gradients: true,
  31809. link: true,
  31810. __experimentalDefaultControls: {
  31811. background: true,
  31812. text: true
  31813. }
  31814. },
  31815. typography: {
  31816. fontSize: true,
  31817. lineHeight: true,
  31818. __experimentalFontFamily: true,
  31819. __experimentalFontWeight: true,
  31820. __experimentalFontStyle: true,
  31821. __experimentalTextTransform: true,
  31822. __experimentalTextDecoration: true,
  31823. __experimentalLetterSpacing: true,
  31824. __experimentalDefaultControls: {
  31825. fontSize: true
  31826. }
  31827. }
  31828. }
  31829. };
  31830. const {
  31831. name: post_author_biography_name
  31832. } = post_author_biography_metadata;
  31833. const post_author_biography_settings = {
  31834. icon: post_author,
  31835. edit: post_author_biography_edit
  31836. };
  31837. const post_author_biography_init = () => initBlock({
  31838. name: post_author_biography_name,
  31839. metadata: post_author_biography_metadata,
  31840. settings: post_author_biography_settings
  31841. });
  31842. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
  31843. /**
  31844. * WordPress dependencies
  31845. */
  31846. const blockDefault = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  31847. xmlns: "http://www.w3.org/2000/svg",
  31848. viewBox: "0 0 24 24"
  31849. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  31850. d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
  31851. }));
  31852. /* harmony default export */ var block_default = (blockDefault);
  31853. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/edit.js
  31854. /**
  31855. * WordPress dependencies
  31856. */
  31857. const post_comment_edit_ALLOWED_BLOCKS = ['core/avatar', 'core/comment-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link'];
  31858. const post_comment_edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
  31859. function post_comment_edit_Edit(_ref) {
  31860. let {
  31861. attributes: {
  31862. commentId
  31863. },
  31864. setAttributes
  31865. } = _ref;
  31866. const [commentIdInput, setCommentIdInput] = (0,external_wp_element_namespaceObject.useState)(commentId);
  31867. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31868. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31869. template: post_comment_edit_TEMPLATE,
  31870. allowedBlocks: post_comment_edit_ALLOWED_BLOCKS
  31871. });
  31872. if (!commentId) {
  31873. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  31874. icon: block_default,
  31875. label: (0,external_wp_i18n_namespaceObject._x)('Post Comment', 'block title'),
  31876. instructions: (0,external_wp_i18n_namespaceObject.__)('To show a comment, input the comment ID.')
  31877. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  31878. value: commentId,
  31879. onChange: val => setCommentIdInput(parseInt(val))
  31880. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  31881. variant: "primary",
  31882. onClick: () => {
  31883. setAttributes({
  31884. commentId: commentIdInput
  31885. });
  31886. }
  31887. }, (0,external_wp_i18n_namespaceObject.__)('Save'))));
  31888. }
  31889. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  31890. }
  31891. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/save.js
  31892. /**
  31893. * WordPress dependencies
  31894. */
  31895. function post_comment_save_save() {
  31896. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  31897. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  31898. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  31899. }
  31900. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js
  31901. /**
  31902. * WordPress dependencies
  31903. */
  31904. /**
  31905. * Internal dependencies
  31906. */
  31907. const post_comment_metadata = {
  31908. $schema: "https://schemas.wp.org/trunk/block.json",
  31909. apiVersion: 2,
  31910. __experimental: "fse",
  31911. name: "core/post-comment",
  31912. title: "Post Comment (deprecated)",
  31913. category: "theme",
  31914. description: "This block is deprecated. Please use the Comments block instead.",
  31915. textdomain: "default",
  31916. attributes: {
  31917. commentId: {
  31918. type: "number"
  31919. }
  31920. },
  31921. providesContext: {
  31922. commentId: "commentId"
  31923. },
  31924. supports: {
  31925. html: false,
  31926. inserter: false
  31927. }
  31928. };
  31929. const {
  31930. name: post_comment_name
  31931. } = post_comment_metadata;
  31932. const post_comment_settings = {
  31933. icon: library_comment,
  31934. edit: post_comment_edit_Edit,
  31935. save: post_comment_save_save
  31936. };
  31937. const post_comment_init = () => initBlock({
  31938. name: post_comment_name,
  31939. metadata: post_comment_metadata,
  31940. settings: post_comment_settings
  31941. });
  31942. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-count.js
  31943. /**
  31944. * WordPress dependencies
  31945. */
  31946. const postCommentsCount = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  31947. xmlns: "http://www.w3.org/2000/svg",
  31948. viewBox: "0 0 24 24"
  31949. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  31950. d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"
  31951. }));
  31952. /* harmony default export */ var post_comments_count = (postCommentsCount);
  31953. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-count/edit.js
  31954. /**
  31955. * External dependencies
  31956. */
  31957. /**
  31958. * WordPress dependencies
  31959. */
  31960. function PostCommentsCountEdit(_ref) {
  31961. var _blockProps$style;
  31962. let {
  31963. attributes,
  31964. context,
  31965. setAttributes
  31966. } = _ref;
  31967. const {
  31968. textAlign
  31969. } = attributes;
  31970. const {
  31971. postId
  31972. } = context;
  31973. const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
  31974. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  31975. className: classnames_default()({
  31976. [`has-text-align-${textAlign}`]: textAlign
  31977. })
  31978. });
  31979. (0,external_wp_element_namespaceObject.useEffect)(() => {
  31980. if (!postId) {
  31981. return;
  31982. }
  31983. const currentPostId = postId;
  31984. external_wp_apiFetch_default()({
  31985. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
  31986. post: postId
  31987. }),
  31988. parse: false
  31989. }).then(res => {
  31990. // Stale requests will have the `currentPostId` of an older closure.
  31991. if (currentPostId === postId) {
  31992. setCommentsCount(res.headers.get('X-WP-Total'));
  31993. }
  31994. });
  31995. }, [postId]);
  31996. const hasPostAndComments = postId && commentsCount !== undefined;
  31997. const blockStyles = { ...blockProps.style,
  31998. textDecoration: hasPostAndComments ? (_blockProps$style = blockProps.style) === null || _blockProps$style === void 0 ? void 0 : _blockProps$style.textDecoration : undefined
  31999. };
  32000. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32001. group: "block"
  32002. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32003. value: textAlign,
  32004. onChange: nextAlign => {
  32005. setAttributes({
  32006. textAlign: nextAlign
  32007. });
  32008. }
  32009. })), (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  32010. style: blockStyles
  32011. }), hasPostAndComments ? commentsCount : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Count block: post not found.'))));
  32012. }
  32013. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js
  32014. /**
  32015. * WordPress dependencies
  32016. */
  32017. /**
  32018. * Internal dependencies
  32019. */
  32020. const post_comments_count_metadata = {
  32021. $schema: "https://schemas.wp.org/trunk/block.json",
  32022. apiVersion: 2,
  32023. __experimental: "fse",
  32024. name: "core/post-comments-count",
  32025. title: "Post Comments Count",
  32026. category: "theme",
  32027. description: "Display a post's comments count.",
  32028. textdomain: "default",
  32029. attributes: {
  32030. textAlign: {
  32031. type: "string"
  32032. }
  32033. },
  32034. usesContext: ["postId"],
  32035. supports: {
  32036. html: false,
  32037. color: {
  32038. gradients: true,
  32039. __experimentalDefaultControls: {
  32040. background: true,
  32041. text: true
  32042. }
  32043. },
  32044. typography: {
  32045. fontSize: true,
  32046. lineHeight: true,
  32047. __experimentalFontFamily: true,
  32048. __experimentalFontWeight: true,
  32049. __experimentalFontStyle: true,
  32050. __experimentalTextTransform: true,
  32051. __experimentalTextDecoration: true,
  32052. __experimentalLetterSpacing: true,
  32053. __experimentalDefaultControls: {
  32054. fontSize: true
  32055. }
  32056. }
  32057. }
  32058. };
  32059. const {
  32060. name: post_comments_count_name
  32061. } = post_comments_count_metadata;
  32062. const post_comments_count_settings = {
  32063. icon: post_comments_count,
  32064. edit: PostCommentsCountEdit
  32065. };
  32066. const post_comments_count_init = () => initBlock({
  32067. name: post_comments_count_name,
  32068. metadata: post_comments_count_metadata,
  32069. settings: post_comments_count_settings
  32070. });
  32071. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js
  32072. /**
  32073. * WordPress dependencies
  32074. */
  32075. const postCommentsForm = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32076. xmlns: "http://www.w3.org/2000/svg",
  32077. viewBox: "0 0 24 24"
  32078. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32079. d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"
  32080. }));
  32081. /* harmony default export */ var post_comments_form = (postCommentsForm);
  32082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js
  32083. /**
  32084. * External dependencies
  32085. */
  32086. /**
  32087. * WordPress dependencies
  32088. */
  32089. /**
  32090. * Internal dependencies
  32091. */
  32092. function PostCommentsFormEdit(_ref) {
  32093. let {
  32094. attributes,
  32095. context,
  32096. setAttributes
  32097. } = _ref;
  32098. const {
  32099. textAlign
  32100. } = attributes;
  32101. const {
  32102. postId,
  32103. postType
  32104. } = context;
  32105. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32106. className: classnames_default()({
  32107. [`has-text-align-${textAlign}`]: textAlign
  32108. })
  32109. });
  32110. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32111. group: "block"
  32112. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32113. value: textAlign,
  32114. onChange: nextAlign => {
  32115. setAttributes({
  32116. textAlign: nextAlign
  32117. });
  32118. }
  32119. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(post_comments_form_form, {
  32120. postId: postId,
  32121. postType: postType
  32122. })));
  32123. }
  32124. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  32125. /**
  32126. * WordPress dependencies
  32127. */
  32128. /**
  32129. * Internal dependencies
  32130. */
  32131. const post_comments_form_metadata = {
  32132. $schema: "https://schemas.wp.org/trunk/block.json",
  32133. apiVersion: 2,
  32134. name: "core/post-comments-form",
  32135. title: "Post Comments Form",
  32136. category: "theme",
  32137. description: "Display a post's comments form.",
  32138. textdomain: "default",
  32139. attributes: {
  32140. textAlign: {
  32141. type: "string"
  32142. }
  32143. },
  32144. usesContext: ["postId", "postType"],
  32145. supports: {
  32146. html: false,
  32147. color: {
  32148. gradients: true,
  32149. link: true,
  32150. __experimentalDefaultControls: {
  32151. background: true,
  32152. text: true
  32153. }
  32154. },
  32155. typography: {
  32156. fontSize: true,
  32157. lineHeight: true,
  32158. __experimentalFontStyle: true,
  32159. __experimentalFontWeight: true,
  32160. __experimentalLetterSpacing: true,
  32161. __experimentalTextTransform: true,
  32162. __experimentalDefaultControls: {
  32163. fontSize: true
  32164. }
  32165. }
  32166. },
  32167. editorStyle: "wp-block-post-comments-form-editor",
  32168. style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
  32169. };
  32170. const {
  32171. name: post_comments_form_name
  32172. } = post_comments_form_metadata;
  32173. const post_comments_form_settings = {
  32174. icon: post_comments_form,
  32175. edit: PostCommentsFormEdit
  32176. };
  32177. const post_comments_form_init = () => initBlock({
  32178. name: post_comments_form_name,
  32179. metadata: post_comments_form_metadata,
  32180. settings: post_comments_form_settings
  32181. });
  32182. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-link/edit.js
  32183. /**
  32184. * External dependencies
  32185. */
  32186. /**
  32187. * WordPress dependencies
  32188. */
  32189. function PostCommentsLinkEdit(_ref) {
  32190. let {
  32191. context,
  32192. attributes,
  32193. setAttributes
  32194. } = _ref;
  32195. const {
  32196. textAlign
  32197. } = attributes;
  32198. const {
  32199. postType,
  32200. postId
  32201. } = context;
  32202. const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
  32203. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32204. className: classnames_default()({
  32205. [`has-text-align-${textAlign}`]: textAlign
  32206. })
  32207. });
  32208. (0,external_wp_element_namespaceObject.useEffect)(() => {
  32209. if (!postId) {
  32210. return;
  32211. }
  32212. const currentPostId = postId;
  32213. external_wp_apiFetch_default()({
  32214. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
  32215. post: postId
  32216. }),
  32217. parse: false
  32218. }).then(res => {
  32219. // Stale requests will have the `currentPostId` of an older closure.
  32220. if (currentPostId === postId) {
  32221. setCommentsCount(res.headers.get('X-WP-Total'));
  32222. }
  32223. });
  32224. }, [postId]);
  32225. const post = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId), [postType, postId]);
  32226. if (!post) {
  32227. return null;
  32228. }
  32229. const {
  32230. link
  32231. } = post;
  32232. let commentsText;
  32233. if (commentsCount !== undefined) {
  32234. const commentsNumber = parseInt(commentsCount);
  32235. if (commentsNumber === 0) {
  32236. commentsText = (0,external_wp_i18n_namespaceObject.__)('No comments');
  32237. } else {
  32238. commentsText = (0,external_wp_i18n_namespaceObject.sprintf)(
  32239. /* translators: %s: Number of comments */
  32240. (0,external_wp_i18n_namespaceObject._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString());
  32241. }
  32242. }
  32243. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32244. group: "block"
  32245. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32246. value: textAlign,
  32247. onChange: nextAlign => {
  32248. setAttributes({
  32249. textAlign: nextAlign
  32250. });
  32251. }
  32252. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, link && commentsText !== undefined ? (0,external_wp_element_namespaceObject.createElement)("a", {
  32253. href: link + '#comments',
  32254. onClick: event => event.preventDefault()
  32255. }, commentsText) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Link block: post not found.'))));
  32256. }
  32257. /* harmony default export */ var post_comments_link_edit = (PostCommentsLinkEdit);
  32258. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js
  32259. /**
  32260. * WordPress dependencies
  32261. */
  32262. /**
  32263. * Internal dependencies
  32264. */
  32265. const post_comments_link_metadata = {
  32266. $schema: "https://schemas.wp.org/trunk/block.json",
  32267. apiVersion: 2,
  32268. __experimental: "fse",
  32269. name: "core/post-comments-link",
  32270. title: "Post Comments Link",
  32271. category: "theme",
  32272. description: "Displays the link to the current post comments.",
  32273. textdomain: "default",
  32274. usesContext: ["postType", "postId"],
  32275. attributes: {
  32276. textAlign: {
  32277. type: "string"
  32278. }
  32279. },
  32280. supports: {
  32281. html: false,
  32282. color: {
  32283. link: true,
  32284. text: false,
  32285. __experimentalDefaultControls: {
  32286. background: true,
  32287. link: true
  32288. }
  32289. },
  32290. typography: {
  32291. fontSize: true,
  32292. lineHeight: true,
  32293. __experimentalFontFamily: true,
  32294. __experimentalFontWeight: true,
  32295. __experimentalFontStyle: true,
  32296. __experimentalTextTransform: true,
  32297. __experimentalTextDecoration: true,
  32298. __experimentalLetterSpacing: true,
  32299. __experimentalDefaultControls: {
  32300. fontSize: true
  32301. }
  32302. }
  32303. }
  32304. };
  32305. const {
  32306. name: post_comments_link_name
  32307. } = post_comments_link_metadata;
  32308. const post_comments_link_settings = {
  32309. edit: post_comments_link_edit,
  32310. icon: post_comments_count
  32311. };
  32312. const post_comments_link_init = () => initBlock({
  32313. name: post_comments_link_name,
  32314. metadata: post_comments_link_metadata,
  32315. settings: post_comments_link_settings
  32316. });
  32317. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
  32318. /**
  32319. * WordPress dependencies
  32320. */
  32321. /**
  32322. * Returns whether the current user can edit the given entity.
  32323. *
  32324. * @param {string} kind Entity kind.
  32325. * @param {string} name Entity name.
  32326. * @param {string} recordId Record's id.
  32327. */
  32328. function useCanEditEntity(kind, name, recordId) {
  32329. return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
  32330. }
  32331. /* harmony default export */ var hooks = ({
  32332. useCanEditEntity
  32333. });
  32334. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
  32335. /**
  32336. * WordPress dependencies
  32337. */
  32338. /**
  32339. * Internal dependencies
  32340. */
  32341. function ReadOnlyContent(_ref) {
  32342. let {
  32343. userCanEdit,
  32344. postType,
  32345. postId
  32346. } = _ref;
  32347. const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
  32348. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32349. return content !== null && content !== void 0 && content.protected && !userCanEdit ? (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  32350. dangerouslySetInnerHTML: {
  32351. __html: content === null || content === void 0 ? void 0 : content.rendered
  32352. }
  32353. }));
  32354. }
  32355. function EditableContent(_ref2) {
  32356. let {
  32357. layout,
  32358. context = {}
  32359. } = _ref2;
  32360. const {
  32361. postType,
  32362. postId
  32363. } = context;
  32364. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  32365. var _getSettings;
  32366. const {
  32367. getSettings
  32368. } = select(external_wp_blockEditor_namespaceObject.store);
  32369. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  32370. }, []);
  32371. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  32372. const usedLayout = !(layout !== null && layout !== void 0 && layout.type) ? { ...defaultLayout,
  32373. ...layout,
  32374. type: 'default'
  32375. } : { ...defaultLayout,
  32376. ...layout
  32377. };
  32378. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
  32379. id: postId
  32380. });
  32381. const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32382. className: 'entry-content'
  32383. }), {
  32384. value: blocks,
  32385. onInput,
  32386. onChange,
  32387. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  32388. });
  32389. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  32390. }
  32391. function Content(props) {
  32392. const {
  32393. context: {
  32394. queryId,
  32395. postType,
  32396. postId
  32397. } = {}
  32398. } = props;
  32399. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  32400. const userCanEdit = useCanEditEntity('postType', postType, postId);
  32401. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  32402. return isEditable ? (0,external_wp_element_namespaceObject.createElement)(EditableContent, props) : (0,external_wp_element_namespaceObject.createElement)(ReadOnlyContent, {
  32403. userCanEdit: userCanEdit,
  32404. postType: postType,
  32405. postId: postId
  32406. });
  32407. }
  32408. function edit_Placeholder() {
  32409. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32410. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Content block, it will display all the blocks in any single post or page.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.')));
  32411. }
  32412. function RecursionError() {
  32413. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32414. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  32415. }
  32416. function PostContentEdit(_ref3) {
  32417. let {
  32418. context,
  32419. attributes
  32420. } = _ref3;
  32421. const {
  32422. postId: contextPostId,
  32423. postType: contextPostType
  32424. } = context;
  32425. const {
  32426. layout = {}
  32427. } = attributes;
  32428. const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.__experimentalUseHasRecursion)(contextPostId);
  32429. if (contextPostId && contextPostType && hasAlreadyRendered) {
  32430. return (0,external_wp_element_namespaceObject.createElement)(RecursionError, null);
  32431. }
  32432. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalRecursionProvider, {
  32433. uniqueId: contextPostId
  32434. }, contextPostId && contextPostType ? (0,external_wp_element_namespaceObject.createElement)(Content, {
  32435. context: context,
  32436. layout: layout
  32437. }) : (0,external_wp_element_namespaceObject.createElement)(edit_Placeholder, null));
  32438. }
  32439. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  32440. /**
  32441. * WordPress dependencies
  32442. */
  32443. /**
  32444. * Internal dependencies
  32445. */
  32446. const post_content_metadata = {
  32447. $schema: "https://schemas.wp.org/trunk/block.json",
  32448. apiVersion: 2,
  32449. name: "core/post-content",
  32450. title: "Post Content",
  32451. category: "theme",
  32452. description: "Displays the contents of a post or page.",
  32453. textdomain: "default",
  32454. usesContext: ["postId", "postType", "queryId"],
  32455. supports: {
  32456. align: ["wide", "full"],
  32457. html: false,
  32458. __experimentalLayout: true,
  32459. typography: {
  32460. fontSize: true,
  32461. lineHeight: true,
  32462. __experimentalFontFamily: true,
  32463. __experimentalFontWeight: true,
  32464. __experimentalFontStyle: true,
  32465. __experimentalTextTransform: true,
  32466. __experimentalTextDecoration: true,
  32467. __experimentalLetterSpacing: true,
  32468. __experimentalDefaultControls: {
  32469. fontSize: true
  32470. }
  32471. }
  32472. },
  32473. editorStyle: "wp-block-post-content-editor"
  32474. };
  32475. const {
  32476. name: post_content_name
  32477. } = post_content_metadata;
  32478. const post_content_settings = {
  32479. icon: post_content,
  32480. edit: PostContentEdit
  32481. };
  32482. const post_content_init = () => initBlock({
  32483. name: post_content_name,
  32484. metadata: post_content_metadata,
  32485. settings: post_content_settings
  32486. });
  32487. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
  32488. /**
  32489. * External dependencies
  32490. */
  32491. /**
  32492. * WordPress dependencies
  32493. */
  32494. function PostDateEdit(_ref) {
  32495. let {
  32496. attributes: {
  32497. textAlign,
  32498. format,
  32499. isLink,
  32500. displayType
  32501. },
  32502. context: {
  32503. postId,
  32504. postType: postTypeSlug,
  32505. queryId
  32506. },
  32507. setAttributes
  32508. } = _ref;
  32509. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32510. className: classnames_default()({
  32511. [`has-text-align-${textAlign}`]: textAlign
  32512. })
  32513. }); // Use internal state instead of a ref to make sure that the component
  32514. // re-renders when the popover's anchor updates.
  32515. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time.
  32516. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
  32517. anchor: popoverAnchor
  32518. }), [popoverAnchor]);
  32519. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  32520. const dateSettings = (0,external_wp_date_namespaceObject.getSettings)();
  32521. const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  32522. const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
  32523. const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId);
  32524. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
  32525. let postDate = date ? (0,external_wp_element_namespaceObject.createElement)("time", {
  32526. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
  32527. ref: setPopoverAnchor
  32528. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_i18n_namespaceObject.__)('Post Date');
  32529. if (isLink && date) {
  32530. postDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  32531. href: "#post-date-pseudo-link",
  32532. onClick: event => event.preventDefault()
  32533. }, postDate);
  32534. }
  32535. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32536. group: "block"
  32537. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32538. value: textAlign,
  32539. onChange: nextAlign => {
  32540. setAttributes({
  32541. textAlign: nextAlign
  32542. });
  32543. }
  32544. }), date && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  32545. popoverProps: popoverProps,
  32546. renderContent: _ref2 => {
  32547. let {
  32548. onClose
  32549. } = _ref2;
  32550. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, {
  32551. currentDate: date,
  32552. onChange: setDate,
  32553. is12Hour: is12HourFormat(siteTimeFormat),
  32554. onClose: onClose
  32555. });
  32556. },
  32557. renderToggle: _ref3 => {
  32558. let {
  32559. isOpen,
  32560. onToggle
  32561. } = _ref3;
  32562. const openOnArrowDown = event => {
  32563. if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
  32564. event.preventDefault();
  32565. onToggle();
  32566. }
  32567. };
  32568. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  32569. "aria-expanded": isOpen,
  32570. icon: library_edit,
  32571. title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
  32572. onClick: onToggle,
  32573. onKeyDown: openOnArrowDown
  32574. });
  32575. }
  32576. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  32577. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  32578. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  32579. format: format,
  32580. defaultFormat: siteFormat,
  32581. onChange: nextFormat => setAttributes({
  32582. format: nextFormat
  32583. })
  32584. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  32585. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  32586. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  32587. onChange: () => setAttributes({
  32588. isLink: !isLink
  32589. }),
  32590. checked: isLink
  32591. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  32592. label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'),
  32593. onChange: value => setAttributes({
  32594. displayType: value ? 'modified' : 'date'
  32595. }),
  32596. checked: displayType === 'modified'
  32597. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, postDate));
  32598. }
  32599. function is12HourFormat(format) {
  32600. // To know if the time format is a 12 hour time, look for any of the 12 hour
  32601. // format characters: 'a', 'A', 'g', and 'h'. The character must be
  32602. // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I
  32603. // feel when working with regular expressions.
  32604. // https://www.php.net/manual/en/datetime.format.php
  32605. return /(?:^|[^\\])[aAgh]/.test(format);
  32606. }
  32607. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
  32608. /**
  32609. * Internal dependencies
  32610. */
  32611. const post_date_deprecated_v1 = {
  32612. attributes: {
  32613. textAlign: {
  32614. type: 'string'
  32615. },
  32616. format: {
  32617. type: 'string'
  32618. },
  32619. isLink: {
  32620. type: 'boolean',
  32621. default: false
  32622. }
  32623. },
  32624. supports: {
  32625. html: false,
  32626. color: {
  32627. gradients: true,
  32628. link: true
  32629. },
  32630. typography: {
  32631. fontSize: true,
  32632. lineHeight: true,
  32633. __experimentalFontFamily: true,
  32634. __experimentalFontWeight: true,
  32635. __experimentalFontStyle: true,
  32636. __experimentalTextTransform: true,
  32637. __experimentalLetterSpacing: true
  32638. }
  32639. },
  32640. save() {
  32641. return null;
  32642. },
  32643. migrate: migrate_font_family,
  32644. isEligible(_ref) {
  32645. var _style$typography;
  32646. let {
  32647. style
  32648. } = _ref;
  32649. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  32650. }
  32651. };
  32652. /**
  32653. * New deprecations need to be placed first
  32654. * for them to have higher priority.
  32655. *
  32656. * Old deprecations may need to be updated as well.
  32657. *
  32658. * See block-deprecation.md
  32659. */
  32660. /* harmony default export */ var post_date_deprecated = ([post_date_deprecated_v1]);
  32661. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  32662. /**
  32663. * WordPress dependencies
  32664. */
  32665. /**
  32666. * Internal dependencies
  32667. */
  32668. const post_date_metadata = {
  32669. $schema: "https://schemas.wp.org/trunk/block.json",
  32670. apiVersion: 2,
  32671. name: "core/post-date",
  32672. title: "Post Date",
  32673. category: "theme",
  32674. description: "Add the date of this post.",
  32675. textdomain: "default",
  32676. attributes: {
  32677. textAlign: {
  32678. type: "string"
  32679. },
  32680. format: {
  32681. type: "string"
  32682. },
  32683. isLink: {
  32684. type: "boolean",
  32685. "default": false
  32686. },
  32687. displayType: {
  32688. type: "string",
  32689. "default": "date"
  32690. }
  32691. },
  32692. usesContext: ["postId", "postType", "queryId"],
  32693. supports: {
  32694. html: false,
  32695. color: {
  32696. gradients: true,
  32697. link: true,
  32698. __experimentalDefaultControls: {
  32699. background: true,
  32700. text: true,
  32701. link: true
  32702. }
  32703. },
  32704. spacing: {
  32705. margin: true,
  32706. padding: true
  32707. },
  32708. typography: {
  32709. fontSize: true,
  32710. lineHeight: true,
  32711. __experimentalFontFamily: true,
  32712. __experimentalFontWeight: true,
  32713. __experimentalFontStyle: true,
  32714. __experimentalTextTransform: true,
  32715. __experimentalTextDecoration: true,
  32716. __experimentalLetterSpacing: true,
  32717. __experimentalDefaultControls: {
  32718. fontSize: true
  32719. }
  32720. }
  32721. }
  32722. };
  32723. const {
  32724. name: post_date_name
  32725. } = post_date_metadata;
  32726. const post_date_settings = {
  32727. icon: post_date,
  32728. edit: PostDateEdit,
  32729. deprecated: post_date_deprecated
  32730. };
  32731. const post_date_init = () => initBlock({
  32732. name: post_date_name,
  32733. metadata: post_date_metadata,
  32734. settings: post_date_settings
  32735. });
  32736. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
  32737. /**
  32738. * WordPress dependencies
  32739. */
  32740. const postExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32741. xmlns: "http://www.w3.org/2000/svg",
  32742. viewBox: "0 0 24 24"
  32743. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32744. d: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
  32745. }));
  32746. /* harmony default export */ var post_excerpt = (postExcerpt);
  32747. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
  32748. /**
  32749. * External dependencies
  32750. */
  32751. /**
  32752. * WordPress dependencies
  32753. */
  32754. /**
  32755. * Internal dependencies
  32756. */
  32757. function PostExcerptEditor(_ref) {
  32758. let {
  32759. attributes: {
  32760. textAlign,
  32761. moreText,
  32762. showMoreOnNewLine
  32763. },
  32764. setAttributes,
  32765. isSelected,
  32766. context: {
  32767. postId,
  32768. postType,
  32769. queryId
  32770. }
  32771. } = _ref;
  32772. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  32773. const userCanEdit = useCanEditEntity('postType', postType, postId);
  32774. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  32775. const [rawExcerpt, setExcerpt, {
  32776. rendered: renderedExcerpt,
  32777. protected: isProtected
  32778. } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
  32779. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32780. className: classnames_default()({
  32781. [`has-text-align-${textAlign}`]: textAlign
  32782. })
  32783. });
  32784. /**
  32785. * When excerpt is editable, strip the html tags from
  32786. * rendered excerpt. This will be used if the entity's
  32787. * excerpt has been produced from the content.
  32788. */
  32789. const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
  32790. if (!renderedExcerpt) return '';
  32791. const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
  32792. return document.body.textContent || document.body.innerText || '';
  32793. }, [renderedExcerpt]);
  32794. if (!postType || !postId) {
  32795. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Excerpt block, it will display the excerpt from single posts.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.')));
  32796. }
  32797. if (isProtected && !userCanEdit) {
  32798. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('There is no excerpt because this is a protected post.')));
  32799. }
  32800. const readMoreLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32801. className: "wp-block-post-excerpt__more-link",
  32802. tagName: "a",
  32803. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  32804. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
  32805. value: moreText,
  32806. onChange: newMoreText => setAttributes({
  32807. moreText: newMoreText
  32808. }),
  32809. withoutInteractiveFormatting: true
  32810. });
  32811. const excerptClassName = classnames_default()('wp-block-post-excerpt__excerpt', {
  32812. 'is-inline': !showMoreOnNewLine
  32813. });
  32814. const excerptContent = isEditable ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32815. className: excerptClassName,
  32816. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post excerpt text'),
  32817. value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : (0,external_wp_i18n_namespaceObject.__)('No post excerpt found')),
  32818. onChange: setExcerpt,
  32819. tagName: "p"
  32820. }) : (0,external_wp_element_namespaceObject.createElement)("p", {
  32821. className: excerptClassName
  32822. }, strippedRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No post excerpt found'));
  32823. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  32824. value: textAlign,
  32825. onChange: newAlign => setAttributes({
  32826. textAlign: newAlign
  32827. })
  32828. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  32829. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  32830. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  32831. label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
  32832. checked: showMoreOnNewLine,
  32833. onChange: newShowMoreOnNewLine => setAttributes({
  32834. showMoreOnNewLine: newShowMoreOnNewLine
  32835. })
  32836. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_wp_element_namespaceObject.createElement)("p", {
  32837. className: "wp-block-post-excerpt__more-text"
  32838. }, readMoreLink) : readMoreLink));
  32839. }
  32840. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js
  32841. /**
  32842. * WordPress dependencies
  32843. */
  32844. const post_excerpt_transforms_transforms = {
  32845. from: [{
  32846. type: 'block',
  32847. blocks: ['core/post-content'],
  32848. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt')
  32849. }],
  32850. to: [{
  32851. type: 'block',
  32852. blocks: ['core/post-content'],
  32853. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content')
  32854. }]
  32855. };
  32856. /* harmony default export */ var post_excerpt_transforms = (post_excerpt_transforms_transforms);
  32857. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  32858. /**
  32859. * WordPress dependencies
  32860. */
  32861. /**
  32862. * Internal dependencies
  32863. */
  32864. const post_excerpt_metadata = {
  32865. $schema: "https://schemas.wp.org/trunk/block.json",
  32866. apiVersion: 2,
  32867. name: "core/post-excerpt",
  32868. title: "Post Excerpt",
  32869. category: "theme",
  32870. description: "Display a post's excerpt.",
  32871. textdomain: "default",
  32872. attributes: {
  32873. textAlign: {
  32874. type: "string"
  32875. },
  32876. moreText: {
  32877. type: "string"
  32878. },
  32879. showMoreOnNewLine: {
  32880. type: "boolean",
  32881. "default": true
  32882. }
  32883. },
  32884. usesContext: ["postId", "postType", "queryId"],
  32885. supports: {
  32886. html: false,
  32887. color: {
  32888. gradients: true,
  32889. link: true,
  32890. __experimentalDefaultControls: {
  32891. background: true,
  32892. text: true,
  32893. link: true
  32894. }
  32895. },
  32896. spacing: {
  32897. margin: true,
  32898. padding: true
  32899. },
  32900. typography: {
  32901. fontSize: true,
  32902. lineHeight: true,
  32903. __experimentalFontFamily: true,
  32904. __experimentalFontWeight: true,
  32905. __experimentalFontStyle: true,
  32906. __experimentalTextTransform: true,
  32907. __experimentalTextDecoration: true,
  32908. __experimentalLetterSpacing: true,
  32909. __experimentalDefaultControls: {
  32910. fontSize: true
  32911. }
  32912. }
  32913. },
  32914. editorStyle: "wp-block-post-excerpt-editor",
  32915. style: "wp-block-post-excerpt"
  32916. };
  32917. const {
  32918. name: post_excerpt_name
  32919. } = post_excerpt_metadata;
  32920. const post_excerpt_settings = {
  32921. icon: post_excerpt,
  32922. transforms: post_excerpt_transforms,
  32923. edit: PostExcerptEditor
  32924. };
  32925. const post_excerpt_init = () => initBlock({
  32926. name: post_excerpt_name,
  32927. metadata: post_excerpt_metadata,
  32928. settings: post_excerpt_settings
  32929. });
  32930. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
  32931. /**
  32932. * WordPress dependencies
  32933. */
  32934. const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32935. xmlns: "http://www.w3.org/2000/svg",
  32936. viewBox: "0 0 24 24"
  32937. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32938. d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
  32939. }));
  32940. /* harmony default export */ var post_featured_image = (postFeaturedImage);
  32941. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
  32942. /**
  32943. * WordPress dependencies
  32944. */
  32945. const SCALE_OPTIONS = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  32946. value: "cover",
  32947. label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
  32948. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  32949. value: "contain",
  32950. label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
  32951. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  32952. value: "fill",
  32953. label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
  32954. }));
  32955. const DEFAULT_SCALE = 'cover';
  32956. const DEFAULT_SIZE = 'full';
  32957. const scaleHelp = {
  32958. cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
  32959. contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
  32960. fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
  32961. };
  32962. const DimensionControls = _ref => {
  32963. let {
  32964. clientId,
  32965. attributes: {
  32966. width,
  32967. height,
  32968. scale,
  32969. sizeSlug
  32970. },
  32971. setAttributes,
  32972. imageSizeOptions = []
  32973. } = _ref;
  32974. const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
  32975. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  32976. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
  32977. });
  32978. const onDimensionChange = (dimension, nextValue) => {
  32979. const parsedValue = parseFloat(nextValue);
  32980. /**
  32981. * If we have no value set and we change the unit,
  32982. * we don't want to set the attribute, as it would
  32983. * end up having the unit as value without any number.
  32984. */
  32985. if (isNaN(parsedValue) && nextValue) return;
  32986. setAttributes({
  32987. [dimension]: parsedValue < 0 ? '0' : nextValue
  32988. });
  32989. };
  32990. const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
  32991. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  32992. __experimentalGroup: "dimensions"
  32993. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  32994. className: "single-column",
  32995. hasValue: () => !!height,
  32996. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  32997. onDeselect: () => setAttributes({
  32998. height: undefined
  32999. }),
  33000. resetAllFilter: () => ({
  33001. height: undefined
  33002. }),
  33003. isShownByDefault: true,
  33004. panelId: clientId
  33005. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  33006. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  33007. labelPosition: "top",
  33008. value: height || '',
  33009. min: 0,
  33010. onChange: nextHeight => onDimensionChange('height', nextHeight),
  33011. units: units
  33012. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  33013. className: "single-column",
  33014. hasValue: () => !!width,
  33015. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  33016. onDeselect: () => setAttributes({
  33017. width: undefined
  33018. }),
  33019. resetAllFilter: () => ({
  33020. width: undefined
  33021. }),
  33022. isShownByDefault: true,
  33023. panelId: clientId
  33024. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  33025. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  33026. labelPosition: "top",
  33027. value: width || '',
  33028. min: 0,
  33029. onChange: nextWidth => onDimensionChange('width', nextWidth),
  33030. units: units
  33031. })), !!height && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  33032. hasValue: () => !!scale && scale !== DEFAULT_SCALE,
  33033. label: scaleLabel,
  33034. onDeselect: () => setAttributes({
  33035. scale: DEFAULT_SCALE
  33036. }),
  33037. resetAllFilter: () => ({
  33038. scale: DEFAULT_SCALE
  33039. }),
  33040. isShownByDefault: true,
  33041. panelId: clientId
  33042. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  33043. label: scaleLabel,
  33044. value: scale,
  33045. help: scaleHelp[scale],
  33046. onChange: value => setAttributes({
  33047. scale: value
  33048. }),
  33049. isBlock: true
  33050. }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  33051. hasValue: () => !!sizeSlug,
  33052. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  33053. onDeselect: () => setAttributes({
  33054. sizeSlug: undefined
  33055. }),
  33056. resetAllFilter: () => ({
  33057. sizeSlug: undefined
  33058. }),
  33059. isShownByDefault: false,
  33060. panelId: clientId
  33061. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  33062. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  33063. value: sizeSlug || DEFAULT_SIZE,
  33064. options: imageSizeOptions,
  33065. onChange: nextSizeSlug => setAttributes({
  33066. sizeSlug: nextSizeSlug
  33067. }),
  33068. help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.')
  33069. })));
  33070. };
  33071. /* harmony default export */ var dimension_controls = (DimensionControls);
  33072. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/utils.js
  33073. /**
  33074. * Generates the opacity/dim class based on given number.
  33075. *
  33076. * @param {number} ratio Dim/opacity number.
  33077. *
  33078. * @return {string} Generated class.
  33079. */
  33080. function utils_dimRatioToClass(ratio) {
  33081. return ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  33082. }
  33083. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay.js
  33084. /**
  33085. * External dependencies
  33086. */
  33087. /**
  33088. * WordPress dependencies
  33089. */
  33090. /**
  33091. * Internal dependencies
  33092. */
  33093. const Overlay = _ref => {
  33094. let {
  33095. clientId,
  33096. attributes,
  33097. setAttributes,
  33098. overlayColor,
  33099. setOverlayColor
  33100. } = _ref;
  33101. const {
  33102. dimRatio
  33103. } = attributes;
  33104. const {
  33105. gradientClass,
  33106. gradientValue,
  33107. setGradient
  33108. } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
  33109. const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  33110. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  33111. const overlayStyles = {
  33112. backgroundColor: overlayColor.color,
  33113. backgroundImage: gradientValue,
  33114. ...borderProps.style
  33115. };
  33116. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!dimRatio && (0,external_wp_element_namespaceObject.createElement)("span", {
  33117. "aria-hidden": "true",
  33118. className: classnames_default()('wp-block-post-featured-image__overlay', utils_dimRatioToClass(dimRatio), {
  33119. [overlayColor.class]: overlayColor.class,
  33120. 'has-background-dim': dimRatio !== undefined,
  33121. 'has-background-gradient': gradientValue,
  33122. [gradientClass]: gradientClass
  33123. }, borderProps.className),
  33124. style: overlayStyles
  33125. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  33126. __experimentalGroup: "color"
  33127. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, _extends({
  33128. __experimentalHasMultipleOrigins: true,
  33129. __experimentalIsRenderedInSidebar: true,
  33130. settings: [{
  33131. colorValue: overlayColor.color,
  33132. gradientValue,
  33133. label: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
  33134. onColorChange: setOverlayColor,
  33135. onGradientChange: setGradient,
  33136. isShownByDefault: true,
  33137. resetAllFilter: () => ({
  33138. overlayColor: undefined,
  33139. customOverlayColor: undefined,
  33140. gradient: undefined,
  33141. customGradient: undefined
  33142. })
  33143. }],
  33144. panelId: clientId
  33145. }, colorGradientSettings)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  33146. hasValue: () => dimRatio !== undefined,
  33147. label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
  33148. onDeselect: () => setAttributes({
  33149. dimRatio: 0
  33150. }),
  33151. resetAllFilter: () => ({
  33152. dimRatio: 0
  33153. }),
  33154. isShownByDefault: true,
  33155. panelId: clientId
  33156. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33157. label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
  33158. value: dimRatio,
  33159. onChange: newDimRatio => setAttributes({
  33160. dimRatio: newDimRatio
  33161. }),
  33162. min: 0,
  33163. max: 100,
  33164. step: 10,
  33165. required: true
  33166. }))));
  33167. };
  33168. /* harmony default export */ var overlay = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
  33169. overlayColor: 'background-color'
  33170. })])(Overlay));
  33171. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
  33172. /**
  33173. * External dependencies
  33174. */
  33175. /**
  33176. * WordPress dependencies
  33177. */
  33178. /**
  33179. * Internal dependencies
  33180. */
  33181. const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
  33182. function getMediaSourceUrlBySizeSlug(media, slug) {
  33183. var _media$media_details, _media$media_details$, _media$media_details$2;
  33184. return (media === null || media === void 0 ? void 0 : (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$[slug]) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url) || (media === null || media === void 0 ? void 0 : media.source_url);
  33185. }
  33186. function PostFeaturedImageDisplay(_ref) {
  33187. let {
  33188. clientId,
  33189. attributes,
  33190. setAttributes,
  33191. context: {
  33192. postId,
  33193. postType: postTypeSlug,
  33194. queryId
  33195. }
  33196. } = _ref;
  33197. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  33198. const {
  33199. isLink,
  33200. height,
  33201. width,
  33202. scale,
  33203. sizeSlug,
  33204. rel,
  33205. linkTarget
  33206. } = attributes;
  33207. const [featuredImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
  33208. const {
  33209. media,
  33210. postType
  33211. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  33212. const {
  33213. getMedia,
  33214. getPostType
  33215. } = select(external_wp_coreData_namespaceObject.store);
  33216. return {
  33217. media: featuredImage && getMedia(featuredImage, {
  33218. context: 'view'
  33219. }),
  33220. postType: postTypeSlug && getPostType(postTypeSlug)
  33221. };
  33222. }, [featuredImage, postTypeSlug]);
  33223. const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
  33224. const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []);
  33225. const imageSizeOptions = imageSizes.filter(_ref2 => {
  33226. var _media$media_details2, _media$media_details3, _media$media_details4;
  33227. let {
  33228. slug
  33229. } = _ref2;
  33230. return media === null || media === void 0 ? void 0 : (_media$media_details2 = media.media_details) === null || _media$media_details2 === void 0 ? void 0 : (_media$media_details3 = _media$media_details2.sizes) === null || _media$media_details3 === void 0 ? void 0 : (_media$media_details4 = _media$media_details3[slug]) === null || _media$media_details4 === void 0 ? void 0 : _media$media_details4.source_url;
  33231. }).map(_ref3 => {
  33232. let {
  33233. name,
  33234. slug
  33235. } = _ref3;
  33236. return {
  33237. value: slug,
  33238. label: name
  33239. };
  33240. });
  33241. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33242. style: {
  33243. width,
  33244. height
  33245. }
  33246. });
  33247. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  33248. const placeholder = content => {
  33249. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  33250. className: classnames_default()('block-editor-media-placeholder', borderProps.className),
  33251. withIllustration: true,
  33252. style: borderProps.style
  33253. }, content);
  33254. };
  33255. const onSelectImage = value => {
  33256. if (value !== null && value !== void 0 && value.id) {
  33257. setFeaturedImage(value.id);
  33258. }
  33259. };
  33260. const {
  33261. createErrorNotice
  33262. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  33263. const onUploadError = message => {
  33264. createErrorNotice(message, {
  33265. type: 'snackbar'
  33266. });
  33267. };
  33268. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dimension_controls, {
  33269. clientId: clientId,
  33270. attributes: attributes,
  33271. setAttributes: setAttributes,
  33272. imageSizeOptions: imageSizeOptions
  33273. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33274. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  33275. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33276. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  33277. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  33278. onChange: () => setAttributes({
  33279. isLink: !isLink
  33280. }),
  33281. checked: isLink
  33282. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33283. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  33284. onChange: value => setAttributes({
  33285. linkTarget: value ? '_blank' : '_self'
  33286. }),
  33287. checked: linkTarget === '_blank'
  33288. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  33289. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  33290. value: rel,
  33291. onChange: newRel => setAttributes({
  33292. rel: newRel
  33293. })
  33294. })))));
  33295. let image;
  33296. if (!featuredImage && isDescendentOfQueryLoop) {
  33297. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholder(), (0,external_wp_element_namespaceObject.createElement)(overlay, {
  33298. attributes: attributes,
  33299. setAttributes: setAttributes,
  33300. clientId: clientId
  33301. })));
  33302. }
  33303. const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
  33304. const imageStyles = { ...borderProps.style,
  33305. height,
  33306. objectFit: height && scale
  33307. };
  33308. if (!featuredImage) {
  33309. image = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  33310. onSelect: onSelectImage,
  33311. accept: "image/*",
  33312. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  33313. onError: onUploadError,
  33314. placeholder: placeholder,
  33315. mediaLibraryButton: _ref4 => {
  33316. let {
  33317. open
  33318. } = _ref4;
  33319. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  33320. icon: library_upload,
  33321. variant: "primary",
  33322. label: label,
  33323. showTooltip: true,
  33324. tooltipPosition: "top center",
  33325. onClick: () => {
  33326. open();
  33327. }
  33328. });
  33329. }
  33330. });
  33331. } else {
  33332. // We have a Featured image so show a Placeholder if is loading.
  33333. image = !media ? placeholder() : (0,external_wp_element_namespaceObject.createElement)("img", {
  33334. className: borderProps.className,
  33335. src: mediaUrl,
  33336. alt: media.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text.
  33337. (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
  33338. style: imageStyles
  33339. });
  33340. }
  33341. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  33342. group: "other"
  33343. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  33344. mediaId: featuredImage,
  33345. mediaURL: mediaUrl,
  33346. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  33347. accept: "image/*",
  33348. onSelect: onSelectImage,
  33349. onError: onUploadError
  33350. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  33351. onClick: () => setFeaturedImage(0)
  33352. }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, image, (0,external_wp_element_namespaceObject.createElement)(overlay, {
  33353. attributes: attributes,
  33354. setAttributes: setAttributes,
  33355. clientId: clientId
  33356. })));
  33357. }
  33358. function PostFeaturedImageEdit(props) {
  33359. var _props$context;
  33360. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  33361. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(props.attributes);
  33362. if (!((_props$context = props.context) !== null && _props$context !== void 0 && _props$context.postId)) {
  33363. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  33364. className: classnames_default()('block-editor-media-placeholder', borderProps.className),
  33365. withIllustration: true,
  33366. style: borderProps.style
  33367. }), (0,external_wp_element_namespaceObject.createElement)(overlay, {
  33368. attributes: props.attributes,
  33369. setAttributes: props.setAttributes,
  33370. clientId: props.clientId
  33371. }));
  33372. }
  33373. return (0,external_wp_element_namespaceObject.createElement)(PostFeaturedImageDisplay, props);
  33374. }
  33375. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  33376. /**
  33377. * WordPress dependencies
  33378. */
  33379. /**
  33380. * Internal dependencies
  33381. */
  33382. const post_featured_image_metadata = {
  33383. $schema: "https://schemas.wp.org/trunk/block.json",
  33384. apiVersion: 2,
  33385. name: "core/post-featured-image",
  33386. title: "Post Featured Image",
  33387. category: "theme",
  33388. description: "Display a post's featured image.",
  33389. textdomain: "default",
  33390. attributes: {
  33391. isLink: {
  33392. type: "boolean",
  33393. "default": false
  33394. },
  33395. width: {
  33396. type: "string"
  33397. },
  33398. height: {
  33399. type: "string"
  33400. },
  33401. scale: {
  33402. type: "string",
  33403. "default": "cover"
  33404. },
  33405. sizeSlug: {
  33406. type: "string"
  33407. },
  33408. rel: {
  33409. type: "string",
  33410. attribute: "rel",
  33411. "default": ""
  33412. },
  33413. linkTarget: {
  33414. type: "string",
  33415. "default": "_self"
  33416. },
  33417. overlayColor: {
  33418. type: "string"
  33419. },
  33420. customOverlayColor: {
  33421. type: "string"
  33422. },
  33423. dimRatio: {
  33424. type: "number",
  33425. "default": 0
  33426. },
  33427. gradient: {
  33428. type: "string"
  33429. },
  33430. customGradient: {
  33431. type: "string"
  33432. }
  33433. },
  33434. usesContext: ["postId", "postType", "queryId"],
  33435. supports: {
  33436. align: ["left", "right", "center", "wide", "full"],
  33437. color: {
  33438. __experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
  33439. text: false,
  33440. background: false
  33441. },
  33442. __experimentalBorder: {
  33443. color: true,
  33444. radius: true,
  33445. width: true,
  33446. __experimentalSelector: "img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay",
  33447. __experimentalSkipSerialization: true,
  33448. __experimentalDefaultControls: {
  33449. color: true,
  33450. radius: true,
  33451. width: true
  33452. }
  33453. },
  33454. html: false,
  33455. spacing: {
  33456. margin: true,
  33457. padding: true
  33458. }
  33459. },
  33460. editorStyle: "wp-block-post-featured-image-editor",
  33461. style: "wp-block-post-featured-image"
  33462. };
  33463. const {
  33464. name: post_featured_image_name
  33465. } = post_featured_image_metadata;
  33466. const post_featured_image_settings = {
  33467. icon: post_featured_image,
  33468. edit: PostFeaturedImageEdit
  33469. };
  33470. const post_featured_image_init = () => initBlock({
  33471. name: post_featured_image_name,
  33472. metadata: post_featured_image_metadata,
  33473. settings: post_featured_image_settings
  33474. });
  33475. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
  33476. /**
  33477. * External dependencies
  33478. */
  33479. /**
  33480. * WordPress dependencies
  33481. */
  33482. function PostNavigationLinkEdit(_ref) {
  33483. let {
  33484. attributes: {
  33485. type,
  33486. label,
  33487. showTitle,
  33488. textAlign,
  33489. linkLabel
  33490. },
  33491. setAttributes
  33492. } = _ref;
  33493. const isNext = type === 'next';
  33494. let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
  33495. if (showTitle) {
  33496. /* translators: Label before for next and previous post. There is a space after the colon. */
  33497. placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: ');
  33498. }
  33499. const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
  33500. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33501. className: classnames_default()({
  33502. [`has-text-align-${textAlign}`]: textAlign
  33503. })
  33504. });
  33505. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33506. label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
  33507. help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
  33508. checked: !!showTitle,
  33509. onChange: () => setAttributes({
  33510. showTitle: !showTitle
  33511. })
  33512. }), showTitle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33513. label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
  33514. checked: !!linkLabel,
  33515. onChange: () => setAttributes({
  33516. linkLabel: !linkLabel
  33517. })
  33518. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  33519. value: textAlign,
  33520. onChange: nextAlign => {
  33521. setAttributes({
  33522. textAlign: nextAlign
  33523. });
  33524. }
  33525. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  33526. tagName: "a",
  33527. "aria-label": ariaLabel,
  33528. placeholder: placeholder,
  33529. value: label,
  33530. allowedFormats: ['core/bold', 'core/italic'],
  33531. onChange: newLabel => setAttributes({
  33532. label: newLabel
  33533. })
  33534. }), showTitle && (0,external_wp_element_namespaceObject.createElement)("a", {
  33535. href: "#post-navigation-pseudo-link",
  33536. onClick: event => event.preventDefault()
  33537. }, (0,external_wp_i18n_namespaceObject.__)('An example title'))));
  33538. }
  33539. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
  33540. /**
  33541. * WordPress dependencies
  33542. */
  33543. const next = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33544. xmlns: "http://www.w3.org/2000/svg",
  33545. viewBox: "0 0 24 24"
  33546. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33547. d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
  33548. }));
  33549. /* harmony default export */ var library_next = (next);
  33550. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
  33551. /**
  33552. * WordPress dependencies
  33553. */
  33554. const previous = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33555. xmlns: "http://www.w3.org/2000/svg",
  33556. viewBox: "0 0 24 24"
  33557. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33558. d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
  33559. }));
  33560. /* harmony default export */ var library_previous = (previous);
  33561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
  33562. /**
  33563. * WordPress dependencies
  33564. */
  33565. const post_navigation_link_variations_variations = [{
  33566. isDefault: true,
  33567. name: 'post-next',
  33568. title: (0,external_wp_i18n_namespaceObject.__)('Next post'),
  33569. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
  33570. icon: library_next,
  33571. attributes: {
  33572. type: 'next'
  33573. },
  33574. scope: ['inserter', 'transform']
  33575. }, {
  33576. name: 'post-previous',
  33577. title: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
  33578. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
  33579. icon: library_previous,
  33580. attributes: {
  33581. type: 'previous'
  33582. },
  33583. scope: ['inserter', 'transform']
  33584. }];
  33585. /**
  33586. * Add `isActive` function to all `post-navigation-link` variations, if not defined.
  33587. * `isActive` function is used to find a variation match from a created
  33588. * Block by providing its attributes.
  33589. */
  33590. post_navigation_link_variations_variations.forEach(variation => {
  33591. if (variation.isActive) return;
  33592. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  33593. });
  33594. /* harmony default export */ var post_navigation_link_variations = (post_navigation_link_variations_variations);
  33595. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  33596. /**
  33597. * Internal dependencies
  33598. */
  33599. const post_navigation_link_metadata = {
  33600. $schema: "https://schemas.wp.org/trunk/block.json",
  33601. apiVersion: 2,
  33602. name: "core/post-navigation-link",
  33603. title: "Post Navigation Link",
  33604. category: "theme",
  33605. description: "Displays the next or previous post link that is adjacent to the current post.",
  33606. textdomain: "default",
  33607. attributes: {
  33608. textAlign: {
  33609. type: "string"
  33610. },
  33611. type: {
  33612. type: "string",
  33613. "default": "next"
  33614. },
  33615. label: {
  33616. type: "string"
  33617. },
  33618. showTitle: {
  33619. type: "boolean",
  33620. "default": false
  33621. },
  33622. linkLabel: {
  33623. type: "boolean",
  33624. "default": false
  33625. }
  33626. },
  33627. supports: {
  33628. reusable: false,
  33629. html: false,
  33630. color: {
  33631. link: true
  33632. },
  33633. typography: {
  33634. fontSize: true,
  33635. lineHeight: true,
  33636. __experimentalFontFamily: true,
  33637. __experimentalFontWeight: true,
  33638. __experimentalFontStyle: true,
  33639. __experimentalTextTransform: true,
  33640. __experimentalTextDecoration: true,
  33641. __experimentalLetterSpacing: true,
  33642. __experimentalDefaultControls: {
  33643. fontSize: true
  33644. }
  33645. }
  33646. }
  33647. };
  33648. const {
  33649. name: post_navigation_link_name
  33650. } = post_navigation_link_metadata;
  33651. const post_navigation_link_settings = {
  33652. edit: PostNavigationLinkEdit,
  33653. variations: post_navigation_link_variations
  33654. };
  33655. const post_navigation_link_init = () => initBlock({
  33656. name: post_navigation_link_name,
  33657. metadata: post_navigation_link_metadata,
  33658. settings: post_navigation_link_settings
  33659. });
  33660. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
  33661. /**
  33662. * External dependencies
  33663. */
  33664. /**
  33665. * WordPress dependencies
  33666. */
  33667. const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
  33668. function PostTemplateInnerBlocks() {
  33669. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  33670. className: 'wp-block-post'
  33671. }, {
  33672. template: post_template_edit_TEMPLATE
  33673. });
  33674. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps);
  33675. }
  33676. function PostTemplateBlockPreview(_ref) {
  33677. let {
  33678. blocks,
  33679. blockContextId,
  33680. isHidden,
  33681. setActiveBlockContextId
  33682. } = _ref;
  33683. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  33684. blocks,
  33685. props: {
  33686. className: 'wp-block-post'
  33687. }
  33688. });
  33689. const handleOnClick = () => {
  33690. setActiveBlockContextId(blockContextId);
  33691. };
  33692. const style = {
  33693. display: isHidden ? 'none' : undefined
  33694. };
  33695. return (0,external_wp_element_namespaceObject.createElement)("li", _extends({}, blockPreviewProps, {
  33696. tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  33697. ,
  33698. role: "button",
  33699. onClick: handleOnClick,
  33700. onKeyPress: handleOnClick,
  33701. style: style
  33702. }));
  33703. }
  33704. const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
  33705. function PostTemplateEdit(_ref2) {
  33706. let {
  33707. clientId,
  33708. context: {
  33709. query: {
  33710. perPage,
  33711. offset,
  33712. postType,
  33713. order,
  33714. orderBy,
  33715. author,
  33716. search,
  33717. exclude,
  33718. sticky,
  33719. inherit,
  33720. taxQuery,
  33721. parents,
  33722. pages,
  33723. // We gather extra query args to pass to the REST API call.
  33724. // This way extenders of Query Loop can add their own query args,
  33725. // and have accurate previews in the editor.
  33726. // Noting though that these args should either be supported by the
  33727. // REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.
  33728. ...restQueryArgs
  33729. } = {},
  33730. queryContext = [{
  33731. page: 1
  33732. }],
  33733. templateSlug,
  33734. displayLayout: {
  33735. type: layoutType = 'flex',
  33736. columns = 1
  33737. } = {},
  33738. previewPostType
  33739. }
  33740. } = _ref2;
  33741. const [{
  33742. page
  33743. }] = queryContext;
  33744. const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
  33745. const {
  33746. posts,
  33747. blocks
  33748. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  33749. const {
  33750. getEntityRecords,
  33751. getTaxonomies
  33752. } = select(external_wp_coreData_namespaceObject.store);
  33753. const {
  33754. getBlocks
  33755. } = select(external_wp_blockEditor_namespaceObject.store);
  33756. const taxonomies = getTaxonomies({
  33757. type: postType,
  33758. per_page: -1,
  33759. context: 'view'
  33760. });
  33761. const templateCategory = inherit && (templateSlug === null || templateSlug === void 0 ? void 0 : templateSlug.startsWith('category-')) && getEntityRecords('taxonomy', 'category', {
  33762. context: 'view',
  33763. per_page: 1,
  33764. _fields: ['id'],
  33765. slug: templateSlug.replace('category-', '')
  33766. });
  33767. const query = {
  33768. offset: perPage ? perPage * (page - 1) + offset : 0,
  33769. order,
  33770. orderby: orderBy
  33771. }; // There is no need to build the taxQuery if we inherit.
  33772. if (taxQuery && !inherit) {
  33773. // We have to build the tax query for the REST API and use as
  33774. // keys the taxonomies `rest_base` with the `term ids` as values.
  33775. const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, _ref3) => {
  33776. let [taxonomySlug, terms] = _ref3;
  33777. const taxonomy = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.find(_ref4 => {
  33778. let {
  33779. slug
  33780. } = _ref4;
  33781. return slug === taxonomySlug;
  33782. });
  33783. if (taxonomy !== null && taxonomy !== void 0 && taxonomy.rest_base) {
  33784. accumulator[taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.rest_base] = terms;
  33785. }
  33786. return accumulator;
  33787. }, {});
  33788. if (!!Object.keys(builtTaxQuery).length) {
  33789. Object.assign(query, builtTaxQuery);
  33790. }
  33791. }
  33792. if (perPage) {
  33793. query.per_page = perPage;
  33794. }
  33795. if (author) {
  33796. query.author = author;
  33797. }
  33798. if (search) {
  33799. query.search = search;
  33800. }
  33801. if (exclude !== null && exclude !== void 0 && exclude.length) {
  33802. query.exclude = exclude;
  33803. }
  33804. if (parents !== null && parents !== void 0 && parents.length) {
  33805. query.parent = parents;
  33806. } // If sticky is not set, it will return all posts in the results.
  33807. // If sticky is set to `only`, it will limit the results to sticky posts only.
  33808. // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.
  33809. if (sticky) {
  33810. query.sticky = sticky === 'only';
  33811. } // If `inherit` is truthy, adjust conditionally the query to create a better preview.
  33812. if (inherit) {
  33813. // Change the post-type if needed.
  33814. if (templateSlug !== null && templateSlug !== void 0 && templateSlug.startsWith('archive-')) {
  33815. query.postType = templateSlug.replace('archive-', '');
  33816. postType = query.postType;
  33817. } else if (templateCategory) {
  33818. var _templateCategory$;
  33819. query.categories = (_templateCategory$ = templateCategory[0]) === null || _templateCategory$ === void 0 ? void 0 : _templateCategory$.id;
  33820. }
  33821. } // When we preview Query Loop blocks we should prefer the current
  33822. // block's postType, which is passed through block context.
  33823. const usedPostType = previewPostType || postType;
  33824. return {
  33825. posts: getEntityRecords('postType', usedPostType, { ...query,
  33826. ...restQueryArgs
  33827. }),
  33828. blocks: getBlocks(clientId)
  33829. };
  33830. }, [perPage, page, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, restQueryArgs, previewPostType]);
  33831. const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
  33832. postType: post.type,
  33833. postId: post.id
  33834. })), [posts]);
  33835. const hasLayoutFlex = layoutType === 'flex' && columns > 1;
  33836. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33837. className: classnames_default()({
  33838. 'is-flex-container': hasLayoutFlex,
  33839. [`columns-${columns}`]: hasLayoutFlex
  33840. })
  33841. });
  33842. if (!posts) {
  33843. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  33844. }
  33845. if (!posts.length) {
  33846. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  33847. } // To avoid flicker when switching active block contexts, a preview is rendered
  33848. // for each block context, but the preview for the active block context is hidden.
  33849. // This ensures that when it is displayed again, the cached rendering of the
  33850. // block preview is used, instead of having to re-render the preview from scratch.
  33851. return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
  33852. var _blockContexts$, _blockContexts$2;
  33853. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  33854. key: blockContext.postId,
  33855. value: blockContext
  33856. }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? (0,external_wp_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
  33857. blocks: blocks,
  33858. blockContextId: blockContext.postId,
  33859. setActiveBlockContextId: setActiveBlockContextId,
  33860. isHidden: blockContext.postId === (activeBlockContextId || ((_blockContexts$2 = blockContexts[0]) === null || _blockContexts$2 === void 0 ? void 0 : _blockContexts$2.postId))
  33861. }));
  33862. }));
  33863. }
  33864. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
  33865. /**
  33866. * WordPress dependencies
  33867. */
  33868. function PostTemplateSave() {
  33869. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  33870. }
  33871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  33872. /**
  33873. * WordPress dependencies
  33874. */
  33875. /**
  33876. * Internal dependencies
  33877. */
  33878. const post_template_metadata = {
  33879. $schema: "https://schemas.wp.org/trunk/block.json",
  33880. apiVersion: 2,
  33881. name: "core/post-template",
  33882. title: "Post Template",
  33883. category: "theme",
  33884. parent: ["core/query"],
  33885. description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
  33886. textdomain: "default",
  33887. usesContext: ["queryId", "query", "queryContext", "displayLayout", "templateSlug", "previewPostType"],
  33888. supports: {
  33889. reusable: false,
  33890. html: false,
  33891. align: true,
  33892. __experimentalLayout: {
  33893. allowEditing: false
  33894. },
  33895. typography: {
  33896. fontSize: true,
  33897. lineHeight: true,
  33898. __experimentalFontFamily: true,
  33899. __experimentalFontWeight: true,
  33900. __experimentalFontStyle: true,
  33901. __experimentalTextTransform: true,
  33902. __experimentalTextDecoration: true,
  33903. __experimentalLetterSpacing: true,
  33904. __experimentalDefaultControls: {
  33905. fontSize: true
  33906. }
  33907. }
  33908. },
  33909. style: "wp-block-post-template",
  33910. editorStyle: "wp-block-post-template-editor"
  33911. };
  33912. const {
  33913. name: post_template_name
  33914. } = post_template_metadata;
  33915. const post_template_settings = {
  33916. icon: library_layout,
  33917. edit: PostTemplateEdit,
  33918. save: PostTemplateSave
  33919. };
  33920. const post_template_init = () => initBlock({
  33921. name: post_template_name,
  33922. metadata: post_template_metadata,
  33923. settings: post_template_settings
  33924. });
  33925. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
  33926. /**
  33927. * WordPress dependencies
  33928. */
  33929. const postCategories = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33930. viewBox: "0 0 24 24",
  33931. xmlns: "http://www.w3.org/2000/svg"
  33932. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33933. d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
  33934. fillRule: "evenodd",
  33935. clipRule: "evenodd"
  33936. }));
  33937. /* harmony default export */ var post_categories = (postCategories);
  33938. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
  33939. /**
  33940. * WordPress dependencies
  33941. */
  33942. function usePostTerms(_ref) {
  33943. var _term$visibility2;
  33944. let {
  33945. postId,
  33946. term
  33947. } = _ref;
  33948. const {
  33949. slug
  33950. } = term;
  33951. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  33952. var _term$visibility;
  33953. const visible = term === null || term === void 0 ? void 0 : (_term$visibility = term.visibility) === null || _term$visibility === void 0 ? void 0 : _term$visibility.publicly_queryable;
  33954. if (!visible) {
  33955. return {
  33956. postTerms: [],
  33957. _isLoading: false,
  33958. hasPostTerms: false
  33959. };
  33960. }
  33961. const {
  33962. getEntityRecords,
  33963. isResolving
  33964. } = select(external_wp_coreData_namespaceObject.store);
  33965. const taxonomyArgs = ['taxonomy', slug, {
  33966. post: postId,
  33967. per_page: -1,
  33968. context: 'view'
  33969. }];
  33970. const terms = getEntityRecords(...taxonomyArgs);
  33971. return {
  33972. postTerms: terms,
  33973. isLoading: isResolving('getEntityRecords', taxonomyArgs),
  33974. hasPostTerms: !!(terms !== null && terms !== void 0 && terms.length)
  33975. };
  33976. }, [postId, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
  33977. }
  33978. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
  33979. /**
  33980. * External dependencies
  33981. */
  33982. /**
  33983. * WordPress dependencies
  33984. */
  33985. /**
  33986. * Internal dependencies
  33987. */
  33988. // Allowed formats for the prefix and suffix fields.
  33989. const ALLOWED_FORMATS = ['core/bold', 'core/image', 'core/italic', 'core/link', 'core/strikethrough', 'core/text-color'];
  33990. function PostTermsEdit(_ref) {
  33991. var _selectedTerm$labels;
  33992. let {
  33993. attributes,
  33994. clientId,
  33995. context,
  33996. isSelected,
  33997. setAttributes,
  33998. insertBlocksAfter
  33999. } = _ref;
  34000. const {
  34001. term,
  34002. textAlign,
  34003. separator,
  34004. prefix,
  34005. suffix
  34006. } = attributes;
  34007. const {
  34008. postId,
  34009. postType
  34010. } = context;
  34011. const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34012. var _taxonomy$visibility;
  34013. if (!term) return {};
  34014. const {
  34015. getTaxonomy
  34016. } = select(external_wp_coreData_namespaceObject.store);
  34017. const taxonomy = getTaxonomy(term);
  34018. return taxonomy !== null && taxonomy !== void 0 && (_taxonomy$visibility = taxonomy.visibility) !== null && _taxonomy$visibility !== void 0 && _taxonomy$visibility.publicly_queryable ? taxonomy : {};
  34019. }, [term]);
  34020. const {
  34021. postTerms,
  34022. hasPostTerms,
  34023. isLoading
  34024. } = usePostTerms({
  34025. postId,
  34026. term: selectedTerm
  34027. });
  34028. const hasPost = postId && postType;
  34029. const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
  34030. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34031. className: classnames_default()({
  34032. [`has-text-align-${textAlign}`]: textAlign,
  34033. [`taxonomy-${term}`]: term
  34034. })
  34035. });
  34036. if (!hasPost || !term) {
  34037. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, blockInformation.title);
  34038. }
  34039. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  34040. value: textAlign,
  34041. onChange: nextAlign => {
  34042. setAttributes({
  34043. textAlign: nextAlign
  34044. });
  34045. }
  34046. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  34047. __experimentalGroup: "advanced"
  34048. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  34049. autoComplete: "off",
  34050. label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
  34051. value: separator || '',
  34052. onChange: nextValue => {
  34053. setAttributes({
  34054. separator: nextValue
  34055. });
  34056. },
  34057. help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
  34058. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && (isSelected || prefix) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  34059. allowedFormats: ALLOWED_FORMATS,
  34060. className: "wp-block-post-terms__prefix",
  34061. multiline: false,
  34062. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Prefix'),
  34063. placeholder: (0,external_wp_i18n_namespaceObject.__)('Prefix') + ' ',
  34064. value: prefix,
  34065. onChange: value => setAttributes({
  34066. prefix: value
  34067. }),
  34068. tagName: "span"
  34069. }), !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_wp_element_namespaceObject.createElement)("a", {
  34070. key: postTerm.id,
  34071. href: postTerm.link,
  34072. onClick: event => event.preventDefault()
  34073. }, (0,external_lodash_namespaceObject.unescape)(postTerm.name))).reduce((prev, curr) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prev, (0,external_wp_element_namespaceObject.createElement)("span", {
  34074. className: "wp-block-post-terms__separator"
  34075. }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || (0,external_wp_i18n_namespaceObject.__)('Term items not found.')), !isLoading && hasPostTerms && (isSelected || suffix) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  34076. allowedFormats: ALLOWED_FORMATS,
  34077. className: "wp-block-post-terms__suffix",
  34078. multiline: false,
  34079. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suffix'),
  34080. placeholder: ' ' + (0,external_wp_i18n_namespaceObject.__)('Suffix'),
  34081. value: suffix,
  34082. onChange: value => setAttributes({
  34083. suffix: value
  34084. }),
  34085. tagName: "span",
  34086. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  34087. })));
  34088. }
  34089. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-terms.js
  34090. /**
  34091. * WordPress dependencies
  34092. */
  34093. const postTerms = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34094. viewBox: "0 0 24 24",
  34095. xmlns: "http://www.w3.org/2000/svg"
  34096. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34097. d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
  34098. }));
  34099. /* harmony default export */ var post_terms = (postTerms);
  34100. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/hooks.js
  34101. /**
  34102. * WordPress dependencies
  34103. */
  34104. const variationIconMap = {
  34105. category: post_categories,
  34106. post_tag: post_terms
  34107. }; // We add `icons` to categories and tags. The remaining ones use
  34108. // the block's default icon.
  34109. function enhanceVariations(settings, name) {
  34110. if (name !== 'core/post-terms') {
  34111. return settings;
  34112. }
  34113. const variations = settings.variations.map(variation => ({ ...variation,
  34114. ...(variationIconMap[variation.name] && {
  34115. icon: variationIconMap[variation.name]
  34116. })
  34117. }));
  34118. return { ...settings,
  34119. variations
  34120. };
  34121. }
  34122. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  34123. /**
  34124. * WordPress dependencies
  34125. */
  34126. /**
  34127. * Internal dependencies
  34128. */
  34129. const post_terms_metadata = {
  34130. $schema: "https://schemas.wp.org/trunk/block.json",
  34131. apiVersion: 2,
  34132. name: "core/post-terms",
  34133. title: "Post Terms",
  34134. category: "theme",
  34135. description: "Post terms.",
  34136. textdomain: "default",
  34137. attributes: {
  34138. term: {
  34139. type: "string"
  34140. },
  34141. textAlign: {
  34142. type: "string"
  34143. },
  34144. separator: {
  34145. type: "string",
  34146. "default": ", "
  34147. },
  34148. prefix: {
  34149. type: "string",
  34150. "default": ""
  34151. },
  34152. suffix: {
  34153. type: "string",
  34154. "default": ""
  34155. }
  34156. },
  34157. usesContext: ["postId", "postType"],
  34158. supports: {
  34159. html: false,
  34160. color: {
  34161. gradients: true,
  34162. link: true,
  34163. __experimentalDefaultControls: {
  34164. background: true,
  34165. text: true,
  34166. link: true
  34167. }
  34168. },
  34169. typography: {
  34170. fontSize: true,
  34171. lineHeight: true,
  34172. __experimentalFontFamily: true,
  34173. __experimentalFontWeight: true,
  34174. __experimentalFontStyle: true,
  34175. __experimentalTextTransform: true,
  34176. __experimentalTextDecoration: true,
  34177. __experimentalLetterSpacing: true,
  34178. __experimentalDefaultControls: {
  34179. fontSize: true
  34180. }
  34181. }
  34182. },
  34183. style: "wp-block-post-terms"
  34184. };
  34185. const {
  34186. name: post_terms_name
  34187. } = post_terms_metadata;
  34188. const post_terms_settings = {
  34189. icon: post_categories,
  34190. edit: PostTermsEdit
  34191. };
  34192. const post_terms_init = () => {
  34193. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations);
  34194. return initBlock({
  34195. name: post_terms_name,
  34196. metadata: post_terms_metadata,
  34197. settings: post_terms_settings
  34198. });
  34199. };
  34200. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
  34201. /**
  34202. * External dependencies
  34203. */
  34204. /**
  34205. * WordPress dependencies
  34206. */
  34207. /**
  34208. * Internal dependencies
  34209. */
  34210. function PostTitleEdit(_ref) {
  34211. let {
  34212. attributes: {
  34213. level,
  34214. textAlign,
  34215. isLink,
  34216. rel,
  34217. linkTarget
  34218. },
  34219. setAttributes,
  34220. context: {
  34221. postType,
  34222. postId,
  34223. queryId
  34224. }
  34225. } = _ref;
  34226. const TagName = 0 === level ? 'p' : 'h' + level;
  34227. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  34228. const userCanEdit = useCanEditEntity('postType', postType, postId);
  34229. const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  34230. const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
  34231. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34232. className: classnames_default()({
  34233. [`has-text-align-${textAlign}`]: textAlign
  34234. })
  34235. });
  34236. let titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Title'));
  34237. if (postType && postId) {
  34238. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, _extends({
  34239. tagName: TagName,
  34240. placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'),
  34241. value: rawTitle,
  34242. onChange: setTitle,
  34243. __experimentalVersion: 2
  34244. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
  34245. dangerouslySetInnerHTML: {
  34246. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  34247. }
  34248. }));
  34249. }
  34250. if (isLink && postType && postId) {
  34251. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  34252. tagName: "a",
  34253. href: link,
  34254. target: linkTarget,
  34255. rel: rel,
  34256. placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null,
  34257. value: rawTitle,
  34258. onChange: setTitle,
  34259. __experimentalVersion: 2
  34260. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  34261. href: link,
  34262. target: linkTarget,
  34263. rel: rel,
  34264. onClick: event => event.preventDefault(),
  34265. dangerouslySetInnerHTML: {
  34266. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  34267. }
  34268. }));
  34269. }
  34270. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34271. group: "block"
  34272. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  34273. selectedLevel: level,
  34274. onChange: newLevel => setAttributes({
  34275. level: newLevel
  34276. })
  34277. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  34278. value: textAlign,
  34279. onChange: nextAlign => {
  34280. setAttributes({
  34281. textAlign: nextAlign
  34282. });
  34283. }
  34284. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  34285. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  34286. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34287. label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
  34288. onChange: () => setAttributes({
  34289. isLink: !isLink
  34290. }),
  34291. checked: isLink
  34292. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34293. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  34294. onChange: value => setAttributes({
  34295. linkTarget: value ? '_blank' : '_self'
  34296. }),
  34297. checked: linkTarget === '_blank'
  34298. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  34299. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  34300. value: rel,
  34301. onChange: newRel => setAttributes({
  34302. rel: newRel
  34303. })
  34304. })))), titleElement);
  34305. }
  34306. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
  34307. /**
  34308. * Internal dependencies
  34309. */
  34310. const post_title_deprecated_v1 = {
  34311. attributes: {
  34312. textAlign: {
  34313. type: 'string'
  34314. },
  34315. level: {
  34316. type: 'number',
  34317. default: 2
  34318. },
  34319. isLink: {
  34320. type: 'boolean',
  34321. default: false
  34322. },
  34323. rel: {
  34324. type: 'string',
  34325. attribute: 'rel',
  34326. default: ''
  34327. },
  34328. linkTarget: {
  34329. type: 'string',
  34330. default: '_self'
  34331. }
  34332. },
  34333. supports: {
  34334. align: ['wide', 'full'],
  34335. html: false,
  34336. color: {
  34337. gradients: true,
  34338. link: true
  34339. },
  34340. spacing: {
  34341. margin: true
  34342. },
  34343. typography: {
  34344. fontSize: true,
  34345. lineHeight: true,
  34346. __experimentalFontFamily: true,
  34347. __experimentalFontWeight: true,
  34348. __experimentalFontStyle: true,
  34349. __experimentalTextTransform: true
  34350. }
  34351. },
  34352. save() {
  34353. return null;
  34354. },
  34355. migrate: migrate_font_family,
  34356. isEligible(_ref) {
  34357. var _style$typography;
  34358. let {
  34359. style
  34360. } = _ref;
  34361. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  34362. }
  34363. };
  34364. /**
  34365. * New deprecations need to be placed first
  34366. * for them to have higher priority.
  34367. *
  34368. * Old deprecations may need to be updated as well.
  34369. *
  34370. * See block-deprecation.md
  34371. */
  34372. /* harmony default export */ var post_title_deprecated = ([post_title_deprecated_v1]);
  34373. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  34374. /**
  34375. * WordPress dependencies
  34376. */
  34377. /**
  34378. * Internal dependencies
  34379. */
  34380. const post_title_metadata = {
  34381. $schema: "https://schemas.wp.org/trunk/block.json",
  34382. apiVersion: 2,
  34383. name: "core/post-title",
  34384. title: "Post Title",
  34385. category: "theme",
  34386. description: "Displays the title of a post, page, or any other content-type.",
  34387. textdomain: "default",
  34388. usesContext: ["postId", "postType", "queryId"],
  34389. attributes: {
  34390. textAlign: {
  34391. type: "string"
  34392. },
  34393. level: {
  34394. type: "number",
  34395. "default": 2
  34396. },
  34397. isLink: {
  34398. type: "boolean",
  34399. "default": false
  34400. },
  34401. rel: {
  34402. type: "string",
  34403. attribute: "rel",
  34404. "default": ""
  34405. },
  34406. linkTarget: {
  34407. type: "string",
  34408. "default": "_self"
  34409. }
  34410. },
  34411. supports: {
  34412. align: ["wide", "full"],
  34413. html: false,
  34414. color: {
  34415. gradients: true,
  34416. link: true,
  34417. __experimentalDefaultControls: {
  34418. background: true,
  34419. text: true,
  34420. link: true
  34421. }
  34422. },
  34423. spacing: {
  34424. margin: true,
  34425. padding: true
  34426. },
  34427. typography: {
  34428. fontSize: true,
  34429. lineHeight: true,
  34430. __experimentalFontFamily: true,
  34431. __experimentalFontWeight: true,
  34432. __experimentalFontStyle: true,
  34433. __experimentalTextTransform: true,
  34434. __experimentalTextDecoration: true,
  34435. __experimentalLetterSpacing: true,
  34436. __experimentalDefaultControls: {
  34437. fontSize: true,
  34438. fontAppearance: true,
  34439. textTransform: true
  34440. }
  34441. }
  34442. },
  34443. style: "wp-block-post-title"
  34444. };
  34445. const {
  34446. name: post_title_name
  34447. } = post_title_metadata;
  34448. const post_title_settings = {
  34449. icon: library_title,
  34450. edit: PostTitleEdit,
  34451. deprecated: post_title_deprecated
  34452. };
  34453. const post_title_init = () => initBlock({
  34454. name: post_title_name,
  34455. metadata: post_title_metadata,
  34456. settings: post_title_settings
  34457. });
  34458. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
  34459. /**
  34460. * WordPress dependencies
  34461. */
  34462. const preformatted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34463. viewBox: "0 0 24 24",
  34464. xmlns: "http://www.w3.org/2000/svg"
  34465. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34466. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
  34467. }));
  34468. /* harmony default export */ var library_preformatted = (preformatted);
  34469. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
  34470. /**
  34471. * WordPress dependencies
  34472. */
  34473. function PreformattedEdit(_ref) {
  34474. let {
  34475. attributes,
  34476. mergeBlocks,
  34477. setAttributes,
  34478. onRemove,
  34479. style
  34480. } = _ref;
  34481. const {
  34482. content
  34483. } = attributes;
  34484. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34485. style
  34486. });
  34487. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  34488. tagName: "pre",
  34489. identifier: "content",
  34490. preserveWhiteSpace: true,
  34491. value: content,
  34492. onChange: nextContent => {
  34493. setAttributes({
  34494. content: nextContent
  34495. });
  34496. },
  34497. onRemove: onRemove,
  34498. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
  34499. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
  34500. onMerge: mergeBlocks
  34501. }, blockProps, {
  34502. __unstablePastePlainText: true
  34503. }));
  34504. }
  34505. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
  34506. /**
  34507. * WordPress dependencies
  34508. */
  34509. function preformatted_save_save(_ref) {
  34510. let {
  34511. attributes
  34512. } = _ref;
  34513. const {
  34514. content
  34515. } = attributes;
  34516. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34517. value: content
  34518. }));
  34519. }
  34520. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
  34521. /**
  34522. * WordPress dependencies
  34523. */
  34524. const preformatted_transforms_transforms = {
  34525. from: [{
  34526. type: 'block',
  34527. blocks: ['core/code', 'core/paragraph'],
  34528. transform: _ref => {
  34529. let {
  34530. content,
  34531. anchor
  34532. } = _ref;
  34533. return (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
  34534. content,
  34535. anchor
  34536. });
  34537. }
  34538. }, {
  34539. type: 'raw',
  34540. isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'),
  34541. schema: _ref2 => {
  34542. let {
  34543. phrasingContentSchema
  34544. } = _ref2;
  34545. return {
  34546. pre: {
  34547. children: phrasingContentSchema
  34548. }
  34549. };
  34550. }
  34551. }],
  34552. to: [{
  34553. type: 'block',
  34554. blocks: ['core/paragraph'],
  34555. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  34556. }, {
  34557. type: 'block',
  34558. blocks: ['core/code'],
  34559. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
  34560. }]
  34561. };
  34562. /* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);
  34563. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  34564. /**
  34565. * WordPress dependencies
  34566. */
  34567. /**
  34568. * Internal dependencies
  34569. */
  34570. const preformatted_metadata = {
  34571. $schema: "https://schemas.wp.org/trunk/block.json",
  34572. apiVersion: 2,
  34573. name: "core/preformatted",
  34574. title: "Preformatted",
  34575. category: "text",
  34576. description: "Add text that respects your spacing and tabs, and also allows styling.",
  34577. textdomain: "default",
  34578. attributes: {
  34579. content: {
  34580. type: "string",
  34581. source: "html",
  34582. selector: "pre",
  34583. "default": "",
  34584. __unstablePreserveWhiteSpace: true,
  34585. __experimentalRole: "content"
  34586. }
  34587. },
  34588. supports: {
  34589. anchor: true,
  34590. color: {
  34591. gradients: true,
  34592. __experimentalDefaultControls: {
  34593. background: true,
  34594. text: true
  34595. }
  34596. },
  34597. typography: {
  34598. fontSize: true,
  34599. lineHeight: true,
  34600. __experimentalFontFamily: true,
  34601. __experimentalFontWeight: true,
  34602. __experimentalFontStyle: true,
  34603. __experimentalTextTransform: true,
  34604. __experimentalTextDecoration: true,
  34605. __experimentalLetterSpacing: true,
  34606. __experimentalDefaultControls: {
  34607. fontSize: true
  34608. }
  34609. }
  34610. },
  34611. style: "wp-block-preformatted"
  34612. };
  34613. const {
  34614. name: preformatted_name
  34615. } = preformatted_metadata;
  34616. const preformatted_settings = {
  34617. icon: library_preformatted,
  34618. example: {
  34619. attributes: {
  34620. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  34621. // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
  34622. content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
  34623. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  34624. }
  34625. },
  34626. transforms: preformatted_transforms,
  34627. edit: PreformattedEdit,
  34628. save: preformatted_save_save,
  34629. merge(attributes, attributesToMerge) {
  34630. return {
  34631. content: attributes.content + attributesToMerge.content
  34632. };
  34633. }
  34634. };
  34635. const preformatted_init = () => initBlock({
  34636. name: preformatted_name,
  34637. metadata: preformatted_metadata,
  34638. settings: preformatted_settings
  34639. });
  34640. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
  34641. /**
  34642. * WordPress dependencies
  34643. */
  34644. const pullquote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34645. viewBox: "0 0 24 24",
  34646. xmlns: "http://www.w3.org/2000/svg"
  34647. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34648. d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
  34649. }));
  34650. /* harmony default export */ var library_pullquote = (pullquote);
  34651. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
  34652. const SOLID_COLOR_CLASS = `is-style-solid-color`;
  34653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
  34654. /**
  34655. * External dependencies
  34656. */
  34657. /**
  34658. * WordPress dependencies
  34659. */
  34660. /**
  34661. * Internal dependencies
  34662. */
  34663. const pullquote_deprecated_blockAttributes = {
  34664. value: {
  34665. type: 'string',
  34666. source: 'html',
  34667. selector: 'blockquote',
  34668. multiline: 'p'
  34669. },
  34670. citation: {
  34671. type: 'string',
  34672. source: 'html',
  34673. selector: 'cite',
  34674. default: ''
  34675. },
  34676. mainColor: {
  34677. type: 'string'
  34678. },
  34679. customMainColor: {
  34680. type: 'string'
  34681. },
  34682. textColor: {
  34683. type: 'string'
  34684. },
  34685. customTextColor: {
  34686. type: 'string'
  34687. }
  34688. };
  34689. function parseBorderColor(styleString) {
  34690. if (!styleString) {
  34691. return;
  34692. }
  34693. const matches = styleString.match(/border-color:([^;]+)[;]?/);
  34694. if (matches && matches[1]) {
  34695. return matches[1];
  34696. }
  34697. }
  34698. function multilineToInline(value) {
  34699. return (0,external_wp_richText_namespaceObject.toHTMLString)({
  34700. value: (0,external_wp_richText_namespaceObject.replace)((0,external_wp_richText_namespaceObject.create)({
  34701. html: value,
  34702. multilineTag: 'p'
  34703. }), new RegExp(external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR, 'g'), '\n')
  34704. });
  34705. }
  34706. const pullquote_deprecated_v5 = {
  34707. attributes: {
  34708. value: {
  34709. type: 'string',
  34710. source: 'html',
  34711. selector: 'blockquote',
  34712. multiline: 'p',
  34713. __experimentalRole: 'content'
  34714. },
  34715. citation: {
  34716. type: 'string',
  34717. source: 'html',
  34718. selector: 'cite',
  34719. default: '',
  34720. __experimentalRole: 'content'
  34721. },
  34722. textAlign: {
  34723. type: 'string'
  34724. }
  34725. },
  34726. save(_ref) {
  34727. let {
  34728. attributes
  34729. } = _ref;
  34730. const {
  34731. textAlign,
  34732. citation,
  34733. value
  34734. } = attributes;
  34735. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
  34736. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  34737. className: classnames_default()({
  34738. [`has-text-align-${textAlign}`]: textAlign
  34739. })
  34740. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34741. value: value,
  34742. multiline: true
  34743. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34744. tagName: "cite",
  34745. value: citation
  34746. })));
  34747. },
  34748. migrate(_ref2) {
  34749. let {
  34750. value,
  34751. ...attributes
  34752. } = _ref2;
  34753. return {
  34754. value: multilineToInline(value),
  34755. ...attributes
  34756. };
  34757. }
  34758. }; // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example
  34759. const pullquote_deprecated_v4 = {
  34760. attributes: { ...pullquote_deprecated_blockAttributes
  34761. },
  34762. save(_ref3) {
  34763. let {
  34764. attributes
  34765. } = _ref3;
  34766. const {
  34767. mainColor,
  34768. customMainColor,
  34769. customTextColor,
  34770. textColor,
  34771. value,
  34772. citation,
  34773. className
  34774. } = attributes;
  34775. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  34776. let figureClasses, figureStyles; // Is solid color style
  34777. if (isSolidColorStyle) {
  34778. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  34779. figureClasses = classnames_default()({
  34780. 'has-background': backgroundClass || customMainColor,
  34781. [backgroundClass]: backgroundClass
  34782. });
  34783. figureStyles = {
  34784. backgroundColor: backgroundClass ? undefined : customMainColor
  34785. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  34786. } else if (customMainColor) {
  34787. figureStyles = {
  34788. borderColor: customMainColor
  34789. };
  34790. }
  34791. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  34792. const blockquoteClasses = classnames_default()({
  34793. 'has-text-color': textColor || customTextColor,
  34794. [blockquoteTextColorClass]: blockquoteTextColorClass
  34795. });
  34796. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  34797. color: customTextColor
  34798. };
  34799. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  34800. className: figureClasses,
  34801. style: figureStyles
  34802. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  34803. className: blockquoteClasses,
  34804. style: blockquoteStyles
  34805. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34806. value: value,
  34807. multiline: true
  34808. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34809. tagName: "cite",
  34810. value: citation
  34811. })));
  34812. },
  34813. migrate(_ref4) {
  34814. let {
  34815. value,
  34816. className,
  34817. mainColor,
  34818. customMainColor,
  34819. customTextColor,
  34820. ...attributes
  34821. } = _ref4;
  34822. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  34823. let style;
  34824. if (customMainColor) {
  34825. if (!isSolidColorStyle) {
  34826. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  34827. style = {
  34828. border: {
  34829. color: customMainColor
  34830. }
  34831. };
  34832. } else {
  34833. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  34834. style = {
  34835. color: {
  34836. background: customMainColor
  34837. }
  34838. };
  34839. }
  34840. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  34841. if (customTextColor && style) {
  34842. style.color = { ...style.color,
  34843. text: customTextColor
  34844. };
  34845. }
  34846. return {
  34847. value: multilineToInline(value),
  34848. className,
  34849. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  34850. borderColor: isSolidColorStyle ? undefined : mainColor,
  34851. textAlign: isSolidColorStyle ? 'left' : undefined,
  34852. style,
  34853. ...attributes
  34854. };
  34855. }
  34856. };
  34857. const pullquote_deprecated_v3 = {
  34858. attributes: { ...pullquote_deprecated_blockAttributes,
  34859. // figureStyle is an attribute that never existed.
  34860. // We are using it as a way to access the styles previously applied to the figure.
  34861. figureStyle: {
  34862. source: 'attribute',
  34863. selector: 'figure',
  34864. attribute: 'style'
  34865. }
  34866. },
  34867. save(_ref5) {
  34868. let {
  34869. attributes
  34870. } = _ref5;
  34871. const {
  34872. mainColor,
  34873. customMainColor,
  34874. textColor,
  34875. customTextColor,
  34876. value,
  34877. citation,
  34878. className,
  34879. figureStyle
  34880. } = attributes;
  34881. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  34882. let figureClasses, figureStyles; // Is solid color style
  34883. if (isSolidColorStyle) {
  34884. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  34885. figureClasses = classnames_default()({
  34886. 'has-background': backgroundClass || customMainColor,
  34887. [backgroundClass]: backgroundClass
  34888. });
  34889. figureStyles = {
  34890. backgroundColor: backgroundClass ? undefined : customMainColor
  34891. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  34892. } else if (customMainColor) {
  34893. figureStyles = {
  34894. borderColor: customMainColor
  34895. }; // If normal style and a named color are being used, we need to retrieve the color value to set the style,
  34896. // as there is no expectation that themes create classes that set border colors.
  34897. } else if (mainColor) {
  34898. // Previously here we queried the color settings to know the color value
  34899. // of a named color. This made the save function impure and the block was refactored,
  34900. // because meanwhile a change in the editor made it impossible to query color settings in the save function.
  34901. // Here instead of querying the color settings to know the color value, we retrieve the value
  34902. // directly from the style previously serialized.
  34903. const borderColor = parseBorderColor(figureStyle);
  34904. figureStyles = {
  34905. borderColor
  34906. };
  34907. }
  34908. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  34909. const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
  34910. [blockquoteTextColorClass]: blockquoteTextColorClass
  34911. });
  34912. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  34913. color: customTextColor
  34914. };
  34915. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  34916. className: figureClasses,
  34917. style: figureStyles
  34918. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  34919. className: blockquoteClasses,
  34920. style: blockquoteStyles
  34921. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34922. value: value,
  34923. multiline: true
  34924. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  34925. tagName: "cite",
  34926. value: citation
  34927. })));
  34928. },
  34929. migrate(_ref6) {
  34930. let {
  34931. value,
  34932. className,
  34933. figureStyle,
  34934. mainColor,
  34935. customMainColor,
  34936. customTextColor,
  34937. ...attributes
  34938. } = _ref6;
  34939. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  34940. let style;
  34941. if (customMainColor) {
  34942. if (!isSolidColorStyle) {
  34943. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  34944. style = {
  34945. border: {
  34946. color: customMainColor
  34947. }
  34948. };
  34949. } else {
  34950. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  34951. style = {
  34952. color: {
  34953. background: customMainColor
  34954. }
  34955. };
  34956. }
  34957. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  34958. if (customTextColor && style) {
  34959. style.color = { ...style.color,
  34960. text: customTextColor
  34961. };
  34962. } // If is the default style, and a main color is set,
  34963. // migrate the main color value into a custom border color.
  34964. // The custom border color value is retrieved by parsing the figure styles.
  34965. if (!isSolidColorStyle && mainColor && figureStyle) {
  34966. const borderColor = parseBorderColor(figureStyle);
  34967. if (borderColor) {
  34968. return {
  34969. value: multilineToInline(value),
  34970. ...attributes,
  34971. className,
  34972. // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.
  34973. style: {
  34974. border: {
  34975. color: borderColor
  34976. }
  34977. }
  34978. };
  34979. }
  34980. }
  34981. return {
  34982. value: multilineToInline(value),
  34983. className,
  34984. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  34985. borderColor: isSolidColorStyle ? undefined : mainColor,
  34986. textAlign: isSolidColorStyle ? 'left' : undefined,
  34987. style,
  34988. ...attributes
  34989. };
  34990. }
  34991. };
  34992. const pullquote_deprecated_v2 = {
  34993. attributes: pullquote_deprecated_blockAttributes,
  34994. save(_ref7) {
  34995. let {
  34996. attributes
  34997. } = _ref7;
  34998. const {
  34999. mainColor,
  35000. customMainColor,
  35001. textColor,
  35002. customTextColor,
  35003. value,
  35004. citation,
  35005. className
  35006. } = attributes;
  35007. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  35008. let figureClass, figureStyles; // Is solid color style
  35009. if (isSolidColorStyle) {
  35010. figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  35011. if (!figureClass) {
  35012. figureStyles = {
  35013. backgroundColor: customMainColor
  35014. };
  35015. } // Is normal style and a custom color is being used ( we can set a style directly with its value)
  35016. } else if (customMainColor) {
  35017. figureStyles = {
  35018. borderColor: customMainColor
  35019. }; // Is normal style and a named color is being used, we need to retrieve the color value to set the style,
  35020. // as there is no expectation that themes create classes that set border colors.
  35021. } else if (mainColor) {
  35022. const colors = (0,external_lodash_namespaceObject.get)((0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings(), ['colors'], []);
  35023. const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
  35024. figureStyles = {
  35025. borderColor: colorObject.color
  35026. };
  35027. }
  35028. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  35029. const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
  35030. [blockquoteTextColorClass]: blockquoteTextColorClass
  35031. }) : undefined;
  35032. const blockquoteStyle = blockquoteTextColorClass ? undefined : {
  35033. color: customTextColor
  35034. };
  35035. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  35036. className: figureClass,
  35037. style: figureStyles
  35038. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  35039. className: blockquoteClasses,
  35040. style: blockquoteStyle
  35041. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35042. value: value,
  35043. multiline: true
  35044. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35045. tagName: "cite",
  35046. value: citation
  35047. })));
  35048. },
  35049. migrate(_ref8) {
  35050. let {
  35051. value,
  35052. className,
  35053. mainColor,
  35054. customMainColor,
  35055. customTextColor,
  35056. ...attributes
  35057. } = _ref8;
  35058. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  35059. let style = {};
  35060. if (customMainColor) {
  35061. if (!isSolidColorStyle) {
  35062. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  35063. style = {
  35064. border: {
  35065. color: customMainColor
  35066. }
  35067. };
  35068. } else {
  35069. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  35070. style = {
  35071. color: {
  35072. background: customMainColor
  35073. }
  35074. };
  35075. }
  35076. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  35077. if (customTextColor && style) {
  35078. style.color = { ...style.color,
  35079. text: customTextColor
  35080. };
  35081. }
  35082. return {
  35083. value: multilineToInline(value),
  35084. className,
  35085. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  35086. borderColor: isSolidColorStyle ? undefined : mainColor,
  35087. textAlign: isSolidColorStyle ? 'left' : undefined,
  35088. style,
  35089. ...attributes
  35090. };
  35091. }
  35092. };
  35093. const pullquote_deprecated_v1 = {
  35094. attributes: { ...pullquote_deprecated_blockAttributes
  35095. },
  35096. save(_ref9) {
  35097. let {
  35098. attributes
  35099. } = _ref9;
  35100. const {
  35101. value,
  35102. citation
  35103. } = attributes;
  35104. return (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35105. value: value,
  35106. multiline: true
  35107. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35108. tagName: "cite",
  35109. value: citation
  35110. }));
  35111. },
  35112. migrate(_ref10) {
  35113. let {
  35114. value,
  35115. ...attributes
  35116. } = _ref10;
  35117. return {
  35118. value: multilineToInline(value),
  35119. ...attributes
  35120. };
  35121. }
  35122. };
  35123. const deprecated_v0 = {
  35124. attributes: { ...pullquote_deprecated_blockAttributes,
  35125. citation: {
  35126. type: 'string',
  35127. source: 'html',
  35128. selector: 'footer'
  35129. },
  35130. align: {
  35131. type: 'string',
  35132. default: 'none'
  35133. }
  35134. },
  35135. save(_ref11) {
  35136. let {
  35137. attributes
  35138. } = _ref11;
  35139. const {
  35140. value,
  35141. citation,
  35142. align
  35143. } = attributes;
  35144. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  35145. className: `align${align}`
  35146. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35147. value: value,
  35148. multiline: true
  35149. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35150. tagName: "footer",
  35151. value: citation
  35152. }));
  35153. },
  35154. migrate(_ref12) {
  35155. let {
  35156. value,
  35157. ...attributes
  35158. } = _ref12;
  35159. return {
  35160. value: multilineToInline(value),
  35161. ...attributes
  35162. };
  35163. }
  35164. };
  35165. /**
  35166. * New deprecations need to be placed first
  35167. * for them to have higher priority.
  35168. *
  35169. * Old deprecations may need to be updated as well.
  35170. *
  35171. * See block-deprecation.md
  35172. */
  35173. /* harmony default export */ var pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]);
  35174. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
  35175. const Figure = 'figure';
  35176. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
  35177. const BlockQuote = 'blockquote';
  35178. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
  35179. /**
  35180. * External dependencies
  35181. */
  35182. /**
  35183. * WordPress dependencies
  35184. */
  35185. /**
  35186. * Internal dependencies
  35187. */
  35188. const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  35189. function PullQuoteEdit(_ref) {
  35190. let {
  35191. attributes,
  35192. setAttributes,
  35193. isSelected,
  35194. insertBlocksAfter
  35195. } = _ref;
  35196. const {
  35197. textAlign,
  35198. citation,
  35199. value
  35200. } = attributes;
  35201. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  35202. className: classnames_default()({
  35203. [`has-text-align-${textAlign}`]: textAlign
  35204. })
  35205. });
  35206. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
  35207. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  35208. group: "block"
  35209. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  35210. value: textAlign,
  35211. onChange: nextAlign => {
  35212. setAttributes({
  35213. textAlign: nextAlign
  35214. });
  35215. }
  35216. })), (0,external_wp_element_namespaceObject.createElement)(Figure, blockProps, (0,external_wp_element_namespaceObject.createElement)(BlockQuote, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  35217. identifier: "value",
  35218. tagName: "p",
  35219. value: value,
  35220. onChange: nextValue => setAttributes({
  35221. value: nextValue
  35222. }),
  35223. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
  35224. placeholder: // translators: placeholder text used for the quote
  35225. (0,external_wp_i18n_namespaceObject.__)('Add quote'),
  35226. textAlign: "center"
  35227. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  35228. identifier: "citation",
  35229. tagName: isWebPlatform ? 'cite' : undefined,
  35230. style: {
  35231. display: 'block'
  35232. },
  35233. value: citation,
  35234. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
  35235. placeholder: // translators: placeholder text used for the citation
  35236. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  35237. onChange: nextCitation => setAttributes({
  35238. citation: nextCitation
  35239. }),
  35240. className: "wp-block-pullquote__citation",
  35241. __unstableMobileNoFocusOnMount: true,
  35242. textAlign: "center",
  35243. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  35244. }))));
  35245. }
  35246. /* harmony default export */ var pullquote_edit = (PullQuoteEdit);
  35247. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
  35248. /**
  35249. * External dependencies
  35250. */
  35251. /**
  35252. * WordPress dependencies
  35253. */
  35254. function pullquote_save_save(_ref) {
  35255. let {
  35256. attributes
  35257. } = _ref;
  35258. const {
  35259. textAlign,
  35260. citation,
  35261. value
  35262. } = attributes;
  35263. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
  35264. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  35265. className: classnames_default()({
  35266. [`has-text-align-${textAlign}`]: textAlign
  35267. })
  35268. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35269. tagName: "p",
  35270. value: value
  35271. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  35272. tagName: "cite",
  35273. value: citation
  35274. })));
  35275. }
  35276. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
  35277. /**
  35278. * WordPress dependencies
  35279. */
  35280. const pullquote_transforms_transforms = {
  35281. from: [{
  35282. type: 'block',
  35283. isMultiBlock: true,
  35284. blocks: ['core/paragraph'],
  35285. transform: attributes => {
  35286. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  35287. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  35288. value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
  35289. let {
  35290. content
  35291. } = _ref;
  35292. return (0,external_wp_richText_namespaceObject.create)({
  35293. html: content
  35294. });
  35295. }), '\n')
  35296. }),
  35297. anchor: attributes.anchor
  35298. });
  35299. }
  35300. }, {
  35301. type: 'block',
  35302. blocks: ['core/heading'],
  35303. transform: _ref2 => {
  35304. let {
  35305. content,
  35306. anchor
  35307. } = _ref2;
  35308. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  35309. value: content,
  35310. anchor
  35311. });
  35312. }
  35313. }],
  35314. to: [{
  35315. type: 'block',
  35316. blocks: ['core/paragraph'],
  35317. transform: _ref3 => {
  35318. let {
  35319. value,
  35320. citation
  35321. } = _ref3;
  35322. const paragraphs = [];
  35323. if (value) {
  35324. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  35325. content: value
  35326. }));
  35327. }
  35328. if (citation) {
  35329. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  35330. content: citation
  35331. }));
  35332. }
  35333. if (paragraphs.length === 0) {
  35334. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  35335. content: ''
  35336. });
  35337. }
  35338. return paragraphs;
  35339. }
  35340. }, {
  35341. type: 'block',
  35342. blocks: ['core/heading'],
  35343. transform: _ref4 => {
  35344. let {
  35345. value,
  35346. citation
  35347. } = _ref4;
  35348. // If there is no pullquote content, use the citation as the
  35349. // content of the resulting heading. A nonexistent citation
  35350. // will result in an empty heading.
  35351. if (!value) {
  35352. return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  35353. content: citation
  35354. });
  35355. }
  35356. const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  35357. content: value
  35358. });
  35359. if (!citation) {
  35360. return headingBlock;
  35361. }
  35362. return [headingBlock, (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  35363. content: citation
  35364. })];
  35365. }
  35366. }]
  35367. };
  35368. /* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);
  35369. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  35370. /**
  35371. * WordPress dependencies
  35372. */
  35373. /**
  35374. * Internal dependencies
  35375. */
  35376. const pullquote_metadata = {
  35377. $schema: "https://schemas.wp.org/trunk/block.json",
  35378. apiVersion: 2,
  35379. name: "core/pullquote",
  35380. title: "Pullquote",
  35381. category: "text",
  35382. description: "Give special visual emphasis to a quote from your text.",
  35383. textdomain: "default",
  35384. attributes: {
  35385. value: {
  35386. type: "string",
  35387. source: "html",
  35388. selector: "p",
  35389. __experimentalRole: "content"
  35390. },
  35391. citation: {
  35392. type: "string",
  35393. source: "html",
  35394. selector: "cite",
  35395. "default": "",
  35396. __experimentalRole: "content"
  35397. },
  35398. textAlign: {
  35399. type: "string"
  35400. }
  35401. },
  35402. supports: {
  35403. anchor: true,
  35404. align: ["left", "right", "wide", "full"],
  35405. color: {
  35406. gradients: true,
  35407. background: true,
  35408. link: true,
  35409. __experimentalDefaultControls: {
  35410. background: true,
  35411. text: true
  35412. }
  35413. },
  35414. typography: {
  35415. fontSize: true,
  35416. lineHeight: true,
  35417. __experimentalFontFamily: true,
  35418. __experimentalFontWeight: true,
  35419. __experimentalFontStyle: true,
  35420. __experimentalTextTransform: true,
  35421. __experimentalTextDecoration: true,
  35422. __experimentalLetterSpacing: true,
  35423. __experimentalDefaultControls: {
  35424. fontSize: true,
  35425. fontAppearance: true
  35426. }
  35427. },
  35428. __experimentalBorder: {
  35429. color: true,
  35430. radius: true,
  35431. style: true,
  35432. width: true,
  35433. __experimentalDefaultControls: {
  35434. color: true,
  35435. radius: true,
  35436. style: true,
  35437. width: true
  35438. }
  35439. },
  35440. __experimentalStyle: {
  35441. typography: {
  35442. fontSize: "1.5em",
  35443. lineHeight: "1.6"
  35444. }
  35445. }
  35446. },
  35447. editorStyle: "wp-block-pullquote-editor",
  35448. style: "wp-block-pullquote"
  35449. };
  35450. const {
  35451. name: pullquote_name
  35452. } = pullquote_metadata;
  35453. const pullquote_settings = {
  35454. icon: library_pullquote,
  35455. example: {
  35456. attributes: {
  35457. value: // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
  35458. (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.'),
  35459. citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
  35460. }
  35461. },
  35462. transforms: pullquote_transforms,
  35463. edit: pullquote_edit,
  35464. save: pullquote_save_save,
  35465. deprecated: pullquote_deprecated
  35466. };
  35467. const pullquote_init = () => initBlock({
  35468. name: pullquote_name,
  35469. metadata: pullquote_metadata,
  35470. settings: pullquote_settings
  35471. });
  35472. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
  35473. /**
  35474. * WordPress dependencies
  35475. */
  35476. const loop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35477. viewBox: "0 0 24 24",
  35478. xmlns: "http://www.w3.org/2000/svg"
  35479. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35480. d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
  35481. }));
  35482. /* harmony default export */ var library_loop = (loop);
  35483. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
  35484. /**
  35485. * WordPress dependencies
  35486. */
  35487. const settings_settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35488. xmlns: "http://www.w3.org/2000/svg",
  35489. viewBox: "0 0 24 24"
  35490. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35491. d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
  35492. }));
  35493. /* harmony default export */ var library_settings = (settings_settings);
  35494. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
  35495. /**
  35496. * WordPress dependencies
  35497. */
  35498. function QueryToolbar(_ref) {
  35499. let {
  35500. attributes: {
  35501. query,
  35502. displayLayout
  35503. },
  35504. setQuery,
  35505. setDisplayLayout,
  35506. openPatternSelectionModal,
  35507. name,
  35508. clientId
  35509. } = _ref;
  35510. const hasPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35511. const {
  35512. getBlockRootClientId,
  35513. __experimentalGetPatternsByBlockTypes
  35514. } = select(external_wp_blockEditor_namespaceObject.store);
  35515. const rootClientId = getBlockRootClientId(clientId);
  35516. return !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length;
  35517. }, [name, clientId]);
  35518. const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
  35519. const displayLayoutControls = [{
  35520. icon: library_list,
  35521. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  35522. onClick: () => setDisplayLayout({
  35523. type: 'list'
  35524. }),
  35525. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'list'
  35526. }, {
  35527. icon: library_grid,
  35528. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  35529. onClick: () => setDisplayLayout({
  35530. type: 'flex',
  35531. columns: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.columns) || 3
  35532. }),
  35533. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex'
  35534. }];
  35535. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !query.inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  35536. contentClassName: "block-library-query-toolbar__popover",
  35537. renderToggle: _ref2 => {
  35538. let {
  35539. onToggle
  35540. } = _ref2;
  35541. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  35542. icon: library_settings,
  35543. label: (0,external_wp_i18n_namespaceObject.__)('Display settings'),
  35544. onClick: onToggle
  35545. });
  35546. },
  35547. renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  35548. __unstableInputWidth: "60px",
  35549. label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'),
  35550. labelPosition: "edge",
  35551. min: 1,
  35552. max: 100,
  35553. onChange: value => {
  35554. if (isNaN(value) || value < 1 || value > 100) {
  35555. return;
  35556. }
  35557. setQuery({
  35558. perPage: value
  35559. });
  35560. },
  35561. step: "1",
  35562. value: query.perPage,
  35563. isDragEnabled: false
  35564. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  35565. __unstableInputWidth: "60px",
  35566. label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
  35567. labelPosition: "edge",
  35568. min: 0,
  35569. max: 100,
  35570. onChange: value => {
  35571. if (isNaN(value) || value < 0 || value > 100) {
  35572. return;
  35573. }
  35574. setQuery({
  35575. offset: value
  35576. });
  35577. },
  35578. step: "1",
  35579. value: query.offset,
  35580. isDragEnabled: false
  35581. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  35582. id: maxPageInputId,
  35583. help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
  35584. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  35585. id: maxPageInputId,
  35586. __unstableInputWidth: "60px",
  35587. label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'),
  35588. labelPosition: "edge",
  35589. min: 0,
  35590. onChange: value => {
  35591. if (isNaN(value) || value < 0) {
  35592. return;
  35593. }
  35594. setQuery({
  35595. pages: value
  35596. });
  35597. },
  35598. step: "1",
  35599. value: query.pages,
  35600. isDragEnabled: false
  35601. })))
  35602. })), hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  35603. className: "wp-block-template-part__block-control-group"
  35604. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  35605. onClick: openPatternSelectionModal
  35606. }, (0,external_wp_i18n_namespaceObject.__)('Replace'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  35607. controls: displayLayoutControls
  35608. }));
  35609. }
  35610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js
  35611. /**
  35612. * WordPress dependencies
  35613. */
  35614. const orderOptions = [{
  35615. label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
  35616. value: 'date/desc'
  35617. }, {
  35618. label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
  35619. value: 'date/asc'
  35620. }, {
  35621. /* translators: label for ordering posts by title in ascending order */
  35622. label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
  35623. value: 'title/asc'
  35624. }, {
  35625. /* translators: label for ordering posts by title in descending order */
  35626. label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
  35627. value: 'title/desc'
  35628. }];
  35629. function OrderControl(_ref) {
  35630. let {
  35631. order,
  35632. orderBy,
  35633. onChange
  35634. } = _ref;
  35635. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  35636. label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
  35637. value: `${orderBy}/${order}`,
  35638. options: orderOptions,
  35639. onChange: value => {
  35640. const [newOrderBy, newOrder] = value.split('/');
  35641. onChange({
  35642. order: newOrder,
  35643. orderBy: newOrderBy
  35644. });
  35645. }
  35646. });
  35647. }
  35648. /* harmony default export */ var order_control = (OrderControl);
  35649. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
  35650. /**
  35651. * External dependencies
  35652. */
  35653. /**
  35654. * WordPress dependencies
  35655. */
  35656. /**
  35657. * Internal dependencies
  35658. */
  35659. const {
  35660. name: queryLoopName
  35661. } = {
  35662. $schema: "https://schemas.wp.org/trunk/block.json",
  35663. apiVersion: 2,
  35664. name: "core/query",
  35665. title: "Query Loop",
  35666. category: "theme",
  35667. description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
  35668. textdomain: "default",
  35669. attributes: {
  35670. queryId: {
  35671. type: "number"
  35672. },
  35673. query: {
  35674. type: "object",
  35675. "default": {
  35676. perPage: null,
  35677. pages: 0,
  35678. offset: 0,
  35679. postType: "post",
  35680. order: "desc",
  35681. orderBy: "date",
  35682. author: "",
  35683. search: "",
  35684. exclude: [],
  35685. sticky: "",
  35686. inherit: true,
  35687. taxQuery: null,
  35688. parents: []
  35689. }
  35690. },
  35691. tagName: {
  35692. type: "string",
  35693. "default": "div"
  35694. },
  35695. displayLayout: {
  35696. type: "object",
  35697. "default": {
  35698. type: "list"
  35699. }
  35700. },
  35701. namespace: {
  35702. type: "string"
  35703. }
  35704. },
  35705. providesContext: {
  35706. queryId: "queryId",
  35707. query: "query",
  35708. displayLayout: "displayLayout"
  35709. },
  35710. supports: {
  35711. align: ["wide", "full"],
  35712. html: false,
  35713. color: {
  35714. gradients: true,
  35715. link: true,
  35716. __experimentalDefaultControls: {
  35717. background: true,
  35718. text: true
  35719. }
  35720. },
  35721. __experimentalLayout: true
  35722. },
  35723. editorStyle: "wp-block-query-editor"
  35724. };
  35725. /**
  35726. * @typedef IHasNameAndId
  35727. * @property {string|number} id The entity's id.
  35728. * @property {string} name The entity's name.
  35729. */
  35730. /**
  35731. * The object used in Query block that contains info and helper mappings
  35732. * from an array of IHasNameAndId objects.
  35733. *
  35734. * @typedef {Object} QueryEntitiesInfo
  35735. * @property {IHasNameAndId[]} entities The array of entities.
  35736. * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.
  35737. * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.
  35738. * @property {string[]} names Array with the entities' names.
  35739. */
  35740. /**
  35741. * Returns a helper object with mapping from Objects that implement
  35742. * the `IHasNameAndId` interface. The returned object is used for
  35743. * integration with `FormTokenField` component.
  35744. *
  35745. * @param {IHasNameAndId[]} entities The entities to extract of helper object.
  35746. * @return {QueryEntitiesInfo} The object with the entities information.
  35747. */
  35748. const getEntitiesInfo = entities => {
  35749. const mapping = entities === null || entities === void 0 ? void 0 : entities.reduce((accumulator, entity) => {
  35750. const {
  35751. mapById,
  35752. mapByName,
  35753. names
  35754. } = accumulator;
  35755. mapById[entity.id] = entity;
  35756. mapByName[entity.name] = entity;
  35757. names.push(entity.name);
  35758. return accumulator;
  35759. }, {
  35760. mapById: {},
  35761. mapByName: {},
  35762. names: []
  35763. });
  35764. return {
  35765. entities,
  35766. ...mapping
  35767. };
  35768. };
  35769. /**
  35770. * Helper util to map records to add a `name` prop from a
  35771. * provided path, in order to handle all entities in the same
  35772. * fashion(implementing`IHasNameAndId` interface).
  35773. *
  35774. * @param {Object[]} entities The array of entities.
  35775. * @param {string} path The path to map a `name` property from the entity.
  35776. * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.
  35777. */
  35778. const mapToIHasNameAndId = (entities, path) => {
  35779. return (entities || []).map(entity => ({ ...entity,
  35780. name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)((0,external_lodash_namespaceObject.get)(entity, path))
  35781. }));
  35782. };
  35783. /**
  35784. * Returns a helper object that contains:
  35785. * 1. An `options` object from the available post types, to be passed to a `SelectControl`.
  35786. * 2. A helper map with available taxonomies per post type.
  35787. *
  35788. * @return {Object} The helper object related to post types.
  35789. */
  35790. const usePostTypes = () => {
  35791. const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35792. var _getPostTypes;
  35793. const {
  35794. getPostTypes
  35795. } = select(external_wp_coreData_namespaceObject.store);
  35796. const excludedPostTypes = ['attachment'];
  35797. const filteredPostTypes = (_getPostTypes = getPostTypes({
  35798. per_page: -1
  35799. })) === null || _getPostTypes === void 0 ? void 0 : _getPostTypes.filter(_ref => {
  35800. let {
  35801. viewable,
  35802. slug
  35803. } = _ref;
  35804. return viewable && !excludedPostTypes.includes(slug);
  35805. });
  35806. return filteredPostTypes;
  35807. }, []);
  35808. const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
  35809. if (!(postTypes !== null && postTypes !== void 0 && postTypes.length)) return;
  35810. return postTypes.reduce((accumulator, type) => {
  35811. accumulator[type.slug] = type.taxonomies;
  35812. return accumulator;
  35813. }, {});
  35814. }, [postTypes]);
  35815. const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(_ref2 => {
  35816. let {
  35817. labels,
  35818. slug
  35819. } = _ref2;
  35820. return {
  35821. label: labels.singular_name,
  35822. value: slug
  35823. };
  35824. }), [postTypes]);
  35825. return {
  35826. postTypesTaxonomiesMap,
  35827. postTypesSelectOptions
  35828. };
  35829. };
  35830. /**
  35831. * Hook that returns the taxonomies associated with a specific post type.
  35832. *
  35833. * @param {string} postType The post type from which to retrieve the associated taxonomies.
  35834. * @return {Object[]} An array of the associated taxonomies.
  35835. */
  35836. const useTaxonomies = postType => {
  35837. const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35838. const {
  35839. getTaxonomies
  35840. } = select(external_wp_coreData_namespaceObject.store);
  35841. const filteredTaxonomies = getTaxonomies({
  35842. type: postType,
  35843. per_page: -1,
  35844. context: 'view'
  35845. });
  35846. return filteredTaxonomies;
  35847. }, [postType]);
  35848. return taxonomies;
  35849. };
  35850. /**
  35851. * Hook that returns whether a specific post type is hierarchical.
  35852. *
  35853. * @param {string} postType The post type to check.
  35854. * @return {boolean} Whether a specific post type is hierarchical.
  35855. */
  35856. function useIsPostTypeHierarchical(postType) {
  35857. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  35858. const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
  35859. return (type === null || type === void 0 ? void 0 : type.viewable) && (type === null || type === void 0 ? void 0 : type.hierarchical);
  35860. }, [postType]);
  35861. }
  35862. /**
  35863. * Hook that returns the query properties' names defined by the active
  35864. * block variation, to determine which block's filters to show.
  35865. *
  35866. * @param {Object} attributes Block attributes.
  35867. * @return {string[]} An array of the query attributes.
  35868. */
  35869. function useAllowedControls(attributes) {
  35870. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  35871. var _select$getActiveBloc;
  35872. return (_select$getActiveBloc = select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation(queryLoopName, attributes)) === null || _select$getActiveBloc === void 0 ? void 0 : _select$getActiveBloc.allowedControls;
  35873. }, [attributes]);
  35874. }
  35875. function isControlAllowed(allowedControls, key) {
  35876. // Every controls is allowed if the list is not defined.
  35877. if (!allowedControls) {
  35878. return true;
  35879. }
  35880. return allowedControls.includes(key);
  35881. }
  35882. /**
  35883. * Clones a pattern's blocks and then recurses over that list of blocks,
  35884. * transforming them to retain some `query` attribute properties.
  35885. * For now we retain the `postType` and `inherit` properties as they are
  35886. * fundamental for the expected functionality of the block and don't affect
  35887. * its design and presentation.
  35888. *
  35889. * Returns the cloned/transformed blocks and array of existing Query Loop
  35890. * client ids for further manipulation, in order to avoid multiple recursions.
  35891. *
  35892. * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).
  35893. * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.
  35894. * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.
  35895. */
  35896. const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => {
  35897. const {
  35898. query: {
  35899. postType,
  35900. inherit
  35901. }
  35902. } = queryBlockAttributes;
  35903. const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
  35904. const queryClientIds = [];
  35905. const blocksQueue = [...clonedBlocks];
  35906. while (blocksQueue.length > 0) {
  35907. var _block$innerBlocks;
  35908. const block = blocksQueue.shift();
  35909. if (block.name === 'core/query') {
  35910. block.attributes.query = { ...block.attributes.query,
  35911. postType,
  35912. inherit
  35913. };
  35914. queryClientIds.push(block.clientId);
  35915. }
  35916. (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
  35917. blocksQueue.push(innerBlock);
  35918. });
  35919. }
  35920. return {
  35921. newBlocks: clonedBlocks,
  35922. queryClientIds
  35923. };
  35924. };
  35925. /**
  35926. * Helper hook that determines if there is an active variation of the block
  35927. * and if there are available specific patterns for this variation.
  35928. * If there are, these patterns are going to be the only ones suggested to
  35929. * the user in setup and replace flow, without including the default ones
  35930. * for Query Loop.
  35931. *
  35932. * If there are no such patterns, the default ones for Query Loop are going
  35933. * to be suggested.
  35934. *
  35935. * @param {string} clientId The block's client ID.
  35936. * @param {Object} attributes The block's attributes.
  35937. * @return {string} The block name to be used in the patterns suggestions.
  35938. */
  35939. function useBlockNameForPatterns(clientId, attributes) {
  35940. const activeVariationName = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35941. var _select$getActiveBloc2;
  35942. return (_select$getActiveBloc2 = select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation(queryLoopName, attributes)) === null || _select$getActiveBloc2 === void 0 ? void 0 : _select$getActiveBloc2.name;
  35943. }, [attributes]);
  35944. const blockName = `${queryLoopName}/${activeVariationName}`;
  35945. const activeVariationPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35946. if (!activeVariationName) {
  35947. return;
  35948. }
  35949. const {
  35950. getBlockRootClientId,
  35951. __experimentalGetPatternsByBlockTypes
  35952. } = select(external_wp_blockEditor_namespaceObject.store);
  35953. const rootClientId = getBlockRootClientId(clientId);
  35954. return __experimentalGetPatternsByBlockTypes(blockName, rootClientId);
  35955. }, [clientId, activeVariationName]);
  35956. return activeVariationPatterns !== null && activeVariationPatterns !== void 0 && activeVariationPatterns.length ? blockName : queryLoopName;
  35957. }
  35958. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js
  35959. /**
  35960. * WordPress dependencies
  35961. */
  35962. /**
  35963. * Internal dependencies
  35964. */
  35965. const author_control_AUTHORS_QUERY = {
  35966. who: 'authors',
  35967. per_page: -1,
  35968. _fields: 'id,name',
  35969. context: 'view'
  35970. };
  35971. function AuthorControl(_ref) {
  35972. let {
  35973. value,
  35974. onChange
  35975. } = _ref;
  35976. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35977. const {
  35978. getUsers
  35979. } = select(external_wp_coreData_namespaceObject.store);
  35980. return getUsers(author_control_AUTHORS_QUERY);
  35981. }, []);
  35982. if (!authorsList) {
  35983. return null;
  35984. }
  35985. const authorsInfo = getEntitiesInfo(authorsList);
  35986. /**
  35987. * We need to normalize the value because the block operates on a
  35988. * comma(`,`) separated string value and `FormTokenFiels` needs an
  35989. * array.
  35990. */
  35991. const normalizedValue = !value ? [] : value.toString().split(','); // Returns only the existing authors ids. This prevents the component
  35992. // from crashing in the editor, when non existing ids are provided.
  35993. const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => {
  35994. const author = authorsInfo.mapById[authorId];
  35995. if (author) {
  35996. accumulator.push({
  35997. id: authorId,
  35998. value: author.name
  35999. });
  36000. }
  36001. return accumulator;
  36002. }, []);
  36003. const getIdByValue = (entitiesMappedByName, authorValue) => {
  36004. var _entitiesMappedByName;
  36005. const id = (authorValue === null || authorValue === void 0 ? void 0 : authorValue.id) || ((_entitiesMappedByName = entitiesMappedByName[authorValue]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
  36006. if (id) return id;
  36007. };
  36008. const onAuthorChange = newValue => {
  36009. const ids = Array.from(newValue.reduce((accumulator, author) => {
  36010. // Verify that new values point to existing entities.
  36011. const id = getIdByValue(authorsInfo.mapByName, author);
  36012. if (id) accumulator.add(id);
  36013. return accumulator;
  36014. }, new Set()));
  36015. onChange({
  36016. author: ids.join(',')
  36017. });
  36018. };
  36019. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  36020. label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
  36021. value: sanitizedValue,
  36022. suggestions: authorsInfo.names,
  36023. onChange: onAuthorChange
  36024. });
  36025. }
  36026. /* harmony default export */ var author_control = (AuthorControl);
  36027. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/parent-control.js
  36028. /**
  36029. * WordPress dependencies
  36030. */
  36031. /**
  36032. * Internal dependencies
  36033. */
  36034. const parent_control_EMPTY_ARRAY = [];
  36035. const BASE_QUERY = {
  36036. order: 'asc',
  36037. _fields: 'id,title',
  36038. context: 'view'
  36039. };
  36040. function ParentControl(_ref) {
  36041. let {
  36042. parents,
  36043. postType,
  36044. onChange
  36045. } = _ref;
  36046. const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
  36047. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
  36048. const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
  36049. const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250);
  36050. const {
  36051. searchResults,
  36052. searchHasResolved
  36053. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36054. if (!search) {
  36055. return {
  36056. searchResults: parent_control_EMPTY_ARRAY,
  36057. searchHasResolved: true
  36058. };
  36059. }
  36060. const {
  36061. getEntityRecords,
  36062. hasFinishedResolution
  36063. } = select(external_wp_coreData_namespaceObject.store);
  36064. const selectorArgs = ['postType', postType, { ...BASE_QUERY,
  36065. search,
  36066. orderby: 'relevance',
  36067. exclude: parents,
  36068. per_page: 20
  36069. }];
  36070. return {
  36071. searchResults: getEntityRecords(...selectorArgs),
  36072. searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs)
  36073. };
  36074. }, [search, parents]);
  36075. const currentParents = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36076. if (!(parents !== null && parents !== void 0 && parents.length)) return parent_control_EMPTY_ARRAY;
  36077. const {
  36078. getEntityRecords
  36079. } = select(external_wp_coreData_namespaceObject.store);
  36080. return getEntityRecords('postType', postType, { ...BASE_QUERY,
  36081. include: parents,
  36082. per_page: parents.length
  36083. });
  36084. }, [parents]); // Update the `value` state only after the selectors are resolved
  36085. // to avoid emptying the input when we're changing parents.
  36086. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36087. if (!(parents !== null && parents !== void 0 && parents.length)) {
  36088. setValue(parent_control_EMPTY_ARRAY);
  36089. }
  36090. if (!(currentParents !== null && currentParents !== void 0 && currentParents.length)) return;
  36091. const currentParentsInfo = getEntitiesInfo(mapToIHasNameAndId(currentParents, 'title.rendered')); // Returns only the existing entity ids. This prevents the component
  36092. // from crashing in the editor, when non existing ids are provided.
  36093. const sanitizedValue = parents.reduce((accumulator, id) => {
  36094. const entity = currentParentsInfo.mapById[id];
  36095. if (entity) {
  36096. accumulator.push({
  36097. id,
  36098. value: entity.name
  36099. });
  36100. }
  36101. return accumulator;
  36102. }, []);
  36103. setValue(sanitizedValue);
  36104. }, [parents, currentParents]);
  36105. const entitiesInfo = (0,external_wp_element_namespaceObject.useMemo)(() => {
  36106. if (!(searchResults !== null && searchResults !== void 0 && searchResults.length)) return parent_control_EMPTY_ARRAY;
  36107. return getEntitiesInfo(mapToIHasNameAndId(searchResults, 'title.rendered'));
  36108. }, [searchResults]); // Update suggestions only when the query has resolved.
  36109. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36110. if (!searchHasResolved) return;
  36111. setSuggestions(entitiesInfo.names);
  36112. }, [entitiesInfo.names, searchHasResolved]);
  36113. const getIdByValue = (entitiesMappedByName, entity) => {
  36114. var _entitiesMappedByName;
  36115. const id = (entity === null || entity === void 0 ? void 0 : entity.id) || (entitiesMappedByName === null || entitiesMappedByName === void 0 ? void 0 : (_entitiesMappedByName = entitiesMappedByName[entity]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
  36116. if (id) return id;
  36117. };
  36118. const onParentChange = newValue => {
  36119. const ids = Array.from(newValue.reduce((accumulator, entity) => {
  36120. // Verify that new values point to existing entities.
  36121. const id = getIdByValue(entitiesInfo.mapByName, entity);
  36122. if (id) accumulator.add(id);
  36123. return accumulator;
  36124. }, new Set()));
  36125. setSuggestions(parent_control_EMPTY_ARRAY);
  36126. onChange({
  36127. parents: ids
  36128. });
  36129. };
  36130. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  36131. label: (0,external_wp_i18n_namespaceObject.__)('Parents'),
  36132. value: value,
  36133. onInputChange: debouncedSearch,
  36134. suggestions: suggestions,
  36135. onChange: onParentChange
  36136. });
  36137. }
  36138. /* harmony default export */ var parent_control = (ParentControl);
  36139. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
  36140. const MAX_FETCHED_TERMS = 100;
  36141. const DEFAULTS_POSTS_PER_PAGE = 3;
  36142. /* harmony default export */ var constants = ({
  36143. MAX_FETCHED_TERMS,
  36144. DEFAULTS_POSTS_PER_PAGE
  36145. });
  36146. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js
  36147. /**
  36148. * WordPress dependencies
  36149. */
  36150. /**
  36151. * Internal dependencies
  36152. */
  36153. // Helper function to get the term id based on user input in terms `FormTokenField`.
  36154. const getTermIdByTermValue = (termsMappedByName, termValue) => {
  36155. var _termsMappedByName$te;
  36156. // First we check for exact match by `term.id` or case sensitive `term.name` match.
  36157. const termId = (termValue === null || termValue === void 0 ? void 0 : termValue.id) || ((_termsMappedByName$te = termsMappedByName[termValue]) === null || _termsMappedByName$te === void 0 ? void 0 : _termsMappedByName$te.id);
  36158. if (termId) return termId;
  36159. /**
  36160. * Here we make an extra check for entered terms in a non case sensitive way,
  36161. * to match user expectations, due to `FormTokenField` behaviour that shows
  36162. * suggestions which are case insensitive.
  36163. *
  36164. * Although WP tries to discourage users to add terms with the same name (case insensitive),
  36165. * it's still possible if you manually change the name, as long as the terms have different slugs.
  36166. * In this edge case we always apply the first match from the terms list.
  36167. */
  36168. const termValueLower = termValue.toLocaleLowerCase();
  36169. for (const term in termsMappedByName) {
  36170. if (term.toLocaleLowerCase() === termValueLower) {
  36171. return termsMappedByName[term].id;
  36172. }
  36173. }
  36174. };
  36175. const useTaxonomiesInfo = postType => {
  36176. const taxonomies = useTaxonomies(postType);
  36177. const taxonomiesInfo = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36178. const {
  36179. getEntityRecords
  36180. } = select(external_wp_coreData_namespaceObject.store);
  36181. const termsQuery = {
  36182. context: 'view',
  36183. per_page: MAX_FETCHED_TERMS
  36184. };
  36185. const _taxonomiesInfo = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.map(_ref => {
  36186. let {
  36187. slug,
  36188. name
  36189. } = _ref;
  36190. const _terms = getEntityRecords('taxonomy', slug, termsQuery);
  36191. return {
  36192. slug,
  36193. name,
  36194. terms: getEntitiesInfo(_terms)
  36195. };
  36196. });
  36197. return _taxonomiesInfo;
  36198. }, [taxonomies]);
  36199. return taxonomiesInfo;
  36200. };
  36201. function TaxonomyControls(_ref2) {
  36202. let {
  36203. onChange,
  36204. query
  36205. } = _ref2;
  36206. const taxonomiesInfo = useTaxonomiesInfo(query.postType);
  36207. const onTermsChange = taxonomySlug => newTermValues => {
  36208. const taxonomyInfo = taxonomiesInfo.find(_ref3 => {
  36209. let {
  36210. slug
  36211. } = _ref3;
  36212. return slug === taxonomySlug;
  36213. });
  36214. if (!taxonomyInfo) return;
  36215. const termIds = Array.from(newTermValues.reduce((accumulator, termValue) => {
  36216. const termId = getTermIdByTermValue(taxonomyInfo.terms.mapByName, termValue);
  36217. if (termId) accumulator.add(termId);
  36218. return accumulator;
  36219. }, new Set()));
  36220. const newTaxQuery = { ...query.taxQuery,
  36221. [taxonomySlug]: termIds
  36222. };
  36223. onChange({
  36224. taxQuery: newTaxQuery
  36225. });
  36226. }; // Returns only the existing term ids in proper format to be
  36227. // used in `FormTokenField`. This prevents the component from
  36228. // crashing in the editor, when non existing term ids were provided.
  36229. const getExistingTaxQueryValue = taxonomySlug => {
  36230. var _query$taxQuery;
  36231. const taxonomyInfo = taxonomiesInfo.find(_ref4 => {
  36232. let {
  36233. slug
  36234. } = _ref4;
  36235. return slug === taxonomySlug;
  36236. });
  36237. if (!taxonomyInfo) return [];
  36238. return (((_query$taxQuery = query.taxQuery) === null || _query$taxQuery === void 0 ? void 0 : _query$taxQuery[taxonomySlug]) || []).reduce((accumulator, termId) => {
  36239. const term = taxonomyInfo.terms.mapById[termId];
  36240. if (term) {
  36241. accumulator.push({
  36242. id: termId,
  36243. value: term.name
  36244. });
  36245. }
  36246. return accumulator;
  36247. }, []);
  36248. };
  36249. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!(taxonomiesInfo !== null && taxonomiesInfo !== void 0 && taxonomiesInfo.length) && taxonomiesInfo.map(_ref5 => {
  36250. var _terms$names;
  36251. let {
  36252. slug,
  36253. name,
  36254. terms
  36255. } = _ref5;
  36256. if (!(terms !== null && terms !== void 0 && (_terms$names = terms.names) !== null && _terms$names !== void 0 && _terms$names.length)) {
  36257. return null;
  36258. }
  36259. return (0,external_wp_element_namespaceObject.createElement)("div", {
  36260. key: slug,
  36261. className: "block-library-query-inspector__taxonomy-control"
  36262. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  36263. label: name,
  36264. value: getExistingTaxQueryValue(slug),
  36265. suggestions: terms.names,
  36266. onChange: onTermsChange(slug)
  36267. }));
  36268. }));
  36269. }
  36270. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js
  36271. /**
  36272. * WordPress dependencies
  36273. */
  36274. const stickyOptions = [{
  36275. label: (0,external_wp_i18n_namespaceObject.__)('Include'),
  36276. value: ''
  36277. }, {
  36278. label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
  36279. value: 'exclude'
  36280. }, {
  36281. label: (0,external_wp_i18n_namespaceObject.__)('Only'),
  36282. value: 'only'
  36283. }];
  36284. function StickyControl(_ref) {
  36285. let {
  36286. value,
  36287. onChange
  36288. } = _ref;
  36289. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  36290. label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
  36291. options: stickyOptions,
  36292. value: value,
  36293. onChange: onChange,
  36294. help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
  36295. });
  36296. }
  36297. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js
  36298. /**
  36299. * External dependencies
  36300. */
  36301. /**
  36302. * WordPress dependencies
  36303. */
  36304. /**
  36305. * Internal dependencies
  36306. */
  36307. function QueryInspectorControls(_ref) {
  36308. let {
  36309. attributes,
  36310. setQuery,
  36311. setDisplayLayout
  36312. } = _ref;
  36313. const {
  36314. query,
  36315. displayLayout
  36316. } = attributes;
  36317. const {
  36318. order,
  36319. orderBy,
  36320. author: authorIds,
  36321. postType,
  36322. sticky,
  36323. inherit,
  36324. taxQuery,
  36325. parents
  36326. } = query;
  36327. const allowedControls = useAllowedControls(attributes);
  36328. const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post');
  36329. const {
  36330. postTypesTaxonomiesMap,
  36331. postTypesSelectOptions
  36332. } = usePostTypes();
  36333. const taxonomiesInfo = useTaxonomiesInfo(postType);
  36334. const isPostTypeHierarchical = useIsPostTypeHierarchical(postType);
  36335. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36336. setShowSticky(postType === 'post');
  36337. }, [postType]);
  36338. const onPostTypeChange = newValue => {
  36339. const updateQuery = {
  36340. postType: newValue
  36341. }; // We need to dynamically update the `taxQuery` property,
  36342. // by removing any not supported taxonomy from the query.
  36343. const supportedTaxonomies = postTypesTaxonomiesMap[newValue];
  36344. const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, _ref2) => {
  36345. let [taxonomySlug, terms] = _ref2;
  36346. if (supportedTaxonomies.includes(taxonomySlug)) {
  36347. accumulator[taxonomySlug] = terms;
  36348. }
  36349. return accumulator;
  36350. }, {});
  36351. updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined;
  36352. if (newValue !== 'post') {
  36353. updateQuery.sticky = '';
  36354. } // We need to reset `parents` because they are tied to each post type.
  36355. updateQuery.parents = [];
  36356. setQuery(updateQuery);
  36357. };
  36358. const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
  36359. const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(() => {
  36360. if (query.search !== querySearch) {
  36361. setQuery({
  36362. search: querySearch
  36363. });
  36364. }
  36365. }, 250), [querySearch, query.search]);
  36366. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36367. onChangeDebounced();
  36368. return onChangeDebounced.cancel;
  36369. }, [querySearch, onChangeDebounced]);
  36370. const showInheritControl = isControlAllowed(allowedControls, 'inherit');
  36371. const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType');
  36372. const showColumnsControl = (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex';
  36373. const showOrderControl = !inherit && isControlAllowed(allowedControls, 'order');
  36374. const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, 'sticky');
  36375. const showSettingsPanel = showInheritControl || showPostTypeControl || showColumnsControl || showOrderControl || showStickyControl;
  36376. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showSettingsPanel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36377. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  36378. }, showInheritControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  36379. label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'),
  36380. help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
  36381. checked: !!inherit,
  36382. onChange: value => setQuery({
  36383. inherit: !!value
  36384. })
  36385. }), showPostTypeControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  36386. options: postTypesSelectOptions,
  36387. value: postType,
  36388. label: (0,external_wp_i18n_namespaceObject.__)('Post type'),
  36389. onChange: onPostTypeChange,
  36390. help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called "Post types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
  36391. }), showColumnsControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  36392. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  36393. value: displayLayout.columns,
  36394. onChange: value => setDisplayLayout({
  36395. columns: value
  36396. }),
  36397. min: 2,
  36398. max: Math.max(6, displayLayout.columns)
  36399. }), displayLayout.columns > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  36400. status: "warning",
  36401. isDismissible: false
  36402. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), showOrderControl && (0,external_wp_element_namespaceObject.createElement)(order_control, {
  36403. order,
  36404. orderBy,
  36405. onChange: setQuery
  36406. }), showStickyControl && (0,external_wp_element_namespaceObject.createElement)(StickyControl, {
  36407. value: sticky,
  36408. onChange: value => setQuery({
  36409. sticky: value
  36410. })
  36411. }))), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
  36412. className: "block-library-query-toolspanel__filters",
  36413. label: (0,external_wp_i18n_namespaceObject.__)('Filters'),
  36414. resetAll: () => {
  36415. setQuery({
  36416. author: '',
  36417. parents: [],
  36418. search: '',
  36419. taxQuery: null
  36420. });
  36421. setQuerySearch('');
  36422. }
  36423. }, !!(taxonomiesInfo !== null && taxonomiesInfo !== void 0 && taxonomiesInfo.length) && isControlAllowed(allowedControls, 'taxQuery') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  36424. label: (0,external_wp_i18n_namespaceObject.__)('Taxonomies'),
  36425. hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length),
  36426. onDeselect: () => setQuery({
  36427. taxQuery: null
  36428. })
  36429. }, (0,external_wp_element_namespaceObject.createElement)(TaxonomyControls, {
  36430. onChange: setQuery,
  36431. query: query
  36432. })), isControlAllowed(allowedControls, 'author') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  36433. hasValue: () => !!authorIds,
  36434. label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
  36435. onDeselect: () => setQuery({
  36436. author: ''
  36437. })
  36438. }, (0,external_wp_element_namespaceObject.createElement)(author_control, {
  36439. value: authorIds,
  36440. onChange: setQuery
  36441. })), isControlAllowed(allowedControls, 'search') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  36442. hasValue: () => !!querySearch,
  36443. label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
  36444. onDeselect: () => setQuerySearch('')
  36445. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  36446. label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
  36447. value: querySearch,
  36448. onChange: setQuerySearch
  36449. })), isPostTypeHierarchical && isControlAllowed(allowedControls, 'parents') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  36450. hasValue: () => !!(parents !== null && parents !== void 0 && parents.length),
  36451. label: (0,external_wp_i18n_namespaceObject.__)('Parents'),
  36452. onDeselect: () => setQuery({
  36453. parents: []
  36454. })
  36455. }, (0,external_wp_element_namespaceObject.createElement)(parent_control, {
  36456. parents: parents,
  36457. postType: postType,
  36458. onChange: setQuery
  36459. })))));
  36460. }
  36461. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-content.js
  36462. /**
  36463. * WordPress dependencies
  36464. */
  36465. /**
  36466. * Internal dependencies
  36467. */
  36468. const query_content_TEMPLATE = [['core/post-template']];
  36469. function QueryContent(_ref) {
  36470. let {
  36471. attributes,
  36472. setAttributes,
  36473. openPatternSelectionModal,
  36474. name,
  36475. clientId
  36476. } = _ref;
  36477. const {
  36478. queryId,
  36479. query,
  36480. displayLayout,
  36481. tagName: TagName = 'div',
  36482. layout = {}
  36483. } = attributes;
  36484. const {
  36485. __unstableMarkNextChangeAsNotPersistent
  36486. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  36487. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
  36488. const {
  36489. themeSupportsLayout
  36490. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36491. var _getSettings;
  36492. const {
  36493. getSettings
  36494. } = select(external_wp_blockEditor_namespaceObject.store);
  36495. return {
  36496. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  36497. };
  36498. }, []);
  36499. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  36500. const usedLayout = !(layout !== null && layout !== void 0 && layout.type) ? { ...defaultLayout,
  36501. ...layout,
  36502. type: 'default'
  36503. } : { ...defaultLayout,
  36504. ...layout
  36505. };
  36506. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  36507. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  36508. template: query_content_TEMPLATE,
  36509. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  36510. });
  36511. const {
  36512. postsPerPage
  36513. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36514. const {
  36515. getSettings
  36516. } = select(external_wp_blockEditor_namespaceObject.store);
  36517. return {
  36518. postsPerPage: +getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE
  36519. };
  36520. }, []); // There are some effects running where some initialization logic is
  36521. // happening and setting some values to some attributes (ex. queryId).
  36522. // These updates can cause an `undo trap` where undoing will result in
  36523. // resetting again, so we need to mark these changes as not persistent
  36524. // with `__unstableMarkNextChangeAsNotPersistent`.
  36525. // Changes in query property (which is an object) need to be in the same callback,
  36526. // because updates are batched after the render and changes in different query properties
  36527. // would cause to override previous wanted changes.
  36528. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36529. const newQuery = {};
  36530. if (!query.perPage && postsPerPage) {
  36531. newQuery.perPage = postsPerPage;
  36532. }
  36533. if (!!Object.keys(newQuery).length) {
  36534. __unstableMarkNextChangeAsNotPersistent();
  36535. updateQuery(newQuery);
  36536. }
  36537. }, [query.perPage]); // We need this for multi-query block pagination.
  36538. // Query parameters for each block are scoped to their ID.
  36539. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36540. if (!Number.isFinite(queryId)) {
  36541. __unstableMarkNextChangeAsNotPersistent();
  36542. setAttributes({
  36543. queryId: instanceId
  36544. });
  36545. }
  36546. }, [queryId, instanceId]);
  36547. const updateQuery = newQuery => setAttributes({
  36548. query: { ...query,
  36549. ...newQuery
  36550. }
  36551. });
  36552. const updateDisplayLayout = newDisplayLayout => setAttributes({
  36553. displayLayout: { ...displayLayout,
  36554. ...newDisplayLayout
  36555. }
  36556. });
  36557. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(QueryInspectorControls, {
  36558. attributes: attributes,
  36559. setQuery: updateQuery,
  36560. setDisplayLayout: updateDisplayLayout
  36561. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(QueryToolbar, {
  36562. name: name,
  36563. clientId: clientId,
  36564. attributes: attributes,
  36565. setQuery: updateQuery,
  36566. setDisplayLayout: updateDisplayLayout,
  36567. openPatternSelectionModal: openPatternSelectionModal
  36568. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  36569. __experimentalGroup: "advanced"
  36570. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  36571. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  36572. options: [{
  36573. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  36574. value: 'div'
  36575. }, {
  36576. label: '<main>',
  36577. value: 'main'
  36578. }, {
  36579. label: '<section>',
  36580. value: 'section'
  36581. }, {
  36582. label: '<aside>',
  36583. value: 'aside'
  36584. }],
  36585. value: TagName,
  36586. onChange: value => setAttributes({
  36587. tagName: value
  36588. })
  36589. })), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  36590. }
  36591. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
  36592. /**
  36593. * WordPress dependencies
  36594. */
  36595. function QueryPlaceholder(_ref) {
  36596. var _blockType$icon;
  36597. let {
  36598. attributes,
  36599. clientId,
  36600. name,
  36601. openPatternSelectionModal,
  36602. setAttributes
  36603. } = _ref;
  36604. const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
  36605. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  36606. const {
  36607. blockType,
  36608. allVariations,
  36609. hasPatterns
  36610. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36611. const {
  36612. getBlockVariations,
  36613. getBlockType
  36614. } = select(external_wp_blocks_namespaceObject.store);
  36615. const {
  36616. getBlockRootClientId,
  36617. __experimentalGetPatternsByBlockTypes
  36618. } = select(external_wp_blockEditor_namespaceObject.store);
  36619. const rootClientId = getBlockRootClientId(clientId);
  36620. return {
  36621. blockType: getBlockType(name),
  36622. allVariations: getBlockVariations(name),
  36623. hasPatterns: !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length
  36624. };
  36625. }, [name, clientId]);
  36626. const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
  36627. const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
  36628. const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
  36629. if (isStartingBlank) {
  36630. return (0,external_wp_element_namespaceObject.createElement)(QueryVariationPicker, {
  36631. clientId: clientId,
  36632. name: name,
  36633. attributes: attributes,
  36634. setAttributes: setAttributes,
  36635. icon: icon,
  36636. label: label
  36637. });
  36638. }
  36639. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  36640. icon: icon,
  36641. label: label,
  36642. instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.')
  36643. }, !!hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36644. variant: "primary",
  36645. onClick: openPatternSelectionModal
  36646. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36647. variant: "secondary",
  36648. onClick: () => {
  36649. setIsStartingBlank(true);
  36650. }
  36651. }, (0,external_wp_i18n_namespaceObject.__)('Start blank'))));
  36652. }
  36653. function QueryVariationPicker(_ref2) {
  36654. let {
  36655. clientId,
  36656. name,
  36657. attributes,
  36658. setAttributes,
  36659. icon,
  36660. label
  36661. } = _ref2;
  36662. const {
  36663. defaultVariation,
  36664. scopeVariations
  36665. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  36666. const {
  36667. getBlockVariations,
  36668. getBlockType,
  36669. getDefaultBlockVariation
  36670. } = select(external_wp_blocks_namespaceObject.store);
  36671. return {
  36672. blockType: getBlockType(name),
  36673. defaultVariation: getDefaultBlockVariation(name, 'block'),
  36674. scopeVariations: getBlockVariations(name, 'block')
  36675. };
  36676. }, [name]);
  36677. const {
  36678. replaceInnerBlocks
  36679. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  36680. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  36681. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  36682. icon: icon,
  36683. label: label,
  36684. variations: scopeVariations,
  36685. onSelect: function () {
  36686. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  36687. if (nextVariation.attributes) {
  36688. setAttributes({ ...nextVariation.attributes,
  36689. query: { ...nextVariation.attributes.query,
  36690. postType: attributes.query.postType || nextVariation.attributes.query.postType
  36691. }
  36692. });
  36693. }
  36694. if (nextVariation.innerBlocks) {
  36695. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), false);
  36696. }
  36697. }
  36698. }));
  36699. }
  36700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
  36701. /**
  36702. * WordPress dependencies
  36703. */
  36704. /**
  36705. * Internal dependencies
  36706. */
  36707. const QueryEdit = props => {
  36708. const {
  36709. clientId,
  36710. attributes
  36711. } = props;
  36712. const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  36713. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
  36714. const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder;
  36715. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
  36716. openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
  36717. })), isPatternSelectionModalOpen && (0,external_wp_element_namespaceObject.createElement)(PatternSelectionModal, {
  36718. clientId: clientId,
  36719. attributes: attributes,
  36720. setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen
  36721. }));
  36722. };
  36723. function PatternSelectionModal(_ref) {
  36724. let {
  36725. clientId,
  36726. attributes,
  36727. setIsPatternSelectionModalOpen
  36728. } = _ref;
  36729. const {
  36730. replaceBlock,
  36731. selectBlock
  36732. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  36733. const onBlockPatternSelect = blocks => {
  36734. const {
  36735. newBlocks,
  36736. queryClientIds
  36737. } = getTransformedBlocksFromPattern(blocks, attributes);
  36738. replaceBlock(clientId, newBlocks);
  36739. if (queryClientIds[0]) {
  36740. selectBlock(queryClientIds[0]);
  36741. }
  36742. }; // When we preview Query Loop blocks we should prefer the current
  36743. // block's postType, which is passed through block context.
  36744. const blockPreviewContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
  36745. previewPostType: attributes.query.postType
  36746. }), [attributes.query.postType]);
  36747. const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes);
  36748. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  36749. className: "block-editor-query-pattern__selection-modal",
  36750. title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
  36751. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  36752. onRequestClose: () => setIsPatternSelectionModalOpen(false)
  36753. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  36754. value: blockPreviewContext
  36755. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
  36756. blockName: blockNameForPatterns,
  36757. clientId: clientId,
  36758. onBlockPatternSelect: onBlockPatternSelect
  36759. })));
  36760. }
  36761. /* harmony default export */ var query_edit = (QueryEdit);
  36762. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
  36763. /**
  36764. * WordPress dependencies
  36765. */
  36766. function QuerySave(_ref) {
  36767. let {
  36768. attributes: {
  36769. tagName: Tag = 'div'
  36770. }
  36771. } = _ref;
  36772. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  36773. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  36774. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  36775. }
  36776. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
  36777. /**
  36778. * WordPress dependencies
  36779. */
  36780. const titleDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  36781. xmlns: "http://www.w3.org/2000/svg",
  36782. viewBox: "0 0 48 48"
  36783. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  36784. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
  36785. }));
  36786. const titleExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  36787. xmlns: "http://www.w3.org/2000/svg",
  36788. viewBox: "0 0 48 48"
  36789. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  36790. d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
  36791. }));
  36792. const titleDateExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  36793. xmlns: "http://www.w3.org/2000/svg",
  36794. viewBox: "0 0 48 48"
  36795. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  36796. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
  36797. }));
  36798. const imageDateTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  36799. xmlns: "http://www.w3.org/2000/svg",
  36800. viewBox: "0 0 48 48"
  36801. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  36802. d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
  36803. }));
  36804. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
  36805. /**
  36806. * WordPress dependencies
  36807. */
  36808. /**
  36809. * Internal dependencies
  36810. */
  36811. const QUERY_DEFAULT_ATTRIBUTES = {
  36812. query: {
  36813. perPage: 3,
  36814. pages: 0,
  36815. offset: 0,
  36816. postType: 'post',
  36817. order: 'desc',
  36818. orderBy: 'date',
  36819. author: '',
  36820. search: '',
  36821. exclude: [],
  36822. sticky: '',
  36823. inherit: false
  36824. }
  36825. };
  36826. const query_variations_variations = [{
  36827. name: 'posts-list',
  36828. title: (0,external_wp_i18n_namespaceObject.__)('Posts List'),
  36829. description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'),
  36830. icon: post_list,
  36831. attributes: {
  36832. query: {
  36833. perPage: 4,
  36834. pages: 1,
  36835. offset: 0,
  36836. postType: 'post',
  36837. order: 'desc',
  36838. orderBy: 'date',
  36839. author: '',
  36840. search: '',
  36841. sticky: 'exclude',
  36842. inherit: false
  36843. }
  36844. },
  36845. scope: ['inserter']
  36846. }, {
  36847. name: 'title-date',
  36848. title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
  36849. icon: titleDate,
  36850. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  36851. },
  36852. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
  36853. scope: ['block']
  36854. }, {
  36855. name: 'title-excerpt',
  36856. title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
  36857. icon: titleExcerpt,
  36858. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  36859. },
  36860. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  36861. scope: ['block']
  36862. }, {
  36863. name: 'title-date-excerpt',
  36864. title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
  36865. icon: titleDateExcerpt,
  36866. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  36867. },
  36868. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  36869. scope: ['block']
  36870. }, {
  36871. name: 'image-date-title',
  36872. title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
  36873. icon: imageDateTitle,
  36874. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  36875. },
  36876. innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
  36877. scope: ['block']
  36878. }];
  36879. /* harmony default export */ var query_variations = (query_variations_variations);
  36880. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
  36881. /**
  36882. * WordPress dependencies
  36883. */
  36884. const migrateToTaxQuery = attributes => {
  36885. var _query$categoryIds, _query$tagIds;
  36886. const {
  36887. query
  36888. } = attributes;
  36889. const {
  36890. categoryIds,
  36891. tagIds,
  36892. ...newQuery
  36893. } = query;
  36894. if ((_query$categoryIds = query.categoryIds) !== null && _query$categoryIds !== void 0 && _query$categoryIds.length || (_query$tagIds = query.tagIds) !== null && _query$tagIds !== void 0 && _query$tagIds.length) {
  36895. var _query$categoryIds2, _query$tagIds2;
  36896. newQuery.taxQuery = {
  36897. category: !!((_query$categoryIds2 = query.categoryIds) !== null && _query$categoryIds2 !== void 0 && _query$categoryIds2.length) ? query.categoryIds : undefined,
  36898. post_tag: !!((_query$tagIds2 = query.tagIds) !== null && _query$tagIds2 !== void 0 && _query$tagIds2.length) ? query.tagIds : undefined
  36899. };
  36900. }
  36901. return { ...attributes,
  36902. query: newQuery
  36903. };
  36904. };
  36905. const query_deprecated_deprecated = [// Version with `categoryIds and tagIds`.
  36906. {
  36907. attributes: {
  36908. queryId: {
  36909. type: 'number'
  36910. },
  36911. query: {
  36912. type: 'object',
  36913. default: {
  36914. perPage: null,
  36915. pages: 0,
  36916. offset: 0,
  36917. postType: 'post',
  36918. categoryIds: [],
  36919. tagIds: [],
  36920. order: 'desc',
  36921. orderBy: 'date',
  36922. author: '',
  36923. search: '',
  36924. exclude: [],
  36925. sticky: '',
  36926. inherit: true
  36927. }
  36928. },
  36929. tagName: {
  36930. type: 'string',
  36931. default: 'div'
  36932. },
  36933. displayLayout: {
  36934. type: 'object',
  36935. default: {
  36936. type: 'list'
  36937. }
  36938. }
  36939. },
  36940. supports: {
  36941. align: ['wide', 'full'],
  36942. html: false,
  36943. color: {
  36944. gradients: true,
  36945. link: true
  36946. },
  36947. __experimentalLayout: true
  36948. },
  36949. isEligible: _ref => {
  36950. let {
  36951. query: {
  36952. categoryIds,
  36953. tagIds
  36954. } = {}
  36955. } = _ref;
  36956. return categoryIds || tagIds;
  36957. },
  36958. migrate: migrateToTaxQuery,
  36959. save(_ref2) {
  36960. let {
  36961. attributes: {
  36962. tagName: Tag = 'div'
  36963. }
  36964. } = _ref2;
  36965. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  36966. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  36967. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  36968. }
  36969. }, // Version with NO wrapper `div` element.
  36970. {
  36971. attributes: {
  36972. queryId: {
  36973. type: 'number'
  36974. },
  36975. query: {
  36976. type: 'object',
  36977. default: {
  36978. perPage: null,
  36979. pages: 0,
  36980. offset: 0,
  36981. postType: 'post',
  36982. categoryIds: [],
  36983. tagIds: [],
  36984. order: 'desc',
  36985. orderBy: 'date',
  36986. author: '',
  36987. search: '',
  36988. exclude: [],
  36989. sticky: '',
  36990. inherit: true
  36991. }
  36992. },
  36993. layout: {
  36994. type: 'object',
  36995. default: {
  36996. type: 'list'
  36997. }
  36998. }
  36999. },
  37000. supports: {
  37001. html: false
  37002. },
  37003. migrate(attributes) {
  37004. const withTaxQuery = migrateToTaxQuery(attributes);
  37005. const {
  37006. layout,
  37007. ...restWithTaxQuery
  37008. } = withTaxQuery;
  37009. return { ...restWithTaxQuery,
  37010. displayLayout: withTaxQuery.layout
  37011. };
  37012. },
  37013. save() {
  37014. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  37015. }
  37016. }];
  37017. /* harmony default export */ var query_deprecated = (query_deprecated_deprecated);
  37018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
  37019. /**
  37020. * WordPress dependencies
  37021. */
  37022. const CreateNewPostLink = _ref => {
  37023. let {
  37024. attributes: {
  37025. query: {
  37026. postType
  37027. } = {}
  37028. } = {}
  37029. } = _ref;
  37030. if (!postType) return null;
  37031. const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
  37032. post_type: postType
  37033. });
  37034. return (0,external_wp_element_namespaceObject.createElement)("div", {
  37035. className: "wp-block-query__create-new-link"
  37036. }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
  37037. {
  37038. a: (0,external_wp_element_namespaceObject.createElement)("a", {
  37039. href: newPostUrl
  37040. })
  37041. }));
  37042. };
  37043. /**
  37044. * Override the default edit UI to include layout controls
  37045. *
  37046. * @param {Function} BlockEdit Original component
  37047. * @return {Function} Wrapped component
  37048. */
  37049. const queryTopInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
  37050. const {
  37051. name,
  37052. isSelected
  37053. } = props;
  37054. if (name !== 'core/query' || !isSelected) {
  37055. return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  37056. key: "edit"
  37057. }, props));
  37058. }
  37059. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(CreateNewPostLink, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  37060. key: "edit"
  37061. }, props)));
  37062. }, 'withInspectorControls');
  37063. /* harmony default export */ var query_hooks = (queryTopInspectorControls);
  37064. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
  37065. /**
  37066. * WordPress dependencies
  37067. */
  37068. /**
  37069. * Internal dependencies
  37070. */
  37071. const query_metadata = {
  37072. $schema: "https://schemas.wp.org/trunk/block.json",
  37073. apiVersion: 2,
  37074. name: "core/query",
  37075. title: "Query Loop",
  37076. category: "theme",
  37077. description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
  37078. textdomain: "default",
  37079. attributes: {
  37080. queryId: {
  37081. type: "number"
  37082. },
  37083. query: {
  37084. type: "object",
  37085. "default": {
  37086. perPage: null,
  37087. pages: 0,
  37088. offset: 0,
  37089. postType: "post",
  37090. order: "desc",
  37091. orderBy: "date",
  37092. author: "",
  37093. search: "",
  37094. exclude: [],
  37095. sticky: "",
  37096. inherit: true,
  37097. taxQuery: null,
  37098. parents: []
  37099. }
  37100. },
  37101. tagName: {
  37102. type: "string",
  37103. "default": "div"
  37104. },
  37105. displayLayout: {
  37106. type: "object",
  37107. "default": {
  37108. type: "list"
  37109. }
  37110. },
  37111. namespace: {
  37112. type: "string"
  37113. }
  37114. },
  37115. providesContext: {
  37116. queryId: "queryId",
  37117. query: "query",
  37118. displayLayout: "displayLayout"
  37119. },
  37120. supports: {
  37121. align: ["wide", "full"],
  37122. html: false,
  37123. color: {
  37124. gradients: true,
  37125. link: true,
  37126. __experimentalDefaultControls: {
  37127. background: true,
  37128. text: true
  37129. }
  37130. },
  37131. __experimentalLayout: true
  37132. },
  37133. editorStyle: "wp-block-query-editor"
  37134. };
  37135. const {
  37136. name: query_name
  37137. } = query_metadata;
  37138. const query_settings = {
  37139. icon: library_loop,
  37140. edit: query_edit,
  37141. save: QuerySave,
  37142. variations: query_variations,
  37143. deprecated: query_deprecated
  37144. };
  37145. const query_init = () => {
  37146. (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/query', query_hooks);
  37147. return initBlock({
  37148. name: query_name,
  37149. metadata: query_metadata,
  37150. settings: query_settings
  37151. });
  37152. };
  37153. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js
  37154. /**
  37155. * WordPress dependencies
  37156. */
  37157. const query_no_results_edit_TEMPLATE = [['core/paragraph', {
  37158. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when a query returns no results.')
  37159. }]];
  37160. function QueryNoResultsEdit() {
  37161. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  37162. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  37163. template: query_no_results_edit_TEMPLATE
  37164. });
  37165. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  37166. }
  37167. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js
  37168. /**
  37169. * WordPress dependencies
  37170. */
  37171. function QueryNoResultsSave() {
  37172. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  37173. }
  37174. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  37175. /**
  37176. * WordPress dependencies
  37177. */
  37178. /**
  37179. * Internal dependencies
  37180. */
  37181. const query_no_results_metadata = {
  37182. $schema: "https://schemas.wp.org/trunk/block.json",
  37183. apiVersion: 2,
  37184. name: "core/query-no-results",
  37185. title: "No results",
  37186. category: "theme",
  37187. description: "Contains the block elements used to render content when no query results are found.",
  37188. parent: ["core/query"],
  37189. textdomain: "default",
  37190. usesContext: ["queryId", "query"],
  37191. supports: {
  37192. align: true,
  37193. reusable: false,
  37194. html: false,
  37195. color: {
  37196. gradients: true,
  37197. link: true
  37198. },
  37199. typography: {
  37200. fontSize: true,
  37201. lineHeight: true,
  37202. __experimentalFontFamily: true,
  37203. __experimentalFontWeight: true,
  37204. __experimentalFontStyle: true,
  37205. __experimentalTextTransform: true,
  37206. __experimentalTextDecoration: true,
  37207. __experimentalLetterSpacing: true,
  37208. __experimentalDefaultControls: {
  37209. fontSize: true
  37210. }
  37211. }
  37212. }
  37213. };
  37214. const {
  37215. name: query_no_results_name
  37216. } = query_no_results_metadata;
  37217. const query_no_results_settings = {
  37218. icon: library_loop,
  37219. edit: QueryNoResultsEdit,
  37220. save: QueryNoResultsSave
  37221. };
  37222. const query_no_results_init = () => initBlock({
  37223. name: query_no_results_name,
  37224. metadata: query_no_results_metadata,
  37225. settings: query_no_results_settings
  37226. });
  37227. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
  37228. /**
  37229. * WordPress dependencies
  37230. */
  37231. function QueryPaginationArrowControls(_ref) {
  37232. let {
  37233. value,
  37234. onChange
  37235. } = _ref;
  37236. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  37237. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  37238. value: value,
  37239. onChange: onChange,
  37240. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
  37241. isBlock: true
  37242. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  37243. value: "none",
  37244. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
  37245. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  37246. value: "arrow",
  37247. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
  37248. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  37249. value: "chevron",
  37250. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
  37251. }));
  37252. }
  37253. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
  37254. /**
  37255. * WordPress dependencies
  37256. */
  37257. /**
  37258. * Internal dependencies
  37259. */
  37260. const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
  37261. const query_pagination_edit_ALLOWED_BLOCKS = ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'];
  37262. const edit_getDefaultBlockLayout = blockTypeOrName => {
  37263. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  37264. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  37265. };
  37266. function edit_QueryPaginationEdit(_ref) {
  37267. let {
  37268. attributes: {
  37269. paginationArrow,
  37270. layout
  37271. },
  37272. setAttributes,
  37273. clientId,
  37274. name
  37275. } = _ref;
  37276. const usedLayout = layout || edit_getDefaultBlockLayout(name);
  37277. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  37278. const {
  37279. getBlocks
  37280. } = select(external_wp_blockEditor_namespaceObject.store);
  37281. const innerBlocks = getBlocks(clientId);
  37282. /**
  37283. * Show the `paginationArrow` control only if a
  37284. * `QueryPaginationNext/Previous` block exists.
  37285. */
  37286. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  37287. return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
  37288. });
  37289. }, []);
  37290. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  37291. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  37292. template: query_pagination_edit_TEMPLATE,
  37293. allowedBlocks: query_pagination_edit_ALLOWED_BLOCKS,
  37294. __experimentalLayout: usedLayout
  37295. });
  37296. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  37297. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  37298. }, (0,external_wp_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
  37299. value: paginationArrow,
  37300. onChange: value => {
  37301. setAttributes({
  37302. paginationArrow: value
  37303. });
  37304. }
  37305. }))), (0,external_wp_element_namespaceObject.createElement)("nav", innerBlocksProps));
  37306. }
  37307. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
  37308. /**
  37309. * WordPress dependencies
  37310. */
  37311. function query_pagination_save_save() {
  37312. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  37313. }
  37314. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
  37315. /**
  37316. * WordPress dependencies
  37317. */
  37318. const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
  37319. {
  37320. save() {
  37321. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  37322. }
  37323. }];
  37324. /* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);
  37325. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  37326. /**
  37327. * WordPress dependencies
  37328. */
  37329. /**
  37330. * Internal dependencies
  37331. */
  37332. const query_pagination_metadata = {
  37333. $schema: "https://schemas.wp.org/trunk/block.json",
  37334. apiVersion: 2,
  37335. name: "core/query-pagination",
  37336. title: "Pagination",
  37337. category: "theme",
  37338. parent: ["core/query"],
  37339. description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
  37340. textdomain: "default",
  37341. attributes: {
  37342. paginationArrow: {
  37343. type: "string",
  37344. "default": "none"
  37345. }
  37346. },
  37347. usesContext: ["queryId", "query"],
  37348. providesContext: {
  37349. paginationArrow: "paginationArrow"
  37350. },
  37351. supports: {
  37352. align: true,
  37353. reusable: false,
  37354. html: false,
  37355. color: {
  37356. gradients: true,
  37357. link: true,
  37358. __experimentalDefaultControls: {
  37359. background: true,
  37360. text: true,
  37361. link: true
  37362. }
  37363. },
  37364. __experimentalLayout: {
  37365. allowSwitching: false,
  37366. allowInheriting: false,
  37367. "default": {
  37368. type: "flex"
  37369. }
  37370. },
  37371. typography: {
  37372. fontSize: true,
  37373. lineHeight: true,
  37374. __experimentalFontFamily: true,
  37375. __experimentalFontWeight: true,
  37376. __experimentalFontStyle: true,
  37377. __experimentalTextTransform: true,
  37378. __experimentalTextDecoration: true,
  37379. __experimentalLetterSpacing: true,
  37380. __experimentalDefaultControls: {
  37381. fontSize: true
  37382. }
  37383. }
  37384. },
  37385. editorStyle: "wp-block-query-pagination-editor",
  37386. style: "wp-block-query-pagination"
  37387. };
  37388. const {
  37389. name: query_pagination_name
  37390. } = query_pagination_metadata;
  37391. const query_pagination_settings = {
  37392. icon: query_pagination,
  37393. edit: edit_QueryPaginationEdit,
  37394. save: query_pagination_save_save,
  37395. deprecated: query_pagination_deprecated
  37396. };
  37397. const query_pagination_init = () => initBlock({
  37398. name: query_pagination_name,
  37399. metadata: query_pagination_metadata,
  37400. settings: query_pagination_settings
  37401. });
  37402. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
  37403. /**
  37404. * WordPress dependencies
  37405. */
  37406. const query_pagination_next_edit_arrowMap = {
  37407. none: '',
  37408. arrow: '→',
  37409. chevron: '»'
  37410. };
  37411. function QueryPaginationNextEdit(_ref) {
  37412. let {
  37413. attributes: {
  37414. label
  37415. },
  37416. setAttributes,
  37417. context: {
  37418. paginationArrow
  37419. }
  37420. } = _ref;
  37421. const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow];
  37422. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  37423. href: "#pagination-next-pseudo-link",
  37424. onClick: event => event.preventDefault()
  37425. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  37426. __experimentalVersion: 2,
  37427. tagName: "span",
  37428. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
  37429. placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
  37430. value: label,
  37431. onChange: newLabel => setAttributes({
  37432. label: newLabel
  37433. })
  37434. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  37435. className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`,
  37436. "aria-hidden": true
  37437. }, displayArrow));
  37438. }
  37439. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  37440. /**
  37441. * WordPress dependencies
  37442. */
  37443. /**
  37444. * Internal dependencies
  37445. */
  37446. const query_pagination_next_metadata = {
  37447. $schema: "https://schemas.wp.org/trunk/block.json",
  37448. apiVersion: 2,
  37449. name: "core/query-pagination-next",
  37450. title: "Next Page",
  37451. category: "theme",
  37452. parent: ["core/query-pagination"],
  37453. description: "Displays the next posts page link.",
  37454. textdomain: "default",
  37455. attributes: {
  37456. label: {
  37457. type: "string"
  37458. }
  37459. },
  37460. usesContext: ["queryId", "query", "paginationArrow"],
  37461. supports: {
  37462. reusable: false,
  37463. html: false,
  37464. color: {
  37465. gradients: true,
  37466. text: false,
  37467. __experimentalDefaultControls: {
  37468. background: true
  37469. }
  37470. },
  37471. typography: {
  37472. fontSize: true,
  37473. lineHeight: true,
  37474. __experimentalFontFamily: true,
  37475. __experimentalFontWeight: true,
  37476. __experimentalFontStyle: true,
  37477. __experimentalTextTransform: true,
  37478. __experimentalTextDecoration: true,
  37479. __experimentalLetterSpacing: true,
  37480. __experimentalDefaultControls: {
  37481. fontSize: true
  37482. }
  37483. }
  37484. }
  37485. };
  37486. const {
  37487. name: query_pagination_next_name
  37488. } = query_pagination_next_metadata;
  37489. const query_pagination_next_settings = {
  37490. icon: query_pagination_next,
  37491. edit: QueryPaginationNextEdit
  37492. };
  37493. const query_pagination_next_init = () => initBlock({
  37494. name: query_pagination_next_name,
  37495. metadata: query_pagination_next_metadata,
  37496. settings: query_pagination_next_settings
  37497. });
  37498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
  37499. /**
  37500. * WordPress dependencies
  37501. */
  37502. const createPaginationItem = function (content) {
  37503. let Tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'a';
  37504. let extraClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  37505. return (0,external_wp_element_namespaceObject.createElement)(Tag, {
  37506. className: `page-numbers ${extraClass}`
  37507. }, content);
  37508. };
  37509. const previewPaginationNumbers = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
  37510. function QueryPaginationNumbersEdit() {
  37511. const paginationNumbers = previewPaginationNumbers();
  37512. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), paginationNumbers);
  37513. }
  37514. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  37515. /**
  37516. * WordPress dependencies
  37517. */
  37518. /**
  37519. * Internal dependencies
  37520. */
  37521. const query_pagination_numbers_metadata = {
  37522. $schema: "https://schemas.wp.org/trunk/block.json",
  37523. apiVersion: 2,
  37524. name: "core/query-pagination-numbers",
  37525. title: "Page Numbers",
  37526. category: "theme",
  37527. parent: ["core/query-pagination"],
  37528. description: "Displays a list of page numbers for pagination",
  37529. textdomain: "default",
  37530. usesContext: ["queryId", "query"],
  37531. supports: {
  37532. reusable: false,
  37533. html: false,
  37534. color: {
  37535. gradients: true,
  37536. text: false,
  37537. __experimentalDefaultControls: {
  37538. background: true
  37539. }
  37540. },
  37541. typography: {
  37542. fontSize: true,
  37543. lineHeight: true,
  37544. __experimentalFontFamily: true,
  37545. __experimentalFontWeight: true,
  37546. __experimentalFontStyle: true,
  37547. __experimentalTextTransform: true,
  37548. __experimentalTextDecoration: true,
  37549. __experimentalLetterSpacing: true,
  37550. __experimentalDefaultControls: {
  37551. fontSize: true
  37552. }
  37553. }
  37554. },
  37555. editorStyle: "query-pagination-numbers-editor"
  37556. };
  37557. const {
  37558. name: query_pagination_numbers_name
  37559. } = query_pagination_numbers_metadata;
  37560. const query_pagination_numbers_settings = {
  37561. icon: query_pagination_numbers,
  37562. edit: QueryPaginationNumbersEdit
  37563. };
  37564. const query_pagination_numbers_init = () => initBlock({
  37565. name: query_pagination_numbers_name,
  37566. metadata: query_pagination_numbers_metadata,
  37567. settings: query_pagination_numbers_settings
  37568. });
  37569. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
  37570. /**
  37571. * WordPress dependencies
  37572. */
  37573. const query_pagination_previous_edit_arrowMap = {
  37574. none: '',
  37575. arrow: '←',
  37576. chevron: '«'
  37577. };
  37578. function QueryPaginationPreviousEdit(_ref) {
  37579. let {
  37580. attributes: {
  37581. label
  37582. },
  37583. setAttributes,
  37584. context: {
  37585. paginationArrow
  37586. }
  37587. } = _ref;
  37588. const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow];
  37589. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  37590. href: "#pagination-previous-pseudo-link",
  37591. onClick: event => event.preventDefault()
  37592. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  37593. className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
  37594. "aria-hidden": true
  37595. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  37596. __experimentalVersion: 2,
  37597. tagName: "span",
  37598. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
  37599. placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
  37600. value: label,
  37601. onChange: newLabel => setAttributes({
  37602. label: newLabel
  37603. })
  37604. }));
  37605. }
  37606. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  37607. /**
  37608. * WordPress dependencies
  37609. */
  37610. /**
  37611. * Internal dependencies
  37612. */
  37613. const query_pagination_previous_metadata = {
  37614. $schema: "https://schemas.wp.org/trunk/block.json",
  37615. apiVersion: 2,
  37616. name: "core/query-pagination-previous",
  37617. title: "Previous Page",
  37618. category: "theme",
  37619. parent: ["core/query-pagination"],
  37620. description: "Displays the previous posts page link.",
  37621. textdomain: "default",
  37622. attributes: {
  37623. label: {
  37624. type: "string"
  37625. }
  37626. },
  37627. usesContext: ["queryId", "query", "paginationArrow"],
  37628. supports: {
  37629. reusable: false,
  37630. html: false,
  37631. color: {
  37632. gradients: true,
  37633. text: false,
  37634. __experimentalDefaultControls: {
  37635. background: true
  37636. }
  37637. },
  37638. typography: {
  37639. fontSize: true,
  37640. lineHeight: true,
  37641. __experimentalFontFamily: true,
  37642. __experimentalFontWeight: true,
  37643. __experimentalFontStyle: true,
  37644. __experimentalTextTransform: true,
  37645. __experimentalTextDecoration: true,
  37646. __experimentalLetterSpacing: true,
  37647. __experimentalDefaultControls: {
  37648. fontSize: true
  37649. }
  37650. }
  37651. }
  37652. };
  37653. const {
  37654. name: query_pagination_previous_name
  37655. } = query_pagination_previous_metadata;
  37656. const query_pagination_previous_settings = {
  37657. icon: query_pagination_previous,
  37658. edit: QueryPaginationPreviousEdit
  37659. };
  37660. const query_pagination_previous_init = () => initBlock({
  37661. name: query_pagination_previous_name,
  37662. metadata: query_pagination_previous_metadata,
  37663. settings: query_pagination_previous_settings
  37664. });
  37665. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
  37666. /**
  37667. * External dependencies
  37668. */
  37669. /**
  37670. * WordPress dependencies
  37671. */
  37672. /**
  37673. * Internal dependencies
  37674. */
  37675. const SUPPORTED_TYPES = ['archive', 'search'];
  37676. function QueryTitleEdit(_ref) {
  37677. let {
  37678. attributes: {
  37679. type,
  37680. level,
  37681. textAlign,
  37682. showPrefix,
  37683. showSearchTerm
  37684. },
  37685. setAttributes
  37686. } = _ref;
  37687. const TagName = `h${level}`;
  37688. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  37689. className: classnames_default()('wp-block-query-title__placeholder', {
  37690. [`has-text-align-${textAlign}`]: textAlign
  37691. })
  37692. });
  37693. if (!SUPPORTED_TYPES.includes(type)) {
  37694. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')));
  37695. }
  37696. let titleElement;
  37697. if (type === 'archive') {
  37698. titleElement = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  37699. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  37700. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  37701. label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'),
  37702. onChange: () => setAttributes({
  37703. showPrefix: !showPrefix
  37704. }),
  37705. checked: showPrefix
  37706. }))), (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, showPrefix ? (0,external_wp_i18n_namespaceObject.__)('Archive type: Name') : (0,external_wp_i18n_namespaceObject.__)('Archive title')));
  37707. }
  37708. if (type === 'search') {
  37709. titleElement = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  37710. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  37711. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  37712. label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'),
  37713. onChange: () => setAttributes({
  37714. showSearchTerm: !showSearchTerm
  37715. }),
  37716. checked: showSearchTerm
  37717. }))), (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, showSearchTerm ? (0,external_wp_i18n_namespaceObject.__)('Search results for: "search term"') : (0,external_wp_i18n_namespaceObject.__)('Search results')));
  37718. }
  37719. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  37720. group: "block"
  37721. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  37722. selectedLevel: level,
  37723. onChange: newLevel => setAttributes({
  37724. level: newLevel
  37725. })
  37726. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  37727. value: textAlign,
  37728. onChange: nextAlign => {
  37729. setAttributes({
  37730. textAlign: nextAlign
  37731. });
  37732. }
  37733. })), titleElement);
  37734. }
  37735. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
  37736. /**
  37737. * WordPress dependencies
  37738. */
  37739. const query_title_variations_variations = [{
  37740. isDefault: true,
  37741. name: 'archive-title',
  37742. title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
  37743. description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
  37744. icon: library_title,
  37745. attributes: {
  37746. type: 'archive'
  37747. },
  37748. scope: ['inserter']
  37749. }, {
  37750. isDefault: false,
  37751. name: 'search-title',
  37752. title: (0,external_wp_i18n_namespaceObject.__)('Search Results Title'),
  37753. description: (0,external_wp_i18n_namespaceObject.__)('Display the search results title based on the queried object.'),
  37754. icon: library_title,
  37755. attributes: {
  37756. type: 'search'
  37757. },
  37758. scope: ['inserter']
  37759. }];
  37760. /**
  37761. * Add `isActive` function to all `query-title` variations, if not defined.
  37762. * `isActive` function is used to find a variation match from a created
  37763. * Block by providing its attributes.
  37764. */
  37765. query_title_variations_variations.forEach(variation => {
  37766. if (variation.isActive) return;
  37767. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  37768. });
  37769. /* harmony default export */ var query_title_variations = (query_title_variations_variations);
  37770. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
  37771. /**
  37772. * Internal dependencies
  37773. */
  37774. const query_title_deprecated_v1 = {
  37775. attributes: {
  37776. type: {
  37777. type: 'string'
  37778. },
  37779. textAlign: {
  37780. type: 'string'
  37781. },
  37782. level: {
  37783. type: 'number',
  37784. default: 1
  37785. }
  37786. },
  37787. supports: {
  37788. align: ['wide', 'full'],
  37789. html: false,
  37790. color: {
  37791. gradients: true
  37792. },
  37793. spacing: {
  37794. margin: true
  37795. },
  37796. typography: {
  37797. fontSize: true,
  37798. lineHeight: true,
  37799. __experimentalFontFamily: true
  37800. }
  37801. },
  37802. save() {
  37803. return null;
  37804. },
  37805. migrate: migrate_font_family,
  37806. isEligible(_ref) {
  37807. var _style$typography;
  37808. let {
  37809. style
  37810. } = _ref;
  37811. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  37812. }
  37813. };
  37814. /**
  37815. * New deprecations need to be placed first
  37816. * for them to have higher priority.
  37817. *
  37818. * Old deprecations may need to be updated as well.
  37819. *
  37820. * See block-deprecation.md
  37821. */
  37822. /* harmony default export */ var query_title_deprecated = ([query_title_deprecated_v1]);
  37823. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  37824. /**
  37825. * WordPress dependencies
  37826. */
  37827. /**
  37828. * Internal dependencies
  37829. */
  37830. const query_title_metadata = {
  37831. $schema: "https://schemas.wp.org/trunk/block.json",
  37832. apiVersion: 2,
  37833. name: "core/query-title",
  37834. title: "Query Title",
  37835. category: "theme",
  37836. description: "Display the query title.",
  37837. textdomain: "default",
  37838. attributes: {
  37839. type: {
  37840. type: "string"
  37841. },
  37842. textAlign: {
  37843. type: "string"
  37844. },
  37845. level: {
  37846. type: "number",
  37847. "default": 1
  37848. },
  37849. showPrefix: {
  37850. type: "boolean",
  37851. "default": true
  37852. },
  37853. showSearchTerm: {
  37854. type: "boolean",
  37855. "default": true
  37856. }
  37857. },
  37858. supports: {
  37859. align: ["wide", "full"],
  37860. html: false,
  37861. color: {
  37862. gradients: true,
  37863. __experimentalDefaultControls: {
  37864. background: true,
  37865. text: true
  37866. }
  37867. },
  37868. spacing: {
  37869. margin: true,
  37870. padding: true
  37871. },
  37872. typography: {
  37873. fontSize: true,
  37874. lineHeight: true,
  37875. __experimentalFontFamily: true,
  37876. __experimentalFontStyle: true,
  37877. __experimentalFontWeight: true,
  37878. __experimentalLetterSpacing: true,
  37879. __experimentalTextTransform: true,
  37880. __experimentalTextDecoration: true,
  37881. __experimentalDefaultControls: {
  37882. fontSize: true,
  37883. fontAppearance: true,
  37884. textTransform: true
  37885. }
  37886. }
  37887. },
  37888. style: "wp-block-query-title"
  37889. };
  37890. const {
  37891. name: query_title_name
  37892. } = query_title_metadata;
  37893. const query_title_settings = {
  37894. icon: library_title,
  37895. edit: QueryTitleEdit,
  37896. variations: query_title_variations,
  37897. deprecated: query_title_deprecated
  37898. };
  37899. const query_title_init = () => initBlock({
  37900. name: query_title_name,
  37901. metadata: query_title_metadata,
  37902. settings: query_title_settings
  37903. });
  37904. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
  37905. /**
  37906. * WordPress dependencies
  37907. */
  37908. const quote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37909. viewBox: "0 0 24 24",
  37910. xmlns: "http://www.w3.org/2000/svg"
  37911. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37912. d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
  37913. }));
  37914. /* harmony default export */ var library_quote = (quote);
  37915. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
  37916. /**
  37917. * External dependencies
  37918. */
  37919. /**
  37920. * WordPress dependencies
  37921. */
  37922. const migrateToQuoteV2 = attributes => {
  37923. const {
  37924. value,
  37925. ...restAttributes
  37926. } = attributes;
  37927. return [{ ...restAttributes
  37928. }, value ? (0,external_wp_blocks_namespaceObject.parseWithAttributeSchema)(value, {
  37929. type: 'array',
  37930. source: 'query',
  37931. selector: 'p',
  37932. query: {
  37933. content: {
  37934. type: 'string',
  37935. source: 'html'
  37936. }
  37937. }
  37938. }).map(_ref => {
  37939. let {
  37940. content
  37941. } = _ref;
  37942. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  37943. content
  37944. });
  37945. }) : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')];
  37946. };
  37947. const quote_deprecated_v3 = {
  37948. attributes: {
  37949. value: {
  37950. type: 'string',
  37951. source: 'html',
  37952. selector: 'blockquote',
  37953. multiline: 'p',
  37954. default: '',
  37955. __experimentalRole: 'content'
  37956. },
  37957. citation: {
  37958. type: 'string',
  37959. source: 'html',
  37960. selector: 'cite',
  37961. default: '',
  37962. __experimentalRole: 'content'
  37963. },
  37964. align: {
  37965. type: 'string'
  37966. }
  37967. },
  37968. supports: {
  37969. anchor: true,
  37970. __experimentalSlashInserter: true,
  37971. typography: {
  37972. fontSize: true,
  37973. lineHeight: true,
  37974. __experimentalFontStyle: true,
  37975. __experimentalFontWeight: true,
  37976. __experimentalLetterSpacing: true,
  37977. __experimentalTextTransform: true,
  37978. __experimentalDefaultControls: {
  37979. fontSize: true,
  37980. fontAppearance: true
  37981. }
  37982. }
  37983. },
  37984. save(_ref2) {
  37985. let {
  37986. attributes
  37987. } = _ref2;
  37988. const {
  37989. align,
  37990. value,
  37991. citation
  37992. } = attributes;
  37993. const className = classnames_default()({
  37994. [`has-text-align-${align}`]: align
  37995. });
  37996. return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  37997. className
  37998. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37999. multiline: true,
  38000. value: value
  38001. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38002. tagName: "cite",
  38003. value: citation
  38004. }));
  38005. },
  38006. migrate: migrateToQuoteV2
  38007. };
  38008. const quote_deprecated_v2 = {
  38009. attributes: {
  38010. value: {
  38011. type: 'string',
  38012. source: 'html',
  38013. selector: 'blockquote',
  38014. multiline: 'p',
  38015. default: ''
  38016. },
  38017. citation: {
  38018. type: 'string',
  38019. source: 'html',
  38020. selector: 'cite',
  38021. default: ''
  38022. },
  38023. align: {
  38024. type: 'string'
  38025. }
  38026. },
  38027. migrate: migrateToQuoteV2,
  38028. save(_ref3) {
  38029. let {
  38030. attributes
  38031. } = _ref3;
  38032. const {
  38033. align,
  38034. value,
  38035. citation
  38036. } = attributes;
  38037. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  38038. style: {
  38039. textAlign: align ? align : null
  38040. }
  38041. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38042. multiline: true,
  38043. value: value
  38044. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38045. tagName: "cite",
  38046. value: citation
  38047. }));
  38048. }
  38049. };
  38050. const quote_deprecated_v1 = {
  38051. attributes: {
  38052. value: {
  38053. type: 'string',
  38054. source: 'html',
  38055. selector: 'blockquote',
  38056. multiline: 'p',
  38057. default: ''
  38058. },
  38059. citation: {
  38060. type: 'string',
  38061. source: 'html',
  38062. selector: 'cite',
  38063. default: ''
  38064. },
  38065. align: {
  38066. type: 'string'
  38067. },
  38068. style: {
  38069. type: 'number',
  38070. default: 1
  38071. }
  38072. },
  38073. migrate(attributes) {
  38074. if (attributes.style === 2) {
  38075. const {
  38076. style,
  38077. ...restAttributes
  38078. } = attributes;
  38079. return migrateToQuoteV2({ ...restAttributes,
  38080. className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
  38081. });
  38082. }
  38083. return migrateToQuoteV2(attributes);
  38084. },
  38085. save(_ref4) {
  38086. let {
  38087. attributes
  38088. } = _ref4;
  38089. const {
  38090. align,
  38091. value,
  38092. citation,
  38093. style
  38094. } = attributes;
  38095. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  38096. className: style === 2 ? 'is-large' : '',
  38097. style: {
  38098. textAlign: align ? align : null
  38099. }
  38100. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38101. multiline: true,
  38102. value: value
  38103. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38104. tagName: "cite",
  38105. value: citation
  38106. }));
  38107. }
  38108. };
  38109. const quote_deprecated_v0 = {
  38110. attributes: {
  38111. value: {
  38112. type: 'string',
  38113. source: 'html',
  38114. selector: 'blockquote',
  38115. multiline: 'p',
  38116. default: ''
  38117. },
  38118. citation: {
  38119. type: 'string',
  38120. source: 'html',
  38121. selector: 'footer',
  38122. default: ''
  38123. },
  38124. align: {
  38125. type: 'string'
  38126. },
  38127. style: {
  38128. type: 'number',
  38129. default: 1
  38130. }
  38131. },
  38132. migrate(attributes) {
  38133. if (!isNaN(parseInt(attributes.style))) {
  38134. const {
  38135. style,
  38136. ...restAttributes
  38137. } = attributes;
  38138. return migrateToQuoteV2({ ...restAttributes
  38139. });
  38140. }
  38141. return migrateToQuoteV2(attributes);
  38142. },
  38143. save(_ref5) {
  38144. let {
  38145. attributes
  38146. } = _ref5;
  38147. const {
  38148. align,
  38149. value,
  38150. citation,
  38151. style
  38152. } = attributes;
  38153. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  38154. className: `blocks-quote-style-${style}`,
  38155. style: {
  38156. textAlign: align ? align : null
  38157. }
  38158. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38159. multiline: true,
  38160. value: value
  38161. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38162. tagName: "footer",
  38163. value: citation
  38164. }));
  38165. }
  38166. };
  38167. /**
  38168. * New deprecations need to be placed first
  38169. * for them to have higher priority.
  38170. *
  38171. * Old deprecations may need to be updated as well.
  38172. *
  38173. * See block-deprecation.md
  38174. */
  38175. /* harmony default export */ var quote_deprecated = ([quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]);
  38176. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
  38177. /**
  38178. * External dependencies
  38179. */
  38180. /**
  38181. * WordPress dependencies
  38182. */
  38183. /**
  38184. * Internal dependencies
  38185. */
  38186. const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  38187. const quote_edit_TEMPLATE = [['core/paragraph', {}]];
  38188. /**
  38189. * At the moment, deprecations don't handle create blocks from attributes
  38190. * (like when using CPT templates). For this reason, this hook is necessary
  38191. * to avoid breaking templates using the old quote block format.
  38192. *
  38193. * @param {Object} attributes Block attributes.
  38194. * @param {string} clientId Block client ID.
  38195. */
  38196. const edit_useMigrateOnLoad = (attributes, clientId) => {
  38197. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  38198. const {
  38199. updateBlockAttributes,
  38200. replaceInnerBlocks
  38201. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  38202. (0,external_wp_element_namespaceObject.useEffect)(() => {
  38203. // As soon as the block is loaded, migrate it to the new version.
  38204. if (!attributes.value) {
  38205. // No need to migrate if it doesn't have the value attribute.
  38206. return;
  38207. }
  38208. const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes);
  38209. external_wp_deprecated_default()('Value attribute on the quote block', {
  38210. since: '6.0',
  38211. version: '6.5',
  38212. alternative: 'inner blocks'
  38213. });
  38214. registry.batch(() => {
  38215. updateBlockAttributes(clientId, newAttributes);
  38216. replaceInnerBlocks(clientId, newInnerBlocks);
  38217. });
  38218. }, [attributes.value]);
  38219. };
  38220. function QuoteEdit(_ref) {
  38221. let {
  38222. attributes,
  38223. setAttributes,
  38224. insertBlocksAfter,
  38225. clientId,
  38226. className,
  38227. style
  38228. } = _ref;
  38229. const {
  38230. align,
  38231. citation
  38232. } = attributes;
  38233. edit_useMigrateOnLoad(attributes, clientId);
  38234. const hasSelection = (0,external_wp_data_namespaceObject.useSelect)(select => {
  38235. const {
  38236. isBlockSelected,
  38237. hasSelectedInnerBlock
  38238. } = select(external_wp_blockEditor_namespaceObject.store);
  38239. return hasSelectedInnerBlock(clientId) || isBlockSelected(clientId);
  38240. }, []);
  38241. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  38242. className: classnames_default()(className, {
  38243. [`has-text-align-${align}`]: align
  38244. }),
  38245. ...(!edit_isWebPlatform && {
  38246. style
  38247. })
  38248. });
  38249. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  38250. template: quote_edit_TEMPLATE,
  38251. templateInsertUpdatesSelection: true
  38252. });
  38253. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  38254. group: "block"
  38255. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  38256. value: align,
  38257. onChange: nextAlign => {
  38258. setAttributes({
  38259. align: nextAlign
  38260. });
  38261. }
  38262. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, innerBlocksProps, innerBlocksProps.children, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || hasSelection) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  38263. identifier: "citation",
  38264. tagName: edit_isWebPlatform ? 'cite' : undefined,
  38265. style: {
  38266. display: 'block'
  38267. },
  38268. value: citation,
  38269. onChange: nextCitation => {
  38270. setAttributes({
  38271. citation: nextCitation
  38272. });
  38273. },
  38274. __unstableMobileNoFocusOnMount: true,
  38275. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation'),
  38276. placeholder: // translators: placeholder text used for the
  38277. // citation
  38278. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  38279. className: "wp-block-quote__citation",
  38280. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  38281. }, !edit_isWebPlatform ? {
  38282. textAlign: align
  38283. } : {}))));
  38284. }
  38285. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
  38286. /**
  38287. * External dependencies
  38288. */
  38289. /**
  38290. * WordPress dependencies
  38291. */
  38292. function quote_save_save(_ref) {
  38293. let {
  38294. attributes
  38295. } = _ref;
  38296. const {
  38297. align,
  38298. citation
  38299. } = attributes;
  38300. const className = classnames_default()({
  38301. [`has-text-align-${align}`]: align
  38302. });
  38303. return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  38304. className
  38305. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38306. tagName: "cite",
  38307. value: citation
  38308. }));
  38309. }
  38310. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
  38311. /**
  38312. * WordPress dependencies
  38313. */
  38314. const quote_transforms_transforms = {
  38315. from: [{
  38316. type: 'block',
  38317. blocks: ['core/pullquote'],
  38318. transform: _ref => {
  38319. let {
  38320. value,
  38321. citation,
  38322. anchor,
  38323. fontSize,
  38324. style
  38325. } = _ref;
  38326. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  38327. citation,
  38328. anchor,
  38329. fontSize,
  38330. style
  38331. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  38332. content: value
  38333. })]);
  38334. }
  38335. }, {
  38336. type: 'block',
  38337. blocks: ['core/group'],
  38338. transform: (_ref2, innerBlocks) => {
  38339. let {
  38340. anchor
  38341. } = _ref2;
  38342. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  38343. anchor
  38344. }, innerBlocks);
  38345. }
  38346. }, {
  38347. type: 'prefix',
  38348. prefix: '>',
  38349. transform: content => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  38350. content
  38351. })])
  38352. }, {
  38353. type: 'raw',
  38354. schema: () => ({
  38355. blockquote: {
  38356. children: '*'
  38357. }
  38358. }),
  38359. selector: 'blockquote',
  38360. transform: (node, handler) => {
  38361. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', // Don't try to parse any `cite` out of this content.
  38362. // * There may be more than one cite.
  38363. // * There may be more attribution text than just the cite.
  38364. // * If the cite is nested in the quoted text, it's wrong to
  38365. // remove it.
  38366. {}, handler({
  38367. HTML: node.innerHTML,
  38368. mode: 'BLOCKS'
  38369. }));
  38370. }
  38371. }, {
  38372. type: 'block',
  38373. isMultiBlock: true,
  38374. blocks: ['*'],
  38375. isMatch: (_ref3, blocks) => {
  38376. let {} = _ref3;
  38377. // When a single block is selected make the tranformation
  38378. // available only to specific blocks that make sense.
  38379. if (blocks.length === 1) {
  38380. return ['core/paragraph', 'core/heading', 'core/list', 'core/pullquote'].includes(blocks[0].name);
  38381. }
  38382. return !blocks.some(_ref4 => {
  38383. let {
  38384. name
  38385. } = _ref4;
  38386. return name === 'core/quote';
  38387. });
  38388. },
  38389. __experimentalConvert: blocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks)))
  38390. }],
  38391. to: [{
  38392. type: 'block',
  38393. blocks: ['core/pullquote'],
  38394. isMatch: (_ref5, block) => {
  38395. let {} = _ref5;
  38396. return block.innerBlocks.every(_ref6 => {
  38397. let {
  38398. name
  38399. } = _ref6;
  38400. return name === 'core/paragraph';
  38401. });
  38402. },
  38403. transform: (_ref7, innerBlocks) => {
  38404. let {
  38405. citation,
  38406. anchor,
  38407. fontSize,
  38408. style
  38409. } = _ref7;
  38410. const value = innerBlocks.map(_ref8 => {
  38411. let {
  38412. attributes
  38413. } = _ref8;
  38414. return `${attributes.content}`;
  38415. }).join('<br>');
  38416. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  38417. value,
  38418. citation,
  38419. anchor,
  38420. fontSize,
  38421. style
  38422. });
  38423. }
  38424. }, {
  38425. type: 'block',
  38426. blocks: ['core/group'],
  38427. transform: (_ref9, innerBlocks) => {
  38428. let {
  38429. citation,
  38430. anchor
  38431. } = _ref9;
  38432. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
  38433. anchor
  38434. }, citation ? [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  38435. content: citation
  38436. })] : innerBlocks);
  38437. }
  38438. }, {
  38439. type: 'block',
  38440. blocks: ['*'],
  38441. transform: (_ref10, innerBlocks) => {
  38442. let {
  38443. citation
  38444. } = _ref10;
  38445. return citation ? [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  38446. content: citation
  38447. })] : innerBlocks;
  38448. }
  38449. }]
  38450. };
  38451. /* harmony default export */ var quote_transforms = (quote_transforms_transforms);
  38452. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  38453. /**
  38454. * WordPress dependencies
  38455. */
  38456. /**
  38457. * Internal dependencies
  38458. */
  38459. const quote_metadata = {
  38460. $schema: "https://schemas.wp.org/trunk/block.json",
  38461. apiVersion: 2,
  38462. name: "core/quote",
  38463. title: "Quote",
  38464. category: "text",
  38465. description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar",
  38466. keywords: ["blockquote", "cite"],
  38467. textdomain: "default",
  38468. attributes: {
  38469. value: {
  38470. type: "string",
  38471. source: "html",
  38472. selector: "blockquote",
  38473. multiline: "p",
  38474. "default": "",
  38475. __experimentalRole: "content"
  38476. },
  38477. citation: {
  38478. type: "string",
  38479. source: "html",
  38480. selector: "cite",
  38481. "default": "",
  38482. __experimentalRole: "content"
  38483. },
  38484. align: {
  38485. type: "string"
  38486. }
  38487. },
  38488. supports: {
  38489. anchor: true,
  38490. __experimentalOnEnter: true,
  38491. typography: {
  38492. fontSize: true,
  38493. lineHeight: true,
  38494. __experimentalFontFamily: true,
  38495. __experimentalFontWeight: true,
  38496. __experimentalFontStyle: true,
  38497. __experimentalTextTransform: true,
  38498. __experimentalTextDecoration: true,
  38499. __experimentalLetterSpacing: true,
  38500. __experimentalDefaultControls: {
  38501. fontSize: true,
  38502. fontAppearance: true
  38503. }
  38504. },
  38505. color: {
  38506. gradients: true,
  38507. link: true,
  38508. __experimentalDefaultControls: {
  38509. background: true,
  38510. text: true
  38511. }
  38512. }
  38513. },
  38514. styles: [{
  38515. name: "default",
  38516. label: "Default",
  38517. isDefault: true
  38518. }, {
  38519. name: "plain",
  38520. label: "Plain"
  38521. }],
  38522. editorStyle: "wp-block-quote-editor",
  38523. style: "wp-block-quote"
  38524. };
  38525. const {
  38526. name: quote_name
  38527. } = quote_metadata;
  38528. const quote_settings = {
  38529. icon: library_quote,
  38530. example: {
  38531. attributes: {
  38532. citation: 'Julio Cortázar'
  38533. },
  38534. innerBlocks: [{
  38535. name: 'core/paragraph',
  38536. attributes: {
  38537. content: (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.')
  38538. }
  38539. }]
  38540. },
  38541. transforms: quote_transforms,
  38542. edit: QuoteEdit,
  38543. save: quote_save_save,
  38544. deprecated: quote_deprecated
  38545. };
  38546. const quote_init = () => initBlock({
  38547. name: quote_name,
  38548. metadata: quote_metadata,
  38549. settings: quote_settings
  38550. });
  38551. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
  38552. /**
  38553. * WordPress dependencies
  38554. */
  38555. const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38556. xmlns: "http://www.w3.org/2000/svg",
  38557. viewBox: "0 0 24 24"
  38558. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38559. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  38560. }));
  38561. /* harmony default export */ var library_symbol = (symbol);
  38562. ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
  38563. var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
  38564. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.js
  38565. /**
  38566. * WordPress dependencies
  38567. */
  38568. const ungroup = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38569. xmlns: "http://www.w3.org/2000/svg",
  38570. viewBox: "0 0 24 24"
  38571. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38572. d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"
  38573. }));
  38574. /* harmony default export */ var library_ungroup = (ungroup);
  38575. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
  38576. /**
  38577. * WordPress dependencies
  38578. */
  38579. function ReusableBlockEdit(_ref) {
  38580. let {
  38581. attributes: {
  38582. ref
  38583. },
  38584. clientId
  38585. } = _ref;
  38586. const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.__experimentalUseHasRecursion)(ref);
  38587. const {
  38588. record,
  38589. hasResolved
  38590. } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_block', ref);
  38591. const isMissing = hasResolved && !record;
  38592. const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
  38593. const {
  38594. __experimentalConvertBlockToStatic: convertBlockToStatic
  38595. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_reusableBlocks_namespaceObject.store);
  38596. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
  38597. id: ref
  38598. });
  38599. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_block', 'title', ref);
  38600. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  38601. className: 'block-library-block__reusable-block-container'
  38602. });
  38603. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  38604. value: blocks,
  38605. onInput,
  38606. onChange,
  38607. renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  38608. });
  38609. if (hasAlreadyRendered) {
  38610. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  38611. }
  38612. if (isMissing) {
  38613. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')));
  38614. }
  38615. if (!hasResolved) {
  38616. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
  38617. }
  38618. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalRecursionProvider, {
  38619. uniqueId: ref
  38620. }, canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  38621. onClick: () => convertBlockToStatic(clientId),
  38622. label: (0,external_wp_i18n_namespaceObject.__)('Convert to regular blocks'),
  38623. icon: library_ungroup,
  38624. showTooltip: true
  38625. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38626. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  38627. value: title,
  38628. onChange: setTitle
  38629. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  38630. }
  38631. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
  38632. /**
  38633. * WordPress dependencies
  38634. */
  38635. /**
  38636. * Internal dependencies
  38637. */
  38638. const block_metadata = {
  38639. $schema: "https://schemas.wp.org/trunk/block.json",
  38640. apiVersion: 2,
  38641. name: "core/block",
  38642. title: "Reusable block",
  38643. category: "reusable",
  38644. description: "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it\u2019s used.",
  38645. textdomain: "default",
  38646. attributes: {
  38647. ref: {
  38648. type: "number"
  38649. }
  38650. },
  38651. supports: {
  38652. customClassName: false,
  38653. html: false,
  38654. inserter: false
  38655. },
  38656. editorStyle: "wp-block-editor"
  38657. };
  38658. const {
  38659. name: block_name
  38660. } = block_metadata;
  38661. const block_settings = {
  38662. edit: ReusableBlockEdit,
  38663. icon: library_symbol
  38664. };
  38665. const block_init = () => initBlock({
  38666. name: block_name,
  38667. metadata: block_metadata,
  38668. settings: block_settings
  38669. });
  38670. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/edit.js
  38671. /**
  38672. * WordPress dependencies
  38673. */
  38674. function ReadMore(_ref) {
  38675. let {
  38676. attributes: {
  38677. content,
  38678. linkTarget
  38679. },
  38680. setAttributes,
  38681. insertBlocksAfter
  38682. } = _ref;
  38683. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  38684. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38685. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  38686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38687. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  38688. onChange: value => setAttributes({
  38689. linkTarget: value ? '_blank' : '_self'
  38690. }),
  38691. checked: linkTarget === '_blank'
  38692. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  38693. tagName: "a",
  38694. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  38695. placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'),
  38696. value: content,
  38697. onChange: newValue => setAttributes({
  38698. content: newValue
  38699. }),
  38700. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
  38701. withoutInteractiveFormatting: true
  38702. }, blockProps)));
  38703. }
  38704. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  38705. /**
  38706. * WordPress dependencies
  38707. */
  38708. /**
  38709. * Internal dependencies
  38710. */
  38711. const read_more_metadata = {
  38712. $schema: "https://schemas.wp.org/trunk/block.json",
  38713. apiVersion: 2,
  38714. name: "core/read-more",
  38715. title: "Read More",
  38716. category: "theme",
  38717. description: "Displays the link of a post, page, or any other content-type.",
  38718. textdomain: "default",
  38719. attributes: {
  38720. content: {
  38721. type: "string"
  38722. },
  38723. linkTarget: {
  38724. type: "string",
  38725. "default": "_self"
  38726. }
  38727. },
  38728. usesContext: ["postId"],
  38729. supports: {
  38730. html: false,
  38731. color: {
  38732. gradients: true,
  38733. text: true
  38734. },
  38735. typography: {
  38736. fontSize: true,
  38737. lineHeight: true,
  38738. __experimentalFontFamily: true,
  38739. __experimentalFontWeight: true,
  38740. __experimentalFontStyle: true,
  38741. __experimentalTextTransform: true,
  38742. __experimentalLetterSpacing: true,
  38743. __experimentalTextDecoration: true,
  38744. __experimentalDefaultControls: {
  38745. fontSize: true,
  38746. textDecoration: true
  38747. }
  38748. },
  38749. spacing: {
  38750. margin: ["top", "bottom"],
  38751. padding: true,
  38752. __experimentalDefaultControls: {
  38753. padding: true
  38754. }
  38755. },
  38756. __experimentalBorder: {
  38757. color: true,
  38758. radius: true,
  38759. width: true,
  38760. __experimentalDefaultControls: {
  38761. width: true
  38762. }
  38763. }
  38764. },
  38765. style: "wp-block-read-more"
  38766. };
  38767. const {
  38768. name: read_more_name
  38769. } = read_more_metadata;
  38770. const read_more_settings = {
  38771. icon: library_link,
  38772. edit: ReadMore
  38773. };
  38774. const read_more_init = () => initBlock({
  38775. name: read_more_name,
  38776. metadata: read_more_metadata,
  38777. settings: read_more_settings
  38778. });
  38779. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
  38780. /**
  38781. * WordPress dependencies
  38782. */
  38783. const rss = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38784. xmlns: "http://www.w3.org/2000/svg",
  38785. viewBox: "0 0 24 24"
  38786. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38787. d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
  38788. }));
  38789. /* harmony default export */ var library_rss = (rss);
  38790. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
  38791. /**
  38792. * WordPress dependencies
  38793. */
  38794. const DEFAULT_MIN_ITEMS = 1;
  38795. const DEFAULT_MAX_ITEMS = 20;
  38796. function RSSEdit(_ref) {
  38797. let {
  38798. attributes,
  38799. setAttributes
  38800. } = _ref;
  38801. const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
  38802. const {
  38803. blockLayout,
  38804. columns,
  38805. displayAuthor,
  38806. displayDate,
  38807. displayExcerpt,
  38808. excerptLength,
  38809. feedURL,
  38810. itemsToShow
  38811. } = attributes;
  38812. function toggleAttribute(propName) {
  38813. return () => {
  38814. const value = attributes[propName];
  38815. setAttributes({
  38816. [propName]: !value
  38817. });
  38818. };
  38819. }
  38820. function onSubmitURL(event) {
  38821. event.preventDefault();
  38822. if (feedURL) {
  38823. setAttributes({
  38824. feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL)
  38825. });
  38826. setIsEditing(false);
  38827. }
  38828. }
  38829. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  38830. if (isEditing) {
  38831. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  38832. icon: library_rss,
  38833. label: "RSS"
  38834. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  38835. onSubmit: onSubmitURL,
  38836. className: "wp-block-rss__placeholder-form"
  38837. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38838. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
  38839. value: feedURL,
  38840. onChange: value => setAttributes({
  38841. feedURL: value
  38842. }),
  38843. className: "wp-block-rss__placeholder-input"
  38844. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  38845. variant: "primary",
  38846. type: "submit"
  38847. }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))));
  38848. }
  38849. const toolbarControls = [{
  38850. icon: library_edit,
  38851. title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
  38852. onClick: () => setIsEditing(true)
  38853. }, {
  38854. icon: library_list,
  38855. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  38856. onClick: () => setAttributes({
  38857. blockLayout: 'list'
  38858. }),
  38859. isActive: blockLayout === 'list'
  38860. }, {
  38861. icon: library_grid,
  38862. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  38863. onClick: () => setAttributes({
  38864. blockLayout: 'grid'
  38865. }),
  38866. isActive: blockLayout === 'grid'
  38867. }];
  38868. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  38869. controls: toolbarControls
  38870. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38871. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  38872. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  38873. label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
  38874. value: itemsToShow,
  38875. onChange: value => setAttributes({
  38876. itemsToShow: value
  38877. }),
  38878. min: DEFAULT_MIN_ITEMS,
  38879. max: DEFAULT_MAX_ITEMS,
  38880. required: true
  38881. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38882. label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
  38883. checked: displayAuthor,
  38884. onChange: toggleAttribute('displayAuthor')
  38885. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38886. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  38887. checked: displayDate,
  38888. onChange: toggleAttribute('displayDate')
  38889. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38890. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  38891. checked: displayExcerpt,
  38892. onChange: toggleAttribute('displayExcerpt')
  38893. }), displayExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  38894. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  38895. value: excerptLength,
  38896. onChange: value => setAttributes({
  38897. excerptLength: value
  38898. }),
  38899. min: 10,
  38900. max: 100,
  38901. required: true
  38902. }), blockLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  38903. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  38904. value: columns,
  38905. onChange: value => setAttributes({
  38906. columns: value
  38907. }),
  38908. min: 2,
  38909. max: 6,
  38910. required: true
  38911. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  38912. block: "core/rss",
  38913. attributes: attributes
  38914. }))));
  38915. }
  38916. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  38917. /**
  38918. * WordPress dependencies
  38919. */
  38920. /**
  38921. * Internal dependencies
  38922. */
  38923. const rss_metadata = {
  38924. $schema: "https://schemas.wp.org/trunk/block.json",
  38925. apiVersion: 2,
  38926. name: "core/rss",
  38927. title: "RSS",
  38928. category: "widgets",
  38929. description: "Display entries from any RSS or Atom feed.",
  38930. keywords: ["atom", "feed"],
  38931. textdomain: "default",
  38932. attributes: {
  38933. columns: {
  38934. type: "number",
  38935. "default": 2
  38936. },
  38937. blockLayout: {
  38938. type: "string",
  38939. "default": "list"
  38940. },
  38941. feedURL: {
  38942. type: "string",
  38943. "default": ""
  38944. },
  38945. itemsToShow: {
  38946. type: "number",
  38947. "default": 5
  38948. },
  38949. displayExcerpt: {
  38950. type: "boolean",
  38951. "default": false
  38952. },
  38953. displayAuthor: {
  38954. type: "boolean",
  38955. "default": false
  38956. },
  38957. displayDate: {
  38958. type: "boolean",
  38959. "default": false
  38960. },
  38961. excerptLength: {
  38962. type: "number",
  38963. "default": 55
  38964. }
  38965. },
  38966. supports: {
  38967. align: true,
  38968. html: false
  38969. },
  38970. editorStyle: "wp-block-rss-editor",
  38971. style: "wp-block-rss"
  38972. };
  38973. const {
  38974. name: rss_name
  38975. } = rss_metadata;
  38976. const rss_settings = {
  38977. icon: library_rss,
  38978. example: {
  38979. attributes: {
  38980. feedURL: 'https://wordpress.org'
  38981. }
  38982. },
  38983. edit: RSSEdit
  38984. };
  38985. const rss_init = () => initBlock({
  38986. name: rss_name,
  38987. metadata: rss_metadata,
  38988. settings: rss_settings
  38989. });
  38990. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
  38991. /**
  38992. * WordPress dependencies
  38993. */
  38994. const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38995. xmlns: "http://www.w3.org/2000/svg",
  38996. viewBox: "0 0 24 24"
  38997. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38998. d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"
  38999. }));
  39000. /* harmony default export */ var library_search = (search);
  39001. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
  39002. /**
  39003. * WordPress dependencies
  39004. */
  39005. const buttonOnly = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39006. xmlns: "http://www.w3.org/2000/svg",
  39007. viewBox: "0 0 24 24"
  39008. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39009. x: "7",
  39010. y: "10",
  39011. width: "10",
  39012. height: "4",
  39013. rx: "1",
  39014. fill: "currentColor"
  39015. }));
  39016. const buttonOutside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39017. xmlns: "http://www.w3.org/2000/svg",
  39018. viewBox: "0 0 24 24"
  39019. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39020. x: "4.75",
  39021. y: "15.25",
  39022. width: "6.5",
  39023. height: "9.5",
  39024. transform: "rotate(-90 4.75 15.25)",
  39025. stroke: "currentColor",
  39026. strokeWidth: "1.5",
  39027. fill: "none"
  39028. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39029. x: "16",
  39030. y: "10",
  39031. width: "4",
  39032. height: "4",
  39033. rx: "1",
  39034. fill: "currentColor"
  39035. }));
  39036. const buttonInside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39037. xmlns: "http://www.w3.org/2000/svg",
  39038. viewBox: "0 0 24 24"
  39039. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39040. x: "4.75",
  39041. y: "15.25",
  39042. width: "6.5",
  39043. height: "14.5",
  39044. transform: "rotate(-90 4.75 15.25)",
  39045. stroke: "currentColor",
  39046. strokeWidth: "1.5",
  39047. fill: "none"
  39048. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39049. x: "14",
  39050. y: "10",
  39051. width: "4",
  39052. height: "4",
  39053. rx: "1",
  39054. fill: "currentColor"
  39055. }));
  39056. const noButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39057. xmlns: "http://www.w3.org/2000/svg",
  39058. viewBox: "0 0 24 24"
  39059. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39060. x: "4.75",
  39061. y: "15.25",
  39062. width: "6.5",
  39063. height: "14.5",
  39064. transform: "rotate(-90 4.75 15.25)",
  39065. stroke: "currentColor",
  39066. fill: "none",
  39067. strokeWidth: "1.5"
  39068. }));
  39069. const buttonWithIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39070. xmlns: "http://www.w3.org/2000/svg",
  39071. viewBox: "0 0 24 24"
  39072. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39073. x: "4.75",
  39074. y: "7.75",
  39075. width: "14.5",
  39076. height: "8.5",
  39077. rx: "1.25",
  39078. stroke: "currentColor",
  39079. fill: "none",
  39080. strokeWidth: "1.5"
  39081. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39082. x: "8",
  39083. y: "11",
  39084. width: "8",
  39085. height: "2",
  39086. fill: "currentColor"
  39087. }));
  39088. const toggleLabel = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  39089. xmlns: "http://www.w3.org/2000/svg",
  39090. viewBox: "0 0 24 24"
  39091. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39092. x: "4.75",
  39093. y: "17.25",
  39094. width: "5.5",
  39095. height: "14.5",
  39096. transform: "rotate(-90 4.75 17.25)",
  39097. stroke: "currentColor",
  39098. fill: "none",
  39099. strokeWidth: "1.5"
  39100. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  39101. x: "4",
  39102. y: "7",
  39103. width: "10",
  39104. height: "2",
  39105. fill: "currentColor"
  39106. }));
  39107. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
  39108. /**
  39109. * Constants
  39110. */
  39111. const PC_WIDTH_DEFAULT = 50;
  39112. const PX_WIDTH_DEFAULT = 350;
  39113. const MIN_WIDTH = 220;
  39114. const MIN_WIDTH_UNIT = 'px';
  39115. /**
  39116. * Returns a boolean whether passed unit is percentage
  39117. *
  39118. * @param {string} unit Block width unit.
  39119. *
  39120. * @return {boolean} Whether unit is '%'.
  39121. */
  39122. function utils_isPercentageUnit(unit) {
  39123. return unit === '%';
  39124. }
  39125. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
  39126. /**
  39127. * External dependencies
  39128. */
  39129. /**
  39130. * WordPress dependencies
  39131. */
  39132. /**
  39133. * Internal dependencies
  39134. */
  39135. // Used to calculate border radius adjustment to avoid "fat" corners when
  39136. // button is placed inside wrapper.
  39137. const DEFAULT_INNER_PADDING = '4px';
  39138. function SearchEdit(_ref) {
  39139. var _style$border;
  39140. let {
  39141. className,
  39142. attributes,
  39143. setAttributes,
  39144. toggleSelection,
  39145. isSelected,
  39146. clientId
  39147. } = _ref;
  39148. const {
  39149. label,
  39150. showLabel,
  39151. placeholder,
  39152. width,
  39153. widthUnit,
  39154. align,
  39155. buttonText,
  39156. buttonPosition,
  39157. buttonUseIcon,
  39158. style
  39159. } = attributes;
  39160. const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39161. var _getBlockParentsByBlo;
  39162. const {
  39163. getBlockParentsByBlockName,
  39164. wasBlockJustInserted
  39165. } = select(external_wp_blockEditor_namespaceObject.store);
  39166. return !!((_getBlockParentsByBlo = getBlockParentsByBlockName(clientId, 'core/navigation')) !== null && _getBlockParentsByBlo !== void 0 && _getBlockParentsByBlo.length) && wasBlockJustInserted(clientId);
  39167. }, [clientId]);
  39168. const {
  39169. __unstableMarkNextChangeAsNotPersistent
  39170. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  39171. (0,external_wp_element_namespaceObject.useEffect)(() => {
  39172. if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.
  39173. __unstableMarkNextChangeAsNotPersistent();
  39174. setAttributes({
  39175. showLabel: false,
  39176. buttonUseIcon: true,
  39177. buttonPosition: 'button-inside'
  39178. });
  39179. }, [insertedInNavigationBlock]);
  39180. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
  39181. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate
  39182. // check so that a borderRadius style won't overwrite the longhand
  39183. // per-corner styles.
  39184. if (typeof borderRadius === 'number') {
  39185. borderProps.style.borderRadius = `${borderRadius}px`;
  39186. }
  39187. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  39188. const fluidTypographyEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fluid');
  39189. const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, fluidTypographyEnabled);
  39190. const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  39191. const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
  39192. const isButtonPositionInside = 'button-inside' === buttonPosition;
  39193. const isButtonPositionOutside = 'button-outside' === buttonPosition;
  39194. const hasNoButton = 'no-button' === buttonPosition;
  39195. const hasOnlyButton = 'button-only' === buttonPosition;
  39196. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  39197. availableUnits: ['%', 'px'],
  39198. defaultValues: {
  39199. '%': PC_WIDTH_DEFAULT,
  39200. px: PX_WIDTH_DEFAULT
  39201. }
  39202. });
  39203. const getBlockClassNames = () => {
  39204. return classnames_default()(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined);
  39205. };
  39206. const buttonPositionControls = [{
  39207. role: 'menuitemradio',
  39208. title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
  39209. isActive: buttonPosition === 'button-outside',
  39210. icon: buttonOutside,
  39211. onClick: () => {
  39212. setAttributes({
  39213. buttonPosition: 'button-outside'
  39214. });
  39215. }
  39216. }, {
  39217. role: 'menuitemradio',
  39218. title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
  39219. isActive: buttonPosition === 'button-inside',
  39220. icon: buttonInside,
  39221. onClick: () => {
  39222. setAttributes({
  39223. buttonPosition: 'button-inside'
  39224. });
  39225. }
  39226. }, {
  39227. role: 'menuitemradio',
  39228. title: (0,external_wp_i18n_namespaceObject.__)('No button'),
  39229. isActive: buttonPosition === 'no-button',
  39230. icon: noButton,
  39231. onClick: () => {
  39232. setAttributes({
  39233. buttonPosition: 'no-button'
  39234. });
  39235. }
  39236. }];
  39237. const getButtonPositionIcon = () => {
  39238. switch (buttonPosition) {
  39239. case 'button-inside':
  39240. return buttonInside;
  39241. case 'button-outside':
  39242. return buttonOutside;
  39243. case 'no-button':
  39244. return noButton;
  39245. case 'button-only':
  39246. return buttonOnly;
  39247. }
  39248. };
  39249. const getResizableSides = () => {
  39250. if (hasOnlyButton) {
  39251. return {};
  39252. }
  39253. return {
  39254. right: align !== 'right',
  39255. left: align === 'right'
  39256. };
  39257. };
  39258. const renderTextField = () => {
  39259. // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.
  39260. const textFieldClasses = classnames_default()('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className);
  39261. const textFieldStyles = { ...(isButtonPositionInside ? {
  39262. borderRadius
  39263. } : borderProps.style),
  39264. ...typographyProps.style,
  39265. textDecoration: undefined
  39266. };
  39267. return (0,external_wp_element_namespaceObject.createElement)("input", {
  39268. type: "search",
  39269. className: textFieldClasses,
  39270. style: textFieldStyles,
  39271. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
  39272. // stops screen readers from reading the placeholder field's placeholder
  39273. // which is confusing.
  39274. ,
  39275. placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
  39276. value: placeholder,
  39277. onChange: event => setAttributes({
  39278. placeholder: event.target.value
  39279. })
  39280. });
  39281. };
  39282. const renderButton = () => {
  39283. // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.
  39284. const buttonClasses = classnames_default()('wp-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button'));
  39285. const buttonStyles = { ...colorProps.style,
  39286. ...typographyProps.style,
  39287. ...(isButtonPositionInside ? {
  39288. borderRadius
  39289. } : borderProps.style)
  39290. };
  39291. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  39292. type: "button",
  39293. className: buttonClasses,
  39294. style: buttonStyles,
  39295. "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search')
  39296. }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  39297. icon: library_search
  39298. })), !buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  39299. className: buttonClasses,
  39300. style: buttonStyles,
  39301. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  39302. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
  39303. withoutInteractiveFormatting: true,
  39304. value: buttonText,
  39305. onChange: html => setAttributes({
  39306. buttonText: html
  39307. })
  39308. }));
  39309. };
  39310. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  39311. title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'),
  39312. icon: toggleLabel,
  39313. onClick: () => {
  39314. setAttributes({
  39315. showLabel: !showLabel
  39316. });
  39317. },
  39318. className: showLabel ? 'is-pressed' : undefined
  39319. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  39320. icon: getButtonPositionIcon(),
  39321. label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
  39322. controls: buttonPositionControls
  39323. }), !hasNoButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  39324. title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
  39325. icon: buttonWithIcon,
  39326. onClick: () => {
  39327. setAttributes({
  39328. buttonUseIcon: !buttonUseIcon
  39329. });
  39330. },
  39331. className: buttonUseIcon ? 'is-pressed' : undefined
  39332. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  39333. title: (0,external_wp_i18n_namespaceObject.__)('Display Settings')
  39334. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  39335. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  39336. id: unitControlInputId
  39337. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  39338. id: unitControlInputId,
  39339. min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
  39340. onChange: newWidth => {
  39341. const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
  39342. setAttributes({
  39343. width: parseInt(filteredWidth, 10)
  39344. });
  39345. },
  39346. onUnitChange: newUnit => {
  39347. setAttributes({
  39348. width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
  39349. widthUnit: newUnit
  39350. });
  39351. },
  39352. style: {
  39353. maxWidth: 80
  39354. },
  39355. value: `${width}${widthUnit}`,
  39356. units: units
  39357. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  39358. className: "wp-block-search__components-button-group",
  39359. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage Width')
  39360. }, [25, 50, 75, 100].map(widthValue => {
  39361. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39362. key: widthValue,
  39363. isSmall: true,
  39364. variant: `${widthValue}%` === `${width}${widthUnit}` ? 0 : undefined,
  39365. onClick: () => setAttributes({
  39366. width: widthValue,
  39367. widthUnit: '%'
  39368. })
  39369. }, widthValue, "%");
  39370. }))))));
  39371. const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
  39372. const getWrapperStyles = () => {
  39373. var _borderProps$style, _borderProps$style2, _borderProps$style3, _borderProps$style4, _borderProps$style5;
  39374. const styles = isButtonPositionInside ? borderProps.style : {
  39375. borderRadius: (_borderProps$style = borderProps.style) === null || _borderProps$style === void 0 ? void 0 : _borderProps$style.borderRadius,
  39376. borderTopLeftRadius: (_borderProps$style2 = borderProps.style) === null || _borderProps$style2 === void 0 ? void 0 : _borderProps$style2.borderTopLeftRadius,
  39377. borderTopRightRadius: (_borderProps$style3 = borderProps.style) === null || _borderProps$style3 === void 0 ? void 0 : _borderProps$style3.borderTopRightRadius,
  39378. borderBottomLeftRadius: (_borderProps$style4 = borderProps.style) === null || _borderProps$style4 === void 0 ? void 0 : _borderProps$style4.borderBottomLeftRadius,
  39379. borderBottomRightRadius: (_borderProps$style5 = borderProps.style) === null || _borderProps$style5 === void 0 ? void 0 : _borderProps$style5.borderBottomRightRadius
  39380. };
  39381. const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
  39382. if (isButtonPositionInside && isNonZeroBorderRadius) {
  39383. // We have button inside wrapper and a border radius value to apply.
  39384. // Add default padding so we don't get "fat" corners.
  39385. //
  39386. // CSS calc() is used here to support non-pixel units. The inline
  39387. // style using calc() will only apply if both values have units.
  39388. if (typeof borderRadius === 'object') {
  39389. // Individual corner border radii present.
  39390. const {
  39391. topLeft,
  39392. topRight,
  39393. bottomLeft,
  39394. bottomRight
  39395. } = borderRadius;
  39396. return { ...styles,
  39397. borderTopLeftRadius: padBorderRadius(topLeft),
  39398. borderTopRightRadius: padBorderRadius(topRight),
  39399. borderBottomLeftRadius: padBorderRadius(bottomLeft),
  39400. borderBottomRightRadius: padBorderRadius(bottomRight)
  39401. };
  39402. } // The inline style using calc() will only apply if both values
  39403. // supplied to calc() have units. Deprecated block's may have
  39404. // unitless integer.
  39405. const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius;
  39406. styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`;
  39407. }
  39408. return styles;
  39409. };
  39410. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39411. className: getBlockClassNames(),
  39412. style: { ...typographyProps.style,
  39413. // Input opts out of text decoration.
  39414. textDecoration: undefined
  39415. }
  39416. });
  39417. const labelClassnames = classnames_default()('wp-block-search__label', typographyProps.className);
  39418. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, showLabel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  39419. className: labelClassnames,
  39420. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
  39421. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
  39422. withoutInteractiveFormatting: true,
  39423. value: label,
  39424. onChange: html => setAttributes({
  39425. label: html
  39426. }),
  39427. style: typographyProps.style
  39428. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  39429. size: {
  39430. width: `${width}${widthUnit}`
  39431. },
  39432. className: classnames_default()('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined),
  39433. style: getWrapperStyles(),
  39434. minWidth: MIN_WIDTH,
  39435. enable: getResizableSides(),
  39436. onResizeStart: (event, direction, elt) => {
  39437. setAttributes({
  39438. width: parseInt(elt.offsetWidth, 10),
  39439. widthUnit: 'px'
  39440. });
  39441. toggleSelection(false);
  39442. },
  39443. onResizeStop: (event, direction, elt, delta) => {
  39444. setAttributes({
  39445. width: parseInt(width + delta.width, 10)
  39446. });
  39447. toggleSelection(true);
  39448. },
  39449. showHandle: isSelected
  39450. }, (isButtonPositionInside || isButtonPositionOutside) && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
  39451. }
  39452. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
  39453. /**
  39454. * WordPress dependencies
  39455. */
  39456. const search_variations_variations = [{
  39457. name: 'default',
  39458. isDefault: true,
  39459. attributes: {
  39460. buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
  39461. label: (0,external_wp_i18n_namespaceObject.__)('Search')
  39462. }
  39463. }];
  39464. /* harmony default export */ var search_variations = (search_variations_variations);
  39465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
  39466. /**
  39467. * WordPress dependencies
  39468. */
  39469. /**
  39470. * Internal dependencies
  39471. */
  39472. const search_metadata = {
  39473. $schema: "https://schemas.wp.org/trunk/block.json",
  39474. apiVersion: 2,
  39475. name: "core/search",
  39476. title: "Search",
  39477. category: "widgets",
  39478. description: "Help visitors find your content.",
  39479. keywords: ["find"],
  39480. textdomain: "default",
  39481. attributes: {
  39482. label: {
  39483. type: "string",
  39484. __experimentalRole: "content"
  39485. },
  39486. showLabel: {
  39487. type: "boolean",
  39488. "default": true
  39489. },
  39490. placeholder: {
  39491. type: "string",
  39492. "default": "",
  39493. __experimentalRole: "content"
  39494. },
  39495. width: {
  39496. type: "number"
  39497. },
  39498. widthUnit: {
  39499. type: "string"
  39500. },
  39501. buttonText: {
  39502. type: "string",
  39503. __experimentalRole: "content"
  39504. },
  39505. buttonPosition: {
  39506. type: "string",
  39507. "default": "button-outside"
  39508. },
  39509. buttonUseIcon: {
  39510. type: "boolean",
  39511. "default": false
  39512. },
  39513. query: {
  39514. type: "object",
  39515. "default": {}
  39516. }
  39517. },
  39518. supports: {
  39519. align: ["left", "center", "right"],
  39520. color: {
  39521. gradients: true,
  39522. __experimentalSkipSerialization: true,
  39523. __experimentalDefaultControls: {
  39524. background: true,
  39525. text: true
  39526. }
  39527. },
  39528. typography: {
  39529. __experimentalSkipSerialization: true,
  39530. __experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button",
  39531. fontSize: true,
  39532. lineHeight: true,
  39533. __experimentalFontFamily: true,
  39534. __experimentalFontWeight: true,
  39535. __experimentalFontStyle: true,
  39536. __experimentalTextTransform: true,
  39537. __experimentalTextDecoration: true,
  39538. __experimentalLetterSpacing: true,
  39539. __experimentalDefaultControls: {
  39540. fontSize: true
  39541. }
  39542. },
  39543. __experimentalBorder: {
  39544. color: true,
  39545. radius: true,
  39546. width: true,
  39547. __experimentalSkipSerialization: true,
  39548. __experimentalDefaultControls: {
  39549. color: true,
  39550. radius: true,
  39551. width: true
  39552. }
  39553. },
  39554. html: false
  39555. },
  39556. editorStyle: "wp-block-search-editor",
  39557. style: "wp-block-search"
  39558. };
  39559. const {
  39560. name: search_name
  39561. } = search_metadata;
  39562. const search_settings = {
  39563. icon: library_search,
  39564. example: {},
  39565. variations: search_variations,
  39566. edit: SearchEdit
  39567. };
  39568. const search_init = () => initBlock({
  39569. name: search_name,
  39570. metadata: search_metadata,
  39571. settings: search_settings
  39572. });
  39573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
  39574. /**
  39575. * WordPress dependencies
  39576. */
  39577. const separator = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39578. viewBox: "0 0 24 24",
  39579. xmlns: "http://www.w3.org/2000/svg"
  39580. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39581. d: "M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"
  39582. }));
  39583. /* harmony default export */ var library_separator = (separator);
  39584. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js
  39585. /**
  39586. * WordPress dependencies
  39587. */
  39588. function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
  39589. const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false);
  39590. const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); // A separator with no color set will always have previousColor set to undefined,
  39591. // and we need to differentiate these from those with color set that will return
  39592. // previousColor as undefined on the first render.
  39593. (0,external_wp_element_namespaceObject.useEffect)(() => {
  39594. if (opacity === 'css' && !currentColor && !previousColor) {
  39595. setDeprecatedOpacityWithNoColor(true);
  39596. }
  39597. }, [currentColor, previousColor, opacity]); // For deprecated blocks, that have a default 0.4 css opacity set, we
  39598. // need to remove this if the current color is changed, or a color is added.
  39599. // In these instances the opacity attribute is set back to the default of
  39600. // alpha-channel which allows a new custom opacity to be set via the color picker.
  39601. (0,external_wp_element_namespaceObject.useEffect)(() => {
  39602. if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
  39603. setAttributes({
  39604. opacity: 'alpha-channel'
  39605. });
  39606. setDeprecatedOpacityWithNoColor(false);
  39607. }
  39608. }, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
  39609. }
  39610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
  39611. /**
  39612. * External dependencies
  39613. */
  39614. /**
  39615. * WordPress dependencies
  39616. */
  39617. /**
  39618. * Internal dependencies
  39619. */
  39620. function SeparatorEdit(_ref) {
  39621. var _colorProps$style, _style$color;
  39622. let {
  39623. attributes,
  39624. setAttributes
  39625. } = _ref;
  39626. const {
  39627. backgroundColor,
  39628. opacity,
  39629. style
  39630. } = attributes;
  39631. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  39632. const currentColor = colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor;
  39633. const hasCustomColor = !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.background);
  39634. useDeprecatedOpacity(opacity, currentColor, setAttributes); // The dots styles uses text for the dots, to change those dots color is
  39635. // using color, not backgroundColor.
  39636. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  39637. const className = classnames_default()({
  39638. 'has-text-color': backgroundColor || currentColor,
  39639. [colorClass]: colorClass,
  39640. 'has-css-opacity': opacity === 'css',
  39641. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  39642. }, colorProps.className);
  39643. const styles = {
  39644. color: currentColor,
  39645. backgroundColor: currentColor
  39646. };
  39647. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39648. className,
  39649. style: hasCustomColor ? styles : undefined
  39650. })));
  39651. }
  39652. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
  39653. /**
  39654. * External dependencies
  39655. */
  39656. /**
  39657. * WordPress dependencies
  39658. */
  39659. function separatorSave(_ref) {
  39660. var _style$color, _colorProps$style;
  39661. let {
  39662. attributes
  39663. } = _ref;
  39664. const {
  39665. backgroundColor,
  39666. style,
  39667. opacity
  39668. } = attributes;
  39669. const customColor = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.background;
  39670. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); // The hr support changing color using border-color, since border-color
  39671. // is not yet supported in the color palette, we use background-color.
  39672. // The dots styles uses text for the dots, to change those dots color is
  39673. // using color, not backgroundColor.
  39674. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  39675. const className = classnames_default()({
  39676. 'has-text-color': backgroundColor || customColor,
  39677. [colorClass]: colorClass,
  39678. 'has-css-opacity': opacity === 'css',
  39679. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  39680. }, colorProps.className);
  39681. const styles = {
  39682. backgroundColor: colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor,
  39683. color: colorClass ? undefined : customColor
  39684. };
  39685. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39686. className,
  39687. style: styles
  39688. }));
  39689. }
  39690. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
  39691. /**
  39692. * WordPress dependencies
  39693. */
  39694. const separator_transforms_transforms = {
  39695. from: [{
  39696. type: 'enter',
  39697. regExp: /^-{3,}$/,
  39698. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
  39699. }, {
  39700. type: 'raw',
  39701. selector: 'hr',
  39702. schema: {
  39703. hr: {}
  39704. }
  39705. }]
  39706. };
  39707. /* harmony default export */ var separator_transforms = (separator_transforms_transforms);
  39708. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js
  39709. /**
  39710. * External dependencies
  39711. */
  39712. /**
  39713. * WordPress dependencies
  39714. */
  39715. const separator_deprecated_v1 = {
  39716. attributes: {
  39717. color: {
  39718. type: 'string'
  39719. },
  39720. customColor: {
  39721. type: 'string'
  39722. }
  39723. },
  39724. save(_ref) {
  39725. let {
  39726. attributes
  39727. } = _ref;
  39728. const {
  39729. color,
  39730. customColor
  39731. } = attributes; // the hr support changing color using border-color, since border-color
  39732. // is not yet supported in the color palette, we use background-color
  39733. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is
  39734. // using color, not backgroundColor
  39735. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
  39736. const className = classnames_default()({
  39737. 'has-text-color has-background': color || customColor,
  39738. [backgroundClass]: backgroundClass,
  39739. [colorClass]: colorClass
  39740. });
  39741. const style = {
  39742. backgroundColor: backgroundClass ? undefined : customColor,
  39743. color: colorClass ? undefined : customColor
  39744. };
  39745. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39746. className,
  39747. style
  39748. }));
  39749. },
  39750. migrate(attributes) {
  39751. const {
  39752. color,
  39753. customColor,
  39754. ...restAttributes
  39755. } = attributes;
  39756. return { ...restAttributes,
  39757. backgroundColor: color ? color : undefined,
  39758. opacity: 'css',
  39759. style: customColor ? {
  39760. color: {
  39761. background: customColor
  39762. }
  39763. } : undefined
  39764. };
  39765. }
  39766. };
  39767. /* harmony default export */ var separator_deprecated = ([separator_deprecated_v1]);
  39768. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  39769. /**
  39770. * WordPress dependencies
  39771. */
  39772. /**
  39773. * Internal dependencies
  39774. */
  39775. const separator_metadata = {
  39776. $schema: "https://schemas.wp.org/trunk/block.json",
  39777. apiVersion: 2,
  39778. name: "core/separator",
  39779. title: "Separator",
  39780. category: "design",
  39781. description: "Create a break between ideas or sections with a horizontal separator.",
  39782. keywords: ["horizontal-line", "hr", "divider"],
  39783. textdomain: "default",
  39784. attributes: {
  39785. opacity: {
  39786. type: "string",
  39787. "default": "alpha-channel"
  39788. }
  39789. },
  39790. supports: {
  39791. anchor: true,
  39792. align: ["center", "wide", "full"],
  39793. color: {
  39794. enableContrastChecker: false,
  39795. __experimentalSkipSerialization: true,
  39796. gradients: true,
  39797. background: true,
  39798. text: false,
  39799. __experimentalDefaultControls: {
  39800. background: true
  39801. }
  39802. },
  39803. spacing: {
  39804. margin: ["top", "bottom"]
  39805. }
  39806. },
  39807. styles: [{
  39808. name: "default",
  39809. label: "Default",
  39810. isDefault: true
  39811. }, {
  39812. name: "wide",
  39813. label: "Wide Line"
  39814. }, {
  39815. name: "dots",
  39816. label: "Dots"
  39817. }],
  39818. editorStyle: "wp-block-separator-editor",
  39819. style: "wp-block-separator"
  39820. };
  39821. const {
  39822. name: separator_name
  39823. } = separator_metadata;
  39824. const separator_settings = {
  39825. icon: library_separator,
  39826. example: {
  39827. attributes: {
  39828. customColor: '#065174',
  39829. className: 'is-style-wide'
  39830. }
  39831. },
  39832. transforms: separator_transforms,
  39833. edit: SeparatorEdit,
  39834. save: separatorSave,
  39835. deprecated: separator_deprecated
  39836. };
  39837. const separator_init = () => initBlock({
  39838. name: separator_name,
  39839. metadata: separator_metadata,
  39840. settings: separator_settings
  39841. });
  39842. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
  39843. /**
  39844. * WordPress dependencies
  39845. */
  39846. const shortcode = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39847. viewBox: "0 0 24 24",
  39848. xmlns: "http://www.w3.org/2000/svg"
  39849. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39850. d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
  39851. }));
  39852. /* harmony default export */ var library_shortcode = (shortcode);
  39853. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
  39854. /**
  39855. * WordPress dependencies
  39856. */
  39857. function ShortcodeEdit(_ref) {
  39858. let {
  39859. attributes,
  39860. setAttributes
  39861. } = _ref;
  39862. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
  39863. const inputId = `blocks-shortcode-input-${instanceId}`;
  39864. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39865. className: 'components-placeholder'
  39866. }), (0,external_wp_element_namespaceObject.createElement)("label", {
  39867. htmlFor: inputId,
  39868. className: "components-placeholder__label"
  39869. }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
  39870. icon: library_shortcode
  39871. }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  39872. className: "blocks-shortcode__textarea",
  39873. id: inputId,
  39874. value: attributes.text,
  39875. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
  39876. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
  39877. onChange: text => setAttributes({
  39878. text
  39879. })
  39880. }));
  39881. }
  39882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
  39883. /**
  39884. * WordPress dependencies
  39885. */
  39886. function shortcode_save_save(_ref) {
  39887. let {
  39888. attributes
  39889. } = _ref;
  39890. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text);
  39891. }
  39892. ;// CONCATENATED MODULE: external ["wp","autop"]
  39893. var external_wp_autop_namespaceObject = window["wp"]["autop"];
  39894. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
  39895. /**
  39896. * WordPress dependencies
  39897. */
  39898. const shortcode_transforms_transforms = {
  39899. from: [{
  39900. type: 'shortcode',
  39901. // Per "Shortcode names should be all lowercase and use all
  39902. // letters, but numbers and underscores should work fine too.
  39903. // Be wary of using hyphens (dashes), you'll be better off not
  39904. // using them." in https://codex.wordpress.org/Shortcode_API
  39905. // Require that the first character be a letter. This notably
  39906. // prevents footnote markings ([1]) from being caught as
  39907. // shortcodes.
  39908. tag: '[a-z][a-z0-9_-]*',
  39909. attributes: {
  39910. text: {
  39911. type: 'string',
  39912. shortcode: (attrs, _ref) => {
  39913. let {
  39914. content
  39915. } = _ref;
  39916. return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
  39917. }
  39918. }
  39919. },
  39920. priority: 20
  39921. }]
  39922. };
  39923. /* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);
  39924. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  39925. /**
  39926. * WordPress dependencies
  39927. */
  39928. /**
  39929. * Internal dependencies
  39930. */
  39931. const shortcode_metadata = {
  39932. $schema: "https://schemas.wp.org/trunk/block.json",
  39933. apiVersion: 2,
  39934. name: "core/shortcode",
  39935. title: "Shortcode",
  39936. category: "widgets",
  39937. description: "Insert additional custom elements with a WordPress shortcode.",
  39938. textdomain: "default",
  39939. attributes: {
  39940. text: {
  39941. type: "string",
  39942. source: "html"
  39943. }
  39944. },
  39945. supports: {
  39946. className: false,
  39947. customClassName: false,
  39948. html: false
  39949. },
  39950. editorStyle: "wp-block-shortcode-editor"
  39951. };
  39952. const {
  39953. name: shortcode_name
  39954. } = shortcode_metadata;
  39955. const shortcode_settings = {
  39956. icon: library_shortcode,
  39957. transforms: shortcode_transforms,
  39958. edit: ShortcodeEdit,
  39959. save: shortcode_save_save
  39960. };
  39961. const shortcode_init = () => initBlock({
  39962. name: shortcode_name,
  39963. metadata: shortcode_metadata,
  39964. settings: shortcode_settings
  39965. });
  39966. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
  39967. /**
  39968. * WordPress dependencies
  39969. */
  39970. const siteLogo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39971. xmlns: "http://www.w3.org/2000/svg",
  39972. viewBox: "0 0 24 24"
  39973. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39974. d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
  39975. }));
  39976. /* harmony default export */ var site_logo = (siteLogo);
  39977. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
  39978. /**
  39979. * External dependencies
  39980. */
  39981. /**
  39982. * WordPress dependencies
  39983. */
  39984. /**
  39985. * Internal dependencies
  39986. */
  39987. /**
  39988. * Module constants
  39989. */
  39990. const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
  39991. const ACCEPT_MEDIA_STRING = 'image/*';
  39992. const SiteLogo = _ref => {
  39993. let {
  39994. alt,
  39995. attributes: {
  39996. align,
  39997. width,
  39998. height,
  39999. isLink,
  40000. linkTarget,
  40001. shouldSyncIcon
  40002. },
  40003. containerRef,
  40004. isSelected,
  40005. setAttributes,
  40006. setLogo,
  40007. logoUrl,
  40008. siteUrl,
  40009. logoId,
  40010. iconId,
  40011. setIcon,
  40012. canUserEdit
  40013. } = _ref;
  40014. const clientWidth = useClientWidth(containerRef, [align]);
  40015. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  40016. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  40017. const isResizable = !isWideAligned && isLargeViewport;
  40018. const [{
  40019. naturalWidth,
  40020. naturalHeight
  40021. }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  40022. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  40023. const {
  40024. toggleSelection
  40025. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  40026. const classes = classnames_default()('custom-logo-link', {
  40027. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl)
  40028. });
  40029. const {
  40030. imageEditing,
  40031. maxWidth,
  40032. title
  40033. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40034. const {
  40035. getSettings
  40036. } = select(external_wp_blockEditor_namespaceObject.store);
  40037. const siteEntities = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site');
  40038. return {
  40039. title: siteEntities.title,
  40040. ...(0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'maxWidth'])
  40041. };
  40042. }, []);
  40043. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40044. // Turn the `Use as site icon` toggle off if it is on but the logo and icon have
  40045. // fallen out of sync. This can happen if the toggle is saved in the `on` position,
  40046. // but changes are later made to the site icon in the Customizer.
  40047. if (shouldSyncIcon && logoId !== iconId) {
  40048. setAttributes({
  40049. shouldSyncIcon: false
  40050. });
  40051. }
  40052. }, []);
  40053. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40054. if (!isSelected) {
  40055. setIsEditingImage(false);
  40056. }
  40057. }, [isSelected]);
  40058. function onResizeStart() {
  40059. toggleSelection(false);
  40060. }
  40061. function onResizeStop() {
  40062. toggleSelection(true);
  40063. }
  40064. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  40065. className: "custom-logo",
  40066. src: logoUrl,
  40067. alt: alt,
  40068. onLoad: event => {
  40069. setNaturalSize((0,external_lodash_namespaceObject.pick)(event.target, ['naturalWidth', 'naturalHeight']));
  40070. }
  40071. });
  40072. let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
  40073. // should direct focus to block.
  40074. if (isLink) {
  40075. imgWrapper =
  40076. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  40077. (0,external_wp_element_namespaceObject.createElement)("a", {
  40078. href: siteUrl,
  40079. className: classes,
  40080. rel: "home",
  40081. title: title,
  40082. onClick: event => event.preventDefault()
  40083. }, img)
  40084. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  40085. ;
  40086. }
  40087. let imageWidthWithinContainer;
  40088. if (clientWidth && naturalWidth && naturalHeight) {
  40089. const exceedMaxWidth = naturalWidth > clientWidth;
  40090. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  40091. }
  40092. if (!isResizable || !imageWidthWithinContainer) {
  40093. return (0,external_wp_element_namespaceObject.createElement)("div", {
  40094. style: {
  40095. width,
  40096. height
  40097. }
  40098. }, imgWrapper);
  40099. } // Set the default width to a responsible size.
  40100. // Note that this width is also set in the attached frontend CSS file.
  40101. const defaultWidth = 120;
  40102. const currentWidth = width || defaultWidth;
  40103. const ratio = naturalWidth / naturalHeight;
  40104. const currentHeight = currentWidth / ratio;
  40105. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : Math.ceil(MIN_SIZE * ratio);
  40106. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : Math.ceil(MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an
  40107. // explicit pixel value for the max-width. In absence of being able to
  40108. // set the content-width, this max-width is currently dictated by the
  40109. // vanilla editor style. The following variable adds a buffer to this
  40110. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  40111. // in most cases, allow you to scale the image beyond the width of the
  40112. // main column, though not infinitely.
  40113. // @todo It would be good to revisit this once a content-width variable
  40114. // becomes available.
  40115. const maxWidthBuffer = maxWidth * 2.5;
  40116. let showRightHandle = false;
  40117. let showLeftHandle = false;
  40118. /* eslint-disable no-lonely-if */
  40119. // See https://github.com/WordPress/gutenberg/issues/7584.
  40120. if (align === 'center') {
  40121. // When the image is centered, show both handles.
  40122. showRightHandle = true;
  40123. showLeftHandle = true;
  40124. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  40125. // In RTL mode the image is on the right by default.
  40126. // Show the right handle and hide the left handle only when it is
  40127. // aligned left. Otherwise always show the left handle.
  40128. if (align === 'left') {
  40129. showRightHandle = true;
  40130. } else {
  40131. showLeftHandle = true;
  40132. }
  40133. } else {
  40134. // Show the left handle and hide the right handle only when the
  40135. // image is aligned right. Otherwise always show the right handle.
  40136. if (align === 'right') {
  40137. showLeftHandle = true;
  40138. } else {
  40139. showRightHandle = true;
  40140. }
  40141. }
  40142. /* eslint-enable no-lonely-if */
  40143. const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
  40144. const imgEdit = canEditImage && isEditingImage ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  40145. id: logoId,
  40146. url: logoUrl,
  40147. naturalWidth: naturalWidth,
  40148. naturalHeight: naturalHeight,
  40149. clientWidth: clientWidth,
  40150. onSaveImage: imageAttributes => {
  40151. setLogo(imageAttributes.id);
  40152. },
  40153. isEditing: isEditingImage,
  40154. onFinishEditing: () => setIsEditingImage(false)
  40155. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  40156. url: logoUrl,
  40157. width: currentWidth,
  40158. height: currentHeight,
  40159. clientWidth: clientWidth,
  40160. naturalHeight: naturalHeight,
  40161. naturalWidth: naturalWidth
  40162. })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  40163. size: {
  40164. width: currentWidth,
  40165. height: currentHeight
  40166. },
  40167. showHandle: isSelected,
  40168. minWidth: minWidth,
  40169. maxWidth: maxWidthBuffer,
  40170. minHeight: minHeight,
  40171. maxHeight: maxWidthBuffer / ratio,
  40172. lockAspectRatio: true,
  40173. enable: {
  40174. top: false,
  40175. right: showRightHandle,
  40176. bottom: true,
  40177. left: showLeftHandle
  40178. },
  40179. onResizeStart: onResizeStart,
  40180. onResizeStop: (event, direction, elt, delta) => {
  40181. onResizeStop();
  40182. setAttributes({
  40183. width: parseInt(currentWidth + delta.width, 10),
  40184. height: parseInt(currentHeight + delta.height, 10)
  40185. });
  40186. }
  40187. }, imgWrapper);
  40188. const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
  40189. a: // eslint-disable-next-line jsx-a11y/anchor-has-content
  40190. (0,external_wp_element_namespaceObject.createElement)("a", {
  40191. href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
  40192. target: "_blank",
  40193. rel: "noopener noreferrer"
  40194. })
  40195. });
  40196. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  40197. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  40198. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  40199. label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
  40200. onChange: newWidth => setAttributes({
  40201. width: newWidth
  40202. }),
  40203. min: minWidth,
  40204. max: maxWidthBuffer,
  40205. initialPosition: Math.min(defaultWidth, maxWidthBuffer),
  40206. value: width || '',
  40207. disabled: !isResizable
  40208. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40209. label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
  40210. onChange: () => setAttributes({
  40211. isLink: !isLink
  40212. }),
  40213. checked: isLink
  40214. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40215. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  40216. onChange: value => setAttributes({
  40217. linkTarget: value ? '_blank' : '_self'
  40218. }),
  40219. checked: linkTarget === '_blank'
  40220. })), canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40221. label: (0,external_wp_i18n_namespaceObject.__)('Use as site icon'),
  40222. onChange: value => {
  40223. setAttributes({
  40224. shouldSyncIcon: value
  40225. });
  40226. setIcon(value ? logoId : undefined);
  40227. },
  40228. checked: !!shouldSyncIcon,
  40229. help: syncSiteIconHelpText
  40230. })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40231. group: "block"
  40232. }, canEditImage && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  40233. onClick: () => setIsEditingImage(true),
  40234. icon: library_crop,
  40235. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  40236. })), imgEdit);
  40237. };
  40238. function LogoEdit(_ref2) {
  40239. let {
  40240. attributes,
  40241. className,
  40242. setAttributes,
  40243. isSelected
  40244. } = _ref2;
  40245. const {
  40246. width,
  40247. shouldSyncIcon
  40248. } = attributes;
  40249. const ref = (0,external_wp_element_namespaceObject.useRef)();
  40250. const {
  40251. siteLogoId,
  40252. canUserEdit,
  40253. url,
  40254. siteIconId,
  40255. mediaItemData,
  40256. isRequestingMediaItem
  40257. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40258. const {
  40259. canUser,
  40260. getEntityRecord,
  40261. getEditedEntityRecord
  40262. } = select(external_wp_coreData_namespaceObject.store);
  40263. const siteSettings = getEditedEntityRecord('root', 'site');
  40264. const siteData = getEntityRecord('root', '__unstableBase');
  40265. const _siteLogo = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_logo;
  40266. const _readOnlyLogo = siteData === null || siteData === void 0 ? void 0 : siteData.site_logo;
  40267. const _canUserEdit = canUser('update', 'settings');
  40268. const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
  40269. const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
  40270. const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
  40271. context: 'view'
  40272. });
  40273. const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
  40274. context: 'view'
  40275. }]);
  40276. return {
  40277. siteLogoId: _siteLogoId,
  40278. canUserEdit: _canUserEdit,
  40279. url: siteData === null || siteData === void 0 ? void 0 : siteData.url,
  40280. mediaItemData: mediaItem,
  40281. isRequestingMediaItem: _isRequestingMediaItem,
  40282. siteIconId: _siteIconId
  40283. };
  40284. }, []);
  40285. const {
  40286. editEntityRecord
  40287. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  40288. const setLogo = function (newValue) {
  40289. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  40290. // `shouldForceSync` is used to force syncing when the attribute
  40291. // may not have updated yet.
  40292. if (shouldSyncIcon || shouldForceSync) {
  40293. setIcon(newValue);
  40294. }
  40295. editEntityRecord('root', 'site', undefined, {
  40296. site_logo: newValue
  40297. });
  40298. };
  40299. const setIcon = newValue => // The new value needs to be `null` to reset the Site Icon.
  40300. editEntityRecord('root', 'site', undefined, {
  40301. site_icon: newValue !== null && newValue !== void 0 ? newValue : null
  40302. });
  40303. const {
  40304. alt_text: alt,
  40305. source_url: logoUrl
  40306. } = mediaItemData !== null && mediaItemData !== void 0 ? mediaItemData : {};
  40307. const onInitialSelectLogo = media => {
  40308. // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
  40309. // site icon, automatically sync the logo to the icon.
  40310. if (shouldSyncIcon === undefined) {
  40311. const shouldForceSync = !siteIconId;
  40312. setAttributes({
  40313. shouldSyncIcon: shouldForceSync
  40314. }); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
  40315. // the time `setLogo` is called, pass an argument to force the syncing.
  40316. onSelectLogo(media, shouldForceSync);
  40317. return;
  40318. }
  40319. onSelectLogo(media);
  40320. };
  40321. const onSelectLogo = function (media) {
  40322. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  40323. if (!media) {
  40324. return;
  40325. }
  40326. if (!media.id && media.url) {
  40327. // This is a temporary blob image.
  40328. setLogo(undefined);
  40329. return;
  40330. }
  40331. setLogo(media.id, shouldForceSync);
  40332. };
  40333. const onRemoveLogo = () => {
  40334. setLogo(null);
  40335. setAttributes({
  40336. width: undefined
  40337. });
  40338. };
  40339. const {
  40340. createErrorNotice
  40341. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  40342. const onUploadError = message => {
  40343. createErrorNotice(message, {
  40344. type: 'snackbar'
  40345. });
  40346. };
  40347. const controls = canUserEdit && logoUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40348. group: "other"
  40349. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  40350. mediaURL: logoUrl,
  40351. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  40352. accept: ACCEPT_MEDIA_STRING,
  40353. onSelect: onSelectLogo,
  40354. onError: onUploadError
  40355. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  40356. onClick: onRemoveLogo
  40357. }, (0,external_wp_i18n_namespaceObject.__)('Reset'))));
  40358. let logoImage;
  40359. const isLoading = siteLogoId === undefined || isRequestingMediaItem;
  40360. if (isLoading) {
  40361. logoImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
  40362. }
  40363. if (!!logoUrl) {
  40364. logoImage = (0,external_wp_element_namespaceObject.createElement)(SiteLogo, {
  40365. alt: alt,
  40366. attributes: attributes,
  40367. className: className,
  40368. containerRef: ref,
  40369. isSelected: isSelected,
  40370. setAttributes: setAttributes,
  40371. logoUrl: logoUrl,
  40372. setLogo: setLogo,
  40373. logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
  40374. siteUrl: url,
  40375. setIcon: setIcon,
  40376. iconId: siteIconId,
  40377. canUserEdit: canUserEdit
  40378. });
  40379. }
  40380. const placeholder = content => {
  40381. const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
  40382. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  40383. className: placeholderClassName,
  40384. preview: logoImage,
  40385. withIllustration: true
  40386. }, content);
  40387. };
  40388. const classes = classnames_default()(className, {
  40389. 'is-default-size': !width
  40390. });
  40391. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40392. ref,
  40393. className: classes
  40394. });
  40395. const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo');
  40396. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  40397. className: "site-logo_placeholder"
  40398. }, !!isLoading && (0,external_wp_element_namespaceObject.createElement)("span", {
  40399. className: "components-placeholder__preview"
  40400. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  40401. onSelect: onInitialSelectLogo,
  40402. accept: ACCEPT_MEDIA_STRING,
  40403. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  40404. onError: onUploadError,
  40405. placeholder: placeholder,
  40406. mediaLibraryButton: _ref3 => {
  40407. let {
  40408. open
  40409. } = _ref3;
  40410. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40411. icon: library_upload,
  40412. variant: "primary",
  40413. label: label,
  40414. showTooltip: true,
  40415. tooltipPosition: "top center",
  40416. onClick: () => {
  40417. open();
  40418. }
  40419. });
  40420. }
  40421. }));
  40422. }
  40423. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js
  40424. /**
  40425. * WordPress dependencies
  40426. */
  40427. const site_logo_transforms_transforms = {
  40428. to: [{
  40429. type: 'block',
  40430. blocks: ['core/site-title'],
  40431. transform: _ref => {
  40432. let {
  40433. isLink,
  40434. linkTarget
  40435. } = _ref;
  40436. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', {
  40437. isLink,
  40438. linkTarget
  40439. });
  40440. }
  40441. }]
  40442. };
  40443. /* harmony default export */ var site_logo_transforms = (site_logo_transforms_transforms);
  40444. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  40445. /**
  40446. * WordPress dependencies
  40447. */
  40448. /**
  40449. * Internal dependencies
  40450. */
  40451. const site_logo_metadata = {
  40452. $schema: "https://schemas.wp.org/trunk/block.json",
  40453. apiVersion: 2,
  40454. name: "core/site-logo",
  40455. title: "Site Logo",
  40456. category: "theme",
  40457. description: "Display a graphic to represent this site. Update the block, and the changes apply everywhere it\u2019s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
  40458. textdomain: "default",
  40459. attributes: {
  40460. width: {
  40461. type: "number"
  40462. },
  40463. isLink: {
  40464. type: "boolean",
  40465. "default": true
  40466. },
  40467. linkTarget: {
  40468. type: "string",
  40469. "default": "_self"
  40470. },
  40471. shouldSyncIcon: {
  40472. type: "boolean"
  40473. }
  40474. },
  40475. example: {
  40476. viewportWidth: 500,
  40477. attributes: {
  40478. width: 350,
  40479. className: "block-editor-block-types-list__site-logo-example"
  40480. }
  40481. },
  40482. supports: {
  40483. html: false,
  40484. align: true,
  40485. alignWide: false,
  40486. color: {
  40487. __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before",
  40488. text: false,
  40489. background: false
  40490. },
  40491. spacing: {
  40492. margin: true,
  40493. padding: true
  40494. }
  40495. },
  40496. styles: [{
  40497. name: "default",
  40498. label: "Default",
  40499. isDefault: true
  40500. }, {
  40501. name: "rounded",
  40502. label: "Rounded"
  40503. }],
  40504. editorStyle: "wp-block-site-logo-editor",
  40505. style: "wp-block-site-logo"
  40506. };
  40507. const {
  40508. name: site_logo_name
  40509. } = site_logo_metadata;
  40510. const site_logo_settings = {
  40511. icon: site_logo,
  40512. edit: LogoEdit,
  40513. transforms: site_logo_transforms
  40514. };
  40515. const site_logo_init = () => initBlock({
  40516. name: site_logo_name,
  40517. metadata: site_logo_metadata,
  40518. settings: site_logo_settings
  40519. });
  40520. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
  40521. /**
  40522. * External dependencies
  40523. */
  40524. /**
  40525. * WordPress dependencies
  40526. */
  40527. function SiteTaglineEdit(_ref) {
  40528. let {
  40529. attributes,
  40530. setAttributes,
  40531. insertBlocksAfter
  40532. } = _ref;
  40533. const {
  40534. textAlign
  40535. } = attributes;
  40536. const [siteTagline, setSiteTagline] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'description');
  40537. const {
  40538. canUserEdit,
  40539. readOnlySiteTagLine
  40540. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40541. const {
  40542. canUser,
  40543. getEntityRecord
  40544. } = select(external_wp_coreData_namespaceObject.store);
  40545. const siteData = getEntityRecord('root', '__unstableBase');
  40546. return {
  40547. canUserEdit: canUser('update', 'settings'),
  40548. readOnlySiteTagLine: siteData === null || siteData === void 0 ? void 0 : siteData.description
  40549. };
  40550. }, []);
  40551. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40552. className: classnames_default()({
  40553. [`has-text-align-${textAlign}`]: textAlign,
  40554. 'wp-block-site-tagline__placeholder': !canUserEdit && !readOnlySiteTagLine
  40555. })
  40556. });
  40557. const siteTaglineContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  40558. allowedFormats: [],
  40559. onChange: setSiteTagline,
  40560. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
  40561. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
  40562. tagName: "p",
  40563. value: siteTagline,
  40564. disableLineBreaks: true,
  40565. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  40566. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)("p", blockProps, readOnlySiteTagLine || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder'));
  40567. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40568. group: "block"
  40569. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  40570. onChange: newAlign => setAttributes({
  40571. textAlign: newAlign
  40572. }),
  40573. value: textAlign
  40574. })), siteTaglineContent);
  40575. }
  40576. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
  40577. /**
  40578. * WordPress dependencies
  40579. */
  40580. /* harmony default export */ var icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  40581. xmlns: "http://www.w3.org/2000/svg",
  40582. width: "24",
  40583. height: "24"
  40584. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40585. fill: "none",
  40586. d: "M0 0h24v24H0z"
  40587. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40588. d: "M4 9h16v2H4V9zm0 4h10v2H4v-2z"
  40589. })));
  40590. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
  40591. /**
  40592. * Internal dependencies
  40593. */
  40594. const site_tagline_deprecated_v1 = {
  40595. attributes: {
  40596. textAlign: {
  40597. type: 'string'
  40598. }
  40599. },
  40600. supports: {
  40601. align: ['wide', 'full'],
  40602. html: false,
  40603. color: {
  40604. gradients: true
  40605. },
  40606. spacing: {
  40607. margin: true,
  40608. padding: true
  40609. },
  40610. typography: {
  40611. fontSize: true,
  40612. lineHeight: true,
  40613. __experimentalFontFamily: true,
  40614. __experimentalTextTransform: true,
  40615. __experimentalFontStyle: true,
  40616. __experimentalFontWeight: true,
  40617. __experimentalLetterSpacing: true
  40618. }
  40619. },
  40620. save() {
  40621. return null;
  40622. },
  40623. migrate: migrate_font_family,
  40624. isEligible(_ref) {
  40625. var _style$typography;
  40626. let {
  40627. style
  40628. } = _ref;
  40629. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  40630. }
  40631. };
  40632. /**
  40633. * New deprecations need to be placed first
  40634. * for them to have higher priority.
  40635. *
  40636. * Old deprecations may need to be updated as well.
  40637. *
  40638. * See block-deprecation.md
  40639. */
  40640. /* harmony default export */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);
  40641. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  40642. /**
  40643. * Internal dependencies
  40644. */
  40645. const site_tagline_metadata = {
  40646. $schema: "https://schemas.wp.org/trunk/block.json",
  40647. apiVersion: 2,
  40648. name: "core/site-tagline",
  40649. title: "Site Tagline",
  40650. category: "theme",
  40651. description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
  40652. keywords: ["description"],
  40653. textdomain: "default",
  40654. attributes: {
  40655. textAlign: {
  40656. type: "string"
  40657. }
  40658. },
  40659. supports: {
  40660. align: ["wide", "full"],
  40661. html: false,
  40662. color: {
  40663. gradients: true,
  40664. __experimentalDefaultControls: {
  40665. background: true,
  40666. text: true
  40667. }
  40668. },
  40669. spacing: {
  40670. margin: true,
  40671. padding: true
  40672. },
  40673. typography: {
  40674. fontSize: true,
  40675. lineHeight: true,
  40676. __experimentalFontFamily: true,
  40677. __experimentalTextTransform: true,
  40678. __experimentalTextDecoration: true,
  40679. __experimentalFontStyle: true,
  40680. __experimentalFontWeight: true,
  40681. __experimentalLetterSpacing: true,
  40682. __experimentalDefaultControls: {
  40683. fontSize: true
  40684. }
  40685. }
  40686. },
  40687. editorStyle: "wp-block-site-tagline-editor"
  40688. };
  40689. const {
  40690. name: site_tagline_name
  40691. } = site_tagline_metadata;
  40692. const site_tagline_settings = {
  40693. icon: icon,
  40694. edit: SiteTaglineEdit,
  40695. deprecated: site_tagline_deprecated
  40696. };
  40697. const site_tagline_init = () => initBlock({
  40698. name: site_tagline_name,
  40699. metadata: site_tagline_metadata,
  40700. settings: site_tagline_settings
  40701. });
  40702. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
  40703. /**
  40704. * WordPress dependencies
  40705. */
  40706. const mapMarker = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  40707. xmlns: "https://www.w3.org/2000/svg",
  40708. viewBox: "0 0 24 24"
  40709. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  40710. d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
  40711. }));
  40712. /* harmony default export */ var map_marker = (mapMarker);
  40713. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
  40714. /**
  40715. * WordPress dependencies
  40716. */
  40717. function LevelIcon(_ref) {
  40718. let {
  40719. level,
  40720. isPressed = false
  40721. } = _ref;
  40722. if (level === 0) return library_paragraph;
  40723. const levelToPath = {
  40724. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  40725. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  40726. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  40727. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  40728. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  40729. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  40730. };
  40731. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  40732. width: "20",
  40733. height: "20",
  40734. viewBox: "0 0 20 20",
  40735. xmlns: "http://www.w3.org/2000/svg",
  40736. isPressed: isPressed
  40737. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40738. d: levelToPath[level]
  40739. }));
  40740. }
  40741. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
  40742. /**
  40743. * WordPress dependencies
  40744. */
  40745. /**
  40746. * Internal dependencies
  40747. */
  40748. function LevelControl(_ref) {
  40749. let {
  40750. level,
  40751. onChange
  40752. } = _ref;
  40753. const allControls = [1, 2, 3, 4, 5, 6, 0].map(currentLevel => {
  40754. const isActive = currentLevel === level;
  40755. return {
  40756. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  40757. level: currentLevel,
  40758. isPressed: isActive
  40759. }),
  40760. title: currentLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
  40761. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Heading %d'), currentLevel),
  40762. isActive,
  40763. onClick: () => onChange(currentLevel),
  40764. role: 'menuitemradio'
  40765. };
  40766. });
  40767. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  40768. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  40769. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  40770. level: level
  40771. }),
  40772. controls: allControls
  40773. });
  40774. }
  40775. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
  40776. /**
  40777. * External dependencies
  40778. */
  40779. /**
  40780. * WordPress dependencies
  40781. */
  40782. /**
  40783. * Internal dependencies
  40784. */
  40785. function SiteTitleEdit(_ref) {
  40786. let {
  40787. attributes,
  40788. setAttributes,
  40789. insertBlocksAfter
  40790. } = _ref;
  40791. const {
  40792. level,
  40793. textAlign,
  40794. isLink,
  40795. linkTarget
  40796. } = attributes;
  40797. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'title');
  40798. const {
  40799. canUserEdit,
  40800. readOnlyTitle
  40801. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40802. const {
  40803. canUser,
  40804. getEntityRecord
  40805. } = select(external_wp_coreData_namespaceObject.store);
  40806. const siteData = getEntityRecord('root', '__unstableBase');
  40807. return {
  40808. canUserEdit: canUser('update', 'settings'),
  40809. readOnlyTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteData === null || siteData === void 0 ? void 0 : siteData.name)
  40810. };
  40811. }, []);
  40812. const TagName = level === 0 ? 'p' : `h${level}`;
  40813. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40814. className: classnames_default()({
  40815. [`has-text-align-${textAlign}`]: textAlign,
  40816. 'wp-block-site-title__placeholder': !canUserEdit && !readOnlyTitle
  40817. })
  40818. });
  40819. const siteTitleContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  40820. tagName: isLink ? 'a' : 'span',
  40821. href: isLink ? '#site-title-pseudo-link' : undefined,
  40822. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
  40823. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
  40824. value: title,
  40825. onChange: setTitle,
  40826. allowedFormats: [],
  40827. disableLineBreaks: true,
  40828. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  40829. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  40830. href: "#site-title-pseudo-link",
  40831. onClick: event => event.preventDefault()
  40832. }, readOnlyTitle || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_wp_element_namespaceObject.createElement)("span", null, title || readOnlyTitle));
  40833. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40834. group: "block"
  40835. }, (0,external_wp_element_namespaceObject.createElement)(LevelControl, {
  40836. level: level,
  40837. onChange: newLevel => setAttributes({
  40838. level: newLevel
  40839. })
  40840. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  40841. value: textAlign,
  40842. onChange: nextAlign => {
  40843. setAttributes({
  40844. textAlign: nextAlign
  40845. });
  40846. }
  40847. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  40848. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  40849. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40850. label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
  40851. onChange: () => setAttributes({
  40852. isLink: !isLink
  40853. }),
  40854. checked: isLink
  40855. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40856. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  40857. onChange: value => setAttributes({
  40858. linkTarget: value ? '_blank' : '_self'
  40859. }),
  40860. checked: linkTarget === '_blank'
  40861. }))), siteTitleContent);
  40862. }
  40863. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
  40864. /**
  40865. * Internal dependencies
  40866. */
  40867. const site_title_deprecated_v1 = {
  40868. attributes: {
  40869. level: {
  40870. type: 'number',
  40871. default: 1
  40872. },
  40873. textAlign: {
  40874. type: 'string'
  40875. },
  40876. isLink: {
  40877. type: 'boolean',
  40878. default: true
  40879. },
  40880. linkTarget: {
  40881. type: 'string',
  40882. default: '_self'
  40883. }
  40884. },
  40885. supports: {
  40886. align: ['wide', 'full'],
  40887. html: false,
  40888. color: {
  40889. gradients: true,
  40890. link: true
  40891. },
  40892. spacing: {
  40893. padding: true,
  40894. margin: true
  40895. },
  40896. typography: {
  40897. fontSize: true,
  40898. lineHeight: true,
  40899. __experimentalFontFamily: true,
  40900. __experimentalTextTransform: true,
  40901. __experimentalFontStyle: true,
  40902. __experimentalFontWeight: true,
  40903. __experimentalLetterSpacing: true
  40904. }
  40905. },
  40906. save() {
  40907. return null;
  40908. },
  40909. migrate: migrate_font_family,
  40910. isEligible(_ref) {
  40911. var _style$typography;
  40912. let {
  40913. style
  40914. } = _ref;
  40915. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  40916. }
  40917. };
  40918. /**
  40919. * New deprecations need to be placed first
  40920. * for them to have higher priority.
  40921. *
  40922. * Old deprecations may need to be updated as well.
  40923. *
  40924. * See block-deprecation.md
  40925. */
  40926. /* harmony default export */ var site_title_deprecated = ([site_title_deprecated_v1]);
  40927. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js
  40928. /**
  40929. * WordPress dependencies
  40930. */
  40931. const site_title_transforms_transforms = {
  40932. to: [{
  40933. type: 'block',
  40934. blocks: ['core/site-logo'],
  40935. transform: _ref => {
  40936. let {
  40937. isLink,
  40938. linkTarget
  40939. } = _ref;
  40940. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', {
  40941. isLink,
  40942. linkTarget
  40943. });
  40944. }
  40945. }]
  40946. };
  40947. /* harmony default export */ var site_title_transforms = (site_title_transforms_transforms);
  40948. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  40949. /**
  40950. * WordPress dependencies
  40951. */
  40952. /**
  40953. * Internal dependencies
  40954. */
  40955. const site_title_metadata = {
  40956. $schema: "https://schemas.wp.org/trunk/block.json",
  40957. apiVersion: 2,
  40958. name: "core/site-title",
  40959. title: "Site Title",
  40960. category: "theme",
  40961. description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",
  40962. textdomain: "default",
  40963. attributes: {
  40964. level: {
  40965. type: "number",
  40966. "default": 1
  40967. },
  40968. textAlign: {
  40969. type: "string"
  40970. },
  40971. isLink: {
  40972. type: "boolean",
  40973. "default": true
  40974. },
  40975. linkTarget: {
  40976. type: "string",
  40977. "default": "_self"
  40978. }
  40979. },
  40980. example: {
  40981. viewportWidth: 500
  40982. },
  40983. supports: {
  40984. align: ["wide", "full"],
  40985. html: false,
  40986. color: {
  40987. gradients: true,
  40988. link: true,
  40989. __experimentalDefaultControls: {
  40990. background: true,
  40991. text: true,
  40992. link: true
  40993. }
  40994. },
  40995. spacing: {
  40996. padding: true,
  40997. margin: true
  40998. },
  40999. typography: {
  41000. fontSize: true,
  41001. lineHeight: true,
  41002. __experimentalFontFamily: true,
  41003. __experimentalTextTransform: true,
  41004. __experimentalTextDecoration: true,
  41005. __experimentalFontStyle: true,
  41006. __experimentalFontWeight: true,
  41007. __experimentalLetterSpacing: true,
  41008. __experimentalDefaultControls: {
  41009. fontSize: true,
  41010. lineHeight: true,
  41011. fontAppearance: true,
  41012. letterSpacing: true,
  41013. textTransform: true
  41014. }
  41015. }
  41016. },
  41017. editorStyle: "wp-block-site-title-editor"
  41018. };
  41019. const {
  41020. name: site_title_name
  41021. } = site_title_metadata;
  41022. const site_title_settings = {
  41023. icon: map_marker,
  41024. edit: SiteTitleEdit,
  41025. transforms: site_title_transforms,
  41026. deprecated: site_title_deprecated
  41027. };
  41028. const site_title_init = () => initBlock({
  41029. name: site_title_name,
  41030. metadata: site_title_metadata,
  41031. settings: site_title_settings
  41032. });
  41033. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
  41034. /**
  41035. * WordPress dependencies
  41036. */
  41037. const share = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41038. viewBox: "0 0 24 24",
  41039. xmlns: "http://www.w3.org/2000/svg"
  41040. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41041. d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
  41042. }));
  41043. /* harmony default export */ var library_share = (share);
  41044. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
  41045. /**
  41046. * WordPress dependencies
  41047. */
  41048. const keyboardReturn = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41049. xmlns: "http://www.w3.org/2000/svg",
  41050. viewBox: "-2 -2 24 24"
  41051. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41052. d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
  41053. }));
  41054. /* harmony default export */ var keyboard_return = (keyboardReturn);
  41055. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js
  41056. /**
  41057. * WordPress dependencies
  41058. */
  41059. const WordPressIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41060. width: "24",
  41061. height: "24",
  41062. viewBox: "0 0 24 24",
  41063. version: "1.1",
  41064. xmlns: "http://www.w3.org/2000/svg"
  41065. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41066. d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
  41067. }));
  41068. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
  41069. /**
  41070. * WordPress dependencies
  41071. */
  41072. const FivehundredpxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41073. width: "24",
  41074. height: "24",
  41075. viewBox: "0 0 24 24",
  41076. version: "1.1"
  41077. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41078. d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
  41079. }));
  41080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
  41081. /**
  41082. * WordPress dependencies
  41083. */
  41084. const AmazonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41085. width: "24",
  41086. height: "24",
  41087. viewBox: "0 0 24 24",
  41088. version: "1.1"
  41089. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41090. d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
  41091. }));
  41092. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
  41093. /**
  41094. * WordPress dependencies
  41095. */
  41096. const BandcampIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41097. width: "24",
  41098. height: "24",
  41099. viewBox: "0 0 24 24",
  41100. version: "1.1"
  41101. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41102. d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
  41103. }));
  41104. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
  41105. /**
  41106. * WordPress dependencies
  41107. */
  41108. const BehanceIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41109. width: "24",
  41110. height: "24",
  41111. viewBox: "0 0 24 24",
  41112. version: "1.1"
  41113. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41114. d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
  41115. }));
  41116. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
  41117. /**
  41118. * WordPress dependencies
  41119. */
  41120. const ChainIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41121. width: "24",
  41122. height: "24",
  41123. viewBox: "0 0 24 24",
  41124. version: "1.1"
  41125. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41126. d: "M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"
  41127. }));
  41128. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
  41129. /**
  41130. * WordPress dependencies
  41131. */
  41132. const CodepenIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41133. width: "24",
  41134. height: "24",
  41135. viewBox: "0 0 24 24",
  41136. version: "1.1"
  41137. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41138. d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
  41139. }));
  41140. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
  41141. /**
  41142. * WordPress dependencies
  41143. */
  41144. const DeviantArtIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41145. width: "24",
  41146. height: "24",
  41147. viewBox: "0 0 24 24",
  41148. version: "1.1"
  41149. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41150. d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
  41151. }));
  41152. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
  41153. /**
  41154. * WordPress dependencies
  41155. */
  41156. const DribbbleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41157. width: "24",
  41158. height: "24",
  41159. viewBox: "0 0 24 24",
  41160. version: "1.1"
  41161. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41162. d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
  41163. }));
  41164. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
  41165. /**
  41166. * WordPress dependencies
  41167. */
  41168. const DropboxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41169. width: "24",
  41170. height: "24",
  41171. viewBox: "0 0 24 24",
  41172. version: "1.1"
  41173. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41174. d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
  41175. }));
  41176. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
  41177. /**
  41178. * WordPress dependencies
  41179. */
  41180. const EtsyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41181. width: "24",
  41182. height: "24",
  41183. viewBox: "0 0 24 24",
  41184. version: "1.1"
  41185. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41186. d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
  41187. }));
  41188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
  41189. /**
  41190. * WordPress dependencies
  41191. */
  41192. const FacebookIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41193. width: "24",
  41194. height: "24",
  41195. viewBox: "0 0 24 24",
  41196. version: "1.1"
  41197. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41198. d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
  41199. }));
  41200. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
  41201. /**
  41202. * WordPress dependencies
  41203. */
  41204. const FeedIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41205. width: "24",
  41206. height: "24",
  41207. viewBox: "0 0 24 24",
  41208. version: "1.1"
  41209. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41210. d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
  41211. }));
  41212. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
  41213. /**
  41214. * WordPress dependencies
  41215. */
  41216. const FlickrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41217. width: "24",
  41218. height: "24",
  41219. viewBox: "0 0 24 24",
  41220. version: "1.1"
  41221. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41222. d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
  41223. }));
  41224. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
  41225. /**
  41226. * WordPress dependencies
  41227. */
  41228. const FoursquareIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41229. width: "24",
  41230. height: "24",
  41231. viewBox: "0 0 24 24",
  41232. version: "1.1"
  41233. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41234. d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
  41235. }));
  41236. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
  41237. /**
  41238. * WordPress dependencies
  41239. */
  41240. const GoodreadsIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41241. width: "24",
  41242. height: "24",
  41243. viewBox: "0 0 24 24",
  41244. version: "1.1"
  41245. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41246. d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
  41247. }));
  41248. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
  41249. /**
  41250. * WordPress dependencies
  41251. */
  41252. const GoogleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41253. width: "24",
  41254. height: "24",
  41255. viewBox: "0 0 24 24",
  41256. version: "1.1"
  41257. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41258. d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
  41259. }));
  41260. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
  41261. /**
  41262. * WordPress dependencies
  41263. */
  41264. const GitHubIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41265. width: "24",
  41266. height: "24",
  41267. viewBox: "0 0 24 24",
  41268. version: "1.1"
  41269. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41270. d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
  41271. }));
  41272. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
  41273. /**
  41274. * WordPress dependencies
  41275. */
  41276. const InstagramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41277. width: "24",
  41278. height: "24",
  41279. viewBox: "0 0 24 24",
  41280. version: "1.1"
  41281. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41282. d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
  41283. }));
  41284. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
  41285. /**
  41286. * WordPress dependencies
  41287. */
  41288. const LastfmIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41289. width: "24",
  41290. height: "24",
  41291. viewBox: "0 0 24 24",
  41292. version: "1.1"
  41293. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41294. d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
  41295. }));
  41296. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
  41297. /**
  41298. * WordPress dependencies
  41299. */
  41300. const LinkedInIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41301. width: "24",
  41302. height: "24",
  41303. viewBox: "0 0 24 24",
  41304. version: "1.1"
  41305. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41306. d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
  41307. }));
  41308. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
  41309. /**
  41310. * WordPress dependencies
  41311. */
  41312. const MailIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41313. width: "24",
  41314. height: "24",
  41315. viewBox: "0 0 24 24",
  41316. version: "1.1"
  41317. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41318. d: "M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"
  41319. }));
  41320. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
  41321. /**
  41322. * WordPress dependencies
  41323. */
  41324. const MastodonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41325. width: "24",
  41326. height: "24",
  41327. viewBox: "0 0 24 24",
  41328. version: "1.1"
  41329. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41330. d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
  41331. }));
  41332. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
  41333. /**
  41334. * WordPress dependencies
  41335. */
  41336. const MeetupIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41337. width: "24",
  41338. height: "24",
  41339. viewBox: "0 0 24 24",
  41340. version: "1.1"
  41341. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41342. d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
  41343. }));
  41344. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
  41345. /**
  41346. * WordPress dependencies
  41347. */
  41348. const MediumIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41349. width: "24",
  41350. height: "24",
  41351. viewBox: "0 0 24 24",
  41352. version: "1.1"
  41353. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41354. d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"
  41355. }));
  41356. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
  41357. /**
  41358. * WordPress dependencies
  41359. */
  41360. const PatreonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41361. width: "24",
  41362. height: "24",
  41363. viewBox: "0 0 569 546",
  41364. version: "1.1"
  41365. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  41366. cx: "363",
  41367. cy: "205",
  41368. r: "205"
  41369. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  41370. width: "100",
  41371. height: "546",
  41372. x: "0",
  41373. y: "0"
  41374. }));
  41375. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
  41376. /**
  41377. * WordPress dependencies
  41378. */
  41379. const PinterestIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41380. width: "24",
  41381. height: "24",
  41382. viewBox: "0 0 24 24",
  41383. version: "1.1"
  41384. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41385. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  41386. }));
  41387. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
  41388. /**
  41389. * WordPress dependencies
  41390. */
  41391. const PocketIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41392. width: "24",
  41393. height: "24",
  41394. viewBox: "0 0 24 24",
  41395. version: "1.1"
  41396. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41397. d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
  41398. }));
  41399. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
  41400. /**
  41401. * WordPress dependencies
  41402. */
  41403. const RedditIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41404. width: "24",
  41405. height: "24",
  41406. viewBox: "0 0 24 24",
  41407. version: "1.1"
  41408. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41409. d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"
  41410. }));
  41411. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
  41412. /**
  41413. * WordPress dependencies
  41414. */
  41415. const SkypeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41416. width: "24",
  41417. height: "24",
  41418. viewBox: "0 0 24 24",
  41419. version: "1.1"
  41420. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41421. d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
  41422. }));
  41423. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
  41424. /**
  41425. * WordPress dependencies
  41426. */
  41427. const SnapchatIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41428. width: "24",
  41429. height: "24",
  41430. viewBox: "0 0 24 24",
  41431. version: "1.1"
  41432. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41433. d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
  41434. }));
  41435. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
  41436. /**
  41437. * WordPress dependencies
  41438. */
  41439. const SoundCloudIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41440. width: "24",
  41441. height: "24",
  41442. viewBox: "0 0 24 24",
  41443. version: "1.1"
  41444. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41445. d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"
  41446. }));
  41447. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
  41448. /**
  41449. * WordPress dependencies
  41450. */
  41451. const SpotifyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41452. width: "24",
  41453. height: "24",
  41454. viewBox: "0 0 24 24",
  41455. version: "1.1"
  41456. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41457. d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
  41458. }));
  41459. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
  41460. /**
  41461. * WordPress dependencies
  41462. */
  41463. const TelegramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41464. width: "24",
  41465. height: "24",
  41466. viewBox: "0 0 128 128",
  41467. version: "1.1"
  41468. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41469. d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
  41470. }));
  41471. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
  41472. /**
  41473. * WordPress dependencies
  41474. */
  41475. const TiktokIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41476. width: "24",
  41477. height: "24",
  41478. viewBox: "0 0 32 32",
  41479. version: "1.1"
  41480. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41481. d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
  41482. }));
  41483. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
  41484. /**
  41485. * WordPress dependencies
  41486. */
  41487. const TumblrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41488. width: "24",
  41489. height: "24",
  41490. viewBox: "0 0 24 24",
  41491. version: "1.1"
  41492. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41493. d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
  41494. }));
  41495. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
  41496. /**
  41497. * WordPress dependencies
  41498. */
  41499. const TwitchIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41500. width: "24",
  41501. height: "24",
  41502. viewBox: "0 0 24 24",
  41503. version: "1.1"
  41504. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41505. d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
  41506. }));
  41507. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
  41508. /**
  41509. * WordPress dependencies
  41510. */
  41511. const TwitterIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41512. width: "24",
  41513. height: "24",
  41514. viewBox: "0 0 24 24",
  41515. version: "1.1"
  41516. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41517. d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
  41518. }));
  41519. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
  41520. /**
  41521. * WordPress dependencies
  41522. */
  41523. const VimeoIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41524. width: "24",
  41525. height: "24",
  41526. viewBox: "0 0 24 24",
  41527. version: "1.1"
  41528. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41529. d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
  41530. }));
  41531. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
  41532. /**
  41533. * WordPress dependencies
  41534. */
  41535. const VkIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41536. width: "24",
  41537. height: "24",
  41538. viewBox: "0 0 24 24",
  41539. version: "1.1"
  41540. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41541. d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
  41542. }));
  41543. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/whatsapp.js
  41544. /**
  41545. * WordPress dependencies
  41546. */
  41547. const WhatsAppIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41548. width: "24",
  41549. height: "24",
  41550. viewBox: "0 0 24 24",
  41551. version: "1.1"
  41552. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41553. d: "M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z"
  41554. }));
  41555. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
  41556. /**
  41557. * WordPress dependencies
  41558. */
  41559. const YelpIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41560. width: "24",
  41561. height: "24",
  41562. viewBox: "0 0 24 24",
  41563. version: "1.1"
  41564. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41565. d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
  41566. }));
  41567. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
  41568. /**
  41569. * WordPress dependencies
  41570. */
  41571. const YouTubeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  41572. width: "24",
  41573. height: "24",
  41574. viewBox: "0 0 24 24",
  41575. version: "1.1"
  41576. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  41577. d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
  41578. }));
  41579. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
  41580. /**
  41581. * Internal dependencies
  41582. */
  41583. const social_link_variations_variations = [{
  41584. isDefault: true,
  41585. name: 'wordpress',
  41586. attributes: {
  41587. service: 'wordpress'
  41588. },
  41589. title: 'WordPress',
  41590. icon: WordPressIcon
  41591. }, {
  41592. name: 'fivehundredpx',
  41593. attributes: {
  41594. service: 'fivehundredpx'
  41595. },
  41596. title: '500px',
  41597. icon: FivehundredpxIcon
  41598. }, {
  41599. name: 'amazon',
  41600. attributes: {
  41601. service: 'amazon'
  41602. },
  41603. title: 'Amazon',
  41604. icon: AmazonIcon
  41605. }, {
  41606. name: 'bandcamp',
  41607. attributes: {
  41608. service: 'bandcamp'
  41609. },
  41610. title: 'Bandcamp',
  41611. icon: BandcampIcon
  41612. }, {
  41613. name: 'behance',
  41614. attributes: {
  41615. service: 'behance'
  41616. },
  41617. title: 'Behance',
  41618. icon: BehanceIcon
  41619. }, {
  41620. name: 'chain',
  41621. attributes: {
  41622. service: 'chain'
  41623. },
  41624. title: 'Link',
  41625. icon: ChainIcon
  41626. }, {
  41627. name: 'codepen',
  41628. attributes: {
  41629. service: 'codepen'
  41630. },
  41631. title: 'CodePen',
  41632. icon: CodepenIcon
  41633. }, {
  41634. name: 'deviantart',
  41635. attributes: {
  41636. service: 'deviantart'
  41637. },
  41638. title: 'DeviantArt',
  41639. icon: DeviantArtIcon
  41640. }, {
  41641. name: 'dribbble',
  41642. attributes: {
  41643. service: 'dribbble'
  41644. },
  41645. title: 'Dribbble',
  41646. icon: DribbbleIcon
  41647. }, {
  41648. name: 'dropbox',
  41649. attributes: {
  41650. service: 'dropbox'
  41651. },
  41652. title: 'Dropbox',
  41653. icon: DropboxIcon
  41654. }, {
  41655. name: 'etsy',
  41656. attributes: {
  41657. service: 'etsy'
  41658. },
  41659. title: 'Etsy',
  41660. icon: EtsyIcon
  41661. }, {
  41662. name: 'facebook',
  41663. attributes: {
  41664. service: 'facebook'
  41665. },
  41666. title: 'Facebook',
  41667. icon: FacebookIcon
  41668. }, {
  41669. name: 'feed',
  41670. attributes: {
  41671. service: 'feed'
  41672. },
  41673. title: 'RSS Feed',
  41674. icon: FeedIcon
  41675. }, {
  41676. name: 'flickr',
  41677. attributes: {
  41678. service: 'flickr'
  41679. },
  41680. title: 'Flickr',
  41681. icon: FlickrIcon
  41682. }, {
  41683. name: 'foursquare',
  41684. attributes: {
  41685. service: 'foursquare'
  41686. },
  41687. title: 'Foursquare',
  41688. icon: FoursquareIcon
  41689. }, {
  41690. name: 'goodreads',
  41691. attributes: {
  41692. service: 'goodreads'
  41693. },
  41694. title: 'Goodreads',
  41695. icon: GoodreadsIcon
  41696. }, {
  41697. name: 'google',
  41698. attributes: {
  41699. service: 'google'
  41700. },
  41701. title: 'Google',
  41702. icon: GoogleIcon
  41703. }, {
  41704. name: 'github',
  41705. attributes: {
  41706. service: 'github'
  41707. },
  41708. title: 'GitHub',
  41709. icon: GitHubIcon
  41710. }, {
  41711. name: 'instagram',
  41712. attributes: {
  41713. service: 'instagram'
  41714. },
  41715. title: 'Instagram',
  41716. icon: InstagramIcon
  41717. }, {
  41718. name: 'lastfm',
  41719. attributes: {
  41720. service: 'lastfm'
  41721. },
  41722. title: 'Last.fm',
  41723. icon: LastfmIcon
  41724. }, {
  41725. name: 'linkedin',
  41726. attributes: {
  41727. service: 'linkedin'
  41728. },
  41729. title: 'LinkedIn',
  41730. icon: LinkedInIcon
  41731. }, {
  41732. name: 'mail',
  41733. attributes: {
  41734. service: 'mail'
  41735. },
  41736. title: 'Mail',
  41737. keywords: ['email', 'e-mail'],
  41738. icon: MailIcon
  41739. }, {
  41740. name: 'mastodon',
  41741. attributes: {
  41742. service: 'mastodon'
  41743. },
  41744. title: 'Mastodon',
  41745. icon: MastodonIcon
  41746. }, {
  41747. name: 'meetup',
  41748. attributes: {
  41749. service: 'meetup'
  41750. },
  41751. title: 'Meetup',
  41752. icon: MeetupIcon
  41753. }, {
  41754. name: 'medium',
  41755. attributes: {
  41756. service: 'medium'
  41757. },
  41758. title: 'Medium',
  41759. icon: MediumIcon
  41760. }, {
  41761. name: 'patreon',
  41762. attributes: {
  41763. service: 'patreon'
  41764. },
  41765. title: 'Patreon',
  41766. icon: PatreonIcon
  41767. }, {
  41768. name: 'pinterest',
  41769. attributes: {
  41770. service: 'pinterest'
  41771. },
  41772. title: 'Pinterest',
  41773. icon: PinterestIcon
  41774. }, {
  41775. name: 'pocket',
  41776. attributes: {
  41777. service: 'pocket'
  41778. },
  41779. title: 'Pocket',
  41780. icon: PocketIcon
  41781. }, {
  41782. name: 'reddit',
  41783. attributes: {
  41784. service: 'reddit'
  41785. },
  41786. title: 'Reddit',
  41787. icon: RedditIcon
  41788. }, {
  41789. name: 'skype',
  41790. attributes: {
  41791. service: 'skype'
  41792. },
  41793. title: 'Skype',
  41794. icon: SkypeIcon
  41795. }, {
  41796. name: 'snapchat',
  41797. attributes: {
  41798. service: 'snapchat'
  41799. },
  41800. title: 'Snapchat',
  41801. icon: SnapchatIcon
  41802. }, {
  41803. name: 'soundcloud',
  41804. attributes: {
  41805. service: 'soundcloud'
  41806. },
  41807. title: 'SoundCloud',
  41808. icon: SoundCloudIcon
  41809. }, {
  41810. name: 'spotify',
  41811. attributes: {
  41812. service: 'spotify'
  41813. },
  41814. title: 'Spotify',
  41815. icon: SpotifyIcon
  41816. }, {
  41817. name: 'telegram',
  41818. attributes: {
  41819. service: 'telegram'
  41820. },
  41821. title: 'Telegram',
  41822. icon: TelegramIcon
  41823. }, {
  41824. name: 'tiktok',
  41825. attributes: {
  41826. service: 'tiktok'
  41827. },
  41828. title: 'TikTok',
  41829. icon: TiktokIcon
  41830. }, {
  41831. name: 'tumblr',
  41832. attributes: {
  41833. service: 'tumblr'
  41834. },
  41835. title: 'Tumblr',
  41836. icon: TumblrIcon
  41837. }, {
  41838. name: 'twitch',
  41839. attributes: {
  41840. service: 'twitch'
  41841. },
  41842. title: 'Twitch',
  41843. icon: TwitchIcon
  41844. }, {
  41845. name: 'twitter',
  41846. attributes: {
  41847. service: 'twitter'
  41848. },
  41849. title: 'Twitter',
  41850. icon: TwitterIcon
  41851. }, {
  41852. name: 'vimeo',
  41853. attributes: {
  41854. service: 'vimeo'
  41855. },
  41856. title: 'Vimeo',
  41857. icon: VimeoIcon
  41858. }, {
  41859. name: 'vk',
  41860. attributes: {
  41861. service: 'vk'
  41862. },
  41863. title: 'VK',
  41864. icon: VkIcon
  41865. }, {
  41866. name: 'whatsapp',
  41867. attributes: {
  41868. service: 'whatsapp'
  41869. },
  41870. title: 'WhatsApp',
  41871. icon: WhatsAppIcon
  41872. }, {
  41873. name: 'yelp',
  41874. attributes: {
  41875. service: 'yelp'
  41876. },
  41877. title: 'Yelp',
  41878. icon: YelpIcon
  41879. }, {
  41880. name: 'youtube',
  41881. attributes: {
  41882. service: 'youtube'
  41883. },
  41884. title: 'YouTube',
  41885. icon: YouTubeIcon
  41886. }];
  41887. /**
  41888. * Add `isActive` function to all `social link` variations, if not defined.
  41889. * `isActive` function is used to find a variation match from a created
  41890. * Block by providing its attributes.
  41891. */
  41892. social_link_variations_variations.forEach(variation => {
  41893. if (variation.isActive) return;
  41894. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service;
  41895. });
  41896. /* harmony default export */ var social_link_variations = (social_link_variations_variations);
  41897. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
  41898. /**
  41899. * External dependencies
  41900. */
  41901. /**
  41902. * WordPress dependencies
  41903. */
  41904. /**
  41905. * Internal dependencies
  41906. */
  41907. /**
  41908. * Retrieves the social service's icon component.
  41909. *
  41910. * @param {string} name key for a social service (lowercase slug)
  41911. *
  41912. * @return {WPComponent} Icon component for social service.
  41913. */
  41914. const getIconBySite = name => {
  41915. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  41916. name
  41917. });
  41918. return variation ? variation.icon : ChainIcon;
  41919. };
  41920. /**
  41921. * Retrieves the display name for the social service.
  41922. *
  41923. * @param {string} name key for a social service (lowercase slug)
  41924. *
  41925. * @return {string} Display name for social service
  41926. */
  41927. const getNameBySite = name => {
  41928. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  41929. name
  41930. });
  41931. return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
  41932. };
  41933. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
  41934. /**
  41935. * External dependencies
  41936. */
  41937. /**
  41938. * WordPress dependencies
  41939. */
  41940. /**
  41941. * Internal dependencies
  41942. */
  41943. const SocialLinkURLPopover = _ref => {
  41944. let {
  41945. url,
  41946. setAttributes,
  41947. setPopover,
  41948. popoverAnchor
  41949. } = _ref;
  41950. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, {
  41951. anchor: popoverAnchor,
  41952. onClose: () => setPopover(false)
  41953. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  41954. className: "block-editor-url-popover__link-editor",
  41955. onSubmit: event => {
  41956. event.preventDefault();
  41957. setPopover(false);
  41958. }
  41959. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  41960. className: "block-editor-url-input"
  41961. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, {
  41962. value: url,
  41963. onChange: nextURL => setAttributes({
  41964. url: nextURL
  41965. }),
  41966. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'),
  41967. disableSuggestions: true
  41968. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  41969. icon: keyboard_return,
  41970. label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
  41971. type: "submit"
  41972. })));
  41973. };
  41974. const SocialLinkEdit = _ref2 => {
  41975. let {
  41976. attributes,
  41977. context,
  41978. isSelected,
  41979. setAttributes
  41980. } = _ref2;
  41981. const {
  41982. url,
  41983. service,
  41984. label
  41985. } = attributes;
  41986. const {
  41987. showLabels,
  41988. iconColorValue,
  41989. iconBackgroundColorValue
  41990. } = context;
  41991. const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
  41992. const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, {
  41993. 'wp-social-link__is-incomplete': !url
  41994. }); // Use internal state instead of a ref to make sure that the component
  41995. // re-renders when the popover's anchor updates.
  41996. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
  41997. const IconComponent = getIconBySite(service);
  41998. const socialLinkName = getNameBySite(service);
  41999. const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName;
  42000. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  42001. className: classes,
  42002. style: {
  42003. color: iconColorValue,
  42004. backgroundColor: iconBackgroundColorValue
  42005. }
  42006. });
  42007. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  42008. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  42009. /* translators: %s: name of the social service. */
  42010. (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName),
  42011. initialOpen: false
  42012. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  42013. label: (0,external_wp_i18n_namespaceObject.__)('Link label'),
  42014. help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'),
  42015. value: label,
  42016. onChange: value => setAttributes({
  42017. label: value
  42018. })
  42019. })))), (0,external_wp_element_namespaceObject.createElement)("li", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  42020. className: "wp-block-social-link-anchor",
  42021. ref: setPopoverAnchor,
  42022. onClick: () => setPopover(true)
  42023. }, (0,external_wp_element_namespaceObject.createElement)(IconComponent, null), (0,external_wp_element_namespaceObject.createElement)("span", {
  42024. className: classnames_default()('wp-block-social-link-label', {
  42025. 'screen-reader-text': !showLabels
  42026. })
  42027. }, socialLinkLabel), isSelected && showURLPopover && (0,external_wp_element_namespaceObject.createElement)(SocialLinkURLPopover, {
  42028. url: url,
  42029. setAttributes: setAttributes,
  42030. setPopover: setPopover,
  42031. popoverAnchor: popoverAnchor
  42032. }))));
  42033. };
  42034. /* harmony default export */ var social_link_edit = (SocialLinkEdit);
  42035. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  42036. /**
  42037. * WordPress dependencies
  42038. */
  42039. /**
  42040. * Internal dependencies
  42041. */
  42042. const social_link_metadata = {
  42043. $schema: "https://schemas.wp.org/trunk/block.json",
  42044. apiVersion: 2,
  42045. name: "core/social-link",
  42046. title: "Social Icon",
  42047. category: "widgets",
  42048. parent: ["core/social-links"],
  42049. description: "Display an icon linking to a social media profile or site.",
  42050. textdomain: "default",
  42051. attributes: {
  42052. url: {
  42053. type: "string"
  42054. },
  42055. service: {
  42056. type: "string"
  42057. },
  42058. label: {
  42059. type: "string"
  42060. }
  42061. },
  42062. usesContext: ["openInNewTab", "showLabels", "iconColorValue", "iconBackgroundColorValue"],
  42063. supports: {
  42064. reusable: false,
  42065. html: false
  42066. },
  42067. editorStyle: "wp-block-social-link-editor"
  42068. };
  42069. const {
  42070. name: social_link_name
  42071. } = social_link_metadata;
  42072. const social_link_settings = {
  42073. icon: library_share,
  42074. edit: social_link_edit,
  42075. variations: social_link_variations
  42076. };
  42077. const social_link_init = () => initBlock({
  42078. name: social_link_name,
  42079. metadata: social_link_metadata,
  42080. settings: social_link_settings
  42081. });
  42082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
  42083. /**
  42084. * External dependencies
  42085. */
  42086. /**
  42087. * WordPress dependencies
  42088. */
  42089. /**
  42090. * The specific handling by `className` below is needed because `itemsJustification`
  42091. * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't
  42092. * declared in block.json.
  42093. *
  42094. * @param {Object} attributes Block's attributes.
  42095. */
  42096. const social_links_deprecated_migrateWithLayout = attributes => {
  42097. var _className$match, _className$match$;
  42098. if (!!attributes.layout) {
  42099. return attributes;
  42100. }
  42101. const {
  42102. className
  42103. } = attributes; // Matches classes with `items-justified-` prefix.
  42104. const prefix = `items-justified-`;
  42105. const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g');
  42106. const newAttributes = { ...attributes,
  42107. className: className === null || className === void 0 ? void 0 : className.replace(justifiedItemsRegex, '').trim()
  42108. };
  42109. /**
  42110. * Add `layout` prop only if `justifyContent` is defined, for backwards
  42111. * compatibility. In other cases the block's default layout will be used.
  42112. * Also noting that due to the missing attribute, it's possible for a block
  42113. * to have more than one of `justified` classes.
  42114. */
  42115. const justifyContent = className === null || className === void 0 ? void 0 : (_className$match = className.match(justifiedItemsRegex)) === null || _className$match === void 0 ? void 0 : (_className$match$ = _className$match[0]) === null || _className$match$ === void 0 ? void 0 : _className$match$.trim();
  42116. if (justifyContent) {
  42117. Object.assign(newAttributes, {
  42118. layout: {
  42119. type: 'flex',
  42120. justifyContent: justifyContent.slice(prefix.length)
  42121. }
  42122. });
  42123. }
  42124. return newAttributes;
  42125. }; // Social Links block deprecations.
  42126. const social_links_deprecated_deprecated = [// V1. Remove CSS variable use for colors.
  42127. {
  42128. attributes: {
  42129. iconColor: {
  42130. type: 'string'
  42131. },
  42132. customIconColor: {
  42133. type: 'string'
  42134. },
  42135. iconColorValue: {
  42136. type: 'string'
  42137. },
  42138. iconBackgroundColor: {
  42139. type: 'string'
  42140. },
  42141. customIconBackgroundColor: {
  42142. type: 'string'
  42143. },
  42144. iconBackgroundColorValue: {
  42145. type: 'string'
  42146. },
  42147. openInNewTab: {
  42148. type: 'boolean',
  42149. default: false
  42150. },
  42151. size: {
  42152. type: 'string'
  42153. }
  42154. },
  42155. providesContext: {
  42156. openInNewTab: 'openInNewTab'
  42157. },
  42158. supports: {
  42159. align: ['left', 'center', 'right'],
  42160. anchor: true
  42161. },
  42162. migrate: social_links_deprecated_migrateWithLayout,
  42163. save: props => {
  42164. const {
  42165. attributes: {
  42166. iconBackgroundColorValue,
  42167. iconColorValue,
  42168. itemsJustification,
  42169. size
  42170. }
  42171. } = props;
  42172. const className = classnames_default()(size, {
  42173. 'has-icon-color': iconColorValue,
  42174. 'has-icon-background-color': iconBackgroundColorValue,
  42175. [`items-justified-${itemsJustification}`]: itemsJustification
  42176. });
  42177. const style = {
  42178. '--wp--social-links--icon-color': iconColorValue,
  42179. '--wp--social-links--icon-background-color': iconBackgroundColorValue
  42180. };
  42181. return (0,external_wp_element_namespaceObject.createElement)("ul", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  42182. className,
  42183. style
  42184. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  42185. }
  42186. }];
  42187. /* harmony default export */ var social_links_deprecated = (social_links_deprecated_deprecated);
  42188. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  42189. /**
  42190. * WordPress dependencies
  42191. */
  42192. const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  42193. xmlns: "http://www.w3.org/2000/svg",
  42194. viewBox: "0 0 24 24"
  42195. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  42196. d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
  42197. }));
  42198. /* harmony default export */ var library_check = (check);
  42199. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
  42200. /**
  42201. * External dependencies
  42202. */
  42203. /**
  42204. * WordPress dependencies
  42205. */
  42206. const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
  42207. const sizeOptions = [{
  42208. name: (0,external_wp_i18n_namespaceObject.__)('Small'),
  42209. value: 'has-small-icon-size'
  42210. }, {
  42211. name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
  42212. value: 'has-normal-icon-size'
  42213. }, {
  42214. name: (0,external_wp_i18n_namespaceObject.__)('Large'),
  42215. value: 'has-large-icon-size'
  42216. }, {
  42217. name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
  42218. value: 'has-huge-icon-size'
  42219. }];
  42220. const social_links_edit_getDefaultBlockLayout = blockTypeOrName => {
  42221. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  42222. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  42223. };
  42224. function SocialLinksEdit(props) {
  42225. var _attributes$className;
  42226. const {
  42227. clientId,
  42228. name,
  42229. attributes,
  42230. iconBackgroundColor,
  42231. iconColor,
  42232. isSelected,
  42233. setAttributes,
  42234. setIconBackgroundColor,
  42235. setIconColor
  42236. } = props;
  42237. const {
  42238. iconBackgroundColorValue,
  42239. customIconBackgroundColor,
  42240. iconColorValue,
  42241. openInNewTab,
  42242. showLabels,
  42243. size,
  42244. layout
  42245. } = attributes;
  42246. const usedLayout = layout || social_links_edit_getDefaultBlockLayout(name);
  42247. const logosOnly = (_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.includes('is-style-logos-only'); // Remove icon background color when logos only style is selected or
  42248. // restore it when any other style is selected.
  42249. const backgroundBackup = (0,external_wp_element_namespaceObject.useRef)({});
  42250. (0,external_wp_element_namespaceObject.useEffect)(() => {
  42251. if (logosOnly) {
  42252. backgroundBackup.current = {
  42253. iconBackgroundColor,
  42254. iconBackgroundColorValue,
  42255. customIconBackgroundColor
  42256. };
  42257. setAttributes({
  42258. iconBackgroundColor: undefined,
  42259. customIconBackgroundColor: undefined,
  42260. iconBackgroundColorValue: undefined
  42261. });
  42262. } else {
  42263. setAttributes({ ...backgroundBackup.current
  42264. });
  42265. }
  42266. }, [logosOnly]);
  42267. const SocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  42268. className: "wp-block-social-links__social-placeholder"
  42269. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  42270. className: "wp-block-social-links__social-placeholder-icons"
  42271. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  42272. className: "wp-social-link wp-social-link-twitter"
  42273. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  42274. className: "wp-social-link wp-social-link-facebook"
  42275. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  42276. className: "wp-social-link wp-social-link-instagram"
  42277. })));
  42278. const SelectedSocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  42279. className: "wp-block-social-links__social-prompt"
  42280. }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); // Fallback color values are used maintain selections in case switching
  42281. // themes and named colors in palette do not match.
  42282. const className = classnames_default()(size, {
  42283. 'has-visible-labels': showLabels,
  42284. 'has-icon-color': iconColor.color || iconColorValue,
  42285. 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
  42286. });
  42287. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  42288. className
  42289. });
  42290. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  42291. allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
  42292. placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
  42293. templateLock: false,
  42294. __experimentalAppenderTagName: 'li',
  42295. __experimentalLayout: usedLayout
  42296. });
  42297. const POPOVER_PROPS = {
  42298. position: 'bottom right'
  42299. };
  42300. const colorSettings = [{
  42301. // Use custom attribute as fallback to prevent loss of named color selection when
  42302. // switching themes to a new theme that does not have a matching named color.
  42303. value: iconColor.color || iconColorValue,
  42304. onChange: colorValue => {
  42305. setIconColor(colorValue);
  42306. setAttributes({
  42307. iconColorValue: colorValue
  42308. });
  42309. },
  42310. label: (0,external_wp_i18n_namespaceObject.__)('Icon color'),
  42311. resetAllFilter: () => {
  42312. setIconColor(undefined);
  42313. setAttributes({
  42314. iconColorValue: undefined
  42315. });
  42316. }
  42317. }];
  42318. if (!logosOnly) {
  42319. colorSettings.push({
  42320. // Use custom attribute as fallback to prevent loss of named color selection when
  42321. // switching themes to a new theme that does not have a matching named color.
  42322. value: iconBackgroundColor.color || iconBackgroundColorValue,
  42323. onChange: colorValue => {
  42324. setIconBackgroundColor(colorValue);
  42325. setAttributes({
  42326. iconBackgroundColorValue: colorValue
  42327. });
  42328. },
  42329. label: (0,external_wp_i18n_namespaceObject.__)('Icon background'),
  42330. resetAllFilter: () => {
  42331. setIconBackgroundColor(undefined);
  42332. setAttributes({
  42333. iconBackgroundColorValue: undefined
  42334. });
  42335. }
  42336. });
  42337. }
  42338. const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  42339. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  42340. group: "other"
  42341. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  42342. label: (0,external_wp_i18n_namespaceObject.__)('Size'),
  42343. text: (0,external_wp_i18n_namespaceObject.__)('Size'),
  42344. icon: null,
  42345. popoverProps: POPOVER_PROPS
  42346. }, _ref => {
  42347. let {
  42348. onClose
  42349. } = _ref;
  42350. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
  42351. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  42352. icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
  42353. isSelected: size === entry.value,
  42354. key: entry.value,
  42355. onClick: () => {
  42356. setAttributes({
  42357. size: entry.value
  42358. });
  42359. },
  42360. onClose: onClose,
  42361. role: "menuitemradio"
  42362. }, entry.name);
  42363. }));
  42364. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  42365. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  42366. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  42367. label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
  42368. checked: openInNewTab,
  42369. onChange: () => setAttributes({
  42370. openInNewTab: !openInNewTab
  42371. })
  42372. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  42373. label: (0,external_wp_i18n_namespaceObject.__)('Show labels'),
  42374. checked: showLabels,
  42375. onChange: () => setAttributes({
  42376. showLabels: !showLabels
  42377. })
  42378. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  42379. __experimentalGroup: "color"
  42380. }, colorSettings.map(_ref2 => {
  42381. let {
  42382. onChange,
  42383. label,
  42384. value,
  42385. resetAllFilter
  42386. } = _ref2;
  42387. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, _extends({
  42388. key: `social-links-color-${label}`,
  42389. __experimentalHasMultipleOrigins: true,
  42390. __experimentalIsRenderedInSidebar: true,
  42391. settings: [{
  42392. colorValue: value,
  42393. label,
  42394. onColorChange: onChange,
  42395. isShownByDefault: true,
  42396. resetAllFilter,
  42397. enableAlpha: true
  42398. }],
  42399. panelId: clientId
  42400. }, colorGradientSettings));
  42401. }), !logosOnly && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  42402. textColor: iconColorValue,
  42403. backgroundColor: iconBackgroundColorValue,
  42404. isLargeText: false
  42405. })), (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps));
  42406. }
  42407. const iconColorAttributes = {
  42408. iconColor: 'icon-color',
  42409. iconBackgroundColor: 'icon-background-color'
  42410. };
  42411. /* harmony default export */ var social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
  42412. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
  42413. /**
  42414. * External dependencies
  42415. */
  42416. /**
  42417. * WordPress dependencies
  42418. */
  42419. function social_links_save_save(props) {
  42420. const {
  42421. attributes: {
  42422. iconBackgroundColorValue,
  42423. iconColorValue,
  42424. showLabels,
  42425. size
  42426. }
  42427. } = props;
  42428. const className = classnames_default()(size, {
  42429. 'has-visible-labels': showLabels,
  42430. 'has-icon-color': iconColorValue,
  42431. 'has-icon-background-color': iconBackgroundColorValue
  42432. });
  42433. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  42434. className
  42435. });
  42436. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  42437. return (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps);
  42438. }
  42439. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  42440. /**
  42441. * WordPress dependencies
  42442. */
  42443. /**
  42444. * Internal dependencies
  42445. */
  42446. const social_links_metadata = {
  42447. $schema: "https://schemas.wp.org/trunk/block.json",
  42448. apiVersion: 2,
  42449. name: "core/social-links",
  42450. title: "Social Icons",
  42451. category: "widgets",
  42452. description: "Display icons linking to your social media profiles or sites.",
  42453. keywords: ["links"],
  42454. textdomain: "default",
  42455. attributes: {
  42456. iconColor: {
  42457. type: "string"
  42458. },
  42459. customIconColor: {
  42460. type: "string"
  42461. },
  42462. iconColorValue: {
  42463. type: "string"
  42464. },
  42465. iconBackgroundColor: {
  42466. type: "string"
  42467. },
  42468. customIconBackgroundColor: {
  42469. type: "string"
  42470. },
  42471. iconBackgroundColorValue: {
  42472. type: "string"
  42473. },
  42474. openInNewTab: {
  42475. type: "boolean",
  42476. "default": false
  42477. },
  42478. showLabels: {
  42479. type: "boolean",
  42480. "default": false
  42481. },
  42482. size: {
  42483. type: "string"
  42484. }
  42485. },
  42486. providesContext: {
  42487. openInNewTab: "openInNewTab",
  42488. showLabels: "showLabels",
  42489. iconColorValue: "iconColorValue",
  42490. iconBackgroundColorValue: "iconBackgroundColorValue"
  42491. },
  42492. supports: {
  42493. align: ["left", "center", "right"],
  42494. anchor: true,
  42495. __experimentalExposeControlsToChildren: true,
  42496. __experimentalLayout: {
  42497. allowSwitching: false,
  42498. allowInheriting: false,
  42499. allowVerticalAlignment: false,
  42500. "default": {
  42501. type: "flex"
  42502. }
  42503. },
  42504. color: {
  42505. enableContrastChecker: false,
  42506. background: true,
  42507. gradients: true,
  42508. text: false,
  42509. __experimentalDefaultControls: {
  42510. background: false
  42511. }
  42512. },
  42513. spacing: {
  42514. blockGap: ["horizontal", "vertical"],
  42515. margin: true,
  42516. padding: true,
  42517. units: ["px", "em", "rem", "vh", "vw"],
  42518. __experimentalDefaultControls: {
  42519. blockGap: true
  42520. }
  42521. }
  42522. },
  42523. styles: [{
  42524. name: "default",
  42525. label: "Default",
  42526. isDefault: true
  42527. }, {
  42528. name: "logos-only",
  42529. label: "Logos Only"
  42530. }, {
  42531. name: "pill-shape",
  42532. label: "Pill Shape"
  42533. }],
  42534. editorStyle: "wp-block-social-links-editor",
  42535. style: "wp-block-social-links"
  42536. };
  42537. const {
  42538. name: social_links_name
  42539. } = social_links_metadata;
  42540. const social_links_settings = {
  42541. example: {
  42542. innerBlocks: [{
  42543. name: 'core/social-link',
  42544. attributes: {
  42545. service: 'wordpress',
  42546. url: 'https://wordpress.org'
  42547. }
  42548. }, {
  42549. name: 'core/social-link',
  42550. attributes: {
  42551. service: 'facebook',
  42552. url: 'https://www.facebook.com/WordPress/'
  42553. }
  42554. }, {
  42555. name: 'core/social-link',
  42556. attributes: {
  42557. service: 'twitter',
  42558. url: 'https://twitter.com/WordPress'
  42559. }
  42560. }]
  42561. },
  42562. icon: library_share,
  42563. edit: social_links_edit,
  42564. save: social_links_save_save,
  42565. deprecated: social_links_deprecated
  42566. };
  42567. const social_links_init = () => initBlock({
  42568. name: social_links_name,
  42569. metadata: social_links_metadata,
  42570. settings: social_links_settings
  42571. });
  42572. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
  42573. /**
  42574. * WordPress dependencies
  42575. */
  42576. const resizeCornerNE = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  42577. viewBox: "0 0 24 24",
  42578. xmlns: "http://www.w3.org/2000/svg"
  42579. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  42580. d: "M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"
  42581. }));
  42582. /* harmony default export */ var resize_corner_n_e = (resizeCornerNE);
  42583. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
  42584. /**
  42585. * WordPress dependencies
  42586. */
  42587. const spacer_deprecated_deprecated = [{
  42588. attributes: {
  42589. height: {
  42590. type: 'number',
  42591. default: 100
  42592. },
  42593. width: {
  42594. type: 'number'
  42595. }
  42596. },
  42597. migrate(attributes) {
  42598. const {
  42599. height,
  42600. width
  42601. } = attributes;
  42602. return { ...attributes,
  42603. width: width !== undefined ? `${width}px` : undefined,
  42604. height: height !== undefined ? `${height}px` : undefined
  42605. };
  42606. },
  42607. save(_ref) {
  42608. let {
  42609. attributes
  42610. } = _ref;
  42611. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  42612. style: {
  42613. height: attributes.height,
  42614. width: attributes.width
  42615. },
  42616. 'aria-hidden': true
  42617. }));
  42618. }
  42619. }];
  42620. /* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);
  42621. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/constants.js
  42622. const MIN_SPACER_SIZE = 0;
  42623. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
  42624. /**
  42625. * WordPress dependencies
  42626. */
  42627. /**
  42628. * Internal dependencies
  42629. */
  42630. function DimensionInput(_ref) {
  42631. var _ref2;
  42632. let {
  42633. label,
  42634. onChange,
  42635. isResizing,
  42636. value = ''
  42637. } = _ref;
  42638. const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
  42639. // percentage, since this is relative to the parent container. This
  42640. // unit is disabled from the UI.
  42641. const availableUnitSettings = (_ref2 = (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
  42642. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  42643. availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
  42644. defaultValues: {
  42645. px: 100,
  42646. em: 10,
  42647. rem: 10,
  42648. vw: 10,
  42649. vh: 25
  42650. }
  42651. });
  42652. const handleOnChange = unprocessedValue => {
  42653. onChange(unprocessedValue);
  42654. }; // Force the unit to update to `px` when the Spacer is being resized.
  42655. const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  42656. const computedValue = [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
  42657. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  42658. label: label,
  42659. id: inputId
  42660. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  42661. id: inputId,
  42662. isResetValueOnUnitChange: true,
  42663. min: MIN_SPACER_SIZE,
  42664. onChange: handleOnChange,
  42665. style: {
  42666. maxWidth: 80
  42667. },
  42668. value: computedValue,
  42669. units: units
  42670. }));
  42671. }
  42672. function SpacerControls(_ref3) {
  42673. let {
  42674. setAttributes,
  42675. orientation,
  42676. height,
  42677. width,
  42678. isResizing
  42679. } = _ref3;
  42680. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  42681. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  42682. }, orientation === 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  42683. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  42684. value: width,
  42685. onChange: nextWidth => setAttributes({
  42686. width: nextWidth
  42687. }),
  42688. isResizing: isResizing
  42689. }), orientation !== 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  42690. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  42691. value: height,
  42692. onChange: nextHeight => setAttributes({
  42693. height: nextHeight
  42694. }),
  42695. isResizing: isResizing
  42696. })));
  42697. }
  42698. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
  42699. /**
  42700. * External dependencies
  42701. */
  42702. /**
  42703. * WordPress dependencies
  42704. */
  42705. /**
  42706. * Internal dependencies
  42707. */
  42708. const ResizableSpacer = _ref => {
  42709. let {
  42710. orientation,
  42711. onResizeStart,
  42712. onResize,
  42713. onResizeStop,
  42714. isSelected,
  42715. isResizing,
  42716. setIsResizing,
  42717. ...props
  42718. } = _ref;
  42719. const getCurrentSize = elt => {
  42720. return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight;
  42721. };
  42722. const getNextVal = elt => {
  42723. return `${getCurrentSize(elt)}px`;
  42724. };
  42725. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  42726. className: classnames_default()('block-library-spacer__resize-container', {
  42727. 'resize-horizontal': orientation === 'horizontal',
  42728. 'is-resizing': isResizing,
  42729. 'is-selected': isSelected
  42730. }),
  42731. onResizeStart: (_event, _direction, elt) => {
  42732. const nextVal = getNextVal(elt);
  42733. onResizeStart(nextVal);
  42734. onResize(nextVal);
  42735. },
  42736. onResize: (_event, _direction, elt) => {
  42737. onResize(getNextVal(elt));
  42738. if (!isResizing) {
  42739. setIsResizing(true);
  42740. }
  42741. },
  42742. onResizeStop: (_event, _direction, elt) => {
  42743. const nextVal = getCurrentSize(elt);
  42744. onResizeStop(`${nextVal}px`);
  42745. setIsResizing(false);
  42746. },
  42747. __experimentalShowTooltip: true,
  42748. __experimentalTooltipProps: {
  42749. axis: orientation === 'horizontal' ? 'x' : 'y',
  42750. position: 'corner',
  42751. isVisible: isResizing
  42752. },
  42753. showHandle: isSelected
  42754. }, props));
  42755. };
  42756. const SpacerEdit = _ref2 => {
  42757. let {
  42758. attributes,
  42759. isSelected,
  42760. setAttributes,
  42761. toggleSelection,
  42762. context
  42763. } = _ref2;
  42764. const {
  42765. orientation
  42766. } = context;
  42767. const {
  42768. height,
  42769. width
  42770. } = attributes;
  42771. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  42772. const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
  42773. const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  42774. const onResizeStart = () => toggleSelection(false);
  42775. const onResizeStop = () => toggleSelection(true);
  42776. const handleOnVerticalResizeStop = newHeight => {
  42777. onResizeStop();
  42778. setAttributes({
  42779. height: newHeight
  42780. });
  42781. setTemporaryHeight(null);
  42782. };
  42783. const handleOnHorizontalResizeStop = newWidth => {
  42784. onResizeStop();
  42785. setAttributes({
  42786. width: newWidth
  42787. });
  42788. setTemporaryWidth(null);
  42789. };
  42790. const style = {
  42791. height: orientation === 'horizontal' ? 24 : temporaryHeight || height || undefined,
  42792. width: orientation === 'horizontal' ? temporaryWidth || width || undefined : undefined
  42793. };
  42794. const resizableBoxWithOrientation = blockOrientation => {
  42795. if (blockOrientation === 'horizontal') {
  42796. return (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  42797. minWidth: MIN_SPACER_SIZE,
  42798. enable: {
  42799. top: false,
  42800. right: true,
  42801. bottom: false,
  42802. left: false,
  42803. topRight: false,
  42804. bottomRight: false,
  42805. bottomLeft: false,
  42806. topLeft: false
  42807. },
  42808. orientation: blockOrientation,
  42809. onResizeStart: onResizeStart,
  42810. onResize: setTemporaryWidth,
  42811. onResizeStop: handleOnHorizontalResizeStop,
  42812. isSelected: isSelected,
  42813. isResizing: isResizing,
  42814. setIsResizing: setIsResizing
  42815. });
  42816. }
  42817. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  42818. minHeight: MIN_SPACER_SIZE,
  42819. enable: {
  42820. top: false,
  42821. right: false,
  42822. bottom: true,
  42823. left: false,
  42824. topRight: false,
  42825. bottomRight: false,
  42826. bottomLeft: false,
  42827. topLeft: false
  42828. },
  42829. orientation: blockOrientation,
  42830. onResizeStart: onResizeStart,
  42831. onResize: setTemporaryHeight,
  42832. onResizeStop: handleOnVerticalResizeStop,
  42833. isSelected: isSelected,
  42834. isResizing: isResizing,
  42835. setIsResizing: setIsResizing
  42836. }));
  42837. };
  42838. (0,external_wp_element_namespaceObject.useEffect)(() => {
  42839. if (orientation === 'horizontal' && !width) {
  42840. setAttributes({
  42841. height: '0px',
  42842. width: '72px'
  42843. });
  42844. }
  42845. }, []);
  42846. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  42847. style
  42848. }), resizableBoxWithOrientation(orientation)), (0,external_wp_element_namespaceObject.createElement)(SpacerControls, {
  42849. setAttributes: setAttributes,
  42850. height: temporaryHeight || height,
  42851. width: temporaryWidth || width,
  42852. orientation: orientation,
  42853. isResizing: isResizing
  42854. }));
  42855. };
  42856. /* harmony default export */ var spacer_edit = (SpacerEdit);
  42857. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
  42858. /**
  42859. * WordPress dependencies
  42860. */
  42861. function spacer_save_save(_ref) {
  42862. let {
  42863. attributes: {
  42864. height,
  42865. width
  42866. }
  42867. } = _ref;
  42868. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  42869. style: {
  42870. height,
  42871. width
  42872. },
  42873. 'aria-hidden': true
  42874. }));
  42875. }
  42876. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  42877. /**
  42878. * WordPress dependencies
  42879. */
  42880. /**
  42881. * Internal dependencies
  42882. */
  42883. const spacer_metadata = {
  42884. $schema: "https://schemas.wp.org/trunk/block.json",
  42885. apiVersion: 2,
  42886. name: "core/spacer",
  42887. title: "Spacer",
  42888. category: "design",
  42889. description: "Add white space between blocks and customize its height.",
  42890. textdomain: "default",
  42891. attributes: {
  42892. height: {
  42893. type: "string",
  42894. "default": "100px"
  42895. },
  42896. width: {
  42897. type: "string"
  42898. }
  42899. },
  42900. usesContext: ["orientation"],
  42901. supports: {
  42902. anchor: true,
  42903. spacing: {
  42904. margin: ["top", "bottom"],
  42905. __experimentalDefaultControls: {
  42906. margin: true
  42907. }
  42908. }
  42909. },
  42910. editorStyle: "wp-block-spacer-editor",
  42911. style: "wp-block-spacer"
  42912. };
  42913. const {
  42914. name: spacer_name
  42915. } = spacer_metadata;
  42916. const spacer_settings = {
  42917. icon: resize_corner_n_e,
  42918. edit: spacer_edit,
  42919. save: spacer_save_save,
  42920. deprecated: spacer_deprecated
  42921. };
  42922. const spacer_init = () => initBlock({
  42923. name: spacer_name,
  42924. metadata: spacer_metadata,
  42925. settings: spacer_settings
  42926. });
  42927. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
  42928. /**
  42929. * WordPress dependencies
  42930. */
  42931. const blockTable = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  42932. viewBox: "0 0 24 24",
  42933. xmlns: "http://www.w3.org/2000/svg"
  42934. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  42935. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
  42936. }));
  42937. /* harmony default export */ var block_table = (blockTable);
  42938. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
  42939. /**
  42940. * External dependencies
  42941. */
  42942. /**
  42943. * WordPress dependencies
  42944. */
  42945. // As the previous arbitrary colors won't match theme color palettes, the hex
  42946. // value will be mapped to the style.color.background attribute as if it was
  42947. // a custom color selection.
  42948. const oldColors = {
  42949. 'subtle-light-gray': '#f3f4f5',
  42950. 'subtle-pale-green': '#e9fbe5',
  42951. 'subtle-pale-blue': '#e7f5fe',
  42952. 'subtle-pale-pink': '#fcf0ef'
  42953. }; // In #41140 support was added to global styles for caption elements which
  42954. // added a `wp-element-caption` classname to the embed figcaption element.
  42955. const table_deprecated_v3 = {
  42956. attributes: {
  42957. hasFixedLayout: {
  42958. type: 'boolean',
  42959. default: false
  42960. },
  42961. caption: {
  42962. type: 'string',
  42963. source: 'html',
  42964. selector: 'figcaption',
  42965. default: ''
  42966. },
  42967. head: {
  42968. type: 'array',
  42969. default: [],
  42970. source: 'query',
  42971. selector: 'thead tr',
  42972. query: {
  42973. cells: {
  42974. type: 'array',
  42975. default: [],
  42976. source: 'query',
  42977. selector: 'td,th',
  42978. query: {
  42979. content: {
  42980. type: 'string',
  42981. source: 'html'
  42982. },
  42983. tag: {
  42984. type: 'string',
  42985. default: 'td',
  42986. source: 'tag'
  42987. },
  42988. scope: {
  42989. type: 'string',
  42990. source: 'attribute',
  42991. attribute: 'scope'
  42992. },
  42993. align: {
  42994. type: 'string',
  42995. source: 'attribute',
  42996. attribute: 'data-align'
  42997. }
  42998. }
  42999. }
  43000. }
  43001. },
  43002. body: {
  43003. type: 'array',
  43004. default: [],
  43005. source: 'query',
  43006. selector: 'tbody tr',
  43007. query: {
  43008. cells: {
  43009. type: 'array',
  43010. default: [],
  43011. source: 'query',
  43012. selector: 'td,th',
  43013. query: {
  43014. content: {
  43015. type: 'string',
  43016. source: 'html'
  43017. },
  43018. tag: {
  43019. type: 'string',
  43020. default: 'td',
  43021. source: 'tag'
  43022. },
  43023. scope: {
  43024. type: 'string',
  43025. source: 'attribute',
  43026. attribute: 'scope'
  43027. },
  43028. align: {
  43029. type: 'string',
  43030. source: 'attribute',
  43031. attribute: 'data-align'
  43032. }
  43033. }
  43034. }
  43035. }
  43036. },
  43037. foot: {
  43038. type: 'array',
  43039. default: [],
  43040. source: 'query',
  43041. selector: 'tfoot tr',
  43042. query: {
  43043. cells: {
  43044. type: 'array',
  43045. default: [],
  43046. source: 'query',
  43047. selector: 'td,th',
  43048. query: {
  43049. content: {
  43050. type: 'string',
  43051. source: 'html'
  43052. },
  43053. tag: {
  43054. type: 'string',
  43055. default: 'td',
  43056. source: 'tag'
  43057. },
  43058. scope: {
  43059. type: 'string',
  43060. source: 'attribute',
  43061. attribute: 'scope'
  43062. },
  43063. align: {
  43064. type: 'string',
  43065. source: 'attribute',
  43066. attribute: 'data-align'
  43067. }
  43068. }
  43069. }
  43070. }
  43071. }
  43072. },
  43073. supports: {
  43074. anchor: true,
  43075. align: true,
  43076. color: {
  43077. __experimentalSkipSerialization: true,
  43078. gradients: true,
  43079. __experimentalDefaultControls: {
  43080. background: true,
  43081. text: true
  43082. }
  43083. },
  43084. spacing: {
  43085. margin: true,
  43086. padding: true
  43087. },
  43088. typography: {
  43089. fontSize: true,
  43090. lineHeight: true,
  43091. __experimentalFontFamily: true,
  43092. __experimentalFontStyle: true,
  43093. __experimentalFontWeight: true,
  43094. __experimentalLetterSpacing: true,
  43095. __experimentalTextTransform: true,
  43096. __experimentalTextDecoration: true,
  43097. __experimentalDefaultControls: {
  43098. fontSize: true
  43099. }
  43100. },
  43101. __experimentalBorder: {
  43102. __experimentalSkipSerialization: true,
  43103. color: true,
  43104. style: true,
  43105. width: true,
  43106. __experimentalDefaultControls: {
  43107. color: true,
  43108. style: true,
  43109. width: true
  43110. }
  43111. },
  43112. __experimentalSelector: '.wp-block-table > table'
  43113. },
  43114. save(_ref) {
  43115. let {
  43116. attributes
  43117. } = _ref;
  43118. const {
  43119. hasFixedLayout,
  43120. head,
  43121. body,
  43122. foot,
  43123. caption
  43124. } = attributes;
  43125. const isEmpty = !head.length && !body.length && !foot.length;
  43126. if (isEmpty) {
  43127. return null;
  43128. }
  43129. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  43130. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  43131. const classes = classnames_default()(colorProps.className, borderProps.className, {
  43132. 'has-fixed-layout': hasFixedLayout
  43133. });
  43134. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  43135. const Section = _ref2 => {
  43136. let {
  43137. type,
  43138. rows
  43139. } = _ref2;
  43140. if (!rows.length) {
  43141. return null;
  43142. }
  43143. const Tag = `t${type}`;
  43144. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  43145. let {
  43146. cells
  43147. } = _ref3;
  43148. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  43149. key: rowIndex
  43150. }, cells.map((_ref4, cellIndex) => {
  43151. let {
  43152. content,
  43153. tag,
  43154. scope,
  43155. align
  43156. } = _ref4;
  43157. const cellClasses = classnames_default()({
  43158. [`has-text-align-${align}`]: align
  43159. });
  43160. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  43161. className: cellClasses ? cellClasses : undefined,
  43162. "data-align": align,
  43163. tagName: tag,
  43164. value: content,
  43165. key: cellIndex,
  43166. scope: tag === 'th' ? scope : undefined
  43167. });
  43168. }));
  43169. }));
  43170. };
  43171. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  43172. className: classes === '' ? undefined : classes,
  43173. style: { ...colorProps.style,
  43174. ...borderProps.style
  43175. }
  43176. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  43177. type: "head",
  43178. rows: head
  43179. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43180. type: "body",
  43181. rows: body
  43182. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43183. type: "foot",
  43184. rows: foot
  43185. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  43186. tagName: "figcaption",
  43187. value: caption
  43188. }));
  43189. }
  43190. }; // Deprecation migrating table block to use colors block support feature.
  43191. const table_deprecated_v2 = {
  43192. attributes: {
  43193. hasFixedLayout: {
  43194. type: 'boolean',
  43195. default: false
  43196. },
  43197. backgroundColor: {
  43198. type: 'string'
  43199. },
  43200. caption: {
  43201. type: 'string',
  43202. source: 'html',
  43203. selector: 'figcaption',
  43204. default: ''
  43205. },
  43206. head: {
  43207. type: 'array',
  43208. default: [],
  43209. source: 'query',
  43210. selector: 'thead tr',
  43211. query: {
  43212. cells: {
  43213. type: 'array',
  43214. default: [],
  43215. source: 'query',
  43216. selector: 'td,th',
  43217. query: {
  43218. content: {
  43219. type: 'string',
  43220. source: 'html'
  43221. },
  43222. tag: {
  43223. type: 'string',
  43224. default: 'td',
  43225. source: 'tag'
  43226. },
  43227. scope: {
  43228. type: 'string',
  43229. source: 'attribute',
  43230. attribute: 'scope'
  43231. },
  43232. align: {
  43233. type: 'string',
  43234. source: 'attribute',
  43235. attribute: 'data-align'
  43236. }
  43237. }
  43238. }
  43239. }
  43240. },
  43241. body: {
  43242. type: 'array',
  43243. default: [],
  43244. source: 'query',
  43245. selector: 'tbody tr',
  43246. query: {
  43247. cells: {
  43248. type: 'array',
  43249. default: [],
  43250. source: 'query',
  43251. selector: 'td,th',
  43252. query: {
  43253. content: {
  43254. type: 'string',
  43255. source: 'html'
  43256. },
  43257. tag: {
  43258. type: 'string',
  43259. default: 'td',
  43260. source: 'tag'
  43261. },
  43262. scope: {
  43263. type: 'string',
  43264. source: 'attribute',
  43265. attribute: 'scope'
  43266. },
  43267. align: {
  43268. type: 'string',
  43269. source: 'attribute',
  43270. attribute: 'data-align'
  43271. }
  43272. }
  43273. }
  43274. }
  43275. },
  43276. foot: {
  43277. type: 'array',
  43278. default: [],
  43279. source: 'query',
  43280. selector: 'tfoot tr',
  43281. query: {
  43282. cells: {
  43283. type: 'array',
  43284. default: [],
  43285. source: 'query',
  43286. selector: 'td,th',
  43287. query: {
  43288. content: {
  43289. type: 'string',
  43290. source: 'html'
  43291. },
  43292. tag: {
  43293. type: 'string',
  43294. default: 'td',
  43295. source: 'tag'
  43296. },
  43297. scope: {
  43298. type: 'string',
  43299. source: 'attribute',
  43300. attribute: 'scope'
  43301. },
  43302. align: {
  43303. type: 'string',
  43304. source: 'attribute',
  43305. attribute: 'data-align'
  43306. }
  43307. }
  43308. }
  43309. }
  43310. }
  43311. },
  43312. supports: {
  43313. anchor: true,
  43314. align: true,
  43315. __experimentalSelector: '.wp-block-table > table'
  43316. },
  43317. save: _ref5 => {
  43318. let {
  43319. attributes
  43320. } = _ref5;
  43321. const {
  43322. hasFixedLayout,
  43323. head,
  43324. body,
  43325. foot,
  43326. backgroundColor,
  43327. caption
  43328. } = attributes;
  43329. const isEmpty = !head.length && !body.length && !foot.length;
  43330. if (isEmpty) {
  43331. return null;
  43332. }
  43333. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  43334. const classes = classnames_default()(backgroundClass, {
  43335. 'has-fixed-layout': hasFixedLayout,
  43336. 'has-background': !!backgroundClass
  43337. });
  43338. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  43339. const Section = _ref6 => {
  43340. let {
  43341. type,
  43342. rows
  43343. } = _ref6;
  43344. if (!rows.length) {
  43345. return null;
  43346. }
  43347. const Tag = `t${type}`;
  43348. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref7, rowIndex) => {
  43349. let {
  43350. cells
  43351. } = _ref7;
  43352. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  43353. key: rowIndex
  43354. }, cells.map((_ref8, cellIndex) => {
  43355. let {
  43356. content,
  43357. tag,
  43358. scope,
  43359. align
  43360. } = _ref8;
  43361. const cellClasses = classnames_default()({
  43362. [`has-text-align-${align}`]: align
  43363. });
  43364. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  43365. className: cellClasses ? cellClasses : undefined,
  43366. "data-align": align,
  43367. tagName: tag,
  43368. value: content,
  43369. key: cellIndex,
  43370. scope: tag === 'th' ? scope : undefined
  43371. });
  43372. }));
  43373. }));
  43374. };
  43375. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  43376. className: classes === '' ? undefined : classes
  43377. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  43378. type: "head",
  43379. rows: head
  43380. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43381. type: "body",
  43382. rows: body
  43383. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43384. type: "foot",
  43385. rows: foot
  43386. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  43387. tagName: "figcaption",
  43388. value: caption
  43389. }));
  43390. },
  43391. isEligible: attributes => {
  43392. return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style;
  43393. },
  43394. // This version is the first to introduce the style attribute to the
  43395. // table block. As a result, we'll explicitly override that.
  43396. migrate: attributes => {
  43397. return { ...attributes,
  43398. backgroundColor: undefined,
  43399. style: {
  43400. color: {
  43401. background: oldColors[attributes.backgroundColor]
  43402. }
  43403. }
  43404. };
  43405. }
  43406. };
  43407. const table_deprecated_v1 = {
  43408. attributes: {
  43409. hasFixedLayout: {
  43410. type: 'boolean',
  43411. default: false
  43412. },
  43413. backgroundColor: {
  43414. type: 'string'
  43415. },
  43416. head: {
  43417. type: 'array',
  43418. default: [],
  43419. source: 'query',
  43420. selector: 'thead tr',
  43421. query: {
  43422. cells: {
  43423. type: 'array',
  43424. default: [],
  43425. source: 'query',
  43426. selector: 'td,th',
  43427. query: {
  43428. content: {
  43429. type: 'string',
  43430. source: 'html'
  43431. },
  43432. tag: {
  43433. type: 'string',
  43434. default: 'td',
  43435. source: 'tag'
  43436. },
  43437. scope: {
  43438. type: 'string',
  43439. source: 'attribute',
  43440. attribute: 'scope'
  43441. }
  43442. }
  43443. }
  43444. }
  43445. },
  43446. body: {
  43447. type: 'array',
  43448. default: [],
  43449. source: 'query',
  43450. selector: 'tbody tr',
  43451. query: {
  43452. cells: {
  43453. type: 'array',
  43454. default: [],
  43455. source: 'query',
  43456. selector: 'td,th',
  43457. query: {
  43458. content: {
  43459. type: 'string',
  43460. source: 'html'
  43461. },
  43462. tag: {
  43463. type: 'string',
  43464. default: 'td',
  43465. source: 'tag'
  43466. },
  43467. scope: {
  43468. type: 'string',
  43469. source: 'attribute',
  43470. attribute: 'scope'
  43471. }
  43472. }
  43473. }
  43474. }
  43475. },
  43476. foot: {
  43477. type: 'array',
  43478. default: [],
  43479. source: 'query',
  43480. selector: 'tfoot tr',
  43481. query: {
  43482. cells: {
  43483. type: 'array',
  43484. default: [],
  43485. source: 'query',
  43486. selector: 'td,th',
  43487. query: {
  43488. content: {
  43489. type: 'string',
  43490. source: 'html'
  43491. },
  43492. tag: {
  43493. type: 'string',
  43494. default: 'td',
  43495. source: 'tag'
  43496. },
  43497. scope: {
  43498. type: 'string',
  43499. source: 'attribute',
  43500. attribute: 'scope'
  43501. }
  43502. }
  43503. }
  43504. }
  43505. }
  43506. },
  43507. supports: {
  43508. align: true
  43509. },
  43510. save(_ref9) {
  43511. let {
  43512. attributes
  43513. } = _ref9;
  43514. const {
  43515. hasFixedLayout,
  43516. head,
  43517. body,
  43518. foot,
  43519. backgroundColor
  43520. } = attributes;
  43521. const isEmpty = !head.length && !body.length && !foot.length;
  43522. if (isEmpty) {
  43523. return null;
  43524. }
  43525. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  43526. const classes = classnames_default()(backgroundClass, {
  43527. 'has-fixed-layout': hasFixedLayout,
  43528. 'has-background': !!backgroundClass
  43529. });
  43530. const Section = _ref10 => {
  43531. let {
  43532. type,
  43533. rows
  43534. } = _ref10;
  43535. if (!rows.length) {
  43536. return null;
  43537. }
  43538. const Tag = `t${type}`;
  43539. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref11, rowIndex) => {
  43540. let {
  43541. cells
  43542. } = _ref11;
  43543. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  43544. key: rowIndex
  43545. }, cells.map((_ref12, cellIndex) => {
  43546. let {
  43547. content,
  43548. tag,
  43549. scope
  43550. } = _ref12;
  43551. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  43552. tagName: tag,
  43553. value: content,
  43554. key: cellIndex,
  43555. scope: tag === 'th' ? scope : undefined
  43556. });
  43557. }));
  43558. }));
  43559. };
  43560. return (0,external_wp_element_namespaceObject.createElement)("table", {
  43561. className: classes
  43562. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  43563. type: "head",
  43564. rows: head
  43565. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43566. type: "body",
  43567. rows: body
  43568. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  43569. type: "foot",
  43570. rows: foot
  43571. }));
  43572. }
  43573. };
  43574. /**
  43575. * New deprecations need to be placed first
  43576. * for them to have higher priority.
  43577. *
  43578. * Old deprecations may need to be updated as well.
  43579. *
  43580. * See block-deprecation.md
  43581. */
  43582. /* harmony default export */ var table_deprecated = ([table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]);
  43583. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js
  43584. /**
  43585. * WordPress dependencies
  43586. */
  43587. const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43588. xmlns: "http://www.w3.org/2000/svg",
  43589. viewBox: "0 0 24 24"
  43590. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43591. d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"
  43592. }));
  43593. /* harmony default export */ var align_left = (alignLeft);
  43594. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js
  43595. /**
  43596. * WordPress dependencies
  43597. */
  43598. const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43599. xmlns: "http://www.w3.org/2000/svg",
  43600. viewBox: "0 0 24 24"
  43601. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43602. d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
  43603. }));
  43604. /* harmony default export */ var align_center = (alignCenter);
  43605. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
  43606. /**
  43607. * WordPress dependencies
  43608. */
  43609. const alignRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43610. xmlns: "http://www.w3.org/2000/svg",
  43611. viewBox: "0 0 24 24"
  43612. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43613. d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
  43614. }));
  43615. /* harmony default export */ var align_right = (alignRight);
  43616. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-before.js
  43617. /**
  43618. * WordPress dependencies
  43619. */
  43620. const tableRowBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43621. xmlns: "http://www.w3.org/2000/svg",
  43622. viewBox: "-2 -2 24 24"
  43623. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43624. d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
  43625. }));
  43626. /* harmony default export */ var table_row_before = (tableRowBefore);
  43627. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
  43628. /**
  43629. * WordPress dependencies
  43630. */
  43631. const tableRowAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43632. xmlns: "http://www.w3.org/2000/svg",
  43633. viewBox: "-2 -2 24 24"
  43634. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43635. d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
  43636. }));
  43637. /* harmony default export */ var table_row_after = (tableRowAfter);
  43638. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
  43639. /**
  43640. * WordPress dependencies
  43641. */
  43642. const tableRowDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43643. xmlns: "http://www.w3.org/2000/svg",
  43644. viewBox: "-2 -2 24 24"
  43645. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43646. d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
  43647. }));
  43648. /* harmony default export */ var table_row_delete = (tableRowDelete);
  43649. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
  43650. /**
  43651. * WordPress dependencies
  43652. */
  43653. const tableColumnBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43654. xmlns: "http://www.w3.org/2000/svg",
  43655. viewBox: "-2 -2 24 24"
  43656. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43657. d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
  43658. }));
  43659. /* harmony default export */ var table_column_before = (tableColumnBefore);
  43660. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
  43661. /**
  43662. * WordPress dependencies
  43663. */
  43664. const tableColumnAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43665. xmlns: "http://www.w3.org/2000/svg",
  43666. viewBox: "-2 -2 24 24"
  43667. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43668. d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
  43669. }));
  43670. /* harmony default export */ var table_column_after = (tableColumnAfter);
  43671. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
  43672. /**
  43673. * WordPress dependencies
  43674. */
  43675. const tableColumnDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43676. xmlns: "http://www.w3.org/2000/svg",
  43677. viewBox: "-2 -2 24 24"
  43678. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43679. d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
  43680. }));
  43681. /* harmony default export */ var table_column_delete = (tableColumnDelete);
  43682. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
  43683. /**
  43684. * WordPress dependencies
  43685. */
  43686. const table = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  43687. xmlns: "http://www.w3.org/2000/svg",
  43688. viewBox: "0 0 24 24"
  43689. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  43690. d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
  43691. }));
  43692. /* harmony default export */ var library_table = (table);
  43693. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
  43694. /**
  43695. * External dependencies
  43696. */
  43697. const INHERITED_COLUMN_ATTRIBUTES = ['align'];
  43698. /**
  43699. * Creates a table state.
  43700. *
  43701. * @param {Object} options
  43702. * @param {number} options.rowCount Row count for the table to create.
  43703. * @param {number} options.columnCount Column count for the table to create.
  43704. *
  43705. * @return {Object} New table state.
  43706. */
  43707. function createTable(_ref) {
  43708. let {
  43709. rowCount,
  43710. columnCount
  43711. } = _ref;
  43712. return {
  43713. body: Array.from({
  43714. length: rowCount
  43715. }).map(() => ({
  43716. cells: Array.from({
  43717. length: columnCount
  43718. }).map(() => ({
  43719. content: '',
  43720. tag: 'td'
  43721. }))
  43722. }))
  43723. };
  43724. }
  43725. /**
  43726. * Returns the first row in the table.
  43727. *
  43728. * @param {Object} state Current table state.
  43729. *
  43730. * @return {Object} The first table row.
  43731. */
  43732. function getFirstRow(state) {
  43733. if (!isEmptyTableSection(state.head)) {
  43734. return state.head[0];
  43735. }
  43736. if (!isEmptyTableSection(state.body)) {
  43737. return state.body[0];
  43738. }
  43739. if (!isEmptyTableSection(state.foot)) {
  43740. return state.foot[0];
  43741. }
  43742. }
  43743. /**
  43744. * Gets an attribute for a cell.
  43745. *
  43746. * @param {Object} state Current table state.
  43747. * @param {Object} cellLocation The location of the cell
  43748. * @param {string} attributeName The name of the attribute to get the value of.
  43749. *
  43750. * @return {*} The attribute value.
  43751. */
  43752. function getCellAttribute(state, cellLocation, attributeName) {
  43753. const {
  43754. sectionName,
  43755. rowIndex,
  43756. columnIndex
  43757. } = cellLocation;
  43758. return (0,external_lodash_namespaceObject.get)(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
  43759. }
  43760. /**
  43761. * Returns updated cell attributes after applying the `updateCell` function to the selection.
  43762. *
  43763. * @param {Object} state The block attributes.
  43764. * @param {Object} selection The selection of cells to update.
  43765. * @param {Function} updateCell A function to update the selected cell attributes.
  43766. *
  43767. * @return {Object} New table state including the updated cells.
  43768. */
  43769. function updateSelectedCell(state, selection, updateCell) {
  43770. if (!selection) {
  43771. return state;
  43772. }
  43773. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  43774. const {
  43775. sectionName: selectionSectionName,
  43776. rowIndex: selectionRowIndex
  43777. } = selection;
  43778. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  43779. if (selectionSectionName && selectionSectionName !== sectionName) {
  43780. return section;
  43781. }
  43782. return section.map((row, rowIndex) => {
  43783. if (selectionRowIndex && selectionRowIndex !== rowIndex) {
  43784. return row;
  43785. }
  43786. return {
  43787. cells: row.cells.map((cellAttributes, columnIndex) => {
  43788. const cellLocation = {
  43789. sectionName,
  43790. columnIndex,
  43791. rowIndex
  43792. };
  43793. if (!isCellSelected(cellLocation, selection)) {
  43794. return cellAttributes;
  43795. }
  43796. return updateCell(cellAttributes);
  43797. })
  43798. };
  43799. });
  43800. });
  43801. }
  43802. /**
  43803. * Returns whether the cell at `cellLocation` is included in the selection `selection`.
  43804. *
  43805. * @param {Object} cellLocation An object containing cell location properties.
  43806. * @param {Object} selection An object containing selection properties.
  43807. *
  43808. * @return {boolean} True if the cell is selected, false otherwise.
  43809. */
  43810. function isCellSelected(cellLocation, selection) {
  43811. if (!cellLocation || !selection) {
  43812. return false;
  43813. }
  43814. switch (selection.type) {
  43815. case 'column':
  43816. return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex;
  43817. case 'cell':
  43818. return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex;
  43819. }
  43820. }
  43821. /**
  43822. * Inserts a row in the table state.
  43823. *
  43824. * @param {Object} state Current table state.
  43825. * @param {Object} options
  43826. * @param {string} options.sectionName Section in which to insert the row.
  43827. * @param {number} options.rowIndex Row index at which to insert the row.
  43828. * @param {number} options.columnCount Column count for the table to create.
  43829. *
  43830. * @return {Object} New table state.
  43831. */
  43832. function insertRow(state, _ref2) {
  43833. let {
  43834. sectionName,
  43835. rowIndex,
  43836. columnCount
  43837. } = _ref2;
  43838. const firstRow = getFirstRow(state);
  43839. const cellCount = columnCount === undefined ? (0,external_lodash_namespaceObject.get)(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
  43840. if (!cellCount) {
  43841. return state;
  43842. }
  43843. return {
  43844. [sectionName]: [...state[sectionName].slice(0, rowIndex), {
  43845. cells: Array.from({
  43846. length: cellCount
  43847. }).map((_, index) => {
  43848. const firstCellInColumn = (0,external_lodash_namespaceObject.get)(firstRow, ['cells', index], {});
  43849. const inheritedAttributes = (0,external_lodash_namespaceObject.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
  43850. return { ...inheritedAttributes,
  43851. content: '',
  43852. tag: sectionName === 'head' ? 'th' : 'td'
  43853. };
  43854. })
  43855. }, ...state[sectionName].slice(rowIndex)]
  43856. };
  43857. }
  43858. /**
  43859. * Deletes a row from the table state.
  43860. *
  43861. * @param {Object} state Current table state.
  43862. * @param {Object} options
  43863. * @param {string} options.sectionName Section in which to delete the row.
  43864. * @param {number} options.rowIndex Row index to delete.
  43865. *
  43866. * @return {Object} New table state.
  43867. */
  43868. function deleteRow(state, _ref3) {
  43869. let {
  43870. sectionName,
  43871. rowIndex
  43872. } = _ref3;
  43873. return {
  43874. [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex)
  43875. };
  43876. }
  43877. /**
  43878. * Inserts a column in the table state.
  43879. *
  43880. * @param {Object} state Current table state.
  43881. * @param {Object} options
  43882. * @param {number} options.columnIndex Column index at which to insert the column.
  43883. *
  43884. * @return {Object} New table state.
  43885. */
  43886. function insertColumn(state, _ref4) {
  43887. let {
  43888. columnIndex
  43889. } = _ref4;
  43890. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  43891. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  43892. // Bail early if the table section is empty.
  43893. if (isEmptyTableSection(section)) {
  43894. return section;
  43895. }
  43896. return section.map(row => {
  43897. // Bail early if the row is empty or it's an attempt to insert past
  43898. // the last possible index of the array.
  43899. if (isEmptyRow(row) || row.cells.length < columnIndex) {
  43900. return row;
  43901. }
  43902. return {
  43903. cells: [...row.cells.slice(0, columnIndex), {
  43904. content: '',
  43905. tag: sectionName === 'head' ? 'th' : 'td'
  43906. }, ...row.cells.slice(columnIndex)]
  43907. };
  43908. });
  43909. });
  43910. }
  43911. /**
  43912. * Deletes a column from the table state.
  43913. *
  43914. * @param {Object} state Current table state.
  43915. * @param {Object} options
  43916. * @param {number} options.columnIndex Column index to delete.
  43917. *
  43918. * @return {Object} New table state.
  43919. */
  43920. function deleteColumn(state, _ref5) {
  43921. let {
  43922. columnIndex
  43923. } = _ref5;
  43924. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  43925. return (0,external_lodash_namespaceObject.mapValues)(tableSections, section => {
  43926. // Bail early if the table section is empty.
  43927. if (isEmptyTableSection(section)) {
  43928. return section;
  43929. }
  43930. return section.map(row => ({
  43931. cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells
  43932. })).filter(row => row.cells.length);
  43933. });
  43934. }
  43935. /**
  43936. * Toggles the existance of a section.
  43937. *
  43938. * @param {Object} state Current table state.
  43939. * @param {string} sectionName Name of the section to toggle.
  43940. *
  43941. * @return {Object} New table state.
  43942. */
  43943. function toggleSection(state, sectionName) {
  43944. // Section exists, replace it with an empty row to remove it.
  43945. if (!isEmptyTableSection(state[sectionName])) {
  43946. return {
  43947. [sectionName]: []
  43948. };
  43949. } // Get the length of the first row of the body to use when creating the header.
  43950. const columnCount = (0,external_lodash_namespaceObject.get)(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
  43951. return insertRow(state, {
  43952. sectionName,
  43953. rowIndex: 0,
  43954. columnCount
  43955. });
  43956. }
  43957. /**
  43958. * Determines whether a table section is empty.
  43959. *
  43960. * @param {Object} section Table section state.
  43961. *
  43962. * @return {boolean} True if the table section is empty, false otherwise.
  43963. */
  43964. function isEmptyTableSection(section) {
  43965. return !section || !section.length || (0,external_lodash_namespaceObject.every)(section, isEmptyRow);
  43966. }
  43967. /**
  43968. * Determines whether a table row is empty.
  43969. *
  43970. * @param {Object} row Table row state.
  43971. *
  43972. * @return {boolean} True if the table section is empty, false otherwise.
  43973. */
  43974. function isEmptyRow(row) {
  43975. return !(row.cells && row.cells.length);
  43976. }
  43977. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
  43978. /**
  43979. * External dependencies
  43980. */
  43981. /**
  43982. * WordPress dependencies
  43983. */
  43984. /**
  43985. * Internal dependencies
  43986. */
  43987. const ALIGNMENT_CONTROLS = [{
  43988. icon: align_left,
  43989. title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
  43990. align: 'left'
  43991. }, {
  43992. icon: align_center,
  43993. title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
  43994. align: 'center'
  43995. }, {
  43996. icon: align_right,
  43997. title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
  43998. align: 'right'
  43999. }];
  44000. const cellAriaLabel = {
  44001. head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
  44002. body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
  44003. foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
  44004. };
  44005. const edit_placeholder = {
  44006. head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
  44007. foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
  44008. };
  44009. function TSection(_ref) {
  44010. let {
  44011. name,
  44012. ...props
  44013. } = _ref;
  44014. const TagName = `t${name}`;
  44015. return (0,external_wp_element_namespaceObject.createElement)(TagName, props);
  44016. }
  44017. function TableEdit(_ref2) {
  44018. var _attributes$style;
  44019. let {
  44020. attributes,
  44021. setAttributes,
  44022. insertBlocksAfter,
  44023. isSelected
  44024. } = _ref2;
  44025. const {
  44026. hasFixedLayout,
  44027. caption,
  44028. head,
  44029. foot
  44030. } = attributes;
  44031. const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
  44032. const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
  44033. const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
  44034. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  44035. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  44036. const tableRef = (0,external_wp_element_namespaceObject.useRef)();
  44037. const [hasTableCreated, setHasTableCreated] = (0,external_wp_element_namespaceObject.useState)(false);
  44038. /**
  44039. * Updates the initial column count used for table creation.
  44040. *
  44041. * @param {number} count New initial column count.
  44042. */
  44043. function onChangeInitialColumnCount(count) {
  44044. setInitialColumnCount(count);
  44045. }
  44046. /**
  44047. * Updates the initial row count used for table creation.
  44048. *
  44049. * @param {number} count New initial row count.
  44050. */
  44051. function onChangeInitialRowCount(count) {
  44052. setInitialRowCount(count);
  44053. }
  44054. /**
  44055. * Creates a table based on dimensions in local state.
  44056. *
  44057. * @param {Object} event Form submit event.
  44058. */
  44059. function onCreateTable(event) {
  44060. event.preventDefault();
  44061. setAttributes(createTable({
  44062. rowCount: parseInt(initialRowCount, 10) || 2,
  44063. columnCount: parseInt(initialColumnCount, 10) || 2
  44064. }));
  44065. setHasTableCreated(true);
  44066. }
  44067. /**
  44068. * Toggles whether the table has a fixed layout or not.
  44069. */
  44070. function onChangeFixedLayout() {
  44071. setAttributes({
  44072. hasFixedLayout: !hasFixedLayout
  44073. });
  44074. }
  44075. /**
  44076. * Changes the content of the currently selected cell.
  44077. *
  44078. * @param {Array} content A RichText content value.
  44079. */
  44080. function onChange(content) {
  44081. if (!selectedCell) {
  44082. return;
  44083. }
  44084. setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ ...cellAttributes,
  44085. content
  44086. })));
  44087. }
  44088. /**
  44089. * Align text within the a column.
  44090. *
  44091. * @param {string} align The new alignment to apply to the column.
  44092. */
  44093. function onChangeColumnAlignment(align) {
  44094. if (!selectedCell) {
  44095. return;
  44096. } // Convert the cell selection to a column selection so that alignment
  44097. // is applied to the entire column.
  44098. const columnSelection = {
  44099. type: 'column',
  44100. columnIndex: selectedCell.columnIndex
  44101. };
  44102. const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ ...cellAttributes,
  44103. align
  44104. }));
  44105. setAttributes(newAttributes);
  44106. }
  44107. /**
  44108. * Get the alignment of the currently selected cell.
  44109. *
  44110. * @return {string} The new alignment to apply to the column.
  44111. */
  44112. function getCellAlignment() {
  44113. if (!selectedCell) {
  44114. return;
  44115. }
  44116. return getCellAttribute(attributes, selectedCell, 'align');
  44117. }
  44118. /**
  44119. * Add or remove a `head` table section.
  44120. */
  44121. function onToggleHeaderSection() {
  44122. setAttributes(toggleSection(attributes, 'head'));
  44123. }
  44124. /**
  44125. * Add or remove a `foot` table section.
  44126. */
  44127. function onToggleFooterSection() {
  44128. setAttributes(toggleSection(attributes, 'foot'));
  44129. }
  44130. /**
  44131. * Inserts a row at the currently selected row index, plus `delta`.
  44132. *
  44133. * @param {number} delta Offset for selected row index at which to insert.
  44134. */
  44135. function onInsertRow(delta) {
  44136. if (!selectedCell) {
  44137. return;
  44138. }
  44139. const {
  44140. sectionName,
  44141. rowIndex
  44142. } = selectedCell;
  44143. const newRowIndex = rowIndex + delta;
  44144. setAttributes(insertRow(attributes, {
  44145. sectionName,
  44146. rowIndex: newRowIndex
  44147. })); // Select the first cell of the new row.
  44148. setSelectedCell({
  44149. sectionName,
  44150. rowIndex: newRowIndex,
  44151. columnIndex: 0,
  44152. type: 'cell'
  44153. });
  44154. }
  44155. /**
  44156. * Inserts a row before the currently selected row.
  44157. */
  44158. function onInsertRowBefore() {
  44159. onInsertRow(0);
  44160. }
  44161. /**
  44162. * Inserts a row after the currently selected row.
  44163. */
  44164. function onInsertRowAfter() {
  44165. onInsertRow(1);
  44166. }
  44167. /**
  44168. * Deletes the currently selected row.
  44169. */
  44170. function onDeleteRow() {
  44171. if (!selectedCell) {
  44172. return;
  44173. }
  44174. const {
  44175. sectionName,
  44176. rowIndex
  44177. } = selectedCell;
  44178. setSelectedCell();
  44179. setAttributes(deleteRow(attributes, {
  44180. sectionName,
  44181. rowIndex
  44182. }));
  44183. }
  44184. /**
  44185. * Inserts a column at the currently selected column index, plus `delta`.
  44186. *
  44187. * @param {number} delta Offset for selected column index at which to insert.
  44188. */
  44189. function onInsertColumn() {
  44190. let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  44191. if (!selectedCell) {
  44192. return;
  44193. }
  44194. const {
  44195. columnIndex
  44196. } = selectedCell;
  44197. const newColumnIndex = columnIndex + delta;
  44198. setAttributes(insertColumn(attributes, {
  44199. columnIndex: newColumnIndex
  44200. })); // Select the first cell of the new column.
  44201. setSelectedCell({
  44202. rowIndex: 0,
  44203. columnIndex: newColumnIndex,
  44204. type: 'cell'
  44205. });
  44206. }
  44207. /**
  44208. * Inserts a column before the currently selected column.
  44209. */
  44210. function onInsertColumnBefore() {
  44211. onInsertColumn(0);
  44212. }
  44213. /**
  44214. * Inserts a column after the currently selected column.
  44215. */
  44216. function onInsertColumnAfter() {
  44217. onInsertColumn(1);
  44218. }
  44219. /**
  44220. * Deletes the currently selected column.
  44221. */
  44222. function onDeleteColumn() {
  44223. if (!selectedCell) {
  44224. return;
  44225. }
  44226. const {
  44227. sectionName,
  44228. columnIndex
  44229. } = selectedCell;
  44230. setSelectedCell();
  44231. setAttributes(deleteColumn(attributes, {
  44232. sectionName,
  44233. columnIndex
  44234. }));
  44235. }
  44236. (0,external_wp_element_namespaceObject.useEffect)(() => {
  44237. if (!isSelected) {
  44238. setSelectedCell();
  44239. }
  44240. }, [isSelected]);
  44241. (0,external_wp_element_namespaceObject.useEffect)(() => {
  44242. if (hasTableCreated) {
  44243. var _tableRef$current, _tableRef$current$que;
  44244. tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$que = _tableRef$current.querySelector('td[contentEditable="true"]')) === null || _tableRef$current$que === void 0 ? void 0 : _tableRef$current$que.focus();
  44245. setHasTableCreated(false);
  44246. }
  44247. }, [hasTableCreated]);
  44248. const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
  44249. const tableControls = [{
  44250. icon: table_row_before,
  44251. title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
  44252. isDisabled: !selectedCell,
  44253. onClick: onInsertRowBefore
  44254. }, {
  44255. icon: table_row_after,
  44256. title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
  44257. isDisabled: !selectedCell,
  44258. onClick: onInsertRowAfter
  44259. }, {
  44260. icon: table_row_delete,
  44261. title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
  44262. isDisabled: !selectedCell,
  44263. onClick: onDeleteRow
  44264. }, {
  44265. icon: table_column_before,
  44266. title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
  44267. isDisabled: !selectedCell,
  44268. onClick: onInsertColumnBefore
  44269. }, {
  44270. icon: table_column_after,
  44271. title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
  44272. isDisabled: !selectedCell,
  44273. onClick: onInsertColumnAfter
  44274. }, {
  44275. icon: table_column_delete,
  44276. title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
  44277. isDisabled: !selectedCell,
  44278. onClick: onDeleteColumn
  44279. }];
  44280. const renderedSections = ['head', 'body', 'foot'].map(name => (0,external_wp_element_namespaceObject.createElement)(TSection, {
  44281. name: name,
  44282. key: name
  44283. }, attributes[name].map((_ref3, rowIndex) => {
  44284. let {
  44285. cells
  44286. } = _ref3;
  44287. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  44288. key: rowIndex
  44289. }, cells.map((_ref4, columnIndex) => {
  44290. let {
  44291. content,
  44292. tag: CellTag,
  44293. scope,
  44294. align
  44295. } = _ref4;
  44296. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  44297. tagName: CellTag,
  44298. key: columnIndex,
  44299. className: classnames_default()({
  44300. [`has-text-align-${align}`]: align
  44301. }, 'wp-block-table__cell-content'),
  44302. scope: CellTag === 'th' ? scope : undefined,
  44303. value: content,
  44304. onChange: onChange,
  44305. unstableOnFocus: () => {
  44306. setSelectedCell({
  44307. sectionName: name,
  44308. rowIndex,
  44309. columnIndex,
  44310. type: 'cell'
  44311. });
  44312. },
  44313. "aria-label": cellAriaLabel[name],
  44314. placeholder: edit_placeholder[name]
  44315. });
  44316. }));
  44317. })));
  44318. const isEmpty = !sections.length;
  44319. return (0,external_wp_element_namespaceObject.createElement)("figure", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  44320. ref: tableRef
  44321. }), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  44322. group: "block"
  44323. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  44324. label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
  44325. alignmentControls: ALIGNMENT_CONTROLS,
  44326. value: getCellAlignment(),
  44327. onChange: nextAlign => onChangeColumnAlignment(nextAlign)
  44328. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  44329. group: "other"
  44330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  44331. hasArrowIndicator: true,
  44332. icon: library_table,
  44333. label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
  44334. controls: tableControls
  44335. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  44336. title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
  44337. className: "blocks-table-settings"
  44338. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  44339. label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
  44340. checked: !!hasFixedLayout,
  44341. onChange: onChangeFixedLayout
  44342. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  44343. label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
  44344. checked: !!(head && head.length),
  44345. onChange: onToggleHeaderSection
  44346. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  44347. label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
  44348. checked: !!(foot && foot.length),
  44349. onChange: onToggleFooterSection
  44350. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)("table", {
  44351. className: classnames_default()(colorProps.className, borderProps.className, {
  44352. 'has-fixed-layout': hasFixedLayout,
  44353. // This is required in the editor only to overcome
  44354. // the fact the editor rewrites individual border
  44355. // widths into a shorthand format.
  44356. 'has-individual-borders': (0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.border)
  44357. }),
  44358. style: { ...colorProps.style,
  44359. ...borderProps.style
  44360. }
  44361. }, renderedSections), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  44362. tagName: "figcaption",
  44363. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  44364. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
  44365. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  44366. value: caption,
  44367. onChange: value => setAttributes({
  44368. caption: value
  44369. }) // Deselect the selected table cell when the caption is focused.
  44370. ,
  44371. unstableOnFocus: () => setSelectedCell(),
  44372. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  44373. }), isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  44374. label: (0,external_wp_i18n_namespaceObject.__)('Table'),
  44375. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  44376. icon: block_table,
  44377. showColors: true
  44378. }),
  44379. instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.')
  44380. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  44381. className: "blocks-table__placeholder-form",
  44382. onSubmit: onCreateTable
  44383. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  44384. type: "number",
  44385. label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
  44386. value: initialColumnCount,
  44387. onChange: onChangeInitialColumnCount,
  44388. min: "1",
  44389. className: "blocks-table__placeholder-input"
  44390. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  44391. type: "number",
  44392. label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
  44393. value: initialRowCount,
  44394. onChange: onChangeInitialRowCount,
  44395. min: "1",
  44396. className: "blocks-table__placeholder-input"
  44397. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  44398. className: "blocks-table__placeholder-button",
  44399. variant: "primary",
  44400. type: "submit"
  44401. }, (0,external_wp_i18n_namespaceObject.__)('Create Table')))));
  44402. }
  44403. /* harmony default export */ var table_edit = (TableEdit);
  44404. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
  44405. /**
  44406. * External dependencies
  44407. */
  44408. /**
  44409. * WordPress dependencies
  44410. */
  44411. function table_save_save(_ref) {
  44412. let {
  44413. attributes
  44414. } = _ref;
  44415. const {
  44416. hasFixedLayout,
  44417. head,
  44418. body,
  44419. foot,
  44420. caption
  44421. } = attributes;
  44422. const isEmpty = !head.length && !body.length && !foot.length;
  44423. if (isEmpty) {
  44424. return null;
  44425. }
  44426. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  44427. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  44428. const classes = classnames_default()(colorProps.className, borderProps.className, {
  44429. 'has-fixed-layout': hasFixedLayout
  44430. });
  44431. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  44432. const Section = _ref2 => {
  44433. let {
  44434. type,
  44435. rows
  44436. } = _ref2;
  44437. if (!rows.length) {
  44438. return null;
  44439. }
  44440. const Tag = `t${type}`;
  44441. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  44442. let {
  44443. cells
  44444. } = _ref3;
  44445. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  44446. key: rowIndex
  44447. }, cells.map((_ref4, cellIndex) => {
  44448. let {
  44449. content,
  44450. tag,
  44451. scope,
  44452. align
  44453. } = _ref4;
  44454. const cellClasses = classnames_default()({
  44455. [`has-text-align-${align}`]: align
  44456. });
  44457. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  44458. className: cellClasses ? cellClasses : undefined,
  44459. "data-align": align,
  44460. tagName: tag,
  44461. value: content,
  44462. key: cellIndex,
  44463. scope: tag === 'th' ? scope : undefined
  44464. });
  44465. }));
  44466. }));
  44467. };
  44468. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  44469. className: classes === '' ? undefined : classes,
  44470. style: { ...colorProps.style,
  44471. ...borderProps.style
  44472. }
  44473. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  44474. type: "head",
  44475. rows: head
  44476. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  44477. type: "body",
  44478. rows: body
  44479. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  44480. type: "foot",
  44481. rows: foot
  44482. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  44483. tagName: "figcaption",
  44484. value: caption,
  44485. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
  44486. }));
  44487. }
  44488. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js
  44489. const tableContentPasteSchema = _ref => {
  44490. let {
  44491. phrasingContentSchema
  44492. } = _ref;
  44493. return {
  44494. tr: {
  44495. allowEmpty: true,
  44496. children: {
  44497. th: {
  44498. allowEmpty: true,
  44499. children: phrasingContentSchema,
  44500. attributes: ['scope']
  44501. },
  44502. td: {
  44503. allowEmpty: true,
  44504. children: phrasingContentSchema
  44505. }
  44506. }
  44507. }
  44508. };
  44509. };
  44510. const tablePasteSchema = args => ({
  44511. table: {
  44512. children: {
  44513. thead: {
  44514. allowEmpty: true,
  44515. children: tableContentPasteSchema(args)
  44516. },
  44517. tfoot: {
  44518. allowEmpty: true,
  44519. children: tableContentPasteSchema(args)
  44520. },
  44521. tbody: {
  44522. allowEmpty: true,
  44523. children: tableContentPasteSchema(args)
  44524. }
  44525. }
  44526. }
  44527. });
  44528. const table_transforms_transforms = {
  44529. from: [{
  44530. type: 'raw',
  44531. selector: 'table',
  44532. schema: tablePasteSchema
  44533. }]
  44534. };
  44535. /* harmony default export */ var table_transforms = (table_transforms_transforms);
  44536. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
  44537. /**
  44538. * WordPress dependencies
  44539. */
  44540. /**
  44541. * Internal dependencies
  44542. */
  44543. const table_metadata = {
  44544. $schema: "https://schemas.wp.org/trunk/block.json",
  44545. apiVersion: 2,
  44546. name: "core/table",
  44547. title: "Table",
  44548. category: "text",
  44549. description: "Create structured content in rows and columns to display information.",
  44550. textdomain: "default",
  44551. attributes: {
  44552. hasFixedLayout: {
  44553. type: "boolean",
  44554. "default": false
  44555. },
  44556. caption: {
  44557. type: "string",
  44558. source: "html",
  44559. selector: "figcaption",
  44560. "default": ""
  44561. },
  44562. head: {
  44563. type: "array",
  44564. "default": [],
  44565. source: "query",
  44566. selector: "thead tr",
  44567. query: {
  44568. cells: {
  44569. type: "array",
  44570. "default": [],
  44571. source: "query",
  44572. selector: "td,th",
  44573. query: {
  44574. content: {
  44575. type: "string",
  44576. source: "html"
  44577. },
  44578. tag: {
  44579. type: "string",
  44580. "default": "td",
  44581. source: "tag"
  44582. },
  44583. scope: {
  44584. type: "string",
  44585. source: "attribute",
  44586. attribute: "scope"
  44587. },
  44588. align: {
  44589. type: "string",
  44590. source: "attribute",
  44591. attribute: "data-align"
  44592. }
  44593. }
  44594. }
  44595. }
  44596. },
  44597. body: {
  44598. type: "array",
  44599. "default": [],
  44600. source: "query",
  44601. selector: "tbody tr",
  44602. query: {
  44603. cells: {
  44604. type: "array",
  44605. "default": [],
  44606. source: "query",
  44607. selector: "td,th",
  44608. query: {
  44609. content: {
  44610. type: "string",
  44611. source: "html"
  44612. },
  44613. tag: {
  44614. type: "string",
  44615. "default": "td",
  44616. source: "tag"
  44617. },
  44618. scope: {
  44619. type: "string",
  44620. source: "attribute",
  44621. attribute: "scope"
  44622. },
  44623. align: {
  44624. type: "string",
  44625. source: "attribute",
  44626. attribute: "data-align"
  44627. }
  44628. }
  44629. }
  44630. }
  44631. },
  44632. foot: {
  44633. type: "array",
  44634. "default": [],
  44635. source: "query",
  44636. selector: "tfoot tr",
  44637. query: {
  44638. cells: {
  44639. type: "array",
  44640. "default": [],
  44641. source: "query",
  44642. selector: "td,th",
  44643. query: {
  44644. content: {
  44645. type: "string",
  44646. source: "html"
  44647. },
  44648. tag: {
  44649. type: "string",
  44650. "default": "td",
  44651. source: "tag"
  44652. },
  44653. scope: {
  44654. type: "string",
  44655. source: "attribute",
  44656. attribute: "scope"
  44657. },
  44658. align: {
  44659. type: "string",
  44660. source: "attribute",
  44661. attribute: "data-align"
  44662. }
  44663. }
  44664. }
  44665. }
  44666. }
  44667. },
  44668. supports: {
  44669. anchor: true,
  44670. align: true,
  44671. color: {
  44672. __experimentalSkipSerialization: true,
  44673. gradients: true,
  44674. __experimentalDefaultControls: {
  44675. background: true,
  44676. text: true
  44677. }
  44678. },
  44679. spacing: {
  44680. margin: true,
  44681. padding: true
  44682. },
  44683. typography: {
  44684. fontSize: true,
  44685. lineHeight: true,
  44686. __experimentalFontFamily: true,
  44687. __experimentalFontStyle: true,
  44688. __experimentalFontWeight: true,
  44689. __experimentalLetterSpacing: true,
  44690. __experimentalTextTransform: true,
  44691. __experimentalTextDecoration: true,
  44692. __experimentalDefaultControls: {
  44693. fontSize: true
  44694. }
  44695. },
  44696. __experimentalBorder: {
  44697. __experimentalSkipSerialization: true,
  44698. color: true,
  44699. style: true,
  44700. width: true,
  44701. __experimentalDefaultControls: {
  44702. color: true,
  44703. style: true,
  44704. width: true
  44705. }
  44706. },
  44707. __experimentalSelector: ".wp-block-table > table"
  44708. },
  44709. styles: [{
  44710. name: "regular",
  44711. label: "Default",
  44712. isDefault: true
  44713. }, {
  44714. name: "stripes",
  44715. label: "Stripes"
  44716. }],
  44717. editorStyle: "wp-block-table-editor",
  44718. style: "wp-block-table"
  44719. };
  44720. const {
  44721. name: table_name
  44722. } = table_metadata;
  44723. const table_settings = {
  44724. icon: block_table,
  44725. example: {
  44726. attributes: {
  44727. head: [{
  44728. cells: [{
  44729. content: (0,external_wp_i18n_namespaceObject.__)('Version'),
  44730. tag: 'th'
  44731. }, {
  44732. content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
  44733. tag: 'th'
  44734. }, {
  44735. content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
  44736. tag: 'th'
  44737. }]
  44738. }],
  44739. body: [{
  44740. cells: [{
  44741. content: '5.2',
  44742. tag: 'td'
  44743. }, {
  44744. content: 'Jaco Pastorius',
  44745. tag: 'td'
  44746. }, {
  44747. content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
  44748. tag: 'td'
  44749. }]
  44750. }, {
  44751. cells: [{
  44752. content: '5.1',
  44753. tag: 'td'
  44754. }, {
  44755. content: 'Betty Carter',
  44756. tag: 'td'
  44757. }, {
  44758. content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
  44759. tag: 'td'
  44760. }]
  44761. }, {
  44762. cells: [{
  44763. content: '5.0',
  44764. tag: 'td'
  44765. }, {
  44766. content: 'Bebo Valdés',
  44767. tag: 'td'
  44768. }, {
  44769. content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
  44770. tag: 'td'
  44771. }]
  44772. }]
  44773. }
  44774. },
  44775. transforms: table_transforms,
  44776. edit: table_edit,
  44777. save: table_save_save,
  44778. deprecated: table_deprecated
  44779. };
  44780. const table_init = () => initBlock({
  44781. name: table_name,
  44782. metadata: table_metadata,
  44783. settings: table_settings
  44784. });
  44785. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/icon.js
  44786. /**
  44787. * WordPress dependencies
  44788. */
  44789. /* harmony default export */ var table_of_contents_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  44790. xmlns: "http://www.w3.org/2000/svg",
  44791. width: "24",
  44792. height: "24",
  44793. viewBox: "0 0 24 24"
  44794. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  44795. d: "M15.1 15.8H20v-1.5h-4.9v1.5zm-4-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 3c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zm5-3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",
  44796. fill: "#1e1e1e"
  44797. })));
  44798. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/list.js
  44799. /**
  44800. * WordPress dependencies
  44801. */
  44802. /**
  44803. * Internal dependencies
  44804. */
  44805. const ENTRY_CLASS_NAME = 'wp-block-table-of-contents__entry';
  44806. function TableOfContentsList(_ref) {
  44807. let {
  44808. nestedHeadingList
  44809. } = _ref;
  44810. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, nestedHeadingList.map((node, index) => {
  44811. const {
  44812. content,
  44813. link
  44814. } = node.heading;
  44815. const entry = link ? (0,external_wp_element_namespaceObject.createElement)("a", {
  44816. className: ENTRY_CLASS_NAME,
  44817. href: link
  44818. }, content) : (0,external_wp_element_namespaceObject.createElement)("span", {
  44819. className: ENTRY_CLASS_NAME
  44820. }, content);
  44821. return (0,external_wp_element_namespaceObject.createElement)("li", {
  44822. key: index
  44823. }, entry, node.children ? (0,external_wp_element_namespaceObject.createElement)("ol", null, (0,external_wp_element_namespaceObject.createElement)(TableOfContentsList, {
  44824. nestedHeadingList: node.children
  44825. })) : null);
  44826. }));
  44827. }
  44828. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/utils.js
  44829. /**
  44830. * Takes a flat list of heading parameters and nests them based on each header's
  44831. * immediate parent's level.
  44832. *
  44833. * @param headingList The flat list of headings to nest.
  44834. *
  44835. * @return The nested list of headings.
  44836. */
  44837. function linearToNestedHeadingList(headingList) {
  44838. const nestedHeadingList = [];
  44839. headingList.forEach((heading, key) => {
  44840. if (heading.content === '') {
  44841. return;
  44842. } // Make sure we are only working with the same level as the first iteration in our set.
  44843. if (heading.level === headingList[0].level) {
  44844. var _headingList;
  44845. // Check that the next iteration will return a value.
  44846. // If it does and the next level is greater than the current level,
  44847. // the next iteration becomes a child of the current iteration.
  44848. if (((_headingList = headingList[key + 1]) === null || _headingList === void 0 ? void 0 : _headingList.level) > heading.level) {
  44849. // We must calculate the last index before the next iteration that
  44850. // has the same level (siblings). We then use this index to slice
  44851. // the array for use in recursion. This prevents duplicate nodes.
  44852. let endOfSlice = headingList.length;
  44853. for (let i = key + 1; i < headingList.length; i++) {
  44854. if (headingList[i].level === heading.level) {
  44855. endOfSlice = i;
  44856. break;
  44857. }
  44858. } // We found a child node: Push a new node onto the return array
  44859. // with children.
  44860. nestedHeadingList.push({
  44861. heading,
  44862. children: linearToNestedHeadingList(headingList.slice(key + 1, endOfSlice))
  44863. });
  44864. } else {
  44865. // No child node: Push a new node onto the return array.
  44866. nestedHeadingList.push({
  44867. heading,
  44868. children: null
  44869. });
  44870. }
  44871. }
  44872. });
  44873. return nestedHeadingList;
  44874. }
  44875. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/edit.js
  44876. /**
  44877. * External dependencies
  44878. */
  44879. /**
  44880. * WordPress dependencies
  44881. */
  44882. /**
  44883. * Internal dependencies
  44884. */
  44885. /** @typedef {import('./utils').HeadingData} HeadingData */
  44886. /**
  44887. * Table of Contents block edit component.
  44888. *
  44889. * @param {Object} props The props.
  44890. * @param {Object} props.attributes The block attributes.
  44891. * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.
  44892. * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).
  44893. * @param {string} props.clientId
  44894. * @param {(attributes: Object) => void} props.setAttributes
  44895. *
  44896. * @return {WPComponent} The component.
  44897. */
  44898. function TableOfContentsEdit(_ref) {
  44899. let {
  44900. attributes: {
  44901. headings = [],
  44902. onlyIncludeCurrentPage
  44903. },
  44904. clientId,
  44905. setAttributes
  44906. } = _ref;
  44907. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  44908. const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
  44909. const canInsertList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  44910. const {
  44911. getBlockRootClientId,
  44912. canInsertBlockType
  44913. } = select(external_wp_blockEditor_namespaceObject.store);
  44914. const rootClientId = getBlockRootClientId(clientId);
  44915. return canInsertBlockType('core/list', rootClientId);
  44916. }, [clientId]);
  44917. const {
  44918. __unstableMarkNextChangeAsNotPersistent,
  44919. replaceBlocks
  44920. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  44921. /**
  44922. * The latest heading data, or null if the new data deeply equals the saved
  44923. * headings attribute.
  44924. *
  44925. * Since useSelect forces a re-render when its return value is shallowly
  44926. * inequal to its prior call, we would be re-rendering this block every time
  44927. * the stores change, even if the latest headings were deeply equal to the
  44928. * ones saved in the block attributes.
  44929. *
  44930. * By returning null when they're equal, we reduce that to 2 renders: one
  44931. * when there are new latest headings (and so it returns them), and one when
  44932. * they haven't changed (so it returns null). As long as the latest heading
  44933. * data remains the same, further calls of the useSelect callback will
  44934. * continue to return null, thus preventing any forced re-renders.
  44935. */
  44936. const latestHeadings = (0,external_wp_data_namespaceObject.useSelect)(select => {
  44937. var _editorSelectors$getP;
  44938. const {
  44939. getBlockAttributes,
  44940. getBlockName,
  44941. getClientIdsWithDescendants,
  44942. __experimentalGetGlobalBlocksByName: getGlobalBlocksByName
  44943. } = select(external_wp_blockEditor_namespaceObject.store); // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  44944. // Blocks can be loaded into a *non-post* block editor, so to avoid
  44945. // declaring @wordpress/editor as a dependency, we must access its
  44946. // store by string. When the store is not available, editorSelectors
  44947. // will be null, and the block's saved markup will lack permalinks.
  44948. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  44949. const editorSelectors = select('core/editor');
  44950. const pageBreakClientIds = getGlobalBlocksByName('core/nextpage');
  44951. const isPaginated = pageBreakClientIds.length !== 0; // Get the client ids of all blocks in the editor.
  44952. const allBlockClientIds = getClientIdsWithDescendants(); // If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.
  44953. let tocPage = 1;
  44954. if (isPaginated && onlyIncludeCurrentPage) {
  44955. // We can't use getBlockIndex because it only returns the index
  44956. // relative to sibling blocks.
  44957. const tocIndex = allBlockClientIds.indexOf(clientId);
  44958. for (const [blockIndex, blockClientId] of allBlockClientIds.entries()) {
  44959. // If we've reached blocks after the Table of Contents, we've
  44960. // finished calculating which page the block is on.
  44961. if (blockIndex >= tocIndex) {
  44962. break;
  44963. }
  44964. if (getBlockName(blockClientId) === 'core/nextpage') {
  44965. tocPage++;
  44966. }
  44967. }
  44968. }
  44969. const _latestHeadings = [];
  44970. /** The page (of a paginated post) a heading will be part of. */
  44971. let headingPage = 1;
  44972. /**
  44973. * A permalink to the current post. If the core/editor store is
  44974. * unavailable, this variable will be null.
  44975. */
  44976. const permalink = (_editorSelectors$getP = editorSelectors === null || editorSelectors === void 0 ? void 0 : editorSelectors.getPermalink()) !== null && _editorSelectors$getP !== void 0 ? _editorSelectors$getP : null;
  44977. let headingPageLink = null; // If the core/editor store is available, we can add permalinks to the
  44978. // generated table of contents.
  44979. if (typeof permalink === 'string') {
  44980. headingPageLink = isPaginated ? (0,external_wp_url_namespaceObject.addQueryArgs)(permalink, {
  44981. page: headingPage
  44982. }) : permalink;
  44983. }
  44984. for (const blockClientId of allBlockClientIds) {
  44985. const blockName = getBlockName(blockClientId);
  44986. if (blockName === 'core/nextpage') {
  44987. headingPage++; // If we're only including headings from the current page (of
  44988. // a paginated post), then exit the loop if we've reached the
  44989. // pages after the one with the Table of Contents block.
  44990. if (onlyIncludeCurrentPage && headingPage > tocPage) {
  44991. break;
  44992. }
  44993. if (typeof permalink === 'string') {
  44994. headingPageLink = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(permalink, ['page']), {
  44995. page: headingPage
  44996. });
  44997. }
  44998. } // If we're including all headings or we've reached headings on
  44999. // the same page as the Table of Contents block, add them to the
  45000. // list.
  45001. else if (!onlyIncludeCurrentPage || headingPage === tocPage) {
  45002. if (blockName === 'core/heading') {
  45003. const headingAttributes = getBlockAttributes(blockClientId);
  45004. const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== '';
  45005. _latestHeadings.push({
  45006. // Convert line breaks to spaces, and get rid of HTML tags in the headings.
  45007. content: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(<br *\/?>)+/g, ' ')),
  45008. level: headingAttributes.level,
  45009. link: canBeLinked ? `${headingPageLink}#${headingAttributes.anchor}` : null
  45010. });
  45011. }
  45012. }
  45013. }
  45014. if ((0,external_lodash_namespaceObject.isEqual)(headings, _latestHeadings)) {
  45015. return null;
  45016. }
  45017. return _latestHeadings;
  45018. }, [clientId, onlyIncludeCurrentPage, headings]);
  45019. (0,external_wp_element_namespaceObject.useEffect)(() => {
  45020. if (latestHeadings !== null) {
  45021. // This is required to keep undo working and not create 2 undo steps
  45022. // for each heading change.
  45023. __unstableMarkNextChangeAsNotPersistent();
  45024. setAttributes({
  45025. headings: latestHeadings
  45026. });
  45027. }
  45028. }, [latestHeadings]);
  45029. const headingTree = linearToNestedHeadingList(headings);
  45030. const toolbarControls = canInsertList && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  45031. onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  45032. ordered: true,
  45033. values: (0,external_wp_element_namespaceObject.renderToString)((0,external_wp_element_namespaceObject.createElement)(TableOfContentsList, {
  45034. nestedHeadingList: headingTree
  45035. }))
  45036. }))
  45037. }, (0,external_wp_i18n_namespaceObject.__)('Convert to static list'))));
  45038. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  45039. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  45040. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  45041. label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'),
  45042. checked: onlyIncludeCurrentPage,
  45043. onChange: value => setAttributes({
  45044. onlyIncludeCurrentPage: value
  45045. }),
  45046. help: onlyIncludeCurrentPage ? (0,external_wp_i18n_namespaceObject.__)('Only including headings from the current page (if the post is paginated).') : (0,external_wp_i18n_namespaceObject.__)('Toggle to only include headings from the current page (if the post is paginated).')
  45047. }))); // If there are no headings or the only heading is empty.
  45048. // Note that the toolbar controls are intentionally omitted since the
  45049. // "Convert to static list" option is useless to the placeholder state.
  45050. if (headings.length === 0) {
  45051. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  45052. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  45053. icon: table_of_contents_icon
  45054. }),
  45055. label: "Table of Contents",
  45056. instructions: (0,external_wp_i18n_namespaceObject.__)('Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.')
  45057. })), inspectorControls);
  45058. }
  45059. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("nav", blockProps, (0,external_wp_element_namespaceObject.createElement)("ol", {
  45060. ref: disabledRef
  45061. }, (0,external_wp_element_namespaceObject.createElement)(TableOfContentsList, {
  45062. nestedHeadingList: headingTree
  45063. }))), toolbarControls, inspectorControls);
  45064. }
  45065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/save.js
  45066. /**
  45067. * WordPress dependencies
  45068. */
  45069. /**
  45070. * Internal dependencies
  45071. */
  45072. function table_of_contents_save_save(_ref) {
  45073. let {
  45074. attributes: {
  45075. headings = []
  45076. }
  45077. } = _ref;
  45078. if (headings.length === 0) {
  45079. return null;
  45080. }
  45081. return (0,external_wp_element_namespaceObject.createElement)("nav", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("ol", null, (0,external_wp_element_namespaceObject.createElement)(TableOfContentsList, {
  45082. nestedHeadingList: linearToNestedHeadingList(headings)
  45083. })));
  45084. }
  45085. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js
  45086. /**
  45087. * Internal dependencies
  45088. */
  45089. const table_of_contents_metadata = {
  45090. $schema: "https://schemas.wp.org/trunk/block.json",
  45091. apiVersion: 2,
  45092. __experimental: true,
  45093. name: "core/table-of-contents",
  45094. title: "Table of Contents",
  45095. category: "layout",
  45096. description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",
  45097. keywords: ["document outline", "summary"],
  45098. textdomain: "default",
  45099. attributes: {
  45100. headings: {
  45101. type: "array",
  45102. items: {
  45103. type: "object"
  45104. }
  45105. },
  45106. onlyIncludeCurrentPage: {
  45107. type: "boolean",
  45108. "default": false
  45109. }
  45110. },
  45111. supports: {
  45112. html: false,
  45113. color: {
  45114. text: true,
  45115. background: true,
  45116. gradients: true,
  45117. link: true
  45118. },
  45119. spacing: {
  45120. margin: true,
  45121. padding: true
  45122. },
  45123. typography: {
  45124. fontSize: true,
  45125. lineHeight: true,
  45126. __experimentalFontFamily: true,
  45127. __experimentalFontWeight: true,
  45128. __experimentalFontStyle: true,
  45129. __experimentalTextTransform: true,
  45130. __experimentalTextDecoration: true,
  45131. __experimentalLetterSpacing: true,
  45132. __experimentalDefaultControls: {
  45133. fontSize: true
  45134. }
  45135. }
  45136. },
  45137. example: {}
  45138. };
  45139. const {
  45140. name: table_of_contents_name
  45141. } = table_of_contents_metadata;
  45142. const table_of_contents_settings = {
  45143. icon: table_of_contents_icon,
  45144. edit: TableOfContentsEdit,
  45145. save: table_of_contents_save_save
  45146. };
  45147. const table_of_contents_init = () => initBlock({
  45148. name: table_of_contents_name,
  45149. metadata: table_of_contents_metadata,
  45150. settings: table_of_contents_settings
  45151. });
  45152. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js
  45153. /**
  45154. * WordPress dependencies
  45155. */
  45156. const tag_cloud_transforms_transforms = {
  45157. from: [{
  45158. type: 'block',
  45159. blocks: ['core/categories'],
  45160. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud')
  45161. }],
  45162. to: [{
  45163. type: 'block',
  45164. blocks: ['core/categories'],
  45165. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories')
  45166. }]
  45167. };
  45168. /* harmony default export */ var tag_cloud_transforms = (tag_cloud_transforms_transforms);
  45169. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
  45170. /**
  45171. * External dependencies
  45172. */
  45173. /**
  45174. * WordPress dependencies
  45175. */
  45176. /**
  45177. * Minimum number of tags a user can show using this block.
  45178. *
  45179. * @type {number}
  45180. */
  45181. const MIN_TAGS = 1;
  45182. /**
  45183. * Maximum number of tags a user can show using this block.
  45184. *
  45185. * @type {number}
  45186. */
  45187. const MAX_TAGS = 100;
  45188. const MIN_FONT_SIZE = 0.1;
  45189. const MAX_FONT_SIZE = 100;
  45190. function TagCloudEdit(_ref) {
  45191. let {
  45192. attributes,
  45193. setAttributes,
  45194. taxonomies
  45195. } = _ref;
  45196. const {
  45197. taxonomy,
  45198. showTagCounts,
  45199. numberOfTags,
  45200. smallestFontSize,
  45201. largestFontSize
  45202. } = attributes;
  45203. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  45204. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem']
  45205. });
  45206. const getTaxonomyOptions = () => {
  45207. const selectOption = {
  45208. label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
  45209. value: '',
  45210. disabled: true
  45211. };
  45212. const taxonomyOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(taxonomies, 'show_cloud'), item => {
  45213. return {
  45214. value: item.slug,
  45215. label: item.name
  45216. };
  45217. });
  45218. return [selectOption, ...taxonomyOptions];
  45219. };
  45220. const onFontSizeChange = (fontSizeLabel, newValue) => {
  45221. // eslint-disable-next-line @wordpress/no-unused-vars-before-return
  45222. const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue);
  45223. if (!Number.isFinite(quantity)) {
  45224. return;
  45225. }
  45226. const updateObj = {
  45227. [fontSizeLabel]: newValue
  45228. }; // We need to keep in sync the `unit` changes to both `smallestFontSize`
  45229. // and `largestFontSize` attributes.
  45230. Object.entries({
  45231. smallestFontSize,
  45232. largestFontSize
  45233. }).forEach(_ref2 => {
  45234. let [attribute, currentValue] = _ref2;
  45235. const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); // Only add an update if the other font size attribute has a different unit.
  45236. if (attribute !== fontSizeLabel && currentUnit !== newUnit) {
  45237. updateObj[attribute] = `${currentQuantity}${newUnit}`;
  45238. }
  45239. });
  45240. setAttributes(updateObj);
  45241. };
  45242. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  45243. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  45244. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  45245. label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
  45246. options: getTaxonomyOptions(),
  45247. value: taxonomy,
  45248. onChange: selectedTaxonomy => setAttributes({
  45249. taxonomy: selectedTaxonomy
  45250. })
  45251. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  45252. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  45253. checked: showTagCounts,
  45254. onChange: () => setAttributes({
  45255. showTagCounts: !showTagCounts
  45256. })
  45257. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  45258. label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
  45259. value: numberOfTags,
  45260. onChange: value => setAttributes({
  45261. numberOfTags: value
  45262. }),
  45263. min: MIN_TAGS,
  45264. max: MAX_TAGS,
  45265. required: true
  45266. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  45267. isBlock: true
  45268. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  45269. label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'),
  45270. value: smallestFontSize,
  45271. onChange: value => {
  45272. onFontSizeChange('smallestFontSize', value);
  45273. },
  45274. units: units,
  45275. min: MIN_FONT_SIZE,
  45276. max: MAX_FONT_SIZE
  45277. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  45278. isBlock: true
  45279. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  45280. label: (0,external_wp_i18n_namespaceObject.__)('Largest size'),
  45281. value: largestFontSize,
  45282. onChange: value => {
  45283. onFontSizeChange('largestFontSize', value);
  45284. },
  45285. units: units,
  45286. min: MIN_FONT_SIZE,
  45287. max: MAX_FONT_SIZE
  45288. })))));
  45289. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  45290. key: "tag-cloud",
  45291. block: "core/tag-cloud",
  45292. attributes: attributes
  45293. })));
  45294. }
  45295. /* harmony default export */ var tag_cloud_edit = ((0,external_wp_data_namespaceObject.withSelect)(select => {
  45296. return {
  45297. taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
  45298. per_page: -1
  45299. })
  45300. };
  45301. })(TagCloudEdit));
  45302. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  45303. /**
  45304. * WordPress dependencies
  45305. */
  45306. /**
  45307. * Internal dependencies
  45308. */
  45309. const tag_cloud_metadata = {
  45310. $schema: "https://schemas.wp.org/trunk/block.json",
  45311. apiVersion: 2,
  45312. name: "core/tag-cloud",
  45313. title: "Tag Cloud",
  45314. category: "widgets",
  45315. description: "A cloud of your most used tags.",
  45316. textdomain: "default",
  45317. attributes: {
  45318. numberOfTags: {
  45319. type: "number",
  45320. "default": 45,
  45321. minimum: 1,
  45322. maximum: 100
  45323. },
  45324. taxonomy: {
  45325. type: "string",
  45326. "default": "post_tag"
  45327. },
  45328. showTagCounts: {
  45329. type: "boolean",
  45330. "default": false
  45331. },
  45332. smallestFontSize: {
  45333. type: "string",
  45334. "default": "8pt"
  45335. },
  45336. largestFontSize: {
  45337. type: "string",
  45338. "default": "22pt"
  45339. }
  45340. },
  45341. styles: [{
  45342. name: "default",
  45343. label: "Default",
  45344. isDefault: true
  45345. }, {
  45346. name: "outline",
  45347. label: "Outline"
  45348. }],
  45349. supports: {
  45350. html: false,
  45351. align: true,
  45352. spacing: {
  45353. margin: true,
  45354. padding: true
  45355. }
  45356. },
  45357. editorStyle: "wp-block-tag-cloud-editor"
  45358. };
  45359. const {
  45360. name: tag_cloud_name
  45361. } = tag_cloud_metadata;
  45362. const tag_cloud_settings = {
  45363. icon: library_tag,
  45364. example: {},
  45365. edit: tag_cloud_edit,
  45366. transforms: tag_cloud_transforms
  45367. };
  45368. const tag_cloud_init = () => initBlock({
  45369. name: tag_cloud_name,
  45370. metadata: tag_cloud_metadata,
  45371. settings: tag_cloud_settings
  45372. });
  45373. ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js
  45374. /*! *****************************************************************************
  45375. Copyright (c) Microsoft Corporation.
  45376. Permission to use, copy, modify, and/or distribute this software for any
  45377. purpose with or without fee is hereby granted.
  45378. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  45379. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  45380. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  45381. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  45382. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  45383. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  45384. PERFORMANCE OF THIS SOFTWARE.
  45385. ***************************************************************************** */
  45386. /* global Reflect, Promise */
  45387. var extendStatics = function(d, b) {
  45388. extendStatics = Object.setPrototypeOf ||
  45389. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  45390. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  45391. return extendStatics(d, b);
  45392. };
  45393. function __extends(d, b) {
  45394. if (typeof b !== "function" && b !== null)
  45395. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  45396. extendStatics(d, b);
  45397. function __() { this.constructor = d; }
  45398. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  45399. }
  45400. var __assign = function() {
  45401. __assign = Object.assign || function __assign(t) {
  45402. for (var s, i = 1, n = arguments.length; i < n; i++) {
  45403. s = arguments[i];
  45404. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  45405. }
  45406. return t;
  45407. }
  45408. return __assign.apply(this, arguments);
  45409. }
  45410. function __rest(s, e) {
  45411. var t = {};
  45412. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  45413. t[p] = s[p];
  45414. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  45415. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  45416. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  45417. t[p[i]] = s[p[i]];
  45418. }
  45419. return t;
  45420. }
  45421. function __decorate(decorators, target, key, desc) {
  45422. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  45423. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  45424. 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;
  45425. return c > 3 && r && Object.defineProperty(target, key, r), r;
  45426. }
  45427. function __param(paramIndex, decorator) {
  45428. return function (target, key) { decorator(target, key, paramIndex); }
  45429. }
  45430. function __metadata(metadataKey, metadataValue) {
  45431. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  45432. }
  45433. function __awaiter(thisArg, _arguments, P, generator) {
  45434. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  45435. return new (P || (P = Promise))(function (resolve, reject) {
  45436. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  45437. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  45438. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  45439. step((generator = generator.apply(thisArg, _arguments || [])).next());
  45440. });
  45441. }
  45442. function __generator(thisArg, body) {
  45443. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  45444. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  45445. function verb(n) { return function (v) { return step([n, v]); }; }
  45446. function step(op) {
  45447. if (f) throw new TypeError("Generator is already executing.");
  45448. while (_) try {
  45449. 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;
  45450. if (y = 0, t) op = [op[0] & 2, t.value];
  45451. switch (op[0]) {
  45452. case 0: case 1: t = op; break;
  45453. case 4: _.label++; return { value: op[1], done: false };
  45454. case 5: _.label++; y = op[1]; op = [0]; continue;
  45455. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  45456. default:
  45457. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  45458. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  45459. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  45460. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  45461. if (t[2]) _.ops.pop();
  45462. _.trys.pop(); continue;
  45463. }
  45464. op = body.call(thisArg, _);
  45465. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  45466. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  45467. }
  45468. }
  45469. var __createBinding = Object.create ? (function(o, m, k, k2) {
  45470. if (k2 === undefined) k2 = k;
  45471. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  45472. }) : (function(o, m, k, k2) {
  45473. if (k2 === undefined) k2 = k;
  45474. o[k2] = m[k];
  45475. });
  45476. function __exportStar(m, o) {
  45477. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  45478. }
  45479. function __values(o) {
  45480. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  45481. if (m) return m.call(o);
  45482. if (o && typeof o.length === "number") return {
  45483. next: function () {
  45484. if (o && i >= o.length) o = void 0;
  45485. return { value: o && o[i++], done: !o };
  45486. }
  45487. };
  45488. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  45489. }
  45490. function __read(o, n) {
  45491. var m = typeof Symbol === "function" && o[Symbol.iterator];
  45492. if (!m) return o;
  45493. var i = m.call(o), r, ar = [], e;
  45494. try {
  45495. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  45496. }
  45497. catch (error) { e = { error: error }; }
  45498. finally {
  45499. try {
  45500. if (r && !r.done && (m = i["return"])) m.call(i);
  45501. }
  45502. finally { if (e) throw e.error; }
  45503. }
  45504. return ar;
  45505. }
  45506. /** @deprecated */
  45507. function __spread() {
  45508. for (var ar = [], i = 0; i < arguments.length; i++)
  45509. ar = ar.concat(__read(arguments[i]));
  45510. return ar;
  45511. }
  45512. /** @deprecated */
  45513. function __spreadArrays() {
  45514. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  45515. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  45516. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  45517. r[k] = a[j];
  45518. return r;
  45519. }
  45520. function __spreadArray(to, from, pack) {
  45521. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  45522. if (ar || !(i in from)) {
  45523. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  45524. ar[i] = from[i];
  45525. }
  45526. }
  45527. return to.concat(ar || Array.prototype.slice.call(from));
  45528. }
  45529. function __await(v) {
  45530. return this instanceof __await ? (this.v = v, this) : new __await(v);
  45531. }
  45532. function __asyncGenerator(thisArg, _arguments, generator) {
  45533. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  45534. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  45535. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  45536. 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); }); }; }
  45537. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  45538. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  45539. function fulfill(value) { resume("next", value); }
  45540. function reject(value) { resume("throw", value); }
  45541. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  45542. }
  45543. function __asyncDelegator(o) {
  45544. var i, p;
  45545. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  45546. 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; }
  45547. }
  45548. function __asyncValues(o) {
  45549. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  45550. var m = o[Symbol.asyncIterator], i;
  45551. 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);
  45552. 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); }); }; }
  45553. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  45554. }
  45555. function __makeTemplateObject(cooked, raw) {
  45556. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  45557. return cooked;
  45558. };
  45559. var __setModuleDefault = Object.create ? (function(o, v) {
  45560. Object.defineProperty(o, "default", { enumerable: true, value: v });
  45561. }) : function(o, v) {
  45562. o["default"] = v;
  45563. };
  45564. function __importStar(mod) {
  45565. if (mod && mod.__esModule) return mod;
  45566. var result = {};
  45567. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  45568. __setModuleDefault(result, mod);
  45569. return result;
  45570. }
  45571. function __importDefault(mod) {
  45572. return (mod && mod.__esModule) ? mod : { default: mod };
  45573. }
  45574. function __classPrivateFieldGet(receiver, state, kind, f) {
  45575. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  45576. 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");
  45577. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  45578. }
  45579. function __classPrivateFieldSet(receiver, state, value, kind, f) {
  45580. if (kind === "m") throw new TypeError("Private method is not writable");
  45581. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  45582. 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");
  45583. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  45584. }
  45585. ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
  45586. /**
  45587. * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
  45588. */
  45589. var SUPPORTED_LOCALE = {
  45590. tr: {
  45591. regexp: /\u0130|\u0049|\u0049\u0307/g,
  45592. map: {
  45593. İ: "\u0069",
  45594. I: "\u0131",
  45595. İ: "\u0069",
  45596. },
  45597. },
  45598. az: {
  45599. regexp: /\u0130/g,
  45600. map: {
  45601. İ: "\u0069",
  45602. I: "\u0131",
  45603. İ: "\u0069",
  45604. },
  45605. },
  45606. lt: {
  45607. regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
  45608. map: {
  45609. I: "\u0069\u0307",
  45610. J: "\u006A\u0307",
  45611. Į: "\u012F\u0307",
  45612. Ì: "\u0069\u0307\u0300",
  45613. Í: "\u0069\u0307\u0301",
  45614. Ĩ: "\u0069\u0307\u0303",
  45615. },
  45616. },
  45617. };
  45618. /**
  45619. * Localized lower case.
  45620. */
  45621. function localeLowerCase(str, locale) {
  45622. var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
  45623. if (lang)
  45624. return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
  45625. return lowerCase(str);
  45626. }
  45627. /**
  45628. * Lower case as a function.
  45629. */
  45630. function lowerCase(str) {
  45631. return str.toLowerCase();
  45632. }
  45633. ;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
  45634. // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
  45635. var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
  45636. // Remove all non-word characters.
  45637. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
  45638. /**
  45639. * Normalize the string into something other libraries can manipulate easier.
  45640. */
  45641. function noCase(input, options) {
  45642. if (options === void 0) { options = {}; }
  45643. var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
  45644. var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
  45645. var start = 0;
  45646. var end = result.length;
  45647. // Trim the delimiter from around the output string.
  45648. while (result.charAt(start) === "\0")
  45649. start++;
  45650. while (result.charAt(end - 1) === "\0")
  45651. end--;
  45652. // Transform each token independently.
  45653. return result.slice(start, end).split("\0").map(transform).join(delimiter);
  45654. }
  45655. /**
  45656. * Replace `re` in the input string with the replacement value.
  45657. */
  45658. function replace(input, re, value) {
  45659. if (re instanceof RegExp)
  45660. return input.replace(re, value);
  45661. return re.reduce(function (input, re) { return input.replace(re, value); }, input);
  45662. }
  45663. ;// CONCATENATED MODULE: ./node_modules/upper-case-first/dist.es2015/index.js
  45664. /**
  45665. * Upper case the first character of an input string.
  45666. */
  45667. function upperCaseFirst(input) {
  45668. return input.charAt(0).toUpperCase() + input.substr(1);
  45669. }
  45670. ;// CONCATENATED MODULE: ./node_modules/capital-case/dist.es2015/index.js
  45671. function capitalCaseTransform(input) {
  45672. return upperCaseFirst(input.toLowerCase());
  45673. }
  45674. function capitalCase(input, options) {
  45675. if (options === void 0) { options = {}; }
  45676. return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options));
  45677. }
  45678. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
  45679. /**
  45680. * WordPress dependencies
  45681. */
  45682. const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  45683. xmlns: "http://www.w3.org/2000/svg",
  45684. viewBox: "0 0 24 24"
  45685. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  45686. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  45687. }));
  45688. /* harmony default export */ var symbol_filled = (symbolFilled);
  45689. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js
  45690. /**
  45691. * External dependencies
  45692. */
  45693. /**
  45694. * WordPress dependencies
  45695. */
  45696. /**
  45697. * Internal dependencies
  45698. */
  45699. /**
  45700. * Retrieves the available template parts for the given area.
  45701. *
  45702. * @param {string} area Template part area.
  45703. * @param {string} excludedId Template part ID to exclude.
  45704. *
  45705. * @return {{ templateParts: Array, isResolving: boolean }} array of template parts.
  45706. */
  45707. function useAlternativeTemplateParts(area, excludedId) {
  45708. const {
  45709. templateParts,
  45710. isResolving
  45711. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  45712. const {
  45713. getEntityRecords,
  45714. isResolving: _isResolving
  45715. } = select(external_wp_coreData_namespaceObject.store);
  45716. const query = {
  45717. per_page: -1
  45718. };
  45719. return {
  45720. templateParts: getEntityRecords('postType', 'wp_template_part', query),
  45721. isLoading: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query])
  45722. };
  45723. }, []);
  45724. const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => {
  45725. if (!templateParts) {
  45726. return [];
  45727. }
  45728. return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || [];
  45729. }, [templateParts, area]);
  45730. return {
  45731. templateParts: filteredTemplateParts,
  45732. isResolving
  45733. };
  45734. }
  45735. /**
  45736. * Retrieves the available block patterns for the given area.
  45737. *
  45738. * @param {string} area Template part area.
  45739. * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks).
  45740. *
  45741. * @return {Array} array of block patterns.
  45742. */
  45743. function useAlternativeBlockPatterns(area, clientId) {
  45744. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  45745. const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part';
  45746. const {
  45747. getBlockRootClientId,
  45748. __experimentalGetPatternsByBlockTypes
  45749. } = select(external_wp_blockEditor_namespaceObject.store);
  45750. const rootClientId = getBlockRootClientId(clientId);
  45751. return __experimentalGetPatternsByBlockTypes(blockNameWithArea, rootClientId);
  45752. }, [area, clientId]);
  45753. }
  45754. function useCreateTemplatePartFromBlocks(area, setAttributes) {
  45755. const {
  45756. saveEntityRecord
  45757. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  45758. return async function () {
  45759. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  45760. let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part');
  45761. // Currently template parts only allow latin chars.
  45762. // Fallback slug will receive suffix by default.
  45763. const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed
  45764. // block variation was inserted. So add this prop to the template
  45765. // part entity on creation. Afterwards remove `area` value from
  45766. // block attributes.
  45767. const record = {
  45768. title,
  45769. slug: cleanSlug,
  45770. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  45771. // `area` is filterable on the server and defaults to `UNCATEGORIZED`
  45772. // if provided value is not allowed.
  45773. area
  45774. };
  45775. const templatePart = await saveEntityRecord('postType', 'wp_template_part', record);
  45776. setAttributes({
  45777. slug: templatePart.slug,
  45778. theme: templatePart.theme,
  45779. area: undefined
  45780. });
  45781. };
  45782. }
  45783. /**
  45784. * Retrieves the template part area object.
  45785. *
  45786. * @param {string} area Template part area identifier.
  45787. *
  45788. * @return {{icon: Object, label: string, tagName: string}} Template Part area.
  45789. */
  45790. function useTemplatePartArea(area) {
  45791. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  45792. var _selectedArea$area_ta;
  45793. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  45794. // Blocks can be loaded into a *non-post* block editor.
  45795. /* eslint-disable @wordpress/data-no-store-string-literals */
  45796. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  45797. /* eslint-enable @wordpress/data-no-store-string-literals */
  45798. const selectedArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  45799. area
  45800. });
  45801. const defaultArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  45802. area: 'uncategorized'
  45803. });
  45804. return {
  45805. icon: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.icon) || (defaultArea === null || defaultArea === void 0 ? void 0 : defaultArea.icon),
  45806. label: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || (0,external_wp_i18n_namespaceObject.__)('Template Part'),
  45807. tagName: (_selectedArea$area_ta = selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div'
  45808. };
  45809. }, [area]);
  45810. }
  45811. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js
  45812. /**
  45813. * WordPress dependencies
  45814. */
  45815. function TitleModal(_ref) {
  45816. let {
  45817. areaLabel,
  45818. onClose,
  45819. onSubmit
  45820. } = _ref;
  45821. // Restructure onCreate to set the blocks on local state.
  45822. // Add modal to confirm title and trigger onCreate.
  45823. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part'));
  45824. const submitForCreation = event => {
  45825. event.preventDefault();
  45826. onSubmit(title);
  45827. };
  45828. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  45829. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  45830. (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()),
  45831. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  45832. overlayClassName: "wp-block-template-part__placeholder-create-new__title-form",
  45833. onRequestClose: onClose
  45834. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  45835. onSubmit: submitForCreation
  45836. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  45837. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  45838. value: title,
  45839. onChange: setTitle
  45840. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  45841. className: "wp-block-template-part__placeholder-create-new__title-form-actions",
  45842. justify: "flex-end"
  45843. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  45844. variant: "primary",
  45845. type: "submit",
  45846. disabled: !title.length,
  45847. "aria-disabled": !title.length
  45848. }, (0,external_wp_i18n_namespaceObject.__)('Create'))))));
  45849. }
  45850. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js
  45851. /**
  45852. * WordPress dependencies
  45853. */
  45854. /**
  45855. * Internal dependencies
  45856. */
  45857. function TemplatePartPlaceholder(_ref) {
  45858. let {
  45859. area,
  45860. clientId,
  45861. templatePartId,
  45862. onOpenSelectionModal,
  45863. setAttributes
  45864. } = _ref;
  45865. const {
  45866. templateParts,
  45867. isResolving
  45868. } = useAlternativeTemplateParts(area, templatePartId);
  45869. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  45870. const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false);
  45871. const areaObject = useTemplatePartArea(area);
  45872. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  45873. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  45874. icon: areaObject.icon,
  45875. label: areaObject.label,
  45876. instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  45877. (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase())
  45878. }, isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  45879. variant: "primary",
  45880. onClick: onOpenSelectionModal
  45881. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), !isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  45882. variant: "secondary",
  45883. onClick: () => {
  45884. setShowTitleModal(true);
  45885. }
  45886. }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), showTitleModal && (0,external_wp_element_namespaceObject.createElement)(TitleModal, {
  45887. areaLabel: areaObject.label,
  45888. onClose: () => setShowTitleModal(false),
  45889. onSubmit: title => {
  45890. createFromBlocks([], title);
  45891. }
  45892. }));
  45893. }
  45894. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/search.js
  45895. /**
  45896. * External dependencies
  45897. */
  45898. /**
  45899. * Sanitizes the search input string.
  45900. *
  45901. * @param {string} input The search input to normalize.
  45902. *
  45903. * @return {string} The normalized search input.
  45904. */
  45905. function normalizeSearchInput() {
  45906. let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  45907. // Disregard diacritics.
  45908. input = remove_accents_default()(input); // Trim & Lowercase.
  45909. input = input.trim().toLowerCase();
  45910. return input;
  45911. }
  45912. /**
  45913. * Get the search rank for a given pattern and a specific search term.
  45914. *
  45915. * @param {Object} pattern Pattern to rank
  45916. * @param {string} searchValue Search term
  45917. * @return {number} A pattern search rank
  45918. */
  45919. function getPatternSearchRank(pattern, searchValue) {
  45920. const normalizedSearchValue = normalizeSearchInput(searchValue);
  45921. const normalizedTitle = normalizeSearchInput(pattern.title);
  45922. let rank = 0;
  45923. if (normalizedSearchValue === normalizedTitle) {
  45924. rank += 30;
  45925. } else if (normalizedTitle.startsWith(normalizedSearchValue)) {
  45926. rank += 20;
  45927. } else {
  45928. const searchTerms = normalizedSearchValue.split(' ');
  45929. const hasMatchedTerms = searchTerms.every(searchTerm => normalizedTitle.includes(searchTerm)); // Prefer pattern with every search word in the title.
  45930. if (hasMatchedTerms) {
  45931. rank += 10;
  45932. }
  45933. }
  45934. return rank;
  45935. }
  45936. /**
  45937. * Filters an pattern list given a search term.
  45938. *
  45939. * @param {Array} patterns Item list
  45940. * @param {string} searchValue Search input.
  45941. *
  45942. * @return {Array} Filtered pattern list.
  45943. */
  45944. function searchPatterns() {
  45945. let patterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  45946. let searchValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  45947. if (!searchValue) {
  45948. return patterns;
  45949. }
  45950. const rankedPatterns = patterns.map(pattern => {
  45951. return [pattern, getPatternSearchRank(pattern, searchValue)];
  45952. }).filter(_ref => {
  45953. let [, rank] = _ref;
  45954. return rank > 0;
  45955. });
  45956. rankedPatterns.sort((_ref2, _ref3) => {
  45957. let [, rank1] = _ref2;
  45958. let [, rank2] = _ref3;
  45959. return rank2 - rank1;
  45960. });
  45961. return rankedPatterns.map(_ref4 => {
  45962. let [pattern] = _ref4;
  45963. return pattern;
  45964. });
  45965. }
  45966. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js
  45967. /**
  45968. * WordPress dependencies
  45969. */
  45970. /**
  45971. * Internal dependencies
  45972. */
  45973. function TemplatePartSelectionModal(_ref) {
  45974. let {
  45975. setAttributes,
  45976. onClose,
  45977. templatePartId = null,
  45978. area,
  45979. clientId
  45980. } = _ref;
  45981. const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)('');
  45982. const {
  45983. templateParts
  45984. } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI
  45985. const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => {
  45986. const partsAsPatterns = templateParts.map(templatePart => ({
  45987. name: createTemplatePartId(templatePart.theme, templatePart.slug),
  45988. title: templatePart.title.rendered,
  45989. blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw),
  45990. templatePart
  45991. }));
  45992. return searchPatterns(partsAsPatterns, searchValue);
  45993. }, [templateParts, searchValue]);
  45994. const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredTemplateParts);
  45995. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  45996. const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
  45997. return searchPatterns(blockPatterns, searchValue);
  45998. }, [blockPatterns, searchValue]);
  45999. const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockPatterns);
  46000. const {
  46001. createSuccessNotice
  46002. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  46003. const onTemplatePartSelect = (0,external_wp_element_namespaceObject.useCallback)(templatePart => {
  46004. var _templatePart$title;
  46005. setAttributes({
  46006. slug: templatePart.slug,
  46007. theme: templatePart.theme,
  46008. area: undefined
  46009. });
  46010. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  46011. /* translators: %s: template part title. */
  46012. (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), ((_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered) || templatePart.slug), {
  46013. type: 'snackbar'
  46014. });
  46015. onClose();
  46016. }, []);
  46017. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  46018. const hasTemplateParts = !!filteredTemplateParts.length;
  46019. const hasBlockPatterns = !!filteredBlockPatterns.length;
  46020. return (0,external_wp_element_namespaceObject.createElement)("div", {
  46021. className: "block-library-template-part__selection-content"
  46022. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  46023. className: "block-library-template-part__selection-search"
  46024. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, {
  46025. onChange: setSearchValue,
  46026. value: searchValue,
  46027. label: (0,external_wp_i18n_namespaceObject.__)('Search for replacements'),
  46028. placeholder: (0,external_wp_i18n_namespaceObject.__)('Search')
  46029. })), hasTemplateParts && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Existing template parts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  46030. blockPatterns: filteredTemplateParts,
  46031. shownPatterns: shownTemplateParts,
  46032. onClickPattern: pattern => {
  46033. onTemplatePartSelect(pattern.templatePart);
  46034. }
  46035. })), hasBlockPatterns && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Patterns')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  46036. blockPatterns: filteredBlockPatterns,
  46037. shownPatterns: shownBlockPatterns,
  46038. onClickPattern: (pattern, blocks) => {
  46039. createFromBlocks(blocks, pattern.title);
  46040. onClose();
  46041. }
  46042. })), !hasTemplateParts && !hasBlockPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
  46043. alignment: "center"
  46044. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))));
  46045. }
  46046. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
  46047. /**
  46048. * WordPress dependencies
  46049. */
  46050. function TemplatePartAdvancedControls(_ref) {
  46051. let {
  46052. tagName,
  46053. setAttributes,
  46054. isEntityAvailable,
  46055. templatePartId,
  46056. defaultWrapper
  46057. } = _ref;
  46058. const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId);
  46059. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId);
  46060. const {
  46061. areaOptions
  46062. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  46063. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  46064. // Blocks can be loaded into a *non-post* block editor.
  46065. /* eslint-disable @wordpress/data-no-store-string-literals */
  46066. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  46067. /* eslint-enable @wordpress/data-no-store-string-literals */
  46068. return {
  46069. areaOptions: definedAreas.map(_ref2 => {
  46070. let {
  46071. label,
  46072. area: _area
  46073. } = _ref2;
  46074. return {
  46075. label,
  46076. value: _area
  46077. };
  46078. })
  46079. };
  46080. }, []);
  46081. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  46082. __experimentalGroup: "advanced"
  46083. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  46084. label: (0,external_wp_i18n_namespaceObject.__)('Title'),
  46085. value: title,
  46086. onChange: value => {
  46087. setTitle(value);
  46088. },
  46089. onFocus: event => event.target.select()
  46090. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  46091. label: (0,external_wp_i18n_namespaceObject.__)('Area'),
  46092. labelPosition: "top",
  46093. options: areaOptions,
  46094. value: area,
  46095. onChange: setArea
  46096. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  46097. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  46098. options: [{
  46099. label: (0,external_wp_i18n_namespaceObject.sprintf)(
  46100. /* translators: %s: HTML tag based on area. */
  46101. (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`),
  46102. value: ''
  46103. }, {
  46104. label: '<header>',
  46105. value: 'header'
  46106. }, {
  46107. label: '<main>',
  46108. value: 'main'
  46109. }, {
  46110. label: '<section>',
  46111. value: 'section'
  46112. }, {
  46113. label: '<article>',
  46114. value: 'article'
  46115. }, {
  46116. label: '<aside>',
  46117. value: 'aside'
  46118. }, {
  46119. label: '<footer>',
  46120. value: 'footer'
  46121. }, {
  46122. label: '<div>',
  46123. value: 'div'
  46124. }],
  46125. value: tagName || '',
  46126. onChange: value => setAttributes({
  46127. tagName: value
  46128. })
  46129. }));
  46130. }
  46131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
  46132. /**
  46133. * WordPress dependencies
  46134. */
  46135. function TemplatePartInnerBlocks(_ref) {
  46136. let {
  46137. postId: id,
  46138. hasInnerBlocks,
  46139. layout,
  46140. tagName: TagName,
  46141. blockProps
  46142. } = _ref;
  46143. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  46144. var _getSettings;
  46145. const {
  46146. getSettings
  46147. } = select(external_wp_blockEditor_namespaceObject.store);
  46148. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  46149. }, []);
  46150. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  46151. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  46152. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', {
  46153. id
  46154. });
  46155. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  46156. value: blocks,
  46157. onInput,
  46158. onChange,
  46159. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  46160. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  46161. });
  46162. return (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps);
  46163. }
  46164. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
  46165. /**
  46166. * External dependencies
  46167. */
  46168. /**
  46169. * WordPress dependencies
  46170. */
  46171. /**
  46172. * Internal dependencies
  46173. */
  46174. function TemplatePartEdit(_ref) {
  46175. let {
  46176. attributes,
  46177. setAttributes,
  46178. clientId,
  46179. isSelected
  46180. } = _ref;
  46181. const {
  46182. slug,
  46183. theme,
  46184. tagName,
  46185. layout = {}
  46186. } = attributes;
  46187. const templatePartId = createTemplatePartId(theme, slug);
  46188. const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.__experimentalUseHasRecursion)(templatePartId);
  46189. const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Set the postId block attribute if it did not exist,
  46190. // but wait until the inner blocks have loaded to allow
  46191. // new edits to trigger this.
  46192. const {
  46193. isResolved,
  46194. innerBlocks,
  46195. isMissing,
  46196. area
  46197. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  46198. const {
  46199. getEditedEntityRecord,
  46200. hasFinishedResolution
  46201. } = select(external_wp_coreData_namespaceObject.store);
  46202. const {
  46203. getBlocks
  46204. } = select(external_wp_blockEditor_namespaceObject.store);
  46205. const getEntityArgs = ['postType', 'wp_template_part', templatePartId];
  46206. const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;
  46207. const _area = (entityRecord === null || entityRecord === void 0 ? void 0 : entityRecord.area) || attributes.area;
  46208. const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false;
  46209. return {
  46210. innerBlocks: getBlocks(clientId),
  46211. isResolved: hasResolvedEntity,
  46212. isMissing: hasResolvedEntity && (0,external_lodash_namespaceObject.isEmpty)(entityRecord),
  46213. area: _area
  46214. };
  46215. }, [templatePartId, clientId]);
  46216. const {
  46217. templateParts
  46218. } = useAlternativeTemplateParts(area, templatePartId);
  46219. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  46220. const hasReplacements = !!templateParts.length || !!blockPatterns.length;
  46221. const areaObject = useTemplatePartArea(area);
  46222. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  46223. const isPlaceholder = !slug;
  46224. const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
  46225. const TagName = tagName || areaObject.tagName; // The `isSelected` check ensures the `BlockSettingsMenuControls` fill
  46226. // doesn't render multiple times. The block controls has similar internal check.
  46227. const canReplace = isSelected && isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); // We don't want to render a missing state if we have any inner blocks.
  46228. // A new template part is automatically created if we have any inner blocks but no entity.
  46229. if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
  46230. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
  46231. /* translators: %s: Template part slug */
  46232. (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug)));
  46233. }
  46234. if (isEntityAvailable && hasAlreadyRendered) {
  46235. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  46236. }
  46237. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalRecursionProvider, {
  46238. uniqueId: templatePartId
  46239. }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
  46240. tagName: tagName,
  46241. setAttributes: setAttributes,
  46242. isEntityAvailable: isEntityAvailable,
  46243. templatePartId: templatePartId,
  46244. defaultWrapper: areaObject.tagName
  46245. }), isPlaceholder && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
  46246. area: attributes.area,
  46247. templatePartId: templatePartId,
  46248. clientId: clientId,
  46249. setAttributes: setAttributes,
  46250. onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true)
  46251. })), canReplace && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  46252. onClick: () => {
  46253. setIsTemplatePartSelectionOpen(true);
  46254. }
  46255. }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Replace <BlockTitle />'), {
  46256. BlockTitle: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTitle, {
  46257. clientId: clientId,
  46258. maximumLength: 25
  46259. })
  46260. }))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
  46261. tagName: TagName,
  46262. blockProps: blockProps,
  46263. postId: templatePartId,
  46264. hasInnerBlocks: innerBlocks.length > 0,
  46265. layout: layout
  46266. }), !isPlaceholder && !isResolved && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), isTemplatePartSelectionOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  46267. overlayClassName: "block-editor-template-part__selection-modal",
  46268. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  46269. (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()),
  46270. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  46271. onRequestClose: () => setIsTemplatePartSelectionOpen(false)
  46272. }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelectionModal, {
  46273. templatePartId: templatePartId,
  46274. clientId: clientId,
  46275. area: area,
  46276. setAttributes: setAttributes,
  46277. onClose: () => setIsTemplatePartSelectionOpen(false)
  46278. })));
  46279. }
  46280. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
  46281. /**
  46282. * WordPress dependencies
  46283. */
  46284. const header = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  46285. xmlns: "http://www.w3.org/2000/svg",
  46286. viewBox: "0 0 24 24"
  46287. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  46288. d: "M18.5 10.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"
  46289. }));
  46290. /* harmony default export */ var library_header = (header);
  46291. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
  46292. /**
  46293. * WordPress dependencies
  46294. */
  46295. const footer = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  46296. xmlns: "http://www.w3.org/2000/svg",
  46297. viewBox: "0 0 24 24"
  46298. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  46299. fillRule: "evenodd",
  46300. d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  46301. }));
  46302. /* harmony default export */ var library_footer = (footer);
  46303. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
  46304. /**
  46305. * WordPress dependencies
  46306. */
  46307. const sidebar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  46308. xmlns: "http://www.w3.org/2000/svg",
  46309. viewBox: "0 0 24 24"
  46310. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  46311. 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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  46312. }));
  46313. /* harmony default export */ var library_sidebar = (sidebar);
  46314. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
  46315. /**
  46316. * WordPress dependencies
  46317. */
  46318. function getTemplatePartIcon(iconName) {
  46319. if ('header' === iconName) {
  46320. return library_header;
  46321. } else if ('footer' === iconName) {
  46322. return library_footer;
  46323. } else if ('sidebar' === iconName) {
  46324. return library_sidebar;
  46325. }
  46326. return symbol_filled;
  46327. }
  46328. function enhanceTemplatePartVariations(settings, name) {
  46329. if (name !== 'core/template-part') {
  46330. return settings;
  46331. }
  46332. if (settings.variations) {
  46333. const isActive = (blockAttributes, variationAttributes) => {
  46334. const {
  46335. area,
  46336. theme,
  46337. slug
  46338. } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
  46339. // This property is removed on the creation of a template part.
  46340. if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
  46341. // by checking the entity's `area` property.
  46342. if (!slug) return false;
  46343. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
  46344. return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
  46345. };
  46346. const variations = settings.variations.map(variation => {
  46347. return { ...variation,
  46348. ...(!variation.isActive && {
  46349. isActive
  46350. }),
  46351. ...(typeof variation.icon === 'string' && {
  46352. icon: getTemplatePartIcon(variation.icon)
  46353. })
  46354. };
  46355. });
  46356. return { ...settings,
  46357. variations
  46358. };
  46359. }
  46360. return settings;
  46361. }
  46362. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  46363. /**
  46364. * External dependencies
  46365. */
  46366. /**
  46367. * WordPress dependencies
  46368. */
  46369. /**
  46370. * Internal dependencies
  46371. */
  46372. const template_part_metadata = {
  46373. $schema: "https://schemas.wp.org/trunk/block.json",
  46374. apiVersion: 2,
  46375. name: "core/template-part",
  46376. title: "Template Part",
  46377. category: "theme",
  46378. description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",
  46379. textdomain: "default",
  46380. attributes: {
  46381. slug: {
  46382. type: "string"
  46383. },
  46384. theme: {
  46385. type: "string"
  46386. },
  46387. tagName: {
  46388. type: "string"
  46389. },
  46390. area: {
  46391. type: "string"
  46392. }
  46393. },
  46394. supports: {
  46395. align: true,
  46396. html: false,
  46397. reusable: false
  46398. },
  46399. editorStyle: "wp-block-template-part-editor"
  46400. };
  46401. const {
  46402. name: template_part_name
  46403. } = template_part_metadata;
  46404. const template_part_settings = {
  46405. icon: symbol_filled,
  46406. __experimentalLabel: _ref => {
  46407. var _entity$title;
  46408. let {
  46409. slug,
  46410. theme
  46411. } = _ref;
  46412. // Attempt to find entity title if block is a template part.
  46413. // Require slug to request, otherwise entity is uncreated and will throw 404.
  46414. if (!slug) {
  46415. return;
  46416. }
  46417. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
  46418. if (!entity) {
  46419. return;
  46420. }
  46421. return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || capitalCase(entity.slug);
  46422. },
  46423. edit: TemplatePartEdit
  46424. };
  46425. const template_part_init = () => {
  46426. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
  46427. const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
  46428. (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, _ref2) => {
  46429. let {
  46430. getBlock,
  46431. getBlockParentsByBlockName
  46432. } = _ref2;
  46433. if (blockType.name !== 'core/template-part') {
  46434. return canInsert;
  46435. }
  46436. for (const disallowedParentType of DISALLOWED_PARENTS) {
  46437. var _getBlock;
  46438. const hasDisallowedParent = ((_getBlock = getBlock(rootClientId)) === null || _getBlock === void 0 ? void 0 : _getBlock.name) === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length;
  46439. if (hasDisallowedParent) {
  46440. return false;
  46441. }
  46442. }
  46443. return true;
  46444. });
  46445. return initBlock({
  46446. name: template_part_name,
  46447. metadata: template_part_metadata,
  46448. settings: template_part_settings
  46449. });
  46450. };
  46451. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
  46452. /**
  46453. * WordPress dependencies
  46454. */
  46455. const term_description_tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  46456. xmlns: "http://www.w3.org/2000/svg",
  46457. viewBox: "0 0 24 24"
  46458. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  46459. d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"
  46460. }));
  46461. /* harmony default export */ var term_description = (term_description_tag);
  46462. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
  46463. /**
  46464. * External dependencies
  46465. */
  46466. /**
  46467. * WordPress dependencies
  46468. */
  46469. function TermDescriptionEdit(_ref) {
  46470. let {
  46471. attributes,
  46472. setAttributes,
  46473. mergedStyle
  46474. } = _ref;
  46475. const {
  46476. textAlign
  46477. } = attributes;
  46478. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  46479. className: classnames_default()({
  46480. [`has-text-align-${textAlign}`]: textAlign
  46481. }),
  46482. style: mergedStyle
  46483. });
  46484. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  46485. group: "block"
  46486. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  46487. value: textAlign,
  46488. onChange: nextAlign => {
  46489. setAttributes({
  46490. textAlign: nextAlign
  46491. });
  46492. }
  46493. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
  46494. className: "wp-block-term-description__placeholder"
  46495. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description')))));
  46496. }
  46497. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  46498. /**
  46499. * WordPress dependencies
  46500. */
  46501. /**
  46502. * Internal dependencies
  46503. */
  46504. const term_description_metadata = {
  46505. $schema: "https://schemas.wp.org/trunk/block.json",
  46506. apiVersion: 2,
  46507. name: "core/term-description",
  46508. title: "Term Description",
  46509. category: "theme",
  46510. description: "Display the description of categories, tags and custom taxonomies when viewing an archive.",
  46511. textdomain: "default",
  46512. attributes: {
  46513. textAlign: {
  46514. type: "string"
  46515. }
  46516. },
  46517. supports: {
  46518. align: ["wide", "full"],
  46519. html: false,
  46520. color: {
  46521. link: true,
  46522. __experimentalDefaultControls: {
  46523. background: true,
  46524. text: true
  46525. }
  46526. },
  46527. spacing: {
  46528. padding: true,
  46529. margin: true
  46530. },
  46531. typography: {
  46532. fontSize: true,
  46533. lineHeight: true,
  46534. __experimentalFontFamily: true,
  46535. __experimentalFontWeight: true,
  46536. __experimentalFontStyle: true,
  46537. __experimentalTextTransform: true,
  46538. __experimentalTextDecoration: true,
  46539. __experimentalLetterSpacing: true,
  46540. __experimentalDefaultControls: {
  46541. fontSize: true
  46542. }
  46543. }
  46544. },
  46545. editorStyle: "wp-block-term-description-editor"
  46546. };
  46547. const {
  46548. name: term_description_name
  46549. } = term_description_metadata;
  46550. const term_description_settings = {
  46551. icon: term_description,
  46552. edit: TermDescriptionEdit
  46553. };
  46554. const term_description_init = () => initBlock({
  46555. name: term_description_name,
  46556. metadata: term_description_metadata,
  46557. settings: term_description_settings
  46558. });
  46559. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js
  46560. /**
  46561. * External dependencies
  46562. */
  46563. /**
  46564. * WordPress dependencies
  46565. */
  46566. function TextColumnsEdit(_ref) {
  46567. let {
  46568. attributes,
  46569. setAttributes
  46570. } = _ref;
  46571. const {
  46572. width,
  46573. content,
  46574. columns
  46575. } = attributes;
  46576. external_wp_deprecated_default()('The Text Columns block', {
  46577. since: '5.3',
  46578. alternative: 'the Columns block'
  46579. });
  46580. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  46581. value: width,
  46582. onChange: nextWidth => setAttributes({
  46583. width: nextWidth
  46584. }),
  46585. controls: ['center', 'wide', 'full']
  46586. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  46587. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  46588. value: columns,
  46589. onChange: value => setAttributes({
  46590. columns: value
  46591. }),
  46592. min: 2,
  46593. max: 4,
  46594. required: true
  46595. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  46596. className: `align${width} columns-${columns}`
  46597. }), Array.from({
  46598. length: columns
  46599. }).map((_, index) => {
  46600. return (0,external_wp_element_namespaceObject.createElement)("div", {
  46601. className: "wp-block-column",
  46602. key: `column-${index}`
  46603. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  46604. tagName: "p",
  46605. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children']),
  46606. onChange: nextContent => {
  46607. setAttributes({
  46608. content: [...content.slice(0, index), {
  46609. children: nextContent
  46610. }, ...content.slice(index + 1)]
  46611. });
  46612. },
  46613. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
  46614. (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1),
  46615. placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column')
  46616. }));
  46617. })));
  46618. }
  46619. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
  46620. /**
  46621. * External dependencies
  46622. */
  46623. /**
  46624. * WordPress dependencies
  46625. */
  46626. function text_columns_save_save(_ref) {
  46627. let {
  46628. attributes
  46629. } = _ref;
  46630. const {
  46631. width,
  46632. content,
  46633. columns
  46634. } = attributes;
  46635. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  46636. className: `align${width} columns-${columns}`
  46637. }), Array.from({
  46638. length: columns
  46639. }).map((_, index) => (0,external_wp_element_namespaceObject.createElement)("div", {
  46640. className: "wp-block-column",
  46641. key: `column-${index}`
  46642. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  46643. tagName: "p",
  46644. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children'])
  46645. }))));
  46646. }
  46647. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
  46648. /**
  46649. * WordPress dependencies
  46650. */
  46651. const text_columns_transforms_transforms = {
  46652. to: [{
  46653. type: 'block',
  46654. blocks: ['core/columns'],
  46655. transform: _ref => {
  46656. let {
  46657. className,
  46658. columns,
  46659. content,
  46660. width
  46661. } = _ref;
  46662. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  46663. align: 'wide' === width || 'full' === width ? width : undefined,
  46664. className,
  46665. columns
  46666. }, content.map(_ref2 => {
  46667. let {
  46668. children
  46669. } = _ref2;
  46670. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  46671. content: children
  46672. })]);
  46673. }));
  46674. }
  46675. }]
  46676. };
  46677. /* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);
  46678. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  46679. /**
  46680. * Internal dependencies
  46681. */
  46682. const text_columns_metadata = {
  46683. $schema: "https://schemas.wp.org/trunk/block.json",
  46684. apiVersion: 2,
  46685. name: "core/text-columns",
  46686. title: "Text Columns (deprecated)",
  46687. icon: "columns",
  46688. category: "design",
  46689. description: "This block is deprecated. Please use the Columns block instead.",
  46690. textdomain: "default",
  46691. attributes: {
  46692. content: {
  46693. type: "array",
  46694. source: "query",
  46695. selector: "p",
  46696. query: {
  46697. children: {
  46698. type: "string",
  46699. source: "html"
  46700. }
  46701. },
  46702. "default": [{}, {}]
  46703. },
  46704. columns: {
  46705. type: "number",
  46706. "default": 2
  46707. },
  46708. width: {
  46709. type: "string"
  46710. }
  46711. },
  46712. supports: {
  46713. inserter: false
  46714. },
  46715. editorStyle: "wp-block-text-columns-editor",
  46716. style: "wp-block-text-columns"
  46717. };
  46718. const {
  46719. name: text_columns_name
  46720. } = text_columns_metadata;
  46721. const text_columns_settings = {
  46722. transforms: text_columns_transforms,
  46723. getEditWrapperProps(attributes) {
  46724. const {
  46725. width
  46726. } = attributes;
  46727. if ('wide' === width || 'full' === width) {
  46728. return {
  46729. 'data-align': width
  46730. };
  46731. }
  46732. },
  46733. edit: TextColumnsEdit,
  46734. save: text_columns_save_save
  46735. };
  46736. const text_columns_init = () => initBlock({
  46737. name: text_columns_name,
  46738. metadata: text_columns_metadata,
  46739. settings: text_columns_settings
  46740. });
  46741. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
  46742. /**
  46743. * WordPress dependencies
  46744. */
  46745. const verse = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  46746. viewBox: "0 0 24 24",
  46747. xmlns: "http://www.w3.org/2000/svg"
  46748. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  46749. d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
  46750. }));
  46751. /* harmony default export */ var library_verse = (verse);
  46752. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
  46753. /**
  46754. * External dependencies
  46755. */
  46756. /**
  46757. * WordPress dependencies
  46758. */
  46759. /**
  46760. * Internal dependencies
  46761. */
  46762. const verse_deprecated_v1 = {
  46763. attributes: {
  46764. content: {
  46765. type: 'string',
  46766. source: 'html',
  46767. selector: 'pre',
  46768. default: ''
  46769. },
  46770. textAlign: {
  46771. type: 'string'
  46772. }
  46773. },
  46774. save(_ref) {
  46775. let {
  46776. attributes
  46777. } = _ref;
  46778. const {
  46779. textAlign,
  46780. content
  46781. } = attributes;
  46782. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  46783. tagName: "pre",
  46784. style: {
  46785. textAlign
  46786. },
  46787. value: content
  46788. });
  46789. }
  46790. };
  46791. const verse_deprecated_v2 = {
  46792. attributes: {
  46793. content: {
  46794. type: 'string',
  46795. source: 'html',
  46796. selector: 'pre',
  46797. default: '',
  46798. __unstablePreserveWhiteSpace: true,
  46799. __experimentalRole: 'content'
  46800. },
  46801. textAlign: {
  46802. type: 'string'
  46803. }
  46804. },
  46805. supports: {
  46806. anchor: true,
  46807. color: {
  46808. gradients: true,
  46809. link: true
  46810. },
  46811. typography: {
  46812. fontSize: true,
  46813. __experimentalFontFamily: true
  46814. },
  46815. spacing: {
  46816. padding: true
  46817. }
  46818. },
  46819. save(_ref2) {
  46820. let {
  46821. attributes
  46822. } = _ref2;
  46823. const {
  46824. textAlign,
  46825. content
  46826. } = attributes;
  46827. const className = classnames_default()({
  46828. [`has-text-align-${textAlign}`]: textAlign
  46829. });
  46830. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  46831. className
  46832. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  46833. value: content
  46834. }));
  46835. },
  46836. migrate: migrate_font_family,
  46837. isEligible(_ref3) {
  46838. var _style$typography;
  46839. let {
  46840. style
  46841. } = _ref3;
  46842. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  46843. }
  46844. };
  46845. /**
  46846. * New deprecations need to be placed first
  46847. * for them to have higher priority.
  46848. *
  46849. * Old deprecations may need to be updated as well.
  46850. *
  46851. * See block-deprecation.md
  46852. */
  46853. /* harmony default export */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);
  46854. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
  46855. /**
  46856. * External dependencies
  46857. */
  46858. /**
  46859. * WordPress dependencies
  46860. */
  46861. function VerseEdit(_ref) {
  46862. let {
  46863. attributes,
  46864. setAttributes,
  46865. mergeBlocks,
  46866. onRemove,
  46867. style
  46868. } = _ref;
  46869. const {
  46870. textAlign,
  46871. content
  46872. } = attributes;
  46873. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  46874. className: classnames_default()({
  46875. [`has-text-align-${textAlign}`]: textAlign
  46876. }),
  46877. style
  46878. });
  46879. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  46880. value: textAlign,
  46881. onChange: nextAlign => {
  46882. setAttributes({
  46883. textAlign: nextAlign
  46884. });
  46885. }
  46886. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  46887. tagName: "pre",
  46888. identifier: "content",
  46889. preserveWhiteSpace: true,
  46890. value: content,
  46891. onChange: nextContent => {
  46892. setAttributes({
  46893. content: nextContent
  46894. });
  46895. },
  46896. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'),
  46897. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'),
  46898. onRemove: onRemove,
  46899. onMerge: mergeBlocks,
  46900. textAlign: textAlign
  46901. }, blockProps, {
  46902. __unstablePastePlainText: true
  46903. })));
  46904. }
  46905. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
  46906. /**
  46907. * External dependencies
  46908. */
  46909. /**
  46910. * WordPress dependencies
  46911. */
  46912. function verse_save_save(_ref) {
  46913. let {
  46914. attributes
  46915. } = _ref;
  46916. const {
  46917. textAlign,
  46918. content
  46919. } = attributes;
  46920. const className = classnames_default()({
  46921. [`has-text-align-${textAlign}`]: textAlign
  46922. });
  46923. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  46924. className
  46925. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  46926. value: content
  46927. }));
  46928. }
  46929. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
  46930. /**
  46931. * WordPress dependencies
  46932. */
  46933. const verse_transforms_transforms = {
  46934. from: [{
  46935. type: 'block',
  46936. blocks: ['core/paragraph'],
  46937. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes)
  46938. }],
  46939. to: [{
  46940. type: 'block',
  46941. blocks: ['core/paragraph'],
  46942. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  46943. }]
  46944. };
  46945. /* harmony default export */ var verse_transforms = (verse_transforms_transforms);
  46946. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  46947. /**
  46948. * WordPress dependencies
  46949. */
  46950. /**
  46951. * Internal dependencies
  46952. */
  46953. const verse_metadata = {
  46954. $schema: "https://schemas.wp.org/trunk/block.json",
  46955. apiVersion: 2,
  46956. name: "core/verse",
  46957. title: "Verse",
  46958. category: "text",
  46959. description: "Insert poetry. Use special spacing formats. Or quote song lyrics.",
  46960. keywords: ["poetry", "poem"],
  46961. textdomain: "default",
  46962. attributes: {
  46963. content: {
  46964. type: "string",
  46965. source: "html",
  46966. selector: "pre",
  46967. "default": "",
  46968. __unstablePreserveWhiteSpace: true,
  46969. __experimentalRole: "content"
  46970. },
  46971. textAlign: {
  46972. type: "string"
  46973. }
  46974. },
  46975. supports: {
  46976. anchor: true,
  46977. color: {
  46978. gradients: true,
  46979. link: true,
  46980. __experimentalDefaultControls: {
  46981. background: true,
  46982. text: true
  46983. }
  46984. },
  46985. typography: {
  46986. fontSize: true,
  46987. __experimentalFontFamily: true,
  46988. lineHeight: true,
  46989. __experimentalFontStyle: true,
  46990. __experimentalFontWeight: true,
  46991. __experimentalLetterSpacing: true,
  46992. __experimentalTextTransform: true,
  46993. __experimentalTextDecoration: true,
  46994. __experimentalDefaultControls: {
  46995. fontSize: true,
  46996. fontAppearance: true
  46997. }
  46998. },
  46999. spacing: {
  47000. margin: true,
  47001. padding: true
  47002. }
  47003. },
  47004. style: "wp-block-verse",
  47005. editorStyle: "wp-block-verse-editor"
  47006. };
  47007. const {
  47008. name: verse_name
  47009. } = verse_metadata;
  47010. const verse_settings = {
  47011. icon: library_verse,
  47012. example: {
  47013. attributes: {
  47014. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  47015. // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
  47016. content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
  47017. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  47018. }
  47019. },
  47020. transforms: verse_transforms,
  47021. deprecated: verse_deprecated,
  47022. merge(attributes, attributesToMerge) {
  47023. return {
  47024. content: attributes.content + attributesToMerge.content
  47025. };
  47026. },
  47027. edit: VerseEdit,
  47028. save: verse_save_save
  47029. };
  47030. const verse_init = () => initBlock({
  47031. name: verse_name,
  47032. metadata: verse_metadata,
  47033. settings: verse_settings
  47034. });
  47035. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
  47036. /**
  47037. * WordPress dependencies
  47038. */
  47039. const video = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  47040. viewBox: "0 0 24 24",
  47041. xmlns: "http://www.w3.org/2000/svg"
  47042. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  47043. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  47044. }));
  47045. /* harmony default export */ var library_video = (video);
  47046. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
  47047. function Tracks(_ref) {
  47048. let {
  47049. tracks = []
  47050. } = _ref;
  47051. return tracks.map(track => {
  47052. return (0,external_wp_element_namespaceObject.createElement)("track", _extends({
  47053. key: track.src
  47054. }, track));
  47055. });
  47056. }
  47057. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/deprecated.js
  47058. /**
  47059. * WordPress dependencies
  47060. */
  47061. /**
  47062. * Internal dependencies
  47063. */
  47064. const video_deprecated_metadata = {
  47065. $schema: "https://schemas.wp.org/trunk/block.json",
  47066. apiVersion: 2,
  47067. name: "core/video",
  47068. title: "Video",
  47069. category: "media",
  47070. description: "Embed a video from your media library or upload a new one.",
  47071. keywords: ["movie"],
  47072. textdomain: "default",
  47073. attributes: {
  47074. autoplay: {
  47075. type: "boolean",
  47076. source: "attribute",
  47077. selector: "video",
  47078. attribute: "autoplay"
  47079. },
  47080. caption: {
  47081. type: "string",
  47082. source: "html",
  47083. selector: "figcaption",
  47084. __experimentalRole: "content"
  47085. },
  47086. controls: {
  47087. type: "boolean",
  47088. source: "attribute",
  47089. selector: "video",
  47090. attribute: "controls",
  47091. "default": true
  47092. },
  47093. id: {
  47094. type: "number",
  47095. __experimentalRole: "content"
  47096. },
  47097. loop: {
  47098. type: "boolean",
  47099. source: "attribute",
  47100. selector: "video",
  47101. attribute: "loop"
  47102. },
  47103. muted: {
  47104. type: "boolean",
  47105. source: "attribute",
  47106. selector: "video",
  47107. attribute: "muted"
  47108. },
  47109. poster: {
  47110. type: "string",
  47111. source: "attribute",
  47112. selector: "video",
  47113. attribute: "poster"
  47114. },
  47115. preload: {
  47116. type: "string",
  47117. source: "attribute",
  47118. selector: "video",
  47119. attribute: "preload",
  47120. "default": "metadata"
  47121. },
  47122. src: {
  47123. type: "string",
  47124. source: "attribute",
  47125. selector: "video",
  47126. attribute: "src",
  47127. __experimentalRole: "content"
  47128. },
  47129. playsInline: {
  47130. type: "boolean",
  47131. source: "attribute",
  47132. selector: "video",
  47133. attribute: "playsinline"
  47134. },
  47135. tracks: {
  47136. __experimentalRole: "content",
  47137. type: "array",
  47138. items: {
  47139. type: "object"
  47140. },
  47141. "default": []
  47142. }
  47143. },
  47144. supports: {
  47145. anchor: true,
  47146. align: true,
  47147. spacing: {
  47148. margin: true,
  47149. padding: true
  47150. }
  47151. },
  47152. editorStyle: "wp-block-video-editor",
  47153. style: "wp-block-video"
  47154. };
  47155. const {
  47156. attributes: video_deprecated_blockAttributes
  47157. } = video_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
  47158. // to the video figcaption element.
  47159. const video_deprecated_v1 = {
  47160. attributes: video_deprecated_blockAttributes,
  47161. save(_ref) {
  47162. let {
  47163. attributes
  47164. } = _ref;
  47165. const {
  47166. autoplay,
  47167. caption,
  47168. controls,
  47169. loop,
  47170. muted,
  47171. poster,
  47172. preload,
  47173. src,
  47174. playsInline,
  47175. tracks
  47176. } = attributes;
  47177. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
  47178. autoPlay: autoplay,
  47179. controls: controls,
  47180. loop: loop,
  47181. muted: muted,
  47182. poster: poster,
  47183. preload: preload !== 'metadata' ? preload : undefined,
  47184. src: src,
  47185. playsInline: playsInline
  47186. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  47187. tracks: tracks
  47188. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  47189. tagName: "figcaption",
  47190. value: caption
  47191. }));
  47192. }
  47193. };
  47194. const video_deprecated_deprecated = [video_deprecated_v1];
  47195. /* harmony default export */ var video_deprecated = (video_deprecated_deprecated);
  47196. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
  47197. /**
  47198. * WordPress dependencies
  47199. */
  47200. const options = [{
  47201. value: 'auto',
  47202. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  47203. }, {
  47204. value: 'metadata',
  47205. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  47206. }, {
  47207. value: 'none',
  47208. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  47209. }];
  47210. const VideoSettings = _ref => {
  47211. let {
  47212. setAttributes,
  47213. attributes
  47214. } = _ref;
  47215. const {
  47216. autoplay,
  47217. controls,
  47218. loop,
  47219. muted,
  47220. playsInline,
  47221. preload
  47222. } = attributes;
  47223. const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.');
  47224. const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({
  47225. web: (0,external_wp_element_namespaceObject.useCallback)(checked => {
  47226. return checked ? autoPlayHelpText : null;
  47227. }, []),
  47228. native: autoPlayHelpText
  47229. });
  47230. const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => {
  47231. const toggleAttribute = attribute => {
  47232. return newValue => {
  47233. setAttributes({
  47234. [attribute]: newValue
  47235. });
  47236. };
  47237. };
  47238. return {
  47239. autoplay: toggleAttribute('autoplay'),
  47240. loop: toggleAttribute('loop'),
  47241. muted: toggleAttribute('muted'),
  47242. controls: toggleAttribute('controls'),
  47243. playsInline: toggleAttribute('playsInline')
  47244. };
  47245. }, []);
  47246. const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => {
  47247. setAttributes({
  47248. preload: value
  47249. });
  47250. }, []);
  47251. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  47252. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  47253. onChange: toggleFactory.autoplay,
  47254. checked: autoplay,
  47255. help: getAutoplayHelp
  47256. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  47257. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  47258. onChange: toggleFactory.loop,
  47259. checked: loop
  47260. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  47261. label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
  47262. onChange: toggleFactory.muted,
  47263. checked: muted
  47264. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  47265. label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
  47266. onChange: toggleFactory.controls,
  47267. checked: controls
  47268. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  47269. label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
  47270. onChange: toggleFactory.playsInline,
  47271. checked: playsInline
  47272. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  47273. label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
  47274. value: preload,
  47275. onChange: onChangePreload,
  47276. options: options,
  47277. hideCancelButton: true
  47278. }));
  47279. };
  47280. /* harmony default export */ var edit_common_settings = (VideoSettings);
  47281. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
  47282. /**
  47283. * WordPress dependencies
  47284. */
  47285. const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  47286. xmlns: "http://www.w3.org/2000/svg",
  47287. viewBox: "0 0 24 24"
  47288. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  47289. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  47290. }));
  47291. /* harmony default export */ var library_media = (media);
  47292. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js
  47293. /**
  47294. * WordPress dependencies
  47295. */
  47296. const ALLOWED_TYPES = ['text/vtt'];
  47297. const DEFAULT_KIND = 'subtitles';
  47298. const KIND_OPTIONS = [{
  47299. label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'),
  47300. value: 'subtitles'
  47301. }, {
  47302. label: (0,external_wp_i18n_namespaceObject.__)('Captions'),
  47303. value: 'captions'
  47304. }, {
  47305. label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'),
  47306. value: 'descriptions'
  47307. }, {
  47308. label: (0,external_wp_i18n_namespaceObject.__)('Chapters'),
  47309. value: 'chapters'
  47310. }, {
  47311. label: (0,external_wp_i18n_namespaceObject.__)('Metadata'),
  47312. value: 'metadata'
  47313. }];
  47314. const captionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  47315. width: "18",
  47316. height: "14",
  47317. viewBox: "0 0 18 14",
  47318. role: "img",
  47319. fill: "none"
  47320. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  47321. x: "0.75",
  47322. y: "0.75",
  47323. width: "16.5",
  47324. height: "12.5",
  47325. rx: "1.25",
  47326. stroke: "black",
  47327. strokeWidth: "1.5",
  47328. fill: "none"
  47329. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  47330. d: "M3 7H15",
  47331. stroke: "black",
  47332. strokeWidth: "1.5"
  47333. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  47334. d: "M3 10L15 10",
  47335. stroke: "black",
  47336. strokeWidth: "1.5"
  47337. }));
  47338. function TrackList(_ref) {
  47339. let {
  47340. tracks,
  47341. onEditPress
  47342. } = _ref;
  47343. let content;
  47344. if (tracks.length === 0) {
  47345. content = (0,external_wp_element_namespaceObject.createElement)("p", {
  47346. className: "block-library-video-tracks-editor__tracks-informative-message"
  47347. }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
  47348. } else {
  47349. content = tracks.map((track, index) => {
  47350. return (0,external_wp_element_namespaceObject.createElement)("div", {
  47351. key: index,
  47352. className: "block-library-video-tracks-editor__track-list-track"
  47353. }, (0,external_wp_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  47354. variant: "tertiary",
  47355. onClick: () => onEditPress(index),
  47356. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
  47357. /* translators: %s: Label of the video text track e.g: "French subtitles" */
  47358. (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label)
  47359. }, (0,external_wp_i18n_namespaceObject.__)('Edit')));
  47360. });
  47361. }
  47362. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  47363. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  47364. className: "block-library-video-tracks-editor__track-list"
  47365. }, content);
  47366. }
  47367. function SingleTrackEditor(_ref2) {
  47368. let {
  47369. track,
  47370. onChange,
  47371. onClose,
  47372. onRemove
  47373. } = _ref2;
  47374. const {
  47375. src = '',
  47376. label = '',
  47377. srcLang = '',
  47378. kind = DEFAULT_KIND
  47379. } = track;
  47380. const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || '';
  47381. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  47382. className: "block-library-video-tracks-editor__single-track-editor"
  47383. }, (0,external_wp_element_namespaceObject.createElement)("span", {
  47384. className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
  47385. }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_wp_element_namespaceObject.createElement)("b", null, fileName)), (0,external_wp_element_namespaceObject.createElement)("div", {
  47386. className: "block-library-video-tracks-editor__single-track-editor-label-language"
  47387. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
  47388. /* eslint-disable jsx-a11y/no-autofocus */
  47389. , {
  47390. autoFocus: true
  47391. /* eslint-enable jsx-a11y/no-autofocus */
  47392. ,
  47393. onChange: newLabel => onChange({ ...track,
  47394. label: newLabel
  47395. }),
  47396. label: (0,external_wp_i18n_namespaceObject.__)('Label'),
  47397. value: label,
  47398. help: (0,external_wp_i18n_namespaceObject.__)('Title of track')
  47399. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  47400. onChange: newSrcLang => onChange({ ...track,
  47401. srcLang: newSrcLang
  47402. }),
  47403. label: (0,external_wp_i18n_namespaceObject.__)('Source language'),
  47404. value: srcLang,
  47405. help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)')
  47406. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  47407. className: "block-library-video-tracks-editor__single-track-editor-kind-select",
  47408. options: KIND_OPTIONS,
  47409. value: kind,
  47410. label: (0,external_wp_i18n_namespaceObject.__)('Kind'),
  47411. onChange: newKind => {
  47412. onChange({ ...track,
  47413. kind: newKind
  47414. });
  47415. }
  47416. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  47417. className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
  47418. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  47419. variant: "secondary",
  47420. onClick: () => {
  47421. const changes = {};
  47422. let hasChanges = false;
  47423. if (label === '') {
  47424. changes.label = (0,external_wp_i18n_namespaceObject.__)('English');
  47425. hasChanges = true;
  47426. }
  47427. if (srcLang === '') {
  47428. changes.srcLang = 'en';
  47429. hasChanges = true;
  47430. }
  47431. if (track.kind === undefined) {
  47432. changes.kind = DEFAULT_KIND;
  47433. hasChanges = true;
  47434. }
  47435. if (hasChanges) {
  47436. onChange({ ...track,
  47437. ...changes
  47438. });
  47439. }
  47440. onClose();
  47441. }
  47442. }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  47443. isDestructive: true,
  47444. variant: "link",
  47445. onClick: onRemove
  47446. }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))));
  47447. }
  47448. function TracksEditor(_ref3) {
  47449. let {
  47450. tracks = [],
  47451. onChange
  47452. } = _ref3;
  47453. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  47454. return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload;
  47455. }, []);
  47456. const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null);
  47457. if (!mediaUpload) {
  47458. return null;
  47459. }
  47460. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  47461. contentClassName: "block-library-video-tracks-editor",
  47462. renderToggle: _ref4 => {
  47463. let {
  47464. isOpen,
  47465. onToggle
  47466. } = _ref4;
  47467. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  47468. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  47469. showTooltip: true,
  47470. "aria-expanded": isOpen,
  47471. "aria-haspopup": "true",
  47472. onClick: onToggle,
  47473. icon: captionIcon
  47474. });
  47475. },
  47476. renderContent: () => {
  47477. if (trackBeingEdited !== null) {
  47478. return (0,external_wp_element_namespaceObject.createElement)(SingleTrackEditor, {
  47479. track: tracks[trackBeingEdited],
  47480. onChange: newTrack => {
  47481. const newTracks = [...tracks];
  47482. newTracks[trackBeingEdited] = newTrack;
  47483. onChange(newTracks);
  47484. },
  47485. onClose: () => setTrackBeingEdited(null),
  47486. onRemove: () => {
  47487. onChange(tracks.filter((_track, index) => index !== trackBeingEdited));
  47488. setTrackBeingEdited(null);
  47489. }
  47490. });
  47491. }
  47492. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)(TrackList, {
  47493. tracks: tracks,
  47494. onEditPress: setTrackBeingEdited
  47495. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  47496. className: "block-library-video-tracks-editor__add-tracks-container",
  47497. label: (0,external_wp_i18n_namespaceObject.__)('Add tracks')
  47498. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  47499. onSelect: _ref5 => {
  47500. let {
  47501. url
  47502. } = _ref5;
  47503. const trackIndex = tracks.length;
  47504. onChange([...tracks, {
  47505. src: url
  47506. }]);
  47507. setTrackBeingEdited(trackIndex);
  47508. },
  47509. allowedTypes: ALLOWED_TYPES,
  47510. render: _ref6 => {
  47511. let {
  47512. open
  47513. } = _ref6;
  47514. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  47515. icon: library_media,
  47516. onClick: open
  47517. }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
  47518. }
  47519. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
  47520. onChange: event => {
  47521. const files = event.target.files;
  47522. const trackIndex = tracks.length;
  47523. mediaUpload({
  47524. allowedTypes: ALLOWED_TYPES,
  47525. filesList: files,
  47526. onFileChange: _ref7 => {
  47527. let [{
  47528. url
  47529. }] = _ref7;
  47530. const newTracks = [...tracks];
  47531. if (!newTracks[trackIndex]) {
  47532. newTracks[trackIndex] = {};
  47533. }
  47534. newTracks[trackIndex] = { ...tracks[trackIndex],
  47535. src: url
  47536. };
  47537. onChange(newTracks);
  47538. setTrackBeingEdited(trackIndex);
  47539. }
  47540. });
  47541. },
  47542. accept: ".vtt,text/vtt",
  47543. render: _ref8 => {
  47544. let {
  47545. openFileDialog
  47546. } = _ref8;
  47547. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  47548. icon: library_upload,
  47549. onClick: () => {
  47550. openFileDialog();
  47551. }
  47552. }, (0,external_wp_i18n_namespaceObject.__)('Upload'));
  47553. }
  47554. })))));
  47555. }
  47556. });
  47557. }
  47558. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
  47559. /**
  47560. * External dependencies
  47561. */
  47562. /**
  47563. * WordPress dependencies
  47564. */
  47565. /**
  47566. * Internal dependencies
  47567. */
  47568. const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
  47569. const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
  47570. function VideoEdit(_ref) {
  47571. let {
  47572. isSelected,
  47573. attributes,
  47574. className,
  47575. setAttributes,
  47576. insertBlocksAfter,
  47577. onReplace
  47578. } = _ref;
  47579. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit);
  47580. const videoPlayer = (0,external_wp_element_namespaceObject.useRef)();
  47581. const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
  47582. const {
  47583. id,
  47584. caption,
  47585. controls,
  47586. poster,
  47587. src,
  47588. tracks
  47589. } = attributes;
  47590. const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  47591. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload, []);
  47592. (0,external_wp_element_namespaceObject.useEffect)(() => {
  47593. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  47594. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  47595. if (file) {
  47596. mediaUpload({
  47597. filesList: [file],
  47598. onFileChange: _ref2 => {
  47599. let [media] = _ref2;
  47600. return onSelectVideo(media);
  47601. },
  47602. onError: onUploadError,
  47603. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES
  47604. });
  47605. }
  47606. }
  47607. }, []);
  47608. (0,external_wp_element_namespaceObject.useEffect)(() => {
  47609. // Placeholder may be rendered.
  47610. if (videoPlayer.current) {
  47611. videoPlayer.current.load();
  47612. }
  47613. }, [poster]);
  47614. function onSelectVideo(media) {
  47615. var _media$image, _media$image2;
  47616. if (!media || !media.url) {
  47617. // In this case there was an error
  47618. // previous attributes should be removed
  47619. // because they may be temporary blob urls.
  47620. setAttributes({
  47621. src: undefined,
  47622. id: undefined,
  47623. poster: undefined
  47624. });
  47625. return;
  47626. } // Sets the block's attribute and updates the edit component from the
  47627. // selected media.
  47628. setAttributes({
  47629. src: media.url,
  47630. id: media.id,
  47631. poster: ((_media$image = media.image) === null || _media$image === void 0 ? void 0 : _media$image.src) !== media.icon ? (_media$image2 = media.image) === null || _media$image2 === void 0 ? void 0 : _media$image2.src : undefined
  47632. });
  47633. }
  47634. function onSelectURL(newSrc) {
  47635. if (newSrc !== src) {
  47636. // Check if there's an embed block that handles this URL.
  47637. const embedBlock = createUpgradedEmbedBlock({
  47638. attributes: {
  47639. url: newSrc
  47640. }
  47641. });
  47642. if (undefined !== embedBlock) {
  47643. onReplace(embedBlock);
  47644. return;
  47645. }
  47646. setAttributes({
  47647. src: newSrc,
  47648. id: undefined,
  47649. poster: undefined
  47650. });
  47651. }
  47652. }
  47653. const {
  47654. createErrorNotice
  47655. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  47656. function onUploadError(message) {
  47657. createErrorNotice(message, {
  47658. type: 'snackbar'
  47659. });
  47660. }
  47661. const classes = classnames_default()(className, {
  47662. 'is-transient': isTemporaryVideo
  47663. });
  47664. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  47665. className: classes
  47666. });
  47667. if (!src) {
  47668. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  47669. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  47670. icon: library_video
  47671. }),
  47672. onSelect: onSelectVideo,
  47673. onSelectURL: onSelectURL,
  47674. accept: "video/*",
  47675. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  47676. value: attributes,
  47677. onError: onUploadError
  47678. }));
  47679. }
  47680. function onSelectPoster(image) {
  47681. setAttributes({
  47682. poster: image.url
  47683. });
  47684. }
  47685. function onRemovePoster() {
  47686. setAttributes({
  47687. poster: undefined
  47688. }); // Move focus back to the Media Upload button.
  47689. posterImageButton.current.focus();
  47690. }
  47691. const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
  47692. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  47693. group: "block"
  47694. }, (0,external_wp_element_namespaceObject.createElement)(TracksEditor, {
  47695. tracks: tracks,
  47696. onChange: newTracks => {
  47697. setAttributes({
  47698. tracks: newTracks
  47699. });
  47700. }
  47701. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  47702. group: "other"
  47703. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  47704. mediaId: id,
  47705. mediaURL: src,
  47706. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  47707. accept: "video/*",
  47708. onSelect: onSelectVideo,
  47709. onSelectURL: onSelectURL,
  47710. onError: onUploadError
  47711. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  47712. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  47713. }, (0,external_wp_element_namespaceObject.createElement)(edit_common_settings, {
  47714. setAttributes: setAttributes,
  47715. attributes: attributes
  47716. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  47717. className: "editor-video-poster-control"
  47718. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  47719. title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'),
  47720. onSelect: onSelectPoster,
  47721. allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
  47722. render: _ref3 => {
  47723. let {
  47724. open
  47725. } = _ref3;
  47726. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  47727. variant: "primary",
  47728. onClick: open,
  47729. ref: posterImageButton,
  47730. "aria-describedby": videoPosterDescription
  47731. }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace'));
  47732. }
  47733. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  47734. id: videoPosterDescription,
  47735. hidden: true
  47736. }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
  47737. /* translators: %s: poster image URL. */
  47738. (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  47739. onClick: onRemovePoster,
  47740. variant: "tertiary"
  47741. }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  47742. isDisabled: !isSelected
  47743. }, (0,external_wp_element_namespaceObject.createElement)("video", {
  47744. controls: controls,
  47745. poster: poster,
  47746. src: src,
  47747. ref: videoPlayer
  47748. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  47749. tracks: tracks
  47750. }))), isTemporaryVideo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  47751. tagName: "figcaption",
  47752. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  47753. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Video caption text'),
  47754. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  47755. value: caption,
  47756. onChange: value => setAttributes({
  47757. caption: value
  47758. }),
  47759. inlineToolbar: true,
  47760. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  47761. })));
  47762. }
  47763. /* harmony default export */ var video_edit = (VideoEdit);
  47764. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
  47765. /**
  47766. * WordPress dependencies
  47767. */
  47768. /**
  47769. * Internal dependencies
  47770. */
  47771. function video_save_save(_ref) {
  47772. let {
  47773. attributes
  47774. } = _ref;
  47775. const {
  47776. autoplay,
  47777. caption,
  47778. controls,
  47779. loop,
  47780. muted,
  47781. poster,
  47782. preload,
  47783. src,
  47784. playsInline,
  47785. tracks
  47786. } = attributes;
  47787. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
  47788. autoPlay: autoplay,
  47789. controls: controls,
  47790. loop: loop,
  47791. muted: muted,
  47792. poster: poster,
  47793. preload: preload !== 'metadata' ? preload : undefined,
  47794. src: src,
  47795. playsInline: playsInline
  47796. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  47797. tracks: tracks
  47798. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  47799. className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
  47800. tagName: "figcaption",
  47801. value: caption
  47802. }));
  47803. }
  47804. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js
  47805. /**
  47806. * WordPress dependencies
  47807. */
  47808. const video_transforms_transforms = {
  47809. from: [{
  47810. type: 'files',
  47811. isMatch(files) {
  47812. return files.length === 1 && files[0].type.indexOf('video/') === 0;
  47813. },
  47814. transform(files) {
  47815. const file = files[0]; // We don't need to upload the media directly here
  47816. // It's already done as part of the `componentDidMount`
  47817. // in the video block
  47818. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  47819. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  47820. });
  47821. return block;
  47822. }
  47823. }, {
  47824. type: 'shortcode',
  47825. tag: 'video',
  47826. attributes: {
  47827. src: {
  47828. type: 'string',
  47829. shortcode: _ref => {
  47830. let {
  47831. named: {
  47832. src,
  47833. mp4,
  47834. m4v,
  47835. webm,
  47836. ogv,
  47837. flv
  47838. }
  47839. } = _ref;
  47840. return src || mp4 || m4v || webm || ogv || flv;
  47841. }
  47842. },
  47843. poster: {
  47844. type: 'string',
  47845. shortcode: _ref2 => {
  47846. let {
  47847. named: {
  47848. poster
  47849. }
  47850. } = _ref2;
  47851. return poster;
  47852. }
  47853. },
  47854. loop: {
  47855. type: 'string',
  47856. shortcode: _ref3 => {
  47857. let {
  47858. named: {
  47859. loop
  47860. }
  47861. } = _ref3;
  47862. return loop;
  47863. }
  47864. },
  47865. autoplay: {
  47866. type: 'string',
  47867. shortcode: _ref4 => {
  47868. let {
  47869. named: {
  47870. autoplay
  47871. }
  47872. } = _ref4;
  47873. return autoplay;
  47874. }
  47875. },
  47876. preload: {
  47877. type: 'string',
  47878. shortcode: _ref5 => {
  47879. let {
  47880. named: {
  47881. preload
  47882. }
  47883. } = _ref5;
  47884. return preload;
  47885. }
  47886. }
  47887. }
  47888. }]
  47889. };
  47890. /* harmony default export */ var video_transforms = (video_transforms_transforms);
  47891. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
  47892. /**
  47893. * WordPress dependencies
  47894. */
  47895. /**
  47896. * Internal dependencies
  47897. */
  47898. const video_metadata = {
  47899. $schema: "https://schemas.wp.org/trunk/block.json",
  47900. apiVersion: 2,
  47901. name: "core/video",
  47902. title: "Video",
  47903. category: "media",
  47904. description: "Embed a video from your media library or upload a new one.",
  47905. keywords: ["movie"],
  47906. textdomain: "default",
  47907. attributes: {
  47908. autoplay: {
  47909. type: "boolean",
  47910. source: "attribute",
  47911. selector: "video",
  47912. attribute: "autoplay"
  47913. },
  47914. caption: {
  47915. type: "string",
  47916. source: "html",
  47917. selector: "figcaption",
  47918. __experimentalRole: "content"
  47919. },
  47920. controls: {
  47921. type: "boolean",
  47922. source: "attribute",
  47923. selector: "video",
  47924. attribute: "controls",
  47925. "default": true
  47926. },
  47927. id: {
  47928. type: "number",
  47929. __experimentalRole: "content"
  47930. },
  47931. loop: {
  47932. type: "boolean",
  47933. source: "attribute",
  47934. selector: "video",
  47935. attribute: "loop"
  47936. },
  47937. muted: {
  47938. type: "boolean",
  47939. source: "attribute",
  47940. selector: "video",
  47941. attribute: "muted"
  47942. },
  47943. poster: {
  47944. type: "string",
  47945. source: "attribute",
  47946. selector: "video",
  47947. attribute: "poster"
  47948. },
  47949. preload: {
  47950. type: "string",
  47951. source: "attribute",
  47952. selector: "video",
  47953. attribute: "preload",
  47954. "default": "metadata"
  47955. },
  47956. src: {
  47957. type: "string",
  47958. source: "attribute",
  47959. selector: "video",
  47960. attribute: "src",
  47961. __experimentalRole: "content"
  47962. },
  47963. playsInline: {
  47964. type: "boolean",
  47965. source: "attribute",
  47966. selector: "video",
  47967. attribute: "playsinline"
  47968. },
  47969. tracks: {
  47970. __experimentalRole: "content",
  47971. type: "array",
  47972. items: {
  47973. type: "object"
  47974. },
  47975. "default": []
  47976. }
  47977. },
  47978. supports: {
  47979. anchor: true,
  47980. align: true,
  47981. spacing: {
  47982. margin: true,
  47983. padding: true
  47984. }
  47985. },
  47986. editorStyle: "wp-block-video-editor",
  47987. style: "wp-block-video"
  47988. };
  47989. const {
  47990. name: video_name
  47991. } = video_metadata;
  47992. const video_settings = {
  47993. icon: library_video,
  47994. example: {
  47995. attributes: {
  47996. src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
  47997. // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
  47998. caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.')
  47999. }
  48000. },
  48001. transforms: video_transforms,
  48002. deprecated: video_deprecated,
  48003. edit: video_edit,
  48004. save: video_save_save
  48005. };
  48006. const video_init = () => initBlock({
  48007. name: video_name,
  48008. metadata: video_metadata,
  48009. settings: video_settings
  48010. });
  48011. // EXTERNAL MODULE: ./node_modules/@wordpress/block-library/build-module/utils/is-block-metadata-experimental.js
  48012. var is_block_metadata_experimental = __webpack_require__(7078);
  48013. var is_block_metadata_experimental_default = /*#__PURE__*/__webpack_require__.n(is_block_metadata_experimental);
  48014. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
  48015. /**
  48016. * WordPress dependencies
  48017. */
  48018. /**
  48019. * Internal dependencies
  48020. */
  48021. // When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks
  48022. // are transformed by packages/block-library/src/index.js as follows:
  48023. // import * as experimentalBlock from './experimental-block'
  48024. // becomes
  48025. // const experimentalBlock = null;
  48026. // This enables webpack to eliminate the experimental blocks code from the
  48027. // production build to make the final bundle smaller.
  48028. //
  48029. // See https://github.com/WordPress/gutenberg/pull/40655 for more context.
  48030. /**
  48031. * Function to get all the block-library blocks in an array
  48032. */
  48033. const getAllBlocks = () => [// Common blocks are grouped at the top to prioritize their display
  48034. // in various contexts — like the inserter and auto-complete components.
  48035. build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_list_item_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
  48036. archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, ...(window.wp && window.wp.oldEditor ? [freeform_namespaceObject] : []), // Only add the classic block in WP Context.
  48037. build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_comment_author_avatar_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, // theme blocks
  48038. build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, post_author_name_namespaceObject, post_comment_namespaceObject, build_module_post_comments_count_namespaceObject, post_comments_link_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, comments_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_form_namespaceObject, table_of_contents_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, query_title_namespaceObject, post_author_biography_namespaceObject].filter(Boolean);
  48039. /**
  48040. * Function to get all the core blocks in an array.
  48041. *
  48042. * @example
  48043. * ```js
  48044. * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';
  48045. *
  48046. * const coreBlocks = __experimentalGetCoreBlocks();
  48047. * ```
  48048. */
  48049. const __experimentalGetCoreBlocks = () => getAllBlocks().filter(_ref => {
  48050. let {
  48051. metadata
  48052. } = _ref;
  48053. return !is_block_metadata_experimental_default()(metadata);
  48054. });
  48055. /**
  48056. * Function to register core blocks provided by the block editor.
  48057. *
  48058. * @param {Array} blocks An optional array of the core blocks being registered.
  48059. *
  48060. * @example
  48061. * ```js
  48062. * import { registerCoreBlocks } from '@wordpress/block-library';
  48063. *
  48064. * registerCoreBlocks();
  48065. * ```
  48066. */
  48067. const registerCoreBlocks = function () {
  48068. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __experimentalGetCoreBlocks();
  48069. blocks.forEach(_ref2 => {
  48070. let {
  48071. init
  48072. } = _ref2;
  48073. return init();
  48074. });
  48075. (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);
  48076. if (window.wp && window.wp.oldEditor) {
  48077. (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
  48078. }
  48079. (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
  48080. (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name);
  48081. };
  48082. /**
  48083. * Function to register experimental core blocks depending on editor settings.
  48084. *
  48085. * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
  48086. * @example
  48087. * ```js
  48088. * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
  48089. *
  48090. * __experimentalRegisterExperimentalCoreBlocks( settings );
  48091. * ```
  48092. */
  48093. const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined;
  48094. }();
  48095. (window.wp = window.wp || {}).blockLibrary = __webpack_exports__;
  48096. /******/ })()
  48097. ;