- md5
- 4efe32d85741d21cb67455629327a63f
- sha1
- bb01fa486e301bca132a41b6873f9818e67dd1d2
- sha256
- df10ee15ba0dbc49e2da902df685c1c524c3f5dc2464cfea426f0b5106150e38
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// package-external:@wordpress/element
var require_element = __commonJS({
"package-external:@wordpress/element"(exports, module) {
module.exports = window.wp.element;
}
});
// vendor-external:react
var require_react = __commonJS({
"vendor-external:react"(exports, module) {
module.exports = window.React;
}
});
// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
"vendor-external:react/jsx-runtime"(exports, module) {
module.exports = window.ReactJSXRuntime;
}
});
// vendor-external:react-dom
var require_react_dom = __commonJS({
"vendor-external:react-dom"(exports, module) {
module.exports = window.ReactDOM;
}
});
// package-external:@wordpress/primitives
var require_primitives = __commonJS({
"package-external:@wordpress/primitives"(exports, module) {
module.exports = window.wp.primitives;
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
"use strict";
(function() {
function is(x, y) {
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
function useSyncExternalStore$2(subscribe, getSnapshot) {
didWarnOld18Alpha || void 0 === React118.startTransition || (didWarnOld18Alpha = true, console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
));
var value = getSnapshot();
if (!didWarnUncachedGetSnapshot) {
var cachedValue = getSnapshot();
objectIs(value, cachedValue) || (console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"
), didWarnUncachedGetSnapshot = true);
}
cachedValue = useState25({
inst: { value, getSnapshot }
});
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
useLayoutEffect3(
function() {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
},
[subscribe, value, getSnapshot]
);
useEffect20(
function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
return subscribe(function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
});
},
[subscribe]
);
useDebugValue2(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error2) {
return true;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
return getSnapshot();
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React118 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState25 = React118.useState, useEffect20 = React118.useEffect, useLayoutEffect3 = React118.useLayoutEffect, useDebugValue2 = React118.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
exports.useSyncExternalStore = void 0 !== React118.useSyncExternalStore ? React118.useSyncExternalStore : shim;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_use_sync_external_store_shim_development();
}
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
var require_with_selector_development = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
"use strict";
(function() {
function is(x, y) {
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React118 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef43 = React118.useRef, useEffect20 = React118.useEffect, useMemo34 = React118.useMemo, useDebugValue2 = React118.useDebugValue;
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
var instRef = useRef43(null);
if (null === instRef.current) {
var inst = { hasValue: false, value: null };
instRef.current = inst;
} else inst = instRef.current;
instRef = useMemo34(
function() {
function memoizedSelector(nextSnapshot) {
if (!hasMemo) {
hasMemo = true;
memoizedSnapshot = nextSnapshot;
nextSnapshot = selector(nextSnapshot);
if (void 0 !== isEqual && inst.hasValue) {
var currentSelection = inst.value;
if (isEqual(currentSelection, nextSnapshot))
return memoizedSelection = currentSelection;
}
return memoizedSelection = nextSnapshot;
}
currentSelection = memoizedSelection;
if (objectIs(memoizedSnapshot, nextSnapshot))
return currentSelection;
var nextSelection = selector(nextSnapshot);
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return memoizedSnapshot = nextSnapshot, currentSelection;
memoizedSnapshot = nextSnapshot;
return memoizedSelection = nextSelection;
}
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
return [
function() {
return memoizedSelector(getSnapshot());
},
null === maybeGetServerSnapshot ? void 0 : function() {
return memoizedSelector(maybeGetServerSnapshot());
}
];
},
[getSnapshot, getServerSnapshot, selector, isEqual]
);
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
useEffect20(
function() {
inst.hasValue = true;
inst.value = value;
},
[value]
);
useDebugValue2(value);
return value;
};
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/with-selector.js
var require_with_selector = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_with_selector_development();
}
}
});
// package-external:@wordpress/i18n
var require_i18n = __commonJS({
"package-external:@wordpress/i18n"(exports, module) {
module.exports = window.wp.i18n;
}
});
// package-external:@wordpress/theme
var require_theme = __commonJS({
"package-external:@wordpress/theme"(exports, module) {
module.exports = window.wp.theme;
}
});
// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
"package-external:@wordpress/private-apis"(exports, module) {
module.exports = window.wp.privateApis;
}
});
// package-external:@wordpress/data
var require_data = __commonJS({
"package-external:@wordpress/data"(exports, module) {
module.exports = window.wp.data;
}
});
// package-external:@wordpress/components
var require_components = __commonJS({
"package-external:@wordpress/components"(exports, module) {
module.exports = window.wp.components;
}
});
// package-external:@wordpress/keyboard-shortcuts
var require_keyboard_shortcuts = __commonJS({
"package-external:@wordpress/keyboard-shortcuts"(exports, module) {
module.exports = window.wp.keyboardShortcuts;
}
});
// package-external:@wordpress/keycodes
var require_keycodes = __commonJS({
"package-external:@wordpress/keycodes"(exports, module) {
module.exports = window.wp.keycodes;
}
});
// package-external:@wordpress/html-entities
var require_html_entities = __commonJS({
"package-external:@wordpress/html-entities"(exports, module) {
module.exports = window.wp.htmlEntities;
}
});
// packages/workflow/build-module/index.mjs
var import_element53 = __toESM(require_element(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useRenderElement.mjs
var React4 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useRefWithInit.mjs
var React = __toESM(require_react(), 1);
var UNINITIALIZED = {};
function useRefWithInit(init, initArg) {
const ref = React.useRef(UNINITIALIZED);
if (ref.current === UNINITIALIZED) {
ref.current = init(initArg);
}
return ref;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useMergedRefs.mjs
function useMergedRefs(a, b, c, d) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChange(forkRef, a, b, c, d)) {
update(forkRef, [a, b, c, d]);
}
return forkRef.callback;
}
function useMergedRefsN(refs) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChangeN(forkRef, refs)) {
update(forkRef, refs);
}
return forkRef.callback;
}
function createForkRef() {
return {
callback: null,
cleanup: null,
refs: []
};
}
function didChange(forkRef, a, b, c, d) {
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
}
function didChangeN(forkRef, newRefs) {
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
}
function update(forkRef, refs) {
forkRef.refs = refs;
if (refs.every((ref) => ref == null)) {
forkRef.callback = null;
return;
}
forkRef.callback = (instance) => {
if (forkRef.cleanup) {
forkRef.cleanup();
forkRef.cleanup = null;
}
if (instance != null) {
const cleanupCallbacks = Array(refs.length).fill(null);
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const refCleanup = ref(instance);
if (typeof refCleanup === "function") {
cleanupCallbacks[i] = refCleanup;
}
break;
}
case "object": {
ref.current = instance;
break;
}
default:
}
}
forkRef.cleanup = () => {
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const cleanupCallback = cleanupCallbacks[i];
if (typeof cleanupCallback === "function") {
cleanupCallback();
} else {
void ref(null);
}
break;
}
case "object": {
ref.current = null;
break;
}
default:
}
}
};
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/getReactElementRef.mjs
var React3 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/reactVersion.mjs
var React2 = __toESM(require_react(), 1);
var majorVersion = parseInt(React2.version, 10);
function isReactVersionAtLeast(reactVersionToCheck) {
return majorVersion >= reactVersionToCheck;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/getReactElementRef.mjs
function getReactElementRef(element) {
if (!/* @__PURE__ */ React3.isValidElement(element)) {
return null;
}
const reactElement = element;
const propsWithRef = reactElement.props;
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/mergeObjects.mjs
function mergeObjects(a, b) {
if (a && !b) {
return a;
}
if (!a && b) {
return b;
}
if (a || b) {
return {
...a,
...b
};
}
return void 0;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/createLogOnce.mjs
var loggedMessages;
if (true) {
loggedMessages = /* @__PURE__ */ new Set();
}
function createLogOnce(severity, prefix) {
return function logOnce(...messages) {
if (true) {
const message = messages.join(" ");
const output = prefix ? `${prefix}: ${message}` : message;
const key = `${severity}:${output}`;
if (!loggedMessages.has(key)) {
loggedMessages.add(key);
if (severity === "warn") {
console.warn(output);
} else {
console.error(output);
}
}
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/warn.mjs
var warn = createLogOnce("warn", "Base UI");
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/empty.mjs
function NOOP() {
}
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
function getStateAttributesProps(state, customMapping) {
const props = {};
for (const key in state) {
const value = state[key];
if (customMapping?.hasOwnProperty(key)) {
const customProps = customMapping[key](value);
if (customProps != null) {
Object.assign(props, customProps);
}
continue;
}
if (value === true) {
props[`data-${key.toLowerCase()}`] = "";
} else if (value) {
props[`data-${key.toLowerCase()}`] = value.toString();
}
}
return props;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveClassName.mjs
function resolveClassName(className, state) {
return typeof className === "function" ? className(state) : className;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveStyle.mjs
function resolveStyle(style, state) {
return typeof style === "function" ? style(state) : style;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/merge-props/mergeProps.mjs
var EMPTY_PROPS = {};
function mergeProps(a, b, c, d, e) {
if (!c && !d && !e && !a) {
return createInitialMergedProps(b);
}
let merged = createInitialMergedProps(a);
if (b) {
merged = mergeInto(merged, b);
}
if (c) {
merged = mergeInto(merged, c);
}
if (d) {
merged = mergeInto(merged, d);
}
if (e) {
merged = mergeInto(merged, e);
}
return merged;
}
function mergePropsN(props) {
if (props.length === 0) {
return EMPTY_PROPS;
}
if (props.length === 1) {
return createInitialMergedProps(props[0]);
}
let merged = createInitialMergedProps(props[0]);
for (let i = 1; i < props.length; i += 1) {
merged = mergeInto(merged, props[i]);
}
return merged;
}
function createInitialMergedProps(inputProps) {
if (isPropsGetter(inputProps)) {
return {
...inputProps(EMPTY_PROPS)
};
}
return copyInitialProps(inputProps);
}
function mergeInto(merged, inputProps) {
if (isPropsGetter(inputProps)) {
return inputProps(merged);
}
return mutablyMergeInto(merged, inputProps);
}
function copyInitialProps(inputProps) {
const copiedProps = {
...inputProps
};
for (const propName in copiedProps) {
const propValue = copiedProps[propName];
if (isEventHandler(propName, propValue)) {
copiedProps[propName] = wrapEventHandler(propValue);
}
}
return copiedProps;
}
function mutablyMergeInto(mergedProps, externalProps) {
if (!externalProps) {
return mergedProps;
}
for (const propName in externalProps) {
const externalPropValue = externalProps[propName];
switch (propName) {
case "style": {
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
break;
}
case "className": {
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
break;
}
default: {
if (isEventHandler(propName, externalPropValue)) {
mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
} else {
mergedProps[propName] = externalPropValue;
}
}
}
}
return mergedProps;
}
function isEventHandler(key, value) {
const code0 = key.charCodeAt(0);
const code1 = key.charCodeAt(1);
const code2 = key.charCodeAt(2);
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
}
function isPropsGetter(inputProps) {
return typeof inputProps === "function";
}
function mergeEventHandlers(ourHandler, theirHandler) {
if (!theirHandler) {
return ourHandler;
}
if (!ourHandler) {
return wrapEventHandler(theirHandler);
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
const baseUIEvent = event;
makeEventPreventable(baseUIEvent);
const result2 = theirHandler(...args);
if (!baseUIEvent.baseUIHandlerPrevented) {
ourHandler?.(...args);
}
return result2;
}
const result = theirHandler(...args);
ourHandler?.(...args);
return result;
};
}
function wrapEventHandler(handler) {
if (!handler) {
return handler;
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
makeEventPreventable(event);
}
return handler(...args);
};
}
function makeEventPreventable(event) {
event.preventBaseUIHandler = () => {
event.baseUIHandlerPrevented = true;
};
return event;
}
function mergeClassNames(ourClassName, theirClassName) {
if (theirClassName) {
if (ourClassName) {
return theirClassName + " " + ourClassName;
}
return theirClassName;
}
return ourClassName;
}
function isSyntheticEvent(event) {
return event != null && typeof event === "object" && "nativeEvent" in event;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useRenderElement.mjs
var import_react = __toESM(require_react(), 1);
function useRenderElement(element, componentProps, params = {}) {
let renderProp = componentProps.render;
if (params.enabled !== false) {
renderProp = unwrapLazyRenderProp(renderProp);
}
const outProps = useRenderElementProps(componentProps, params, renderProp);
if (params.enabled === false) {
return null;
}
const state = params.state ?? EMPTY_OBJECT;
return evaluateRenderProp(element, renderProp, outProps, state);
}
function useRenderElementProps(componentProps, params, renderProp) {
const {
className: classNameProp,
style: styleProp
} = componentProps;
const {
state = EMPTY_OBJECT,
ref,
props,
stateAttributesMapping: stateAttributesMapping5,
enabled = true
} = params;
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
const style = enabled ? resolveStyle(styleProp, state) : void 0;
const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping5) : EMPTY_OBJECT;
const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
if (typeof document !== "undefined") {
if (!enabled) {
void useMergedRefs(null, null);
} else if (Array.isArray(ref)) {
outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
} else {
outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
}
}
if (!enabled) {
return EMPTY_OBJECT;
}
if (className !== void 0) {
outProps.className = mergeClassNames(outProps.className, className);
}
if (style !== void 0) {
outProps.style = mergeObjects(outProps.style, style);
}
return outProps;
}
function resolveRenderFunctionProps(props) {
if (Array.isArray(props)) {
return mergePropsN(props);
}
return mergeProps(void 0, props);
}
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
function unwrapLazyRenderProp(render) {
if (render?.$$typeof !== REACT_LAZY_TYPE) {
return render;
}
const unwrapped = React4.Children.toArray(render)[0];
return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render;
}
function evaluateRenderProp(element, render, props, state) {
if (render) {
if (typeof render === "function") {
if (true) {
warnIfRenderPropLooksLikeComponent(render);
}
return render(props, state);
}
const mergedProps = mergeProps(props, render.props);
mergedProps.ref = props.ref;
if (true) {
if (!/* @__PURE__ */ React4.isValidElement(render)) {
throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
}
}
return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
}
return renderTag(element, props);
}
function warnIfRenderPropLooksLikeComponent(renderFn) {
const functionName = renderFn.name;
if (functionName.length === 0) {
return;
}
if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
return;
}
if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
return;
}
warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
}
function renderTag(Tag, props) {
if (Tag === "button") {
return /* @__PURE__ */ (0, import_react.createElement)("button", {
type: "button",
...props,
key: props.key
});
}
if (Tag === "img") {
return /* @__PURE__ */ (0, import_react.createElement)("img", {
alt: "",
...props,
key: props.key
});
}
return /* @__PURE__ */ React4.createElement(Tag, props);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/safeReact.mjs
var React5 = __toESM(require_react(), 1);
var SafeReact = {
...React5
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useStableCallback.mjs
var useInsertionEffect = SafeReact.useInsertionEffect;
var useSafeInsertionEffect = (
// React 17 doesn't have useInsertionEffect.
useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
);
function useStableCallback(callback) {
const stable = useRefWithInit(createStableCallback).current;
stable.next = callback;
useSafeInsertionEffect(stable.effect);
return stable.trampoline;
}
function createStableCallback() {
const stable = {
next: void 0,
callback: assertNotCalled,
trampoline: (...args) => stable.callback?.(...args),
effect: () => {
stable.callback = stable.next;
}
};
return stable;
}
function assertNotCalled() {
if (true) {
throw (
/* minify-error-disabled */
new Error("Base UI: Cannot call an event handler while rendering.")
);
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
var React6 = __toESM(require_react(), 1);
var noop = () => {
};
var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
var React8 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
var ReactDOM = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useOnMount.mjs
var React7 = __toESM(require_react(), 1);
function useOnMount(fn) {
React7.useEffect(fn, EMPTY_ARRAY);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useAnimationFrame.mjs
var EMPTY = null;
var LAST_RAF = globalThis.requestAnimationFrame;
var Scheduler = class {
/* This implementation uses an array as a backing data-structure for frame callbacks.
* It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
* never calls the native `cancelAnimationFrame` if there are no frames left. This can
* be much more efficient if there is a call pattern that alterns as
* "request-cancel-request-cancel-…".
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
callbacks = [];
callbacksCount = 0;
nextId = 1;
startId = 1;
isScheduled = false;
tick = (timestamp) => {
this.isScheduled = false;
const currentCallbacks = this.callbacks;
const currentCallbacksCount = this.callbacksCount;
this.callbacks = [];
this.callbacksCount = 0;
this.startId = this.nextId;
if (currentCallbacksCount > 0) {
for (let i = 0; i < currentCallbacks.length; i += 1) {
currentCallbacks[i]?.(timestamp);
}
}
};
request(fn) {
const id = this.nextId;
this.nextId += 1;
this.callbacks.push(fn);
this.callbacksCount += 1;
const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
if (!this.isScheduled || didRAFChange) {
requestAnimationFrame(this.tick);
this.isScheduled = true;
}
return id;
}
cancel(id) {
const index2 = id - this.startId;
if (index2 < 0 || index2 >= this.callbacks.length) {
return;
}
if (this.callbacks[index2] === null) {
return;
}
this.callbacks[index2] = null;
this.callbacksCount -= 1;
}
};
var scheduler = new Scheduler();
var AnimationFrame = class _AnimationFrame {
static create() {
return new _AnimationFrame();
}
static request(fn) {
return scheduler.request(fn);
}
static cancel(id) {
return scheduler.cancel(id);
}
currentId = EMPTY;
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
request(fn) {
this.cancel();
this.currentId = scheduler.request(() => {
this.currentId = EMPTY;
fn();
});
}
cancel = () => {
if (this.currentId !== EMPTY) {
scheduler.cancel(this.currentId);
this.currentId = EMPTY;
}
};
disposeEffect = () => {
return this.cancel;
};
};
function useAnimationFrame() {
const timeout = useRefWithInit(AnimationFrame.create).current;
useOnMount(timeout.disposeEffect);
return timeout;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveRef.mjs
function resolveRef(maybeRef) {
if (maybeRef == null) {
return maybeRef;
}
return "current" in maybeRef ? maybeRef.current : maybeRef;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs
function getFiniteAnimations(element, options) {
return element.getAnimations(options).filter((animation) => {
const timing = animation.effect?.getTiming();
return timing?.duration !== Infinity && timing?.iterations !== Infinity;
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
var startingStyle = "data-starting-style";
var endingStyle = "data-ending-style";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
var pendingCallbacks = null;
function flushBeforePaint(fn) {
if (!pendingCallbacks) {
const callbacks = [];
pendingCallbacks = callbacks;
queueMicrotask(() => {
pendingCallbacks = null;
ReactDOM.flushSync(() => {
for (const callback of callbacks) {
callback();
}
});
});
}
pendingCallbacks.push(fn);
}
function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
const frame = useAnimationFrame();
return useStableCallback((fnToExecute, signal = null) => {
frame.cancel();
const element = resolveRef(elementOrRef);
if (element == null) {
return;
}
const resolvedElement = element;
const done = () => {
if (!batch) {
ReactDOM.flushSync(fnToExecute);
return;
}
flushBeforePaint(() => {
if (!signal?.aborted) {
fnToExecute();
}
});
};
if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
fnToExecute();
return;
}
function exec() {
Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => {
if (!signal?.aborted) {
done();
}
}, () => {
if (signal?.aborted) {
return;
}
const currentAnimations = getFiniteAnimations(resolvedElement);
if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
exec();
return;
}
done();
});
}
if (waitForStartingStyleRemoved) {
const startingStyleAttribute = startingStyle;
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
frame.request(exec);
return;
}
const attributeObserver = new MutationObserver(() => {
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
attributeObserver.disconnect();
exec();
}
});
attributeObserver.observe(resolvedElement, {
attributes: true,
attributeFilter: [startingStyleAttribute]
});
signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
once: true
});
return;
}
frame.request(exec);
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
function useOpenChangeComplete(parameters) {
const {
enabled = true,
open: open2,
ref,
batch = false,
onComplete: onCompleteParam
} = parameters;
const onComplete = useStableCallback(onCompleteParam);
const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch);
React8.useEffect(() => {
if (!enabled) {
return void 0;
}
const abortController = new AbortController();
runOnceAnimationsFinish(onComplete, abortController.signal);
return () => {
abortController.abort();
};
}, [enabled, open2, onComplete, runOnceAnimationsFinish]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
var STARTING_HOOK = {
[startingStyle]: ""
};
var ENDING_HOOK = {
[endingStyle]: ""
};
var transitionStatusMapping = {
transitionStatus(value) {
if (value === "starting") {
return STARTING_HOOK;
}
if (value === "ending") {
return ENDING_HOOK;
}
return null;
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useTransitionStatus.mjs
var React9 = __toESM(require_react(), 1);
function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0);
const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen);
if (open2 && !mounted) {
setMounted(true);
setTransitionStatus("starting");
}
if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) {
setTransitionStatus("ending");
}
if (!open2 && !mounted && transitionStatus === "ending") {
setTransitionStatus(void 0);
}
useIsoLayoutEffect(() => {
if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) {
const frame = AnimationFrame.request(() => {
setTransitionStatus("ending");
});
return () => {
AnimationFrame.cancel(frame);
};
}
return void 0;
}, [open2, mounted, transitionStatus, deferEndingState]);
useIsoLayoutEffect(() => {
if (!open2 || enableIdleState || transitionStatus === void 0) {
return void 0;
}
const frame = AnimationFrame.request(() => {
setTransitionStatus(void 0);
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2, transitionStatus]);
useIsoLayoutEffect(() => {
if (!open2 || !enableIdleState) {
return void 0;
}
if (open2 && mounted && transitionStatus !== "idle") {
setTransitionStatus("starting");
}
const frame = AnimationFrame.request(() => {
setTransitionStatus("idle");
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2, mounted, transitionStatus]);
return {
mounted,
setMounted,
transitionStatus
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useTimeout.mjs
var EMPTY2 = 0;
var Timeout = class _Timeout {
static create() {
return new _Timeout();
}
currentId = EMPTY2;
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
start(delay, fn) {
this.clear();
this.currentId = setTimeout(() => {
this.currentId = EMPTY2;
fn();
}, delay);
}
isStarted() {
return this.currentId !== EMPTY2;
}
clear = () => {
if (this.currentId !== EMPTY2) {
clearTimeout(this.currentId);
this.currentId = EMPTY2;
}
};
disposeEffect = () => {
return this.clear;
};
};
function useTimeout() {
const timeout = useRefWithInit(Timeout.create).current;
useOnMount(timeout.disposeEffect);
return timeout;
}
// node_modules/.store/[email protected]/node_modules/clsx/dist/clsx.mjs
function r(e) {
var t, f, n = "";
if ("string" == typeof e || "number" == typeof e) n += e;
else if ("object" == typeof e) if (Array.isArray(e)) {
var o = e.length;
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
} else for (f in e) e[f] && (n && (n += " "), n += f);
return n;
}
function clsx() {
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
return n;
}
var clsx_default = clsx;
// packages/ui/build-module/icon/icon.mjs
var import_element = __toESM(require_element(), 1);
var import_primitives = __toESM(require_primitives(), 1);
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
var Icon = (0, import_element.forwardRef)(
function UnforwardedIcon({ icon, size: size4 = 24, style, ...restProps }, ref) {
const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_primitives.SVG,
{
ref,
...icon.props,
...restProps,
...mergedStyle ? { style: mergedStyle } : {},
width: size4,
height: size4
}
);
}
);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useControlled.mjs
var React10 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/error.mjs
var error = createLogOnce("error", "Base UI");
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useControlled.mjs
function useControlled({
controlled,
default: defaultProp,
name,
state = "value"
}) {
const {
current: isControlled
} = React10.useRef(controlled !== void 0);
const [valueState, setValue] = React10.useState(() => defaultProp);
const value = isControlled && controlled !== void 0 ? controlled : valueState;
if (true) {
React10.useEffect(() => {
if (isControlled !== (controlled !== void 0)) {
error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
}
}, [state, name, controlled]);
const {
current: defaultValue
} = React10.useRef(defaultProp);
React10.useEffect(() => {
if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {
error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
}
}, [defaultProp]);
}
const setValueIfUncontrolled = React10.useCallback((newValue) => {
if (!isControlled) {
setValue(newValue);
}
}, []);
return [value, setValueIfUncontrolled];
}
function serializeToDevModeString(input) {
let nextId = 0;
const seen = /* @__PURE__ */ new WeakMap();
try {
const result = JSON.stringify(input, function replacer(key, value) {
if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) {
return void 0;
}
if (typeof value === "bigint") {
return `__bigint__:${value}`;
}
if (value !== null && typeof value === "object") {
const id = seen.get(value);
if (id !== void 0) {
return `__object__:${id}`;
}
seen.set(value, nextId);
nextId += 1;
}
return value;
});
return result ?? `__top__:${typeof input}`;
} catch {
return "__unserializable__";
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
var React12 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
var React11 = __toESM(require_react(), 1);
var CompositeListContext = /* @__PURE__ */ React11.createContext({
register: () => {
},
unregister: () => {
},
subscribeMapChange: () => () => {
},
nextIndexRef: {
current: 0
}
});
if (true) CompositeListContext.displayName = "CompositeListContext";
function useCompositeListContext() {
return React11.useContext(CompositeListContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
function CompositeList(props) {
const {
children,
elementsRef,
labelsRef,
onMapChange: onMapChangeProp
} = props;
const onMapChange = useStableCallback(onMapChangeProp);
const [, setMapTick] = React12.useState(0);
const listeners = useRefWithInit(createListeners).current;
const map = useRefWithInit(createMap).current;
const nextIndexRef = React12.useRef(0);
const isDirtyRef = React12.useRef(true);
const itemsRef = React12.useRef(null);
const mutationObserverRef = React12.useRef(null);
const scheduleMapUpdate = useStableCallback(() => {
if (isDirtyRef.current) {
return;
}
isDirtyRef.current = true;
setMapTick((tick) => tick + 1);
});
const register2 = useStableCallback((node, registration) => {
map.set(node, registration);
scheduleMapUpdate();
});
const unregister = useStableCallback((node) => {
map.delete(node);
scheduleMapUpdate();
});
const syncRefs = useStableCallback((items) => {
const nextMap = /* @__PURE__ */ new Map();
elementsRef.current.length = 0;
if (labelsRef) {
labelsRef.current.length = 0;
}
items.forEach((item) => {
nextMap.set(item.element, {
...item.registration.metadata ?? {},
index: item.index
});
elementsRef.current[item.index] = item.element;
if (labelsRef) {
labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
}
});
nextIndexRef.current = elementsRef.current.length;
return nextMap;
});
function observe(sortedNodes) {
mutationObserverRef.current?.disconnect();
mutationObserverRef.current = null;
if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
return;
}
const mutationObserver = new MutationObserver((entries) => {
if (!hasMovedNode(entries)) {
return;
}
let previousConnectedNode = null;
for (const node of sortedNodes) {
if (!node.isConnected) {
continue;
}
if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
mutationObserver.disconnect();
scheduleMapUpdate();
return;
}
previousConnectedNode = node;
}
});
mutationObserverRef.current = mutationObserver;
const roots = /* @__PURE__ */ new Set();
for (let i = 1; i < sortedNodes.length; i += 1) {
const root2 = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
if (root2) {
roots.add(root2);
}
}
roots.forEach((root2) => mutationObserver.observe(root2, {
childList: true
}));
}
const flush = useStableCallback(() => {
const [items, automaticNodes] = getCompositeListSnapshot(map);
const nextMap = syncRefs(items);
const previousItems = itemsRef.current;
const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
const previousItem = previousItems[index2];
return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
});
observe(automaticNodes);
itemsRef.current = items;
isDirtyRef.current = false;
if (!changed) {
return;
}
listeners.forEach((listener) => listener(nextMap));
onMapChange(nextMap);
});
useIsoLayoutEffect(() => {
if (!isDirtyRef.current && itemsRef.current) {
syncRefs(itemsRef.current);
}
return () => {
elementsRef.current = [];
if (labelsRef) {
labelsRef.current = [];
}
};
}, [elementsRef, labelsRef, syncRefs]);
useIsoLayoutEffect(() => {
if (isDirtyRef.current) {
flush();
}
});
useIsoLayoutEffect(() => {
return () => {
mutationObserverRef.current?.disconnect();
isDirtyRef.current = true;
};
}, []);
const subscribeMapChange = useStableCallback((fn) => {
listeners.add(fn);
return () => {
listeners.delete(fn);
};
});
const contextValue = React12.useMemo(() => ({
register: register2,
unregister,
subscribeMapChange,
nextIndexRef
}), [register2, unregister, subscribeMapChange, nextIndexRef]);
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CompositeListContext.Provider, {
value: contextValue,
children
});
}
function createMap() {
return /* @__PURE__ */ new Map();
}
function createListeners() {
return /* @__PURE__ */ new Set();
}
function getCompositeListSnapshot(map) {
const reservedIndices = /* @__PURE__ */ new Set();
const items = [];
const automaticItems = [];
map.forEach((registration, node) => {
if (!node.isConnected) {
return;
}
const index2 = registration.index;
const item = {
index: index2 ?? -1,
element: node,
registration
};
if (index2 === null) {
automaticItems.push(item);
} else if (index2 >= 0) {
reservedIndices.add(index2);
items.push(item);
}
});
let nextAutomaticIndex = 0;
automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
automaticItems.forEach((item) => {
while (reservedIndices.has(nextAutomaticIndex)) {
nextAutomaticIndex += 1;
}
item.index = nextAutomaticIndex;
items.push(item);
nextAutomaticIndex += 1;
});
if (reservedIndices.size > 0) {
items.sort((a, b) => a.index - b.index);
}
return [items, automaticItems.map((item) => item.element)];
}
function getCommonAncestor(firstNode, lastNode) {
let ancestor = firstNode.parentElement;
while (ancestor && !ancestor.contains(lastNode)) {
ancestor = ancestor.parentElement;
}
return ancestor;
}
function hasMovedNode(entries) {
for (const entry of entries) {
for (let i = 0; i < entry.removedNodes.length; i += 1) {
if (entry.removedNodes[i].isConnected) {
return true;
}
}
}
return false;
}
function sortByDocumentPosition(a, b) {
if (a.nextElementSibling === b) {
return -1;
}
if (b.nextElementSibling === a) {
return 1;
}
return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useId.mjs
var React14 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useForcedRerendering.mjs
var React13 = __toESM(require_react(), 1);
function useForcedRerendering() {
const [, setState] = React13.useState({});
return React13.useCallback(() => {
setState({});
}, []);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useId.mjs
var globalId = 0;
function useGlobalId(idOverride, prefix = "mui") {
const defaultId = React14.useRef(void 0);
const forceRerender = useForcedRerendering();
const id = idOverride ?? defaultId.current;
React14.useEffect(() => {
if (defaultId.current == null) {
globalId += 1;
defaultId.current = `${prefix}-${globalId}`;
if (idOverride == null) {
forceRerender();
}
}
}, [idOverride, prefix, forceRerender]);
return id;
}
var maybeReactUseId = SafeReact.useId;
function useId(idOverride, prefix) {
if (maybeReactUseId !== void 0) {
const reactId = maybeReactUseId();
return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
}
return useGlobalId(idOverride, prefix);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useBaseUiId.mjs
function useBaseUiId(idOverride) {
return useId(idOverride, "base-ui");
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
function createChangeEventDetails(reason, event, trigger, customProperties) {
let canceled = false;
let allowPropagation = false;
const custom = customProperties ?? EMPTY_OBJECT;
const details = {
reason,
event: event ?? new Event("base-ui"),
cancel() {
canceled = true;
},
allowPropagation() {
allowPropagation = true;
},
get isCanceled() {
return canceled;
},
get isPropagationAllowed() {
return allowPropagation;
},
trigger,
...custom
};
return details;
}
function createGenericEventDetails(reason, event, customProperties) {
const custom = customProperties ?? EMPTY_OBJECT;
const details = {
reason,
event: event ?? new Event("base-ui"),
...custom
};
return details;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/reason-parts.mjs
var reason_parts_exports = {};
__export(reason_parts_exports, {
cancelOpen: () => cancelOpen,
chipRemovePress: () => chipRemovePress,
clearPress: () => clearPress,
closePress: () => closePress,
closeWatcher: () => closeWatcher,
decrementPress: () => decrementPress,
disabled: () => disabled,
drag: () => drag,
escapeKey: () => escapeKey,
focusOut: () => focusOut,
imperativeAction: () => imperativeAction,
incrementPress: () => incrementPress,
initial: () => initial,
inputBlur: () => inputBlur,
inputChange: () => inputChange,
inputClear: () => inputClear,
inputPaste: () => inputPaste,
inputPress: () => inputPress,
itemPress: () => itemPress,
keyboard: () => keyboard,
linkPress: () => linkPress,
listNavigation: () => listNavigation,
missing: () => missing,
none: () => none,
outsidePress: () => outsidePress,
pointer: () => pointer,
popupClose: () => popupClose,
scrub: () => scrub,
siblingOpen: () => siblingOpen,
swipe: () => swipe,
trackPress: () => trackPress,
triggerFocus: () => triggerFocus,
triggerHover: () => triggerHover,
triggerPress: () => triggerPress,
wheel: () => wheel,
windowResize: () => windowResize
});
var none = "none";
var triggerPress = "trigger-press";
var triggerHover = "trigger-hover";
var triggerFocus = "trigger-focus";
var outsidePress = "outside-press";
var itemPress = "item-press";
var closePress = "close-press";
var linkPress = "link-press";
var clearPress = "clear-press";
var chipRemovePress = "chip-remove-press";
var trackPress = "track-press";
var incrementPress = "increment-press";
var decrementPress = "decrement-press";
var inputChange = "input-change";
var inputClear = "input-clear";
var inputBlur = "input-blur";
var inputPaste = "input-paste";
var inputPress = "input-press";
var focusOut = "focus-out";
var escapeKey = "escape-key";
var closeWatcher = "close-watcher";
var listNavigation = "list-navigation";
var keyboard = "keyboard";
var pointer = "pointer";
var drag = "drag";
var wheel = "wheel";
var scrub = "scrub";
var popupClose = "popup-close";
var cancelOpen = "cancel-open";
var siblingOpen = "sibling-open";
var disabled = "disabled";
var missing = "missing";
var initial = "initial";
var imperativeAction = "imperative-action";
var swipe = "swipe";
var windowResize = "window-resize";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
var React15 = __toESM(require_react(), 1);
function useCompositeListItem(params = {}) {
const {
guess,
label,
metadata,
textRef,
index: externalIndex
} = params;
const {
register: register2,
unregister,
subscribeMapChange,
nextIndexRef
} = useCompositeListContext();
const indexRef = React15.useRef(-1);
const [internalIndex, setInternalIndex] = React15.useState(externalIndex == null && guess ? () => {
if (indexRef.current === -1) {
const newIndex = nextIndexRef.current;
nextIndexRef.current += 1;
indexRef.current = newIndex;
}
return indexRef.current;
} : -1);
const index2 = externalIndex ?? internalIndex;
const componentRef = React15.useRef(null);
const ref = React15.useCallback((node) => {
const previousNode = componentRef.current;
if (previousNode) {
unregister(previousNode);
}
componentRef.current = node;
if (node) {
register2(node, {
metadata: metadata ?? null,
index: externalIndex ?? null,
label,
textRef
});
}
}, [externalIndex, register2, unregister, metadata, label, textRef]);
useIsoLayoutEffect(() => {
if (externalIndex != null) {
return void 0;
}
return subscribeMapChange((map) => {
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
if (i != null) {
setInternalIndex(i);
}
});
}, [externalIndex, subscribeMapChange]);
return {
ref,
index: index2
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/use-button/useButton.mjs
var React18 = __toESM(require_react(), 1);
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
return typeof window !== "undefined";
}
function getNodeName(node) {
if (isNode(node)) {
return (node.nodeName || "").toLowerCase();
}
return "#document";
}
function getWindow(node) {
var _node$ownerDocument;
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
var _ref;
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Node || value instanceof getWindow(value).Node;
}
function isElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Element || value instanceof getWindow(value).Element;
}
function isHTMLElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
if (!hasWindow() || typeof ShadowRoot === "undefined") {
return false;
}
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = getComputedStyle2(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
}
function isTableElement(element) {
return /^(table|td|th)$/.test(getNodeName(element));
}
function isTopLayer(element) {
try {
if (element.matches(":popover-open")) {
return true;
}
} catch (_e) {
}
try {
return element.matches(":modal");
} catch (_e) {
return false;
}
}
var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
var containRe = /paint|layout|strict|content/;
var isNotNone = (value) => !!value && value !== "none";
var isWebKitValue;
function isContainingBlock(elementOrCss) {
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else if (isTopLayer(currentNode)) {
return null;
}
currentNode = getParentNode(currentNode);
}
return null;
}
function isWebKit() {
if (isWebKitValue == null) {
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
}
return isWebKitValue;
}
function isLastTraversableNode(node) {
return /^(html|body|#document)$/.test(getNodeName(node));
}
function getComputedStyle2(element) {
return getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
if (isElement(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.scrollX,
scrollTop: element.scrollY
};
}
function getParentNode(node) {
if (getNodeName(node) === "html") {
return node;
}
const result = (
// Step into the shadow DOM of the parent of a slotted node.
node.assignedSlot || // DOM Element detected.
node.parentNode || // ShadowRoot detected.
isShadowRoot(node) && node.host || // Fallback.
getDocumentElement(node)
);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return (node.ownerDocument || node).body;
}
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = getWindow(scrollableAncestor);
if (isBody) {
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
} else {
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
}
function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
var React16 = __toESM(require_react(), 1);
var CompositeRootContext = /* @__PURE__ */ React16.createContext(void 0);
if (true) CompositeRootContext.displayName = "CompositeRootContext";
function useCompositeRootContext(optional = false) {
const context = React16.useContext(CompositeRootContext);
if (context === void 0 && !optional) {
throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
var React17 = __toESM(require_react(), 1);
function useFocusableWhenDisabled(parameters) {
const {
focusableWhenDisabled,
disabled: disabled2,
composite = false,
tabIndex: tabIndexProp = 0,
isNativeButton
} = parameters;
const isFocusableComposite = composite && focusableWhenDisabled !== false;
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
const props = React17.useMemo(() => {
const additionalProps = {
// allow Tabbing away from focusableWhenDisabled elements
onKeyDown(event) {
if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
event.preventDefault();
}
}
};
if (!composite) {
additionalProps.tabIndex = tabIndexProp;
if (!isNativeButton && disabled2) {
additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
}
}
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
additionalProps["aria-disabled"] = disabled2;
}
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
additionalProps.disabled = disabled2;
}
return additionalProps;
}, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
return {
props
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/owner.mjs
function ownerDocument(node) {
return node?.ownerDocument || document;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
function dispatchClickWithModifiers(target, sourceEvent, {
detail = 0,
pointerType = ""
} = {}) {
target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
bubbles: true,
cancelable: true,
composed: true,
detail,
pointerType,
shiftKey: sourceEvent.shiftKey,
ctrlKey: sourceEvent.ctrlKey,
altKey: sourceEvent.altKey,
metaKey: sourceEvent.metaKey
}));
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/use-button/useButton.mjs
function useButton(parameters = {}) {
const {
disabled: disabled2 = false,
focusableWhenDisabled,
tabIndex = 0,
native: isNativeButton = true,
composite: compositeProp
} = parameters;
const elementRef = React18.useRef(null);
const compositeRootContext = useCompositeRootContext(true);
const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
const {
props: focusableWhenDisabledProps
} = useFocusableWhenDisabled({
focusableWhenDisabled,
disabled: disabled2,
composite: isCompositeItem,
tabIndex,
isNativeButton
});
if (true) {
React18.useEffect(() => {
if (!elementRef.current) {
return;
}
const isButtonTag = isButtonElement(elementRef.current);
if (isNativeButton) {
if (!isButtonTag) {
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`.";
error(`${message}${ownerStackMessage}`);
}
} else if (isButtonTag) {
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`.";
error(`${message}${ownerStackMessage}`);
}
}, [isNativeButton]);
}
const updateDisabled = React18.useCallback(() => {
const element = elementRef.current;
if (!isButtonElement(element)) {
return;
}
if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
element.disabled = false;
}
}, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
useIsoLayoutEffect(updateDisabled, [updateDisabled]);
const getButtonProps = React18.useCallback((externalProps = {}) => {
const {
onClick: externalOnClick,
onMouseDown: externalOnMouseDown,
onKeyUp: externalOnKeyUp,
onKeyDown: externalOnKeyDown,
onPointerDown: externalOnPointerDown,
...otherExternalProps
} = externalProps;
return mergeProps({
onClick(event) {
if (disabled2) {
event.preventDefault();
return;
}
externalOnClick?.(event);
},
onMouseDown(event) {
if (!disabled2) {
externalOnMouseDown?.(event);
}
},
onKeyDown(event) {
if (disabled2) {
return;
}
makeEventPreventable(event);
externalOnKeyDown?.(event);
if (event.baseUIHandlerPrevented) {
return;
}
const isCurrentTarget = event.target === event.currentTarget;
const currentTarget = event.currentTarget;
const isButton = isButtonElement(currentTarget);
const isLink = !isNativeButton && isValidLinkElement(currentTarget);
const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
const isEnterKey = event.key === "Enter";
const isSpaceKey = event.key === " ";
const role = currentTarget.getAttribute("role");
const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
if (event.defaultPrevented && isTextNavigationRole) {
return;
}
event.preventDefault();
if (!isNativeButton || isButton) {
event.preventBaseUIHandler();
dispatchClickWithModifiers(currentTarget, event);
}
return;
}
if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
if (isCurrentTarget && isLink && isSpaceKey) {
event.preventDefault();
}
return;
}
if (event.defaultPrevented) {
return;
}
event.preventDefault();
if (isEnterKey) {
event.preventBaseUIHandler();
dispatchClickWithModifiers(currentTarget, event);
}
},
onKeyUp(event) {
if (disabled2) {
return;
}
makeEventPreventable(event);
externalOnKeyUp?.(event);
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
event.preventDefault();
return;
}
if (event.baseUIHandlerPrevented) {
return;
}
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
event.preventBaseUIHandler();
dispatchClickWithModifiers(event.currentTarget, event);
}
},
onPointerDown(event) {
if (disabled2) {
event.preventDefault();
return;
}
externalOnPointerDown?.(event);
}
}, isNativeButton ? {
type: "button"
} : {
role: "button"
}, focusableWhenDisabledProps, otherExternalProps);
}, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
const buttonRef = useStableCallback((element) => {
elementRef.current = element;
updateDisabled();
});
return {
getButtonProps,
buttonRef
};
}
function isButtonElement(elem) {
return isHTMLElement(elem) && elem.tagName === "BUTTON";
}
function isValidLinkElement(elem) {
return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/addEventListener.mjs
function addEventListener(target, type, listener, options) {
target.addEventListener(type, listener, options);
return () => {
target.removeEventListener(type, listener, options);
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useValueAsRef.mjs
function useValueAsRef(value) {
const latest = useRefWithInit(createLatestRef, value).current;
latest.next = value;
useIsoLayoutEffect(latest.effect);
return latest;
}
function createLatestRef(value) {
const latest = {
current: value,
next: value,
effect: () => {
latest.current = latest.next;
}
};
return latest;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/parts.mjs
var parts_exports = {};
__export(parts_exports, {
engine: () => engine_exports,
env: () => env_exports,
mediaQuery: () => media_query_exports,
os: () => os_exports,
screenReader: () => screen_reader_exports
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/os.mjs
var os_exports = {};
__export(os_exports, {
android: () => android,
apple: () => apple,
ios: () => ios,
linux: () => linux,
mac: () => mac,
windows: () => windows
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/shared.mjs
function readRawData() {
if (typeof navigator === "undefined") {
return {
userAgent: "",
platform: "",
maxTouchPoints: 0
};
}
if (true) {
const uaData = navigator.userAgentData;
if (uaData && Array.isArray(uaData.brands)) {
return {
userAgent: uaData.brands.map(({
brand,
version: version2
}) => `${brand}/${version2}`).join(" "),
platform: uaData.platform ?? navigator.platform ?? "",
maxTouchPoints: navigator.maxTouchPoints ?? 0
};
}
}
return {
userAgent: navigator.userAgent,
platform: navigator.platform ?? "",
maxTouchPoints: navigator.maxTouchPoints ?? 0
};
}
var {
userAgent,
platform,
maxTouchPoints
} = readRawData();
var lowerUserAgent = userAgent.toLowerCase();
var lowerPlatform = platform.toLowerCase();
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/os.mjs
var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1;
var ANDROID_STRING = "android";
var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);
var mac = !ios && lowerPlatform.startsWith("mac");
var windows = lowerPlatform.startsWith("win");
var linux = !android && /^(linux|chrome os)/.test(lowerPlatform);
var apple = mac || ios;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/engine.mjs
var engine_exports = {};
__export(engine_exports, {
blink: () => blink,
gecko: () => gecko,
webkit: () => webkit
});
var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none");
var gecko = !webkit && lowerUserAgent.includes("firefox");
var blink = !webkit && lowerUserAgent.includes("chrom");
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/screen-reader.mjs
var screen_reader_exports = {};
__export(screen_reader_exports, {
voiceOver: () => voiceOver
});
var voiceOver = apple;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/env.mjs
var env_exports = {};
__export(env_exports, {
jsdom: () => jsdom
});
var jsdom = /jsdom|happydom/.test(lowerUserAgent);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/media-query.mjs
var media_query_exports = {};
__export(media_query_exports, {
iOS: () => iOS
});
var iOS = "@supports (-webkit-touch-callout: none)";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useScrollLock.mjs
var originalHtmlStyles = {};
var originalBodyStyles = {};
var originalHtmlScrollBehavior = "";
function getViewportScroller(html, body) {
return isOverflowElement(html) ? html : body;
}
function isPageScrollLocked(win, html, body) {
return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);
}
function hasInsetScrollbars(referenceElement) {
if (typeof document === "undefined") {
return false;
}
const doc = ownerDocument(referenceElement);
const win = getWindow(doc);
return win.innerWidth - doc.documentElement.clientWidth > 0;
}
function supportsStableScrollbarGutter(referenceElement) {
const supported = typeof CSS !== "undefined" && CSS.supports && CSS.supports("scrollbar-gutter", "stable");
if (!supported || typeof document === "undefined") {
return false;
}
const doc = ownerDocument(referenceElement);
const html = doc.documentElement;
const body = doc.body;
const scrollContainer = getViewportScroller(html, body);
const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
const originalHtmlStyleGutter = html.style.scrollbarGutter;
html.style.scrollbarGutter = "stable";
scrollContainer.style.overflowY = "scroll";
const before = scrollContainer.offsetWidth;
scrollContainer.style.overflowY = "hidden";
const after = scrollContainer.offsetWidth;
scrollContainer.style.overflowY = originalScrollContainerOverflowY;
html.style.scrollbarGutter = originalHtmlStyleGutter;
return before === after;
}
function preventScrollOverlayScrollbars(referenceElement) {
const doc = ownerDocument(referenceElement);
const html = doc.documentElement;
const body = doc.body;
const elementToLock = getViewportScroller(html, body);
const originalElementToLockStyles = {
overflowY: elementToLock.style.overflowY,
overflowX: elementToLock.style.overflowX
};
Object.assign(elementToLock.style, {
overflowY: "hidden",
overflowX: "hidden"
});
return () => {
Object.assign(elementToLock.style, originalElementToLockStyles);
};
}
function preventScrollInsetScrollbars(referenceElement) {
const doc = ownerDocument(referenceElement);
const html = doc.documentElement;
const body = doc.body;
const win = getWindow(html);
let scrollTop = 0;
let scrollLeft = 0;
let updateGutterOnly = false;
const resizeFrame = AnimationFrame.create();
if (parts_exports.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {
return () => {
};
}
function lockScroll() {
const htmlStyles = win.getComputedStyle(html);
const bodyStyles = win.getComputedStyle(body);
const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || "";
const hasBothEdges = htmlScrollbarGutterValue.includes("both-edges");
const scrollbarGutterValue = hasBothEdges ? "stable both-edges" : "stable";
scrollTop = html.scrollTop;
scrollLeft = html.scrollLeft;
originalHtmlStyles = {
scrollbarGutter: html.style.scrollbarGutter,
overflowY: html.style.overflowY,
overflowX: html.style.overflowX
};
originalHtmlScrollBehavior = html.style.scrollBehavior;
originalBodyStyles = {
position: body.style.position,
height: body.style.height,
width: body.style.width,
boxSizing: body.style.boxSizing,
overflowY: body.style.overflowY,
overflowX: body.style.overflowX,
scrollBehavior: body.style.scrollBehavior
};
const isScrollableY2 = html.scrollHeight > html.clientHeight;
const isScrollableX = html.scrollWidth > html.clientWidth;
const hasConstantOverflowY = htmlStyles.overflowY === "scroll" || bodyStyles.overflowY === "scroll";
const hasConstantOverflowX = htmlStyles.overflowX === "scroll" || bodyStyles.overflowX === "scroll";
const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);
const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);
const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
const elementToLock = getViewportScroller(html, body);
updateGutterOnly = supportsStableScrollbarGutter(referenceElement);
if (updateGutterOnly) {
html.style.scrollbarGutter = scrollbarGutterValue;
elementToLock.style.overflowY = "hidden";
elementToLock.style.overflowX = "hidden";
return;
}
Object.assign(html.style, {
scrollbarGutter: scrollbarGutterValue,
overflowY: "hidden",
overflowX: "hidden"
});
if (isScrollableY2 || hasConstantOverflowY) {
html.style.overflowY = "scroll";
}
if (isScrollableX || hasConstantOverflowX) {
html.style.overflowX = "scroll";
}
Object.assign(body.style, {
position: "relative",
height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : "100dvh",
width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : "100vw",
boxSizing: "border-box",
// Assign the longhands that `cleanup` restores, so nothing is left behind.
overflowY: "hidden",
overflowX: "hidden",
scrollBehavior: "unset"
});
body.scrollTop = scrollTop;
body.scrollLeft = scrollLeft;
html.setAttribute("data-base-ui-scroll-locked", "");
html.style.scrollBehavior = "unset";
}
function cleanup() {
Object.assign(html.style, originalHtmlStyles);
Object.assign(body.style, originalBodyStyles);
if (!updateGutterOnly) {
html.scrollTop = scrollTop;
html.scrollLeft = scrollLeft;
html.removeAttribute("data-base-ui-scroll-locked");
html.style.scrollBehavior = originalHtmlScrollBehavior;
}
}
function handleResize() {
cleanup();
resizeFrame.request(lockScroll);
}
lockScroll();
const unsubscribeResize = addEventListener(win, "resize", handleResize);
return () => {
resizeFrame.cancel();
cleanup();
if (typeof win.removeEventListener === "function") {
unsubscribeResize();
}
};
}
var ScrollLocker = class {
lockCount = 0;
restore = null;
timeoutLock = Timeout.create();
timeoutUnlock = Timeout.create();
acquire(referenceElement) {
this.lockCount += 1;
if (this.lockCount === 1 && this.restore === null) {
this.timeoutLock.start(0, () => this.lock(referenceElement));
}
return this.release;
}
release = () => {
this.lockCount -= 1;
if (this.lockCount === 0 && this.restore) {
this.timeoutUnlock.start(0, this.unlock);
}
};
unlock = () => {
if (this.lockCount === 0 && this.restore) {
this.restore?.();
this.restore = null;
}
};
lock(referenceElement) {
if (this.lockCount === 0 || this.restore !== null) {
return;
}
const doc = ownerDocument(referenceElement);
const html = doc.documentElement;
const body = doc.body;
const win = getWindow(html);
if (isPageScrollLocked(win, html, body)) {
const observer = new win.MutationObserver(() => {
if (isPageScrollLocked(win, html, body)) {
return;
}
observer.disconnect();
this.restore = null;
this.lock(referenceElement);
});
const options = {
attributes: true
};
observer.observe(html, options);
observer.observe(body, options);
this.restore = () => observer.disconnect();
return;
}
const hasOverlayScrollbars = parts_exports.os.ios || !hasInsetScrollbars(referenceElement);
this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);
}
};
var SCROLL_LOCKER = new ScrollLocker();
function useScrollLock(enabled = true, referenceElement = null) {
useIsoLayoutEffect(() => {
if (!enabled) {
return void 0;
}
return SCROLL_LOCKER.acquire(referenceElement);
}, [enabled, referenceElement]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
var React19 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs
function stopEvent(event) {
event.preventDefault();
event.stopPropagation();
}
function isReactEvent(event) {
return "nativeEvent" in event;
}
function isVirtualClick(event) {
if (event.pointerType === "" && event.isTrusted) {
return true;
}
if (parts_exports.os.android && event.pointerType) {
return event.type === "click" && event.buttons === 1;
}
return event.detail === 0 && !event.pointerType;
}
function isVirtualPointerEvent(event) {
if (parts_exports.env.jsdom) {
return false;
}
return !parts_exports.os.android && event.width === 0 && event.height === 0 || // Chrome synthesizes a screen reader press (TalkBack, VoiceOver, NVDA) as a 1x1 mouse
// `pointerdown` with no pressure. TalkBack can report a pressed button, while desktop
// mouse presses can report no pressure, so only require no pressed button off Android.
event.type === "pointerdown" && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" && (parts_exports.os.android || event.buttons === 0) || // iOS VoiceOver returns 0.333• for width/height.
event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch";
}
function isMouseLikePointerType(pointerType, strict) {
const values = ["mouse", "pen"];
if (!strict) {
values.push("", void 0);
}
return values.includes(pointerType);
}
function isClickLikeEvent(event) {
const type = event.type;
return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/shadowDom.mjs
function activeElement(doc) {
let element = doc.activeElement;
while (element?.shadowRoot?.activeElement != null) {
element = element.shadowRoot.activeElement;
}
return element;
}
function contains(parent, child) {
if (!parent || !child) {
return false;
}
const rootNode = child.getRootNode?.();
if (parent.contains(child)) {
return true;
}
if (rootNode && isShadowRoot(rootNode)) {
let next = child;
while (next) {
if (parent === next) {
return true;
}
next = next.parentNode || next.host;
}
}
return false;
}
function closest(node, selector) {
let current = node;
while (current) {
if (isElement(current) && current.matches(selector)) {
return current;
}
current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null);
}
return null;
}
function getTarget(event) {
if ("composedPath" in event) {
return event.composedPath()[0] ?? event.target;
}
return event.target;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs
var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable";
var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
var ARROW_LEFT = "ArrowLeft";
var ARROW_RIGHT = "ArrowRight";
var ARROW_UP = "ArrowUp";
var ARROW_DOWN = "ArrowDown";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs
var open = "data-open";
var closed = "data-closed";
var anchorHidden = "data-anchor-hidden";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs
var CommonTriggerDataAttributes_exports = {};
__export(CommonTriggerDataAttributes_exports, {
popupOpen: () => popupOpen,
pressed: () => pressed
});
var popupOpen = "data-popup-open";
var pressed = "data-pressed";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popupStateMapping.mjs
var TRIGGER_HOOK = {
[popupOpen]: ""
};
var PRESSABLE_TRIGGER_HOOK = {
[popupOpen]: "",
[pressed]: ""
};
var POPUP_OPEN_HOOK = {
[open]: ""
};
var POPUP_CLOSED_HOOK = {
[closed]: ""
};
var ANCHOR_HIDDEN_HOOK = {
[anchorHidden]: ""
};
var triggerOpenStateMapping = {
open(value) {
if (value) {
return TRIGGER_HOOK;
}
return null;
}
};
var pressableTriggerOpenStateMapping = {
open(value) {
if (value) {
return PRESSABLE_TRIGGER_HOOK;
}
return null;
}
};
var popupStateMapping = {
open(value) {
if (value) {
return POPUP_OPEN_HOOK;
}
return POPUP_CLOSED_HOOK;
},
anchorHidden(value) {
if (value) {
return ANCHOR_HIDDEN_HOOK;
}
return null;
}
};
var popupTransitionStateMapping = {
...popupStateMapping,
...transitionStatusMapping
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs
var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen;
var triggerDisabled = "data-trigger-disabled";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs
function isTargetInsideEnabledTrigger(target, triggerElements) {
if (!isElement(target)) {
return false;
}
const targetElement = target;
if (triggerElements.hasElement(targetElement)) {
return !targetElement.hasAttribute(triggerDisabled);
}
for (const [, trigger] of triggerElements.entries()) {
if (contains(trigger, targetElement)) {
return !trigger.hasAttribute(triggerDisabled);
}
}
return false;
}
function isEventTargetWithin(event, node) {
if (node == null) {
return false;
}
if ("composedPath" in event) {
return event.composedPath().includes(node);
}
const eventAgain = event;
return eventAgain.target != null && node.contains(eventAgain.target);
}
function isRootElement(element) {
return element.matches("html,body");
}
function isTypeableElement(element) {
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
}
function isInteractiveElement(element) {
return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
}
function isTypeableCombobox(element) {
if (!element) {
return false;
}
return element.getAttribute("role") === "combobox" && isTypeableElement(element);
}
function matchesFocusVisible(element) {
if (!element || parts_exports.env.jsdom) {
return true;
}
try {
return element.matches(":focus-visible");
} catch (_e) {
return true;
}
}
function getFloatingFocusElement(floatingElement) {
if (!floatingElement) {
return null;
}
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs
function resolveValue(value, pointerType) {
if (pointerType != null && !isMouseLikePointerType(pointerType)) {
return 0;
}
if (typeof value === "function") {
return value();
}
return value;
}
function getDelay(value, prop, pointerType) {
const result = resolveValue(value, pointerType);
if (typeof result === "number") {
return result;
}
return result?.[prop];
}
function getRestMs(value) {
if (typeof value === "function") {
return value();
}
return value;
}
function isClickLikeOpenEvent(openEventType, interactedInside) {
return interactedInside || openEventType === "click" || openEventType === "mousedown";
}
function isHoverOpenEvent(openEventType) {
return openEventType?.includes("mouse") && openEventType !== "mousedown";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
var FloatingDelayGroupContext = /* @__PURE__ */ React19.createContext({
hasProvider: false,
timeoutMs: 0,
delayRef: {
current: 0
},
initialDelayRef: {
current: 0
},
timeout: new Timeout(),
currentIdRef: {
current: null
},
currentContextRef: {
current: null
}
});
if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext";
function resetDelayRef(delayRef, initialDelayRef) {
delayRef.current = initialDelayRef.current;
}
function FloatingDelayGroup(props) {
const {
children,
delay,
timeoutMs = 0
} = props;
const delayRef = React19.useRef(delay);
const initialDelayRef = React19.useRef(delay);
const currentIdRef = React19.useRef(null);
const currentContextRef = React19.useRef(null);
const timeout = useTimeout();
useIsoLayoutEffect(() => {
initialDelayRef.current = delay;
if (!currentIdRef.current) {
delayRef.current = delay;
return;
}
delayRef.current = {
open: getDelay(delayRef.current, "open"),
close: getDelay(delay, "close")
};
}, [delay, currentIdRef, delayRef, initialDelayRef]);
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FloatingDelayGroupContext.Provider, {
value: React19.useMemo(() => ({
hasProvider: true,
delayRef,
initialDelayRef,
currentIdRef,
timeoutMs,
currentContextRef,
timeout
}), [timeoutMs, timeout]),
children
});
}
function useDelayGroup(store, options = {
open: false
}) {
const {
open: open2
} = options;
const floatingId = store.useState("floatingId");
const groupContext = React19.useContext(FloatingDelayGroupContext);
const {
currentIdRef,
delayRef,
timeoutMs,
initialDelayRef,
currentContextRef,
hasProvider,
timeout
} = groupContext;
const [isInstantPhase, setIsInstantPhase] = React19.useState(false);
const openRef = React19.useRef(open2);
useIsoLayoutEffect(() => {
openRef.current = open2;
}, [open2]);
useIsoLayoutEffect(() => {
function unset() {
currentContextRef.current?.setIsInstantPhase(false);
currentIdRef.current = null;
currentContextRef.current = null;
delayRef.current = initialDelayRef.current;
timeout.clear();
}
if (!currentIdRef.current) {
return void 0;
}
if (!open2 && currentIdRef.current === floatingId) {
setIsInstantPhase(false);
if (timeoutMs) {
const closingId = floatingId;
timeout.start(timeoutMs, () => {
if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) {
return;
}
unset();
});
return () => {
if (openRef.current || currentIdRef.current !== closingId) {
timeout.clear();
}
};
}
unset();
}
return void 0;
}, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);
useIsoLayoutEffect(() => {
if (!open2) {
return;
}
const prevContext = currentContextRef.current;
const prevId = currentIdRef.current;
timeout.clear();
currentContextRef.current = {
onOpenChange: store.setOpen,
setIsInstantPhase
};
currentIdRef.current = floatingId;
delayRef.current = {
open: 0,
close: getDelay(initialDelayRef.current, "close")
};
if (prevId !== null && prevId !== floatingId) {
setIsInstantPhase(true);
prevContext?.setIsInstantPhase(true);
prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none));
} else {
setIsInstantPhase(false);
prevContext?.setIsInstantPhase(false);
}
}, [open2, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);
useIsoLayoutEffect(() => {
return () => {
if (currentIdRef.current === floatingId) {
currentContextRef.current = null;
if (!openRef.current) {
return;
}
currentIdRef.current = null;
resetDelayRef(delayRef, initialDelayRef);
timeout.clear();
}
};
}, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);
return React19.useMemo(() => ({
activeIdRef: currentIdRef,
hasProvider,
delayRef,
isInstantPhase
}), [currentIdRef, hasProvider, delayRef, isInstantPhase]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
var React23 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/mergeCleanups.mjs
function mergeCleanups(...cleanups) {
return () => {
for (let i = 0; i < cleanups.length; i += 1) {
const cleanup = cleanups[i];
if (cleanup) {
cleanup();
}
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FocusGuard.mjs
var React20 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/visuallyHidden.mjs
var visuallyHiddenBase = {
clipPath: "inset(50%)",
overflow: "hidden",
whiteSpace: "nowrap",
border: 0,
padding: 0,
width: 1,
height: 1,
margin: -1
};
var visuallyHidden = {
...visuallyHiddenBase,
position: "fixed",
margin: 0,
top: 0,
left: 0
};
var visuallyHiddenInput = {
...visuallyHiddenBase,
position: "absolute"
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FocusGuard.mjs
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
var FocusGuard = /* @__PURE__ */ React20.forwardRef(function FocusGuard2(props, ref) {
const [role, setRole] = React20.useState();
useIsoLayoutEffect(() => {
if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) {
setRole("button");
}
}, []);
const restProps = {
tabIndex: 0,
// Role is only for VoiceOver
role
};
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", {
...props,
ref,
style: visuallyHidden,
"aria-hidden": role ? void 0 : true,
...restProps,
"data-base-ui-focus-guard": ""
});
});
if (true) FocusGuard.displayName = "FocusGuard";
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var min = Math.min;
var max = Math.max;
var round = Math.round;
var floor = Math.floor;
var createCoords = (v) => ({
x: v,
y: v
});
var oppositeSideMap = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function clamp(start, value, end) {
return max(start, min(value, end));
}
function evaluate(value, param) {
return typeof value === "function" ? value(param) : value;
}
function getSide(placement) {
return placement.split("-")[0];
}
function getAlignment(placement) {
return placement.split("-")[1];
}
function getOppositeAxis(axis) {
return axis === "x" ? "y" : "x";
}
function getAxisLength(axis) {
return axis === "y" ? "height" : "width";
}
function getSideAxis(placement) {
const firstChar = placement[0];
return firstChar === "t" || firstChar === "b" ? "y" : "x";
}
function getAlignmentAxis(placement) {
return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
}
var lrPlacement = ["left", "right"];
var rlPlacement = ["right", "left"];
var tbPlacement = ["top", "bottom"];
var btPlacement = ["bottom", "top"];
function getSideList(side, isStart, rtl) {
switch (side) {
case "top":
case "bottom":
if (rtl) return isStart ? rlPlacement : lrPlacement;
return isStart ? lrPlacement : rlPlacement;
case "left":
case "right":
return isStart ? tbPlacement : btPlacement;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction === "start", rtl);
if (alignment) {
list = list.map((side) => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
const side = getSide(placement);
return oppositeSideMap[side] + placement.slice(side.length);
}
function expandPaddingObject(padding) {
var _padding$top, _padding$right, _padding$bottom, _padding$left;
return {
top: (_padding$top = padding.top) != null ? _padding$top : 0,
right: (_padding$right = padding.right) != null ? _padding$right : 0,
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
left: (_padding$left = padding.left) != null ? _padding$left : 0
};
}
function getPaddingObject(padding) {
return typeof padding !== "number" ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
const {
x,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x,
right: x + width,
bottom: y + height,
x,
y
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
function isDifferentGridRow(index2, cols, prevRow) {
return Math.floor(index2 / cols) !== prevRow;
}
function isIndexOutOfListBounds(list, index2) {
return index2 < 0 || index2 >= list.length;
}
function getMinListIndex(listRef, disabledIndices) {
return findNonDisabledListIndex(listRef.current, {
disabledIndices
});
}
function getMaxListIndex(listRef, disabledIndices) {
return findNonDisabledListIndex(listRef.current, {
decrement: true,
startingIndex: listRef.current.length,
disabledIndices
});
}
function getNextListIndex(list, currentIndex, options) {
const {
decrement,
loopFocus,
allowEscape,
disabledIndices,
minIndex,
maxIndex
} = options;
const step = () => findNonDisabledListIndex(list, {
startingIndex: currentIndex,
decrement,
disabledIndices
});
let index2;
let wrapped = false;
if (!loopFocus) {
index2 = decrement ? Math.max(minIndex, step()) : Math.min(maxIndex, step());
} else if (decrement ? currentIndex <= minIndex : currentIndex >= maxIndex) {
const outside = decrement ? -1 : list.length;
if (allowEscape && currentIndex !== outside) {
index2 = -1;
} else {
index2 = decrement ? maxIndex : minIndex;
wrapped = true;
}
} else {
index2 = step();
}
return {
index: isIndexOutOfListBounds(list, index2) ? -1 : index2,
wrapped
};
}
function findNonDisabledListIndex(list, {
startingIndex = -1,
decrement = false,
disabledIndices,
amount = 1
} = {}) {
let index2 = startingIndex;
do {
index2 += decrement ? -amount : amount;
} while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
return index2;
}
function getGridNavigatedIndex(list, {
event,
orientation,
loopFocus,
onLoop,
rtl,
cols,
disabledIndices,
minIndex,
maxIndex,
prevIndex,
stopEvent: stop = false
}) {
let nextIndex = prevIndex;
let verticalDirection;
if (event.key === ARROW_UP) {
verticalDirection = "up";
} else if (event.key === ARROW_DOWN) {
verticalDirection = "down";
}
if (verticalDirection) {
const rows = [];
const rowIndexMap = [];
let hasRoleRow = false;
let visibleItemCount = 0;
{
let currentRowEl = null;
let currentRowIndex = -1;
list.forEach((el, idx) => {
if (el == null) {
return;
}
visibleItemCount += 1;
const rowEl = closest(el, '[role="row"]');
if (rowEl) {
hasRoleRow = true;
}
if (rowEl !== currentRowEl || currentRowIndex === -1) {
currentRowEl = rowEl;
currentRowIndex += 1;
rows[currentRowIndex] = [];
}
rows[currentRowIndex].push(idx);
rowIndexMap[idx] = currentRowIndex;
});
}
let hasDomRows = false;
let inferredDomCols = 0;
if (hasRoleRow) {
for (const row of rows) {
const rowLength = row.length;
if (rowLength > inferredDomCols) {
inferredDomCols = rowLength;
}
if (rowLength !== cols) {
hasDomRows = true;
}
}
}
const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;
const verticalCols = inferredDomCols || cols;
const navigateVertically = (direction) => {
if (!hasDomRows || prevIndex === -1) {
return void 0;
}
const currentRow = rowIndexMap[prevIndex];
if (currentRow == null) {
return void 0;
}
const colInRow = rows[currentRow].indexOf(prevIndex);
const step = direction === "up" ? -1 : 1;
for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {
if (nextRow < 0 || nextRow >= rows.length) {
if (!loopFocus || hasVirtualizedGaps) {
return void 0;
}
nextRow = nextRow < 0 ? rows.length - 1 : 0;
if (onLoop) {
const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);
const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];
const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);
nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;
}
}
const targetRow = rows[nextRow];
for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {
const candidate = targetRow[col];
if (!isListIndexDisabled(list, candidate, disabledIndices)) {
return candidate;
}
}
}
return void 0;
};
const navigateVerticallyWithInferredRows = (direction) => {
if (!hasVirtualizedGaps || prevIndex === -1) {
return void 0;
}
const colInRow = prevIndex % verticalCols;
const rowStep = direction === "up" ? -verticalCols : verticalCols;
const lastRowStart = maxIndex - maxIndex % verticalCols;
const rowCount = floor(maxIndex / verticalCols) + 1;
for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {
if (rowStart < 0 || rowStart > maxIndex) {
if (!loopFocus) {
return void 0;
}
rowStart = rowStart < 0 ? lastRowStart : 0;
}
const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);
for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {
if (!isListIndexDisabled(list, candidate, disabledIndices)) {
return candidate;
}
}
}
return void 0;
};
if (stop) {
stopEvent(event);
}
const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);
if (verticalCandidate !== void 0) {
nextIndex = verticalCandidate;
} else if (prevIndex === -1) {
nextIndex = verticalDirection === "up" ? maxIndex : minIndex;
} else {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex,
amount: verticalCols,
decrement: verticalDirection === "up",
disabledIndices
});
if (loopFocus) {
if (verticalDirection === "up" && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {
const col = prevIndex % verticalCols;
const maxCol = maxIndex % verticalCols;
const offset4 = maxIndex - (maxCol - col);
if (maxCol === col) {
nextIndex = maxIndex;
} else {
nextIndex = maxCol > col ? offset4 : offset4 - verticalCols;
}
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
if (verticalDirection === "down" && prevIndex + verticalCols > maxIndex) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex % verticalCols - verticalCols,
amount: verticalCols,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
}
}
if (isIndexOutOfListBounds(list, nextIndex)) {
nextIndex = prevIndex;
}
}
if (orientation === "both") {
const prevRow = floor(prevIndex / cols);
if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {
if (stop) {
stopEvent(event);
}
if (prevIndex % cols !== cols - 1) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex,
disabledIndices
});
if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex - prevIndex % cols - 1,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
} else if (loopFocus) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex - prevIndex % cols - 1,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
if (isDifferentGridRow(nextIndex, cols, prevRow)) {
nextIndex = prevIndex;
}
}
if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {
if (stop) {
stopEvent(event);
}
if (prevIndex % cols !== 0) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex,
decrement: true,
disabledIndices
});
if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex + (cols - prevIndex % cols),
decrement: true,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
} else if (loopFocus) {
nextIndex = findNonDisabledListIndex(list, {
startingIndex: prevIndex + (cols - prevIndex % cols),
decrement: true,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
}
if (isDifferentGridRow(nextIndex, cols, prevRow)) {
nextIndex = prevIndex;
}
}
const lastRow = floor(maxIndex / cols) === prevRow;
if (isIndexOutOfListBounds(list, nextIndex)) {
if (loopFocus && lastRow) {
nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {
startingIndex: prevIndex - prevIndex % cols - 1,
disabledIndices
});
if (onLoop) {
nextIndex = onLoop(event, prevIndex, nextIndex);
}
} else {
nextIndex = prevIndex;
}
}
}
return nextIndex;
}
function isListIndexDisabled(list, index2, disabledIndices) {
const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index2) : disabledIndices?.includes(index2) ?? false;
if (isExplicitlyDisabled) {
return true;
}
const element = list[index2];
if (!element) {
return false;
}
if (!isElementVisible(element)) {
return true;
}
if (element.matches(":disabled")) {
return true;
}
return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
}
function isHiddenByStyles(styles) {
return styles.visibility === "hidden" || styles.visibility === "collapse";
}
function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) {
if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {
return false;
}
if (typeof element.checkVisibility === "function") {
return element.checkVisibility();
}
return styles.display !== "none" && styles.display !== "contents";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs
var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';
function getParentElement(element) {
const assignedSlot = element.assignedSlot;
if (assignedSlot) {
return assignedSlot;
}
if (element.parentElement) {
return element.parentElement;
}
const rootNode = element.getRootNode();
return isShadowRoot(rootNode) ? rootNode.host : null;
}
function getDetailsSummary(details) {
for (const child of Array.from(details.children)) {
if (getNodeName(child) === "summary") {
return child;
}
}
return null;
}
function isWithinOpenDetailsSummary(element, details) {
const summary = getDetailsSummary(details);
return !!summary && (element === summary || contains(summary, element));
}
function isFocusableCandidate(element) {
const nodeName = element ? getNodeName(element) : "";
return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden");
}
function isFocusableElement(element) {
if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) {
return false;
}
for (let current = element; current; current = getParentElement(current)) {
const isAncestor = current !== element;
const isSlot = getNodeName(current) === "slot";
if (current.hasAttribute("inert")) {
return false;
}
if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {
return false;
}
}
return true;
}
function isVisibleInTabbableTree(element, isAncestor) {
const styles = getComputedStyle2(element);
if (!isAncestor) {
return isElementVisible(element, styles);
}
return styles.display !== "none";
}
function getTabIndex(element) {
const tabIndex = element.tabIndex;
if (tabIndex < 0) {
const nodeName = getNodeName(element);
if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) {
return 0;
}
}
return tabIndex;
}
function getNamedRadioInput(element) {
if (getNodeName(element) !== "input") {
return null;
}
const input = element;
return input.type === "radio" && input.name !== "" ? input : null;
}
function isTabbableRadio(element, candidates) {
const input = getNamedRadioInput(element);
if (!input) {
return true;
}
const checkedRadio = candidates.find((candidate) => {
const radio = getNamedRadioInput(candidate);
return radio?.name === input.name && radio.form === input.form && radio.checked;
});
if (checkedRadio) {
return checkedRadio === input;
}
return candidates.find((candidate) => {
const radio = getNamedRadioInput(candidate);
return radio?.name === input.name && radio.form === input.form;
}) === input;
}
function getComposedChildren(container) {
if (isHTMLElement(container) && getNodeName(container) === "slot") {
const assignedElements = container.assignedElements({
flatten: true
});
if (assignedElements.length > 0) {
return assignedElements;
}
}
if (isHTMLElement(container) && container.shadowRoot) {
return Array.from(container.shadowRoot.children);
}
return Array.from(container.children);
}
function appendCandidates(container, list) {
getComposedChildren(container).forEach((child) => {
if (isFocusableCandidate(child)) {
list.push(child);
}
appendCandidates(child, list);
});
}
function appendMatchingElements(container, selector, list) {
getComposedChildren(container).forEach((child) => {
if (isHTMLElement(child) && child.matches(selector)) {
list.push(child);
}
appendMatchingElements(child, selector, list);
});
}
function isTabbable(element) {
return isFocusableElement(element) && getTabIndex(element) >= 0;
}
function focusable(container) {
const candidates = [];
appendCandidates(container, candidates);
return candidates.filter(isFocusableElement);
}
function tabbable(container) {
const candidates = focusable(container);
return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));
}
function getTabbableIn(container, dir) {
const list = tabbable(container);
const len = list.length;
if (len === 0) {
return void 0;
}
const active = activeElement(ownerDocument(container));
const index2 = list.indexOf(active);
const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir;
return list[nextIndex];
}
function getNextTabbable(referenceElement) {
return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
}
function getPreviousTabbable(referenceElement) {
return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
}
function isOutsideEvent(event, container) {
const containerElement = container || event.currentTarget;
const relatedTarget = event.relatedTarget;
return !relatedTarget || !contains(containerElement, relatedTarget);
}
function disableFocusInside(container) {
const tabbableElements = tabbable(container);
tabbableElements.forEach((element) => {
element.dataset.tabindex = element.getAttribute("tabindex") || "";
element.setAttribute("tabindex", "-1");
});
}
function enableFocusInside(container) {
const elements = [];
appendMatchingElements(container, "[data-tabindex]", elements);
elements.forEach((element) => {
const tabindex = element.dataset.tabindex;
delete element.dataset.tabindex;
if (tabindex) {
element.setAttribute("tabindex", tabindex);
} else {
element.removeAttribute("tabindex");
}
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs
function getNodeChildren(nodes, id, onlyOpenChildren = true) {
const directChildren = nodes.filter((node) => node.parentId === id);
return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
}
function getNodeAncestors(nodes, id) {
let allAncestors = [];
let currentParentId = nodes.find((node) => node.id === id)?.parentId;
while (currentParentId) {
const currentNode = nodes.find((node) => node.id === currentParentId);
currentParentId = currentNode?.parentId;
if (currentNode) {
allAncestors = allAncestors.concat(currentNode);
}
}
return allAncestors;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs
function createAttribute(name) {
return `data-base-ui-${name}`;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs
var rafId = 0;
function enqueueFocus(el, options = {}) {
const {
preventScroll = false,
sync = false,
shouldFocus
} = options;
cancelAnimationFrame(rafId);
function exec() {
if (shouldFocus && !shouldFocus()) {
return;
}
el?.focus({
preventScroll
});
}
if (sync) {
exec();
return NOOP;
}
const currentRafId = requestAnimationFrame(exec);
rafId = currentRafId;
return () => {
if (rafId === currentRafId) {
cancelAnimationFrame(currentRafId);
rafId = 0;
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs
var markerName = "data-base-ui-inert";
var ariaHiddenCounterMap = /* @__PURE__ */ new WeakMap();
var uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
var markerCounterMap = /* @__PURE__ */ new WeakMap();
var lockCount = 0;
function unwrapHost(node) {
if (!node) {
return null;
}
return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
}
var correctElements = (parent, targets) => targets.map((target) => {
if (parent.contains(target)) {
return target;
}
const correctedTarget = unwrapHost(target);
if (parent.contains(correctedTarget)) {
return correctedTarget;
}
return null;
}).filter((x) => x != null);
var buildKeepSet = (targets) => {
const keep = /* @__PURE__ */ new Set();
targets.forEach((target) => {
let node = target;
while (node && !keep.has(node)) {
keep.add(node);
node = node.parentNode;
}
});
return keep;
};
var collectOutsideElements = (root2, keepElements, stopElements) => {
const outside = [];
const walk = (parent) => {
if (!parent || stopElements.has(parent)) {
return;
}
Array.from(parent.children).forEach((node) => {
if (getNodeName(node) === "script") {
return;
}
if (keepElements.has(node)) {
walk(node);
} else {
outside.push(node);
}
});
};
walk(root2);
return outside;
};
function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, {
mark = true
}) {
const avoidElements = correctElements(body, uncorrectedAvoidElements);
const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];
const hiddenElements = [];
const markedElements = [];
if (ariaHidden) {
const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll("[aria-live]")));
const controlElements = avoidElements.concat(ariaLiveElements);
const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));
controlTargets.forEach((node) => {
const attr2 = node.getAttribute("aria-hidden");
const alreadyHidden = attr2 !== null && attr2 !== "false";
const counterValue = (ariaHiddenCounterMap.get(node) || 0) + 1;
ariaHiddenCounterMap.set(node, counterValue);
hiddenElements.push(node);
if (counterValue === 1 && alreadyHidden) {
uncontrolledElementsSet.add(node);
}
if (!alreadyHidden) {
node.setAttribute("aria-hidden", "true");
}
});
}
if (mark) {
markerTargets.forEach((node) => {
const markerValue = (markerCounterMap.get(node) || 0) + 1;
markerCounterMap.set(node, markerValue);
markedElements.push(node);
if (markerValue === 1) {
node.setAttribute(markerName, "");
}
});
}
lockCount += 1;
return () => {
hiddenElements.forEach((element) => {
const counterValue = (ariaHiddenCounterMap.get(element) || 0) - 1;
ariaHiddenCounterMap.set(element, counterValue);
if (!counterValue) {
if (!uncontrolledElementsSet.has(element)) {
element.removeAttribute("aria-hidden");
}
uncontrolledElementsSet.delete(element);
}
});
if (mark) {
markedElements.forEach((element) => {
const markerValue = (markerCounterMap.get(element) || 0) - 1;
markerCounterMap.set(element, markerValue);
if (!markerValue) {
element.removeAttribute(markerName);
}
});
}
lockCount -= 1;
if (!lockCount) {
ariaHiddenCounterMap = /* @__PURE__ */ new WeakMap();
uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
markerCounterMap = /* @__PURE__ */ new WeakMap();
}
};
}
function markOthers(avoidElements, options = {}) {
const {
ariaHidden = false,
mark = true
} = options;
const body = ownerDocument(avoidElements[0]).body;
return applyAttributeToOthers(avoidElements, body, ariaHidden, {
mark
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
var React21 = __toESM(require_react(), 1);
var ReactDOM2 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/constants.mjs
var DISABLED_TRANSITIONS_STYLE = {
style: {
transition: "none"
}
};
var CLICK_TRIGGER_IDENTIFIER = "data-base-ui-click-trigger";
var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;
var DROPDOWN_COLLISION_AVOIDANCE = {
fallbackAxisSide: "none"
};
var POPUP_COLLISION_AVOIDANCE = {
fallbackAxisSide: "end"
};
var ownerVisuallyHidden = {
clipPath: "inset(50%)",
position: "fixed",
top: 0,
left: 0
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var PortalContext = /* @__PURE__ */ React21.createContext(null);
if (true) PortalContext.displayName = "PortalContext";
var usePortalContext = () => React21.useContext(PortalContext);
var attr = createAttribute("portal");
function useFloatingPortalNode(props = {}) {
const {
ref,
container: containerProp,
componentProps = EMPTY_OBJECT,
elementProps
} = props;
const uniqueId = useId();
const portalContext = usePortalContext();
const parentPortalNode = portalContext?.portalNode;
const [containerElement, setContainerElement] = React21.useState(null);
const [portalNode, setPortalNode] = React21.useState(null);
const setPortalNodeRef = useStableCallback((node) => {
if (node !== null) {
setPortalNode(node);
}
});
const containerRef = React21.useRef(null);
useIsoLayoutEffect(() => {
if (containerProp === null) {
if (containerRef.current) {
containerRef.current = null;
setPortalNode(null);
setContainerElement(null);
}
return;
}
const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
if (resolvedContainer == null) {
if (containerRef.current) {
containerRef.current = null;
setPortalNode(null);
setContainerElement(null);
}
return;
}
if (containerRef.current !== resolvedContainer) {
containerRef.current = resolvedContainer;
setPortalNode(null);
setContainerElement(resolvedContainer);
}
}, [containerProp, parentPortalNode]);
const portalElement = useRenderElement("div", componentProps, {
ref: [ref, setPortalNodeRef],
props: [{
id: uniqueId,
[attr]: ""
}, elementProps]
});
const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null;
return {
node: portalNode,
// `id` and `render` props can override or remove the generated ID. Use the exact
// rendered value so `aria-owns` never points at an ID absent from the DOM.
nodeId: /* @__PURE__ */ React21.isValidElement(portalElement) ? portalElement.props.id : void 0,
subtree: portalSubtree
};
}
var FloatingPortal = /* @__PURE__ */ React21.forwardRef(function FloatingPortal2(componentProps, forwardedRef) {
const {
render,
className,
style,
children,
container,
portalOwnerRole,
...elementProps
} = componentProps;
const {
node: portalNode,
nodeId: portalNodeId,
subtree: portalSubtree
} = useFloatingPortalNode({
container,
ref: forwardedRef,
componentProps,
elementProps
});
const beforeOutsideRef = React21.useRef(null);
const afterOutsideRef = React21.useRef(null);
const beforeInsideRef = React21.useRef(null);
const afterInsideRef = React21.useRef(null);
const [focusManagerState, setFocusManagerState] = React21.useState(null);
const focusInsideDisabledRef = React21.useRef(false);
const modal = focusManagerState?.modal;
const open2 = focusManagerState?.open;
const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
React21.useEffect(() => {
if (!portalNode || modal) {
return void 0;
}
function onFocus(event) {
if (portalNode && event.relatedTarget && isOutsideEvent(event)) {
if (event.type === "focusin") {
if (focusInsideDisabledRef.current) {
enableFocusInside(portalNode);
focusInsideDisabledRef.current = false;
}
} else {
disableFocusInside(portalNode);
focusInsideDisabledRef.current = true;
}
}
}
return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true));
}, [portalNode, modal]);
useIsoLayoutEffect(() => {
if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) {
return;
}
enableFocusInside(portalNode);
focusInsideDisabledRef.current = false;
}, [open2, portalNode]);
const portalContextValue = React21.useMemo(() => ({
beforeOutsideRef,
afterOutsideRef,
beforeInsideRef,
afterInsideRef,
portalNode,
setFocusManagerState
}), [portalNode]);
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(React21.Fragment, {
children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(PortalContext.Provider, {
value: portalContextValue,
children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FocusGuard, {
"data-type": "outside",
ref: beforeOutsideRef,
onFocus: (event) => {
if (isOutsideEvent(event, portalNode)) {
beforeInsideRef.current?.focus();
} else {
const domReference = focusManagerState ? focusManagerState.domReference : null;
const prevTabbable = getPreviousTabbable(domReference);
prevTabbable?.focus();
}
}
}), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", {
role: portalOwnerRole,
"aria-owns": portalNodeId,
style: ownerVisuallyHidden
}), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FocusGuard, {
"data-type": "outside",
ref: afterOutsideRef,
onFocus: (event) => {
if (isOutsideEvent(event, portalNode)) {
afterInsideRef.current?.focus();
} else {
const domReference = focusManagerState ? focusManagerState.domReference : null;
const nextTabbable = getNextTabbable(domReference);
nextTabbable?.focus();
if (focusManagerState?.closeOnFocusOut) {
focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent));
}
}
}
})]
})]
});
});
if (true) FloatingPortal.displayName = "FloatingPortal";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
var React22 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs
function createEventEmitter() {
const map = /* @__PURE__ */ new Map();
return {
emit(event, data) {
map.get(event)?.forEach((listener) => listener(data));
},
on(event, listener) {
if (!map.has(event)) {
map.set(event, /* @__PURE__ */ new Set());
}
map.get(event).add(listener);
},
off(event, listener) {
map.get(event)?.delete(listener);
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
var FloatingNodeContext = /* @__PURE__ */ React22.createContext(null);
if (true) FloatingNodeContext.displayName = "FloatingNodeContext";
var FloatingTreeContext = /* @__PURE__ */ React22.createContext(null);
if (true) FloatingTreeContext.displayName = "FloatingTreeContext";
var useFloatingParentNodeId = () => React22.useContext(FloatingNodeContext)?.id || null;
var useFloatingTree = (externalTree) => {
const contextTree = React22.useContext(FloatingTreeContext);
return externalTree ?? contextTree;
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
function getEventType(event, lastInteractionType) {
const win = getWindow(getTarget(event));
if (event instanceof win.KeyboardEvent) {
return "keyboard";
}
if (event instanceof win.FocusEvent) {
return lastInteractionType || "keyboard";
}
if ("pointerType" in event) {
return event.pointerType || (isVirtualClick(event) ? "keyboard" : lastInteractionType || "mouse");
}
if ("touches" in event) {
return "touch";
}
if (event instanceof win.MouseEvent) {
return lastInteractionType || (event.detail === 0 ? "keyboard" : "mouse");
}
return "";
}
var LIST_LIMIT = 20;
var previouslyFocusedElements = [];
function clearDisconnectedPreviouslyFocusedElements() {
previouslyFocusedElements = previouslyFocusedElements.filter((entry) => {
return entry.deref()?.isConnected;
});
}
function addPreviouslyFocusedElement(element) {
clearDisconnectedPreviouslyFocusedElements();
if (element && getNodeName(element) !== "body") {
previouslyFocusedElements.push(new WeakRef(element));
if (previouslyFocusedElements.length > LIST_LIMIT) {
previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
}
}
}
function getPreviouslyFocusedElement() {
clearDisconnectedPreviouslyFocusedElements();
return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();
}
function getFirstTabbableElement(container) {
if (!container) {
return null;
}
if (isTabbable(container)) {
return container;
}
return tabbable(container)[0] || container;
}
function handleTabIndex(floatingFocusElement) {
if (floatingFocusElement.hasAttribute("tabindex") && !floatingFocusElement.hasAttribute("data-tabindex")) {
return;
}
if (!floatingFocusElement.getAttribute("role")?.includes("dialog")) {
return;
}
const focusableElements = focusable(floatingFocusElement);
const tabbableContent = focusableElements.filter((element) => {
const dataTabIndex = element.getAttribute("data-tabindex") || "";
return isTabbable(element) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-");
});
const tabIndex = floatingFocusElement.getAttribute("tabindex");
if (tabbableContent.length === 0) {
if (tabIndex !== "0") {
floatingFocusElement.setAttribute("tabindex", "0");
floatingFocusElement.setAttribute("data-tabindex", "0");
}
} else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") {
floatingFocusElement.setAttribute("tabindex", "-1");
floatingFocusElement.setAttribute("data-tabindex", "-1");
}
}
function FloatingFocusManager(props) {
const {
context: store,
children,
disabled: disabled2 = false,
initialFocus = true,
returnFocus = true,
explicitReturnFocus,
restoreFocus = false,
modal = true,
closeOnFocusOut = true,
openInteractionType = "",
nextFocusableElement,
previousFocusableElement,
beforeContentFocusGuardRef,
externalTree,
getInsideElements
} = props;
const open2 = store.useState("open");
const domReference = store.useState("domReferenceElement");
const floating = store.useState("floatingElement");
const {
events,
dataRef
} = store.context;
const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);
const ignoreInitialFocus = initialFocus === false;
const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;
const initialFocusRef = useValueAsRef(initialFocus);
const returnFocusRef = useValueAsRef(returnFocus);
const explicitReturnFocusRef = useValueAsRef(explicitReturnFocus);
const openInteractionTypeRef = useValueAsRef(openInteractionType);
const openRef = useValueAsRef(open2);
const tree = useFloatingTree(externalTree);
const portalContext = usePortalContext();
const preventReturnFocusRef = React23.useRef(false);
const isPointerDownRef = React23.useRef(false);
const pointerDownOutsideRef = React23.useRef(false);
const lastFocusedTabbableRef = React23.useRef(null);
const closeTypeRef = React23.useRef("");
const lastInteractionTypeRef = React23.useRef("");
const beforeGuardRef = React23.useRef(null);
const afterGuardRef = React23.useRef(null);
const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);
const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);
const blurTimeout = useTimeout();
const pointerDownTimeout = useTimeout();
const restoreFocusFrame = useAnimationFrame();
const isInsidePortal = portalContext != null;
const floatingFocusElement = getFloatingFocusElement(floating);
const getTabbableContent = useStableCallback((container = floatingFocusElement) => {
return container ? tabbable(container) : [];
});
const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter((element) => element != null) ?? []);
React23.useEffect(() => {
if (disabled2 || !modal) {
return void 0;
}
function onKeyDown(event) {
if (event.key === "Tab") {
if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
stopEvent(event);
}
}
}
const doc = ownerDocument(floatingFocusElement);
return addEventListener(doc, "keydown", onKeyDown);
}, [disabled2, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);
React23.useEffect(() => {
if (disabled2 || !open2) {
return void 0;
}
const doc = ownerDocument(floatingFocusElement);
function clearPointerDownOutside() {
pointerDownOutsideRef.current = false;
}
function onPointerDown(event) {
const target = getTarget(event);
const insideElements = getResolvedInsideElements();
const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some((element) => element === target || contains(element, target));
pointerDownOutsideRef.current = !pointerTargetInside;
lastInteractionTypeRef.current = event.pointerType || "keyboard";
if (closest(target, `[${CLICK_TRIGGER_IDENTIFIER}]`)) {
isPointerDownRef.current = true;
pointerDownTimeout.start(0, () => {
isPointerDownRef.current = false;
});
}
}
function onKeyDown() {
lastInteractionTypeRef.current = "keyboard";
}
return mergeCleanups(
addEventListener(doc, "pointerdown", onPointerDown, true),
addEventListener(doc, "pointerup", clearPointerDownOutside, true),
addEventListener(doc, "pointercancel", clearPointerDownOutside, true),
addEventListener(doc, "keydown", onKeyDown, true),
// Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)
// if the popup dismissed between pointerdown and pointerup.
clearPointerDownOutside
);
}, [disabled2, floating, domReference, floatingFocusElement, open2, portalContext, pointerDownTimeout, getResolvedInsideElements]);
React23.useEffect(() => {
if (disabled2 || !closeOnFocusOut) {
return void 0;
}
const doc = ownerDocument(floatingFocusElement);
function handlePointerDown() {
isPointerDownRef.current = true;
pointerDownTimeout.start(0, () => {
isPointerDownRef.current = false;
});
}
function handleFocusIn(event) {
const target = getTarget(event);
if (isTabbable(target)) {
lastFocusedTabbableRef.current = target;
}
}
function handleFocusOutside(event) {
const relatedTarget = event.relatedTarget;
const currentTarget = event.currentTarget;
const target = getTarget(event);
if (modal && relatedTarget == null && target != null && contains(floating, target)) {
addPreviouslyFocusedElement(target);
}
queueMicrotask(() => {
const nodeId = getNodeId();
const triggers = store.context.triggerElements;
const insideElements = getResolvedInsideElements();
const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute("focus-guard")) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);
const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some((element) => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement((trigger) => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find((node) => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find((node) => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));
if (currentTarget === domReference && floatingFocusElement) {
handleTabIndex(floatingFocusElement);
}
if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {
if (isHTMLElement(floatingFocusElement)) {
floatingFocusElement.focus();
if (restoreFocus === "popup") {
restoreFocusFrame.request(() => {
floatingFocusElement.focus();
});
return;
}
}
const tabbableContent = getTabbableContent();
const prevTabbable = lastFocusedTabbableRef.current;
const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
if (isHTMLElement(nodeToFocus)) {
nodeToFocus.focus();
}
}
if (dataRef.current.insideReactTree) {
dataRef.current.insideReactTree = false;
return;
}
if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
// For an "untrapped" typeable combobox (input role=combobox with
// initialFocus=false), re-opening the popup and tabbing out should still close it even
// when the previously focused element (e.g. the next tabbable outside the popup) is
// focused again. Otherwise, the popup remains open on the second Tab sequence:
// click input -> Tab (closes) -> click input -> Tab.
// Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
(isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {
preventReturnFocusRef.current = true;
store.setOpen(false, createChangeEventDetails(reason_parts_exports.focusOut, event));
}
});
}
function markInsideReactTree() {
if (pointerDownOutsideRef.current) {
return;
}
dataRef.current.insideReactTree = true;
blurTimeout.start(0, () => {
dataRef.current.insideReactTree = false;
});
}
const domReferenceElement = isHTMLElement(domReference) ? domReference : null;
if (!floating && !domReferenceElement) {
return void 0;
}
return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, "focusout", handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, "pointerdown", handlePointerDown), floating && addEventListener(floating, "focusin", handleFocusIn), floating && addEventListener(floating, "focusout", handleFocusOutside), floating && portalContext && addEventListener(floating, "focusout", markInsideReactTree, true));
}, [disabled2, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
React23.useEffect(() => {
if (disabled2 || !floating || !open2) {
return void 0;
}
const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute("portal")}]`) || []);
const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];
const rootAncestorComboboxDomReference = ancestors.find((node) => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;
const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];
const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter((x) => x != null);
const ariaHiddenCleanup = markOthers(insideElements, {
ariaHidden: modal || isUntrappedTypeableCombobox,
mark: false
});
const markerInsideElements = [floating, ...portalNodes].filter((x) => x != null);
const markerCleanup = markOthers(markerInsideElements);
return () => {
markerCleanup();
ariaHiddenCleanup();
};
}, [open2, disabled2, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
useIsoLayoutEffect(() => {
if (!open2 || disabled2 || !isHTMLElement(floatingFocusElement)) {
return;
}
closeTypeRef.current = "";
lastInteractionTypeRef.current = "";
const doc = ownerDocument(floatingFocusElement);
const previouslyFocusedElement = activeElement(doc);
queueMicrotask(() => {
const initialFocusValueOrFn = initialFocusRef.current;
const resolvedInitialFocus = typeof initialFocusValueOrFn === "function" ? initialFocusValueOrFn(openInteractionTypeRef.current || "") : initialFocusValueOrFn;
if (resolvedInitialFocus === void 0 || resolvedInitialFocus === false) {
return;
}
const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);
if (focusAlreadyInsideFloatingEl) {
return;
}
let focusableElements = null;
const getDefaultFocusElement = () => {
if (focusableElements == null) {
focusableElements = getTabbableContent(floatingFocusElement);
}
return focusableElements[0] || floatingFocusElement;
};
let elToFocus;
if (resolvedInitialFocus === true || resolvedInitialFocus === null) {
elToFocus = getDefaultFocusElement();
} else {
elToFocus = resolveRef(resolvedInitialFocus);
}
elToFocus = elToFocus || getDefaultFocusElement();
const hadFocusInside = contains(floatingFocusElement, activeElement(doc));
const openEvent = dataRef.current.openEvent;
const openedByVirtualPress = openEvent?.type === "mousedown" && isVirtualClick(openEvent);
void enqueueFocus(elToFocus, {
sync: openedByVirtualPress,
preventScroll: elToFocus === floatingFocusElement,
shouldFocus() {
if (!openRef.current) {
return false;
}
if (hadFocusInside) {
return true;
}
const currentActiveElement = activeElement(doc);
const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);
return !focusMovedInside;
}
});
});
}, [disabled2, open2, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef, dataRef]);
const pendingReturnFocusRef = React23.useRef(null);
useIsoLayoutEffect(() => {
if (disabled2 || !floatingFocusElement) {
pendingReturnFocusRef.current = null;
return void 0;
}
if (pendingReturnFocusRef.current) {
pendingReturnFocusRef.current.cancelled = true;
pendingReturnFocusRef.current = null;
}
const doc = ownerDocument(floatingFocusElement);
const elementFocusedBeforeOpen = activeElement(doc);
const preferPreviousFocus = openInteractionTypeRef.current == null;
addPreviouslyFocusedElement(elementFocusedBeforeOpen);
function onOpenChangeLocal(details) {
if (!details.open) {
closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);
}
if (details.reason === reason_parts_exports.focusOut && details.triggerElement?.hasAttribute(createAttribute("focus-guard")) || details.reason === reason_parts_exports.triggerHover && details.nativeEvent.type === "mouseleave") {
preventReturnFocusRef.current = true;
}
if (details.reason !== reason_parts_exports.outsidePress) {
return;
}
if (details.nested) {
preventReturnFocusRef.current = false;
} else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {
preventReturnFocusRef.current = false;
} else {
let isPreventScrollSupported = false;
ownerDocument(floatingFocusElement).createElement("div").focus({
get preventScroll() {
isPreventScrollSupported = true;
return false;
}
});
if (isPreventScrollSupported) {
preventReturnFocusRef.current = false;
} else {
preventReturnFocusRef.current = true;
}
}
}
events.on("openchange", onOpenChangeLocal);
function getReturnElement(closeType) {
const returnFocusValueOrFn = returnFocusRef.current;
let resolvedReturnFocusValue = typeof returnFocusValueOrFn === "function" ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;
if (resolvedReturnFocusValue === void 0 || resolvedReturnFocusValue === false) {
return null;
}
if (resolvedReturnFocusValue === null) {
resolvedReturnFocusValue = true;
}
const referenceReturnElement = domReference?.isConnected ? domReference : null;
const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== "body" ? elementFocusedBeforeOpen : null;
let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;
if (!defaultReturnElement) {
defaultReturnElement = getPreviouslyFocusedElement() || null;
}
if (typeof resolvedReturnFocusValue === "boolean") {
return defaultReturnElement;
}
return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;
}
return () => {
events.off("openchange", onOpenChangeLocal);
const activeEl = activeElement(doc);
const insideElements = getResolvedInsideElements();
const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some((element) => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some((node) => contains(node.context?.elements.floating, activeEl));
const returnFocusValueOrFn = returnFocusRef.current;
const closeType = closeTypeRef.current;
const returnElement = getReturnElement(closeType);
const job = {
cancelled: false
};
pendingReturnFocusRef.current = job;
queueMicrotask(() => {
if (pendingReturnFocusRef.current === job) {
pendingReturnFocusRef.current = null;
}
const tabbableReturnElement = getFirstTabbableElement(returnElement);
const hasExplicitReturnFocus = (
// eslint-disable-next-line react-hooks/exhaustive-deps
explicitReturnFocusRef.current ?? typeof returnFocusValueOrFn !== "boolean"
);
if (!job.cancelled && returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus
// since it likely entered a different element which should be
// respected: https://github.com/floating-ui/floating-ui/issues/2607
(!hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {
const focusOptions = {
preventScroll: true
};
if (closeType === "keyboard") {
focusOptions.focusVisible = true;
}
tabbableReturnElement.focus(focusOptions);
}
preventReturnFocusRef.current = false;
});
};
}, [disabled2, floating, floatingFocusElement, returnFocusRef, explicitReturnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);
useIsoLayoutEffect(() => {
if (!parts_exports.engine.webkit || open2 || !floating) {
return;
}
const activeEl = activeElement(ownerDocument(floating));
if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {
return;
}
if (contains(floating, activeEl)) {
activeEl.blur();
}
}, [open2, floating]);
useIsoLayoutEffect(() => {
if (disabled2 || !portalContext) {
return void 0;
}
portalContext.setFocusManagerState({
modal,
closeOnFocusOut,
open: open2,
onOpenChange: store.setOpen,
domReference
});
return () => {
portalContext.setFocusManagerState(null);
};
}, [disabled2, portalContext, modal, open2, store, closeOnFocusOut, domReference]);
useIsoLayoutEffect(() => {
if (disabled2 || !floatingFocusElement) {
return void 0;
}
handleTabIndex(floatingFocusElement);
return () => {
queueMicrotask(clearDisconnectedPreviouslyFocusedElements);
};
}, [disabled2, floatingFocusElement]);
const shouldRenderGuards = !disabled2 && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React23.Fragment, {
children: [shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FocusGuard, {
"data-type": "inside",
ref: mergedBeforeGuardRef,
onFocus: (event) => {
if (modal) {
const els = getTabbableContent();
void enqueueFocus(els[els.length - 1]);
} else if (portalContext?.portalNode) {
preventReturnFocusRef.current = false;
if (isOutsideEvent(event, portalContext.portalNode)) {
const nextTabbable = getNextTabbable(domReference);
nextTabbable?.focus();
} else {
resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
}
}
}
}), children, shouldRenderGuards && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FocusGuard, {
"data-type": "inside",
ref: mergedAfterGuardRef,
onFocus: (event) => {
if (modal) {
void enqueueFocus(getTabbableContent()[0]);
} else if (portalContext?.portalNode) {
if (closeOnFocusOut) {
preventReturnFocusRef.current = true;
}
if (isOutsideEvent(event, portalContext.portalNode)) {
const prevTabbable = getPreviousTabbable(domReference);
prevTabbable?.focus();
} else {
resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
}
}
}
})]
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
var React24 = __toESM(require_react(), 1);
function useClick(store, props = {}) {
const {
enabled = true,
event: eventOption = "click",
toggle = true,
ignoreMouse = false,
stickIfOpen = true,
touchOpenDelay = 0,
reason = reason_parts_exports.triggerPress
} = props;
const dataRef = store.context.dataRef;
const pointerTypeRef = React24.useRef(void 0);
const frame = useAnimationFrame();
const touchOpenTimeout = useTimeout();
const reference = React24.useMemo(() => {
function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
const details = createChangeEventDetails(reason, nativeEvent, target);
if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) {
touchOpenTimeout.start(touchOpenDelay, () => {
store.setOpen(true, details);
});
} else {
store.setOpen(nextOpen, details);
}
}
function getNextOpen(open2, currentTarget, isClickLikeOpenEvent2) {
const openEvent = dataRef.current.openEvent;
const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
if (open2 && hasClickedOnInactiveTrigger) {
return true;
}
if (!open2) {
return true;
}
if (!toggle) {
return true;
}
if (openEvent && (typeof stickIfOpen === "function" ? stickIfOpen() : stickIfOpen)) {
return !isClickLikeOpenEvent2(openEvent.type);
}
return false;
}
return {
onPointerDown(event) {
pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
},
onMouseDown(event) {
const pointerType = pointerTypeRef.current;
const nativeEvent = event.nativeEvent;
const open2 = store.select("open");
if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) {
return;
}
const nextOpen = getNextOpen(open2, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
const target = getTarget(nativeEvent);
const isTypeable = isTypeableElement(target);
if (isTypeable || pointerType === "virtual") {
setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
return;
}
const eventCurrentTarget = event.currentTarget;
frame.request(() => {
setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
});
},
onClick(event) {
if (eventOption === "mousedown-only") {
return;
}
const pointerType = pointerTypeRef.current;
if (eventOption === "mousedown" && pointerType) {
pointerTypeRef.current = void 0;
return;
}
if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {
return;
}
const open2 = store.select("open");
const nextOpen = getNextOpen(open2, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup");
setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);
},
onKeyDown() {
pointerTypeRef.current = void 0;
}
};
}, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);
return React24.useMemo(() => enabled ? {
reference
} : EMPTY_OBJECT, [enabled, reference]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs
var React25 = __toESM(require_react(), 1);
function createVirtualElement(domElement, data) {
let offsetX = null;
let offsetY = null;
let isAutoUpdateEvent = false;
return {
contextElement: domElement || void 0,
getBoundingClientRect() {
const domRect = domElement?.getBoundingClientRect() || {
width: 0,
height: 0,
x: 0,
y: 0
};
const isXAxis = data.axis === "x" || data.axis === "both";
const isYAxis = data.axis === "y" || data.axis === "both";
const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch";
const width = data.axis === "y" ? domRect.width : 0;
const height = data.axis === "x" ? domRect.height : 0;
let x = domRect.x;
let y = domRect.y;
if (offsetX == null && data.x && isXAxis) {
offsetX = domRect.x - data.x;
}
if (offsetY == null && data.y && isYAxis) {
offsetY = domRect.y - data.y;
}
x -= offsetX || 0;
y -= offsetY || 0;
if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {
x = isXAxis && data.x != null ? data.x : x;
y = isYAxis && data.y != null ? data.y : y;
}
isAutoUpdateEvent = true;
return {
width,
height,
x,
y,
top: y,
right: x + width,
bottom: y + height,
left: x
};
}
};
}
function isMouseBasedEvent(event) {
return event != null && event.clientX != null;
}
function useClientPoint(store, props = {}) {
const {
enabled = true,
axis = "both"
} = props;
const open2 = store.useState("open");
const floating = store.useState("floatingElement");
const domReference = store.useState("domReferenceElement");
const dataRef = store.context.dataRef;
const initialRef = React25.useRef(false);
const cleanupListenerRef = React25.useRef(null);
const [pointerType, setPointerType] = React25.useState();
const [reactive, setReactive] = React25.useState([]);
const resetReference = useStableCallback((reference2) => {
store.set("positionReference", reference2);
});
const setReference = useStableCallback((newX, newY, referenceElement) => {
if (initialRef.current) {
return;
}
if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {
return;
}
store.set("positionReference", createVirtualElement(referenceElement ?? domReference, {
x: newX,
y: newY,
axis,
dataRef,
pointerType
}));
});
const handleReferenceEnterOrMove = useStableCallback((event) => {
if (!open2) {
setReference(event.clientX, event.clientY, event.currentTarget);
} else if (!cleanupListenerRef.current) {
setReference(event.clientX, event.clientY, event.currentTarget);
setReactive([]);
}
});
const openCheck = isMouseLikePointerType(pointerType) ? floating : open2;
React25.useEffect(() => {
if (!enabled) {
resetReference(domReference);
return void 0;
}
if (!openCheck) {
return void 0;
}
function cleanupListener() {
cleanupListenerRef.current?.();
cleanupListenerRef.current = null;
}
const win = getWindow(floating);
function handleMouseMove(event) {
const target = getTarget(event);
if (!contains(floating, target)) {
setReference(event.clientX, event.clientY);
} else {
cleanupListener();
}
}
if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {
cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove);
} else {
resetReference(domReference);
}
return cleanupListener;
}, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]);
React25.useEffect(() => () => {
store.set("positionReference", null);
}, [store]);
React25.useEffect(() => {
if (enabled && !floating) {
initialRef.current = false;
}
}, [enabled, floating]);
React25.useEffect(() => {
if (!enabled && open2) {
initialRef.current = true;
}
}, [enabled, open2]);
const reference = React25.useMemo(() => {
function setPointerTypeRef(event) {
setPointerType(event.pointerType);
}
return {
onPointerDown: setPointerTypeRef,
onPointerEnter: setPointerTypeRef,
onMouseMove: handleReferenceEnterOrMove,
onMouseEnter: handleReferenceEnterOrMove
};
}, [handleReferenceEnterOrMove]);
return React25.useMemo(() => enabled ? {
reference,
trigger: reference
} : {}, [enabled, reference]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs
var React26 = __toESM(require_react(), 1);
function alwaysFalse() {
return false;
}
function normalizeProp(normalizable) {
return {
escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false,
outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true
};
}
function useDismiss(store, props = {}) {
const {
enabled = true,
escapeKey: escapeKey2 = true,
outsidePress: outsidePressProp = true,
outsidePressEvent = "sloppy",
referencePress = alwaysFalse,
bubbles,
externalTree
} = props;
const open2 = store.useState("open");
const floatingElement = store.useState("floatingElement");
const {
dataRef,
events
} = store.context;
const tree = useFloatingTree(externalTree);
const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
const outsidePressEnabled = outsidePress2 !== false;
const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
const {
escapeKey: escapeKeyBubbles,
outsidePress: outsidePressBubbles
} = normalizeProp(bubbles);
const pressStartedInsideRef = React26.useRef(false);
const pressStartPreventedRef = React26.useRef(false);
const suppressNextOutsideClickRef = React26.useRef(false);
const sawPressWhileOpenRef = React26.useRef(false);
const isComposingRef = React26.useRef(false);
const currentPointerTypeRef = React26.useRef("");
const touchStateRef = React26.useRef(null);
const cancelDismissOnEndTimeout = useTimeout();
const clearInsideReactTreeTimeout = useTimeout();
const compositionTimeout = useTimeout();
const clearInsideReactTree = useStableCallback(() => {
clearInsideReactTreeTimeout.clear();
dataRef.current.insideReactTree = false;
});
const hasBlockingChild = useStableCallback((bubbleKey) => {
const nodeId = dataRef.current.floatingContext?.nodeId;
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]);
});
const isEventWithinOwnElements = useStableCallback((event) => {
return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"));
});
const closeOnReferencePress = useStableCallback((event) => {
if (!referencePress()) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent));
});
const closeOnEscapeKeyDown = useStableCallback((event) => {
if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") {
return;
}
const native = isReactEvent(event) ? event.nativeEvent : event;
if (isComposingRef.current || native.isComposing) {
return;
}
if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) {
return;
}
const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native);
store.setOpen(false, eventDetails);
if (!eventDetails.isCanceled) {
event.preventDefault();
}
if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
event.stopPropagation();
}
});
const markInsideReactTree = useStableCallback(() => {
dataRef.current.insideReactTree = true;
clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
});
const markPressStartedInsideReactTree = useStableCallback((event) => {
if (!open2 || !enabled || event.button !== 0) {
return;
}
const target = getTarget(event.nativeEvent);
if (!contains(store.select("floatingElement"), target)) {
return;
}
if (!pressStartedInsideRef.current) {
pressStartedInsideRef.current = true;
pressStartPreventedRef.current = false;
}
});
const markInsidePressStartPrevented = useStableCallback((event) => {
if (!open2 || !enabled) {
return;
}
if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {
return;
}
if (pressStartedInsideRef.current) {
pressStartPreventedRef.current = true;
}
});
React26.useEffect(() => {
function handleOpenChange(details) {
if (!details.open) {
sawPressWhileOpenRef.current = false;
}
}
events.on("openchange", handleOpenChange);
return () => {
events.off("openchange", handleOpenChange);
};
}, [events]);
React26.useEffect(() => clearInsideReactTree, [clearInsideReactTree]);
React26.useEffect(() => {
if (!open2 || !enabled) {
if (!open2) {
sawPressWhileOpenRef.current = false;
isComposingRef.current = false;
currentPointerTypeRef.current = "";
touchStateRef.current = null;
}
return clearInsideReactTree;
}
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
const preventedPressSuppressionTimeout = new Timeout();
const doc = ownerDocument(floatingElement);
function handleCompositionStart() {
compositionTimeout.clear();
isComposingRef.current = true;
}
function handleCompositionEnd() {
isComposingRef.current = true;
compositionTimeout.start(
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
// Only apply to WebKit for the test to remain 0ms.
parts_exports.engine.webkit ? 5 : 0,
() => {
isComposingRef.current = false;
}
);
}
function suppressImmediateOutsideClickAfterPreventedStart() {
suppressNextOutsideClickRef.current = true;
preventedPressSuppressionTimeout.start(0, () => {
suppressNextOutsideClickRef.current = false;
});
}
function resetPressStartState() {
pressStartedInsideRef.current = false;
pressStartPreventedRef.current = false;
}
function getOutsidePressEvent() {
const type = currentPointerTypeRef.current;
const computedType = type === "pen" || !type ? "mouse" : type;
const outsidePressEventValue = getOutsidePressEventProp();
const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
if (typeof resolved === "string") {
return resolved;
}
return resolved[computedType];
}
function shouldIgnoreEvent(event) {
const computedOutsidePressEvent = getOutsidePressEvent();
return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click";
}
function isEventWithinFloatingTree(event) {
const nodeId = dataRef.current.floatingContext?.nodeId;
const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating));
return isEventWithinOwnElements(event) || targetIsInsideChildren;
}
function closeOnPressOutside(event) {
if (shouldIgnoreEvent(event)) {
if (event.type !== "click" && !isEventWithinOwnElements(event)) {
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = false;
}
clearInsideReactTree();
return;
}
if (dataRef.current.insideReactTree) {
clearInsideReactTree();
return;
}
const target = getTarget(event);
const inertSelector = `[${createAttribute("inert")}]`;
const targetRoot = isElement(target) ? target.getRootNode() : null;
const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector));
const triggers = store.context.triggerElements;
if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) {
return;
}
let targetRootAncestor = isElement(target) ? target : null;
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
const nextParent = getParentNode(targetRootAncestor);
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
break;
}
targetRootAncestor = nextParent;
}
if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
!contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the
// element was injected after the floating element rendered.
markers.every((marker) => !contains(targetRootAncestor, marker))) {
return;
}
if (isHTMLElement(target) && !("touches" in event)) {
const lastTraversableNode = isLastTraversableNode(target);
const style = getComputedStyle2(target);
const scrollRe = /auto|scroll/;
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
const isScrollableY2 = lastTraversableNode || scrollRe.test(style.overflowY);
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
const canScrollY = isScrollableY2 && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
const isRTL4 = style.direction === "rtl";
const pressedVerticalScrollbar = canScrollY && (isRTL4 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
return;
}
}
if (isEventWithinFloatingTree(event)) {
return;
}
if (getOutsidePressEvent() === "intentional") {
if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {
return;
}
if (suppressNextOutsideClickRef.current) {
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = false;
return;
}
}
if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
return;
}
if (hasBlockingChild("__outsidePressBubbles")) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event));
clearInsideReactTree();
}
function handlePointerDown(event) {
if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
return;
}
closeOnPressOutside(event);
}
function handleTouchStart(event) {
if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
return;
}
const touch = event.touches[0];
if (touch) {
touchStateRef.current = {
startTime: Date.now(),
startX: touch.clientX,
startY: touch.clientY,
dismissOnTouchEnd: false,
dismissOnMouseDown: true
};
cancelDismissOnEndTimeout.start(1e3, () => {
if (touchStateRef.current) {
touchStateRef.current.dismissOnTouchEnd = false;
touchStateRef.current.dismissOnMouseDown = false;
}
});
}
}
function addTargetEventListenerOnce(event, listener) {
const target = getTarget(event);
if (!target) {
return;
}
const unsubscribe2 = addEventListener(target, event.type, () => {
listener(event);
unsubscribe2();
});
}
function handleTouchStartCapture(event) {
currentPointerTypeRef.current = "touch";
addTargetEventListenerOnce(event, handleTouchStart);
}
function closeOnPressOutsideCapture(event) {
cancelDismissOnEndTimeout.clear();
if (event.type === "pointerdown") {
if (event.button === 0) {
sawPressWhileOpenRef.current = true;
}
currentPointerTypeRef.current = event.pointerType;
}
if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
return;
}
addTargetEventListenerOnce(event, (targetEvent) => {
if (targetEvent.type === "pointerdown") {
handlePointerDown(targetEvent);
} else {
closeOnPressOutside(targetEvent);
}
});
}
function handlePressEndCapture(event) {
if (event.type === "pointercancel") {
sawPressWhileOpenRef.current = false;
}
if (!pressStartedInsideRef.current) {
return;
}
const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
resetPressStartState();
if (getOutsidePressEvent() !== "intentional") {
return;
}
if (event.type === "pointercancel") {
if (pressStartedInsideDefaultPrevented) {
suppressImmediateOutsideClickAfterPreventedStart();
}
return;
}
if (isEventWithinFloatingTree(event)) {
return;
}
if (pressStartedInsideDefaultPrevented) {
suppressImmediateOutsideClickAfterPreventedStart();
return;
}
if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
return;
}
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = true;
clearInsideReactTree();
}
function handleTouchMove(event) {
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
return;
}
const touch = event.touches[0];
if (!touch) {
return;
}
const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
if (distance > 5) {
touchStateRef.current.dismissOnTouchEnd = true;
}
if (distance > 10) {
closeOnPressOutside(event);
cancelDismissOnEndTimeout.clear();
touchStateRef.current = null;
}
}
function handleTouchMoveCapture(event) {
addTargetEventListenerOnce(event, handleTouchMove);
}
function handleTouchEnd(event) {
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
return;
}
if (touchStateRef.current.dismissOnTouchEnd) {
closeOnPressOutside(event);
}
cancelDismissOnEndTimeout.clear();
touchStateRef.current = null;
}
function handleTouchEndCapture(event) {
addTargetEventListenerOnce(event, handleTouchEnd);
}
const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, {
capture: true,
passive: true
}), addEventListener(doc, "touchmove", handleTouchMoveCapture, {
capture: true,
passive: true
}), addEventListener(doc, "touchend", handleTouchEndCapture, {
capture: true,
passive: true
})));
return () => {
unsubscribe();
preventedPressSuppressionTimeout.clear();
resetPressStartState();
suppressNextOutsideClickRef.current = false;
};
}, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]);
const reference = React26.useMemo(() => ({
onKeyDown: closeOnEscapeKeyDown,
onPointerDown: closeOnReferencePress,
onClick: closeOnReferencePress
}), [closeOnEscapeKeyDown, closeOnReferencePress]);
const floating = React26.useMemo(() => ({
onKeyDown: closeOnEscapeKeyDown,
// `onMouseDown` may be blocked if `event.preventDefault()` is called in
// `onPointerDown`, such as with <NumberField.ScrubArea>.
// See https://github.com/mui/base-ui/pull/3379
onPointerDown: markInsidePressStartPrevented,
onMouseDown: markInsidePressStartPrevented,
onClickCapture: markInsideReactTree,
onMouseDownCapture(event) {
markInsideReactTree();
markPressStartedInsideReactTree(event);
},
onPointerDownCapture(event) {
markInsideReactTree();
markPressStartedInsideReactTree(event);
},
onMouseUpCapture: markInsideReactTree,
onTouchEndCapture: markInsideReactTree,
onTouchMoveCapture: markInsideReactTree
}), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);
return React26.useMemo(() => enabled ? {
reference,
floating,
trigger: reference
} : {}, [enabled, reference, floating]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupHandle.mjs
var BasePopupHandle = class {
/**
* Stores of every root currently using this handle, in attach order. A handle is meant to be used
* by a single mounted root, but roots can transiently overlap (e.g. during an animated route
* transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
* leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
*/
attachedStores = [];
/**
* Store of the root that currently controls the handle: the most recently attached one still
* mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
*/
attachedStoreValue = null;
/**
* Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
*/
storeListeners = /* @__PURE__ */ new Set();
/**
* Creates a handle backed by the store used while no root is attached.
*
* @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
* so they can render and register without a mounted root. Triggers register into whichever store
* `store` currently resolves to, so while detached they live in this store's trigger map and
* migrate themselves to the root's store (and back) as it attaches/detaches.
* @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
* `MenuHandle.open()` in warning text.
* @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
* registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
* so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
*/
constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
this.fallbackStore = fallbackStore;
this.componentName = componentName;
this.throwOnMissingTrigger = throwOnMissingTrigger;
}
get attachedStore() {
return this.attachedStoreValue;
}
/**
* Store that detached triggers read from: the attached root's store, or an inert fallback store
* used while no root is attached.
* @internal
*/
get store() {
return this.attachedStoreValue ?? this.fallbackStore;
}
/**
* Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
* the handle during render because a handle can be shared by concurrent server-rendered requests.
* @internal
*/
get serverStore() {
return this.fallbackStore;
}
/**
* Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
* when a root attaches or detaches. Returns a function that removes the listener.
* @internal
*/
subscribeStore(listener) {
this.storeListeners.add(listener);
return () => {
this.storeListeners.delete(listener);
};
}
/**
* Points the handle at a root's store and notifies subscribers so detached triggers re-render and
* re-register into it (their registration effect migrates them when the store pointer changes).
* Returns a cleanup function that detaches the store again.
* @internal
*/
attachStore(newStore) {
this.attachedStores.push(newStore);
this.setActiveStore(newStore);
if (true) {
if (this.attachedStores.length > 1) {
const dev = this;
(dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
if (this.attachedStores.length > 1) {
console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
}
});
}
}
return () => {
const index2 = this.attachedStores.lastIndexOf(newStore);
if (index2 !== -1) {
this.attachedStores.splice(index2, 1);
}
this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
};
}
/**
* Sets the store that currently controls the handle and notifies subscribers when it changes, so
* detached triggers re-render and migrate their registration to the new store.
*/
setActiveStore(store) {
if (this.attachedStoreValue !== store) {
this.attachedStoreValue = store;
this.storeListeners.forEach((listener) => {
listener();
});
}
}
/**
* Opens the attached root's store and associates it with the trigger with the given id, or a
* no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
* `open()` method, which only narrows the parameter type.
*
* When a trigger id is given but no matching trigger is registered, anchored popups throw (see
* `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
*
* This method should only be called in an event handler or an effect (not during rendering).
*
* @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
* without associating any trigger.
*/
openByTrigger(triggerId) {
const attachedStore = this.attachedStore;
if (attachedStore === null) {
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
}
return;
}
let triggerElement;
if (triggerId) {
for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
}
triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
}
if (triggerId && !triggerElement) {
if (this.throwOnMissingTrigger) {
throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
}
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
}
}
attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
}
/**
* Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
* while no root is attached. Shared by every concrete handle's public `close()` method.
*
* This method should only be called in an event handler or an effect (not during rendering).
*/
closePopup() {
const attachedStore = this.attachedStore;
if (attachedStore === null) {
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
}
return;
}
attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
var React28 = __toESM(require_react(), 1);
var ReactDOM3 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
function useSyncedFloatingRootContext(options) {
const {
popupStore,
treatPopupAsFloatingElement = false,
floatingRootContext: store,
floatingId,
nested,
onOpenChange
} = options;
const open2 = popupStore.useState("open");
const referenceElement = popupStore.useState("activeTriggerElement");
const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement");
const handleOpenChange = onOpenChange;
popupStore.useSyncedValue("floatingId", floatingId);
useIsoLayoutEffect(() => {
const valuesToSync = {
open: open2,
floatingId,
referenceElement,
floatingElement
};
if (isElement(referenceElement)) {
valuesToSync.domReferenceElement = referenceElement;
}
if (store.state.positionReference === store.state.referenceElement) {
valuesToSync.positionReference = referenceElement;
}
store.update(valuesToSync);
}, [open2, floatingId, referenceElement, floatingElement, store]);
store.context.onOpenChange = handleOpenChange;
store.context.nested = nested;
return store;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs
var React27 = __toESM(require_react(), 1);
function useUnmountAfterClose(parameters) {
const {
open: open2,
ref,
preventUnmountOnClose,
setPreventUnmountOnClose: setPreventUnmountOnCloseParam,
onUnmount,
animateInitialOpen
} = parameters;
const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam);
const {
mounted,
setMounted,
transitionStatus
} = useTransitionStatus(open2, false, false, animateInitialOpen);
const preventUnmountingOnClose = open2 ? false : preventUnmountOnClose;
useIsoLayoutEffect(() => {
if (open2) {
setPreventUnmountOnClose(false);
}
}, [open2, setPreventUnmountOnClose]);
const mountedRef = React27.useRef(mounted);
const pendingUnmountRef = React27.useRef(false);
const rerender = useForcedRerendering();
const unmount = () => {
mountedRef.current = false;
setMounted(false);
onUnmount();
};
useIsoLayoutEffect(() => {
mountedRef.current = mounted;
if (pendingUnmountRef.current) {
pendingUnmountRef.current = false;
if (!open2 && mounted) {
unmount();
}
}
});
const forceUnmount = useStableCallback(() => {
if (!mountedRef.current) {
return;
}
if (open2) {
pendingUnmountRef.current = true;
rerender();
return;
}
unmount();
});
useOpenChangeComplete({
enabled: mounted && !open2 && !preventUnmountingOnClose,
open: open2,
ref,
onComplete() {
if (!open2) {
forceUnmount();
}
}
});
return {
mounted,
transitionStatus,
preventUnmountingOnClose,
forceUnmount
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
var FOCUSABLE_POPUP_PROPS = {
tabIndex: -1,
[FOCUSABLE_ATTRIBUTE]: ""
};
function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {
const floatingId = useId();
const nested = useFloatingParentNodeId() != null;
const store = useRefWithInit(() => createStore(floatingId, nested)).current;
useSyncedFloatingRootContext({
popupStore: store,
treatPopupAsFloatingElement,
floatingRootContext: store.state.floatingRootContext,
floatingId,
nested,
onOpenChange: store.setOpen
});
return store;
}
function PopupHandleAttachment({
handle,
store
}) {
useIsoLayoutEffect(() => {
return handle.attachStore(store);
}, [handle, store]);
return null;
}
function syncTriggerCount(store) {
const triggerCount = store.context.triggerElements.size;
if (store.select("open") && store.state.triggerCount !== triggerCount) {
store.set("triggerCount", triggerCount);
}
}
function useTriggerRegistration(id, store) {
const registrationRef = React28.useRef(null);
return useStableCallback((element) => {
const registration = registrationRef.current;
if (registration !== null) {
if (registration.element === element && registration.store === store && registration.id === id) {
return;
}
registrationRef.current = null;
const registeredStore = registration.store;
if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {
registeredStore.context.triggerElements.delete(registration.id);
syncTriggerCount(registeredStore);
}
}
if (element !== null && id !== void 0) {
registrationRef.current = {
store,
id,
element
};
store.context.triggerElements.add(id, element);
syncTriggerCount(store);
}
});
}
function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) {
let preventUnmountingOnClose = state.preventUnmountingOnClose;
if (open2) {
preventUnmountingOnClose = false;
} else if (preventUnmountOnClose) {
preventUnmountingOnClose = true;
}
const triggerId = trigger?.id ?? null;
let activeTriggerId = state.activeTriggerId;
let activeTriggerElement = state.activeTriggerElement;
if (triggerId || open2) {
activeTriggerId = triggerId;
activeTriggerElement = trigger ?? null;
}
return {
open: open2,
preventUnmountingOnClose,
activeTriggerId,
activeTriggerElement,
// An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not
// be reassociated with a lone registered trigger later on. Controlled and default opens never
// pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a
// controlled root may decline it and stay open, so the Root clears the flag only once the
// popup is effectively closed.
openedWithoutTrigger: open2 ? trigger == null : state.openedWithoutTrigger
};
}
function attachPreventUnmountOnClose(eventDetails) {
let preventUnmountOnClose = false;
eventDetails.preventUnmountOnClose = () => {
preventUnmountOnClose = true;
};
return () => preventUnmountOnClose;
}
function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {
const reason = eventDetails.reason;
const isHover = reason === reason_parts_exports.triggerHover;
const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus;
const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey);
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
store.context.onOpenChange?.(nextOpen, eventDetails);
if (eventDetails.isCanceled) {
return;
}
options.onBeforeDispatch?.();
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
const changeState = () => {
const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
const updatedState = {
...options.extraState,
...popupOpenState
};
if (isFocusOpen) {
updatedState.instantType = "focus";
} else if (isDismissClose) {
updatedState.instantType = "dismiss";
} else if (isHover) {
updatedState.instantType = void 0;
}
store.update(updatedState);
};
if (isHover) {
ReactDOM3.flushSync(changeState);
} else {
changeState();
}
}
function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId);
const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
const applyTriggerData = useStableCallback((element) => {
const open2 = store.select("open");
const activeTriggerId = store.select("activeTriggerId");
if (activeTriggerId === triggerId) {
const changes = {
activeTriggerElement: element,
...open2 ? stateUpdates : null
};
store.update(changes);
return;
}
if (activeTriggerId == null && open2 && !store.state.openedWithoutTrigger) {
const changes = {
activeTriggerId: triggerId ?? null,
activeTriggerElement: element,
...stateUpdates
};
store.update(changes);
}
});
const registerTrigger = useStableCallback((element) => {
baseRegisterTrigger(element);
if (element) {
applyTriggerData(element);
}
});
useIsoLayoutEffect(() => {
registerTrigger(triggerElementRef.current);
return () => registerTrigger(null);
}, [registerTrigger, triggerElementRef, store, triggerId]);
useIsoLayoutEffect(() => {
if (isMountedByThisTrigger) {
const changes = {
activeTriggerElement: triggerElementRef.current,
...stateUpdates
};
store.update(changes);
}
}, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);
return {
registerTrigger,
isMountedByThisTrigger
};
}
function useImplicitActiveTrigger(store, options = {}) {
const {
closeOnActiveTriggerUnmount = false
} = options;
const resolvedActiveTriggerIdRef = React28.useRef(null);
const open2 = store.useState("open");
const reactiveTriggerCount = store.useState("triggerCount");
const activeTriggerId = store.useState("activeTriggerId");
const reactiveActiveTriggerElement = store.useState("activeTriggerElement");
useIsoLayoutEffect(() => {
if (!open2) {
resolvedActiveTriggerIdRef.current = null;
if (store.state.triggerCount !== 0) {
store.set("triggerCount", 0);
}
if (store.state.openedWithoutTrigger) {
store.set("openedWithoutTrigger", false);
}
return;
}
const triggerCount = store.context.triggerElements.size;
const stateUpdates = {};
if (store.state.triggerCount !== triggerCount) {
stateUpdates.triggerCount = triggerCount;
}
const currentActiveTriggerId = store.select("activeTriggerId");
let lostActiveTriggerId = null;
if (currentActiveTriggerId) {
const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);
if (!activeTriggerElement) {
for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {
if (triggerElement === store.state.activeTriggerElement) {
stateUpdates.activeTriggerId = triggerId;
stateUpdates.activeTriggerElement = triggerElement;
resolvedActiveTriggerIdRef.current = triggerId;
break;
}
}
if (stateUpdates.activeTriggerId === void 0) {
if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {
lostActiveTriggerId = currentActiveTriggerId;
} else {
resolvedActiveTriggerIdRef.current = null;
}
}
} else {
resolvedActiveTriggerIdRef.current = currentActiveTriggerId;
if (activeTriggerElement !== store.state.activeTriggerElement) {
stateUpdates.activeTriggerElement = activeTriggerElement;
}
}
} else {
resolvedActiveTriggerIdRef.current = null;
}
if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) {
const iteratorResult = store.context.triggerElements.entries().next();
if (!iteratorResult.done) {
const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
stateUpdates.activeTriggerId = implicitTriggerId;
stateUpdates.activeTriggerElement = implicitTriggerElement;
resolvedActiveTriggerIdRef.current = implicitTriggerId;
}
}
if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) {
store.update(stateUpdates);
}
if (lostActiveTriggerId) {
if (closeOnActiveTriggerUnmount) {
queueMicrotask(() => {
if (store.select("open") && store.select("activeTriggerId") === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {
const eventDetails = createChangeEventDetails(reason_parts_exports.none);
store.setOpen(false, eventDetails);
if (!eventDetails.isCanceled) {
store.update({
activeTriggerId: null,
activeTriggerElement: null
});
}
}
});
}
}
}, [open2, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);
}
function useOpenStateTransitions(open2, store, onUnmount, animateInitialOpen) {
const {
mounted,
transitionStatus,
forceUnmount
} = useUnmountAfterClose({
open: open2,
ref: store.context.popupRef,
preventUnmountOnClose: store.useState("preventUnmountingOnClose"),
setPreventUnmountOnClose: (preventUnmountOnClose) => store.set("preventUnmountingOnClose", preventUnmountOnClose),
animateInitialOpen,
onUnmount() {
store.update({
activeTriggerId: null,
activeTriggerElement: null,
mounted: false,
preventUnmountingOnClose: false
});
onUnmount?.();
store.context.onOpenChangeComplete?.(false);
}
});
useRefWithInit(() => {
store.set("mounted", mounted);
return null;
});
store.useSyncedValues({
mounted,
transitionStatus
});
return {
forceUnmount,
transitionStatus
};
}
function usePopupInteractionProps(store, statePart) {
store.useSyncedValues(statePart);
useIsoLayoutEffect(() => () => {
store.update({
activeTriggerProps: EMPTY_OBJECT,
inactiveTriggerProps: EMPTY_OBJECT,
popupProps: EMPTY_OBJECT
});
}, [store]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs
var devElementIdsByMap;
function getDevElementIds(map) {
devElementIdsByMap ??= /* @__PURE__ */ new WeakMap();
let elementIds = devElementIdsByMap.get(map);
if (!elementIds) {
elementIds = /* @__PURE__ */ new WeakMap();
devElementIdsByMap.set(map, elementIds);
}
return elementIds;
}
var PopupTriggerMap = class {
idMap = /* @__PURE__ */ new Map();
/**
* Adds a trigger element with the given ID.
*
* Note: The provided element is assumed to not be registered under multiple IDs.
*/
add(id, element) {
if (true) {
const elementIds = getDevElementIds(this);
const existingId = elementIds.get(element);
if (existingId !== void 0 && existingId !== id) {
throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
}
const previousElement = this.idMap.get(id);
if (previousElement !== void 0 && previousElement !== element) {
elementIds.delete(previousElement);
}
elementIds.set(element, id);
}
this.idMap.set(id, element);
}
/**
* Removes the trigger element with the given ID.
*/
delete(id) {
if (true) {
const element = this.idMap.get(id);
if (element !== void 0) {
devElementIdsByMap?.get(this)?.delete(element);
}
}
this.idMap.delete(id);
}
/**
* Whether the given element is registered as a trigger.
*/
hasElement(element) {
for (const registered of this.idMap.values()) {
if (registered === element) {
return true;
}
}
return false;
}
/**
* Whether there is a registered trigger element matching the given predicate.
*/
hasMatchingElement(predicate) {
for (const element of this.idMap.values()) {
if (predicate(element)) {
return true;
}
}
return false;
}
/**
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
*/
getById(id) {
return this.idMap.get(id);
}
/**
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
*/
entries() {
return this.idMap.entries();
}
/**
* Returns an iterable of all registered trigger elements.
*/
elements() {
return this.idMap.values();
}
/**
* Returns the number of registered trigger elements.
*/
get size() {
return this.idMap.size;
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/useStore.mjs
var React30 = __toESM(require_react(), 1);
var import_shim = __toESM(require_shim(), 1);
var import_with_selector = __toESM(require_with_selector(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/fastHooks.mjs
var React29 = __toESM(require_react(), 1);
var hooks = [];
var currentInstance = void 0;
function getInstance() {
return currentInstance;
}
function register(hook) {
hooks.push(hook);
}
function fastComponent(fn) {
const FastComponent = (props, forwardedRef) => {
const instance = useRefWithInit(createInstance).current;
let result;
try {
currentInstance = instance;
for (const hook of hooks) {
hook.before(instance);
}
result = fn(props, forwardedRef);
for (const hook of hooks) {
hook.after(instance);
}
instance.didInitialize = true;
} finally {
currentInstance = void 0;
}
return result;
};
FastComponent.displayName = fn.displayName || fn.name;
return FastComponent;
}
function fastComponentRef(fn) {
return /* @__PURE__ */ React29.forwardRef(fastComponent(fn));
}
function createInstance() {
return {
didInitialize: false
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/useStore.mjs
var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
function useStore(store, selector, a1, a2, a3) {
return useStoreImplementation(store, selector, a1, a2, a3);
}
function useStoreR19(store, selector, a1, a2, a3) {
const getSelection = React30.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);
return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
}
register({
before(instance) {
instance.syncIndex = 0;
if (!instance.didInitialize) {
instance.syncTick = 1;
instance.syncHooks = [];
instance.didChangeStore = true;
instance.getSnapshot = () => {
let didChange2 = false;
for (let i = 0; i < instance.syncHooks.length; i += 1) {
const hook = instance.syncHooks[i];
const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
if (!Object.is(hook.value, value)) {
didChange2 = true;
hook.value = value;
}
}
if (didChange2) {
instance.syncTick += 1;
}
return instance.syncTick;
};
}
},
after(instance) {
if (instance.syncHooks.length > 0) {
if (instance.didChangeStore) {
instance.didChangeStore = false;
instance.subscribe = (onStoreChange) => {
const stores = /* @__PURE__ */ new Set();
for (const hook of instance.syncHooks) {
stores.add(hook.store);
}
const unsubscribes = [];
for (const store of stores) {
unsubscribes.push(store.subscribe(onStoreChange));
}
return () => {
for (const unsubscribe of unsubscribes) {
unsubscribe();
}
};
};
}
(0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
}
}
});
function useStoreFast(store, selector, a1, a2, a3) {
const instance = getInstance();
if (!instance) {
return useStoreR19(store, selector, a1, a2, a3);
}
const index2 = instance.syncIndex;
instance.syncIndex += 1;
let hook;
if (!instance.didInitialize) {
hook = {
store,
selector,
a1,
a2,
a3,
value: selector(store.getSnapshot(), a1, a2, a3)
};
instance.syncHooks.push(hook);
} else {
hook = instance.syncHooks[index2];
if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
if (hook.store !== store) {
instance.didChangeStore = true;
}
hook.store = store;
hook.selector = selector;
hook.a1 = a1;
hook.a2 = a2;
hook.a3 = a3;
hook.value = selector(store.getSnapshot(), a1, a2, a3);
}
}
return hook.value;
}
function useStoreLegacy(store, selector, a1, a2, a3) {
return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3));
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/Store.mjs
var Store = class {
/**
* Creates a store with the given initial state, constructing the class it is called on.
* Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that
* class but degrades the inferred instance type to `Store`; use `new` there instead.
*/
static create(state) {
return new this(state);
}
/**
* The current state of the store.
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
*
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
*/
// Internal state to handle recursive `setState()` calls
constructor(state) {
this.state = state;
this.listeners = /* @__PURE__ */ new Set();
this.updateTick = 0;
}
/**
* Registers a listener that will be called whenever the store's state changes.
*
* @param fn The listener function to be called on state changes.
* @returns A function to unsubscribe the listener.
*/
subscribe = (fn) => {
this.listeners.add(fn);
return () => {
this.listeners.delete(fn);
};
};
/**
* Returns the current state of the store.
*/
getSnapshot = () => {
return this.state;
};
/**
* Updates the entire store's state and notifies all registered listeners.
*
* @param newState The new state to set for the store.
*/
setState(newState) {
if (this.state === newState) {
return;
}
this.state = newState;
this.updateTick += 1;
const currentTick = this.updateTick;
for (const listener of this.listeners) {
if (currentTick !== this.updateTick) {
return;
}
listener(newState);
}
}
/**
* Merges the provided changes into the current state and notifies listeners if there are changes.
* Each value must match its state key. Pass an exact known subset rather than a broad
* `Partial<State>`, which may contain `undefined` for required state fields.
*
* @param changes An object containing the changes to apply to the current state.
*/
update(changes) {
for (const key in changes) {
if (!Object.is(this.state[key], changes[key])) {
this.setState({
...this.state,
...changes
});
return;
}
}
}
/**
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
*
* @param key The key in the store's state to update.
* @param value The new value to set for the specified key.
*/
set(key, value) {
if (!Object.is(this.state[key], value)) {
this.setState({
...this.state,
[key]: value
});
}
}
/**
* Gives the state a new reference and updates all registered listeners.
*/
notifyAll() {
const newState = {
...this.state
};
this.setState(newState);
}
use(selector, a1, a2, a3) {
return useStore(this, selector, a1, a2, a3);
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/ReactStore.mjs
var React31 = __toESM(require_react(), 1);
var ReactStore = class extends Store {
/**
* Creates a new ReactStore instance.
*
* @param state Initial state of the store.
* @param context Non-reactive context values.
* @param selectors Optional selectors for use with `useState`.
*/
constructor(state, context = {}, selectors4) {
super(state);
this.context = context;
this.selectors = selectors4;
}
/**
* Non-reactive values such as refs, callbacks, etc.
*/
/**
* Synchronizes a single external value into the store.
*
* Note that the while the value in `state` is updated immediately, the value returned
* by `useState` is updated before the next render (similarly to React's `useState`).
*/
useSyncedValue(key, value) {
React31.useDebugValue(key);
const store = this;
useIsoLayoutEffect(() => {
if (store.state[key] !== value) {
store.set(key, value);
}
}, [store, key, value]);
}
/**
* Synchronizes a single external value into the store and
* cleans it up (sets to `undefined`) on unmount.
*
* Note that the while the value in `state` is updated immediately, the value returned
* by `useState` is updated before the next render (similarly to React's `useState`).
*/
useSyncedValueWithCleanup(key, value) {
const store = this;
useIsoLayoutEffect(() => {
if (store.state[key] !== value) {
store.set(key, value);
}
return () => {
store.set(key, void 0);
};
}, [store, key, value]);
}
/**
* Synchronizes multiple external values into the store.
* Each value must match its state key. Pass an exact known subset rather than a broad
* `Partial<State>`, which may contain `undefined` for required state fields.
*
* Note that the while the values in `state` are updated immediately, the values returned
* by `useState` are updated before the next render (similarly to React's `useState`).
*
* @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.
*/
useSyncedValues(statePart) {
const store = this;
if (true) {
React31.useDebugValue(statePart, (p) => Object.keys(p));
const keys = React31.useRef(Object.keys(statePart)).current;
const nextKeys = Object.keys(statePart);
if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) {
console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
}
}
const dependencies = Object.values(statePart);
useIsoLayoutEffect(() => {
store.update(statePart);
}, [store, ...dependencies]);
}
/**
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
* is non-undefined, the store's state at `key` is updated to match `controlled`.
*/
useControlledProp(key, controlled) {
React31.useDebugValue(key);
const store = this;
const isControlled = controlled !== void 0;
useIsoLayoutEffect(() => {
if (isControlled && !Object.is(store.state[key], controlled)) {
store.setState({
...store.state,
[key]: controlled
});
}
}, [store, key, controlled, isControlled]);
if (true) {
const cache = this.controlledValues ??= /* @__PURE__ */ new Map();
if (!cache.has(key)) {
cache.set(key, isControlled);
}
const previouslyControlled = cache.get(key);
if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) {
console.error(`A component is changing the ${previouslyControlled ? "" : "un"}controlled state of ${key.toString()} to be ${previouslyControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
}
}
}
/** Gets the current value from the store using a selector with the provided key.
*
* @param key Key of the selector to use.
*/
select(key, a1, a2, a3) {
const selector = this.selectors[key];
return selector(this.state, a1, a2, a3);
}
/**
* Returns a value from the store's state using a selector function.
* Used to subscribe to specific parts of the state.
* This methods causes a rerender whenever the selected state changes.
*
* @param key Key of the selector to use.
*/
useState(key, a1, a2, a3) {
React31.useDebugValue(key);
return useStore(this, this.selectors[key], a1, a2, a3);
}
/**
* Wraps a function with `useStableCallback` to ensure it has a stable reference
* and assigns it to the context.
*
* @param key Key of the event callback. Must be a function in the context.
* @param fn Function to assign.
*/
useContextCallback(key, fn) {
React31.useDebugValue(key);
const stableFunction = useStableCallback(fn ?? NOOP);
this.context[key] = stableFunction;
}
/**
* Returns a stable setter function for a specific key in the store's state.
* It's commonly used to pass as a ref callback to React elements.
*
* @param key Key of the state to set.
*/
useStateSetter(key) {
const ref = React31.useRef(void 0);
if (ref.current === void 0) {
ref.current = (value) => {
this.set(key, value);
};
}
return ref.current;
}
/**
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
*
* @param key Key of the selector to observe.
* @param listener Listener function called when the selector result changes.
*/
observe(selector, listener) {
let selectFn;
if (typeof selector === "function") {
selectFn = selector;
} else {
selectFn = this.selectors[selector];
}
let prevValue = selectFn(this.state);
listener(prevValue, prevValue, this);
return this.subscribe((nextState) => {
const nextValue = selectFn(nextState);
if (!Object.is(prevValue, nextValue)) {
const oldValue = prevValue;
prevValue = nextValue;
listener(nextValue, oldValue, this);
}
});
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs
var selectors = {
open: (state) => state.open,
transitionStatus: (state) => state.transitionStatus,
domReferenceElement: (state) => state.domReferenceElement,
referenceElement: (state) => state.positionReference ?? state.referenceElement,
floatingElement: (state) => state.floatingElement,
floatingId: (state) => state.floatingId
};
var FloatingRootStore = class extends ReactStore {
constructor(options) {
const {
syncOnly,
nested,
onOpenChange,
triggerElements,
...initialState
} = options;
super({
...initialState,
positionReference: initialState.referenceElement,
domReferenceElement: initialState.referenceElement
}, {
onOpenChange,
dataRef: {
current: {}
},
events: createEventEmitter(),
nested,
triggerElements
}, selectors);
this.syncOnly = syncOnly;
}
/**
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
*/
syncOpenEvent = (newOpen, event) => {
if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
// click events to upgrade a hover-open.
event != null && isClickLikeEvent(event)) {
this.context.dataRef.current.openEvent = newOpen ? event : void 0;
}
};
/**
* Runs the root-owned side effects for an open state change.
*/
dispatchOpenChange = (newOpen, eventDetails) => {
this.syncOpenEvent(newOpen, eventDetails.event);
const details = {
open: newOpen,
reason: eventDetails.reason,
nativeEvent: eventDetails.event,
nested: this.context.nested,
triggerElement: eventDetails.trigger
};
this.context.events.emit("openchange", details);
};
/**
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
*
* @param newOpen The new open state.
* @param eventDetails Details about the event that triggered the open state change.
*/
setOpen = (newOpen, eventDetails) => {
if (this.syncOnly) {
this.context.onOpenChange?.(newOpen, eventDetails);
return;
}
this.dispatchOpenChange(newOpen, eventDetails);
this.context.onOpenChange?.(newOpen, eventDetails);
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/store.mjs
function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
return {
open: false,
openProp: void 0,
mounted: false,
transitionStatus: void 0,
floatingRootContext: new FloatingRootStore({
open: false,
transitionStatus: void 0,
floatingElement: null,
referenceElement: null,
triggerElements,
floatingId,
syncOnly: true,
nested,
onOpenChange: void 0
}),
floatingId,
triggerCount: 0,
preventUnmountingOnClose: false,
payload: void 0,
activeTriggerId: null,
activeTriggerElement: null,
openedWithoutTrigger: false,
triggerIdProp: void 0,
popupElement: null,
positionerElement: null,
activeTriggerProps: EMPTY_OBJECT,
inactiveTriggerProps: EMPTY_OBJECT,
popupProps: EMPTY_OBJECT
};
}
var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
var openSelector = (state) => state.openProp ?? state.open;
var popupIdSelector = (state) => {
const popupId = state.popupElement?.id ?? state.floatingId;
return popupId || void 0;
};
function triggerOwnsOpenPopup(state, triggerId) {
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
}
function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
if (triggerOwnsOpenPopup(state, triggerId)) {
return true;
}
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1;
}
var popupStoreSelectors = {
open: openSelector,
mounted: (state) => state.mounted,
// `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a
// layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase.
transitionStatus: (state) => openSelector(state) && !state.mounted ? "starting" : state.transitionStatus,
floatingRootContext: (state) => state.floatingRootContext,
triggerCount: (state) => state.triggerCount,
preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
payload: (state) => state.payload,
activeTriggerId: activeTriggerIdSelector,
activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
popupId: popupIdSelector,
/**
* Whether the trigger with the given ID was used to open the popup.
*/
isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
/**
* Whether the popup is open and was activated by a trigger with the given ID.
*/
isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
/**
* Whether the popup is mounted and was activated by a trigger with the given ID.
*/
isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
/**
* Popup id for the trigger that currently owns the open popup.
*/
triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
popupProps: (state) => state.popupProps,
popupElement: (state) => state.popupElement,
positionerElement: (state) => state.positionerElement
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
var React32 = __toESM(require_react(), 1);
var import_shim2 = __toESM(require_shim(), 1);
function usePopupHandleStore(handle) {
const subscribe = React32.useCallback((listener) => {
if (handle === void 0) {
return NOOP;
}
return handle.subscribeStore(listener);
}, [handle]);
const getSnapshot = React32.useCallback(() => {
return handle === void 0 ? void 0 : handle.store;
}, [handle]);
return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs
function useFloatingRootContext(options) {
const {
open: open2 = false,
onOpenChange,
elements = {}
} = options;
const floatingId = useId();
const nested = useFloatingParentNodeId() != null;
if (true) {
const optionDomReference = elements.reference;
if (optionDomReference && !isElement(optionDomReference)) {
console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
}
}
const store = useRefWithInit(() => new FloatingRootStore({
open: open2,
transitionStatus: void 0,
onOpenChange,
referenceElement: elements.reference ?? null,
floatingElement: elements.floating ?? null,
triggerElements: new PopupTriggerMap(),
floatingId,
syncOnly: false,
nested
})).current;
useIsoLayoutEffect(() => {
const valuesToSync = {
open: open2,
floatingId
};
if (elements.reference !== void 0) {
valuesToSync.referenceElement = elements.reference;
valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;
}
if (elements.floating !== void 0) {
valuesToSync.floatingElement = elements.floating;
}
store.update(valuesToSync);
}, [open2, floatingId, elements.reference, elements.floating, store]);
store.context.onOpenChange = onOpenChange;
store.context.nested = nested;
return store;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs
var React33 = __toESM(require_react(), 1);
var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit;
function useFocus(store, props = {}) {
const {
enabled = true,
delay
} = props;
const {
events,
dataRef
} = store.context;
const blockFocusRef = React33.useRef(false);
const blockedReferenceRef = React33.useRef(null);
const keyboardModalityRef = React33.useRef(true);
const timeout = useTimeout();
React33.useEffect(() => {
const domReference = store.select("domReferenceElement");
if (!enabled) {
return void 0;
}
const win = getWindow(domReference);
function onBlur() {
const currentDomReference = store.select("domReferenceElement");
if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
blockFocusRef.current = true;
blockedReferenceRef.current = currentDomReference;
}
}
function onKeyDown() {
keyboardModalityRef.current = true;
}
function onPointerDown() {
keyboardModalityRef.current = false;
}
return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true));
}, [store, enabled]);
React33.useEffect(() => {
if (!enabled) {
return void 0;
}
function onOpenChangeLocal(details) {
if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) {
const referenceElement = store.select("domReferenceElement");
if (isElement(referenceElement)) {
blockedReferenceRef.current = referenceElement;
blockFocusRef.current = true;
}
}
}
events.on("openchange", onOpenChangeLocal);
return () => {
events.off("openchange", onOpenChangeLocal);
};
}, [events, enabled, store]);
const reference = React33.useMemo(() => {
function resetBlockedFocus() {
blockFocusRef.current = false;
blockedReferenceRef.current = null;
}
return {
onMouseLeave() {
resetBlockedFocus();
},
onFocus(event) {
const focusTarget = event.currentTarget;
if (blockFocusRef.current) {
if (blockedReferenceRef.current === focusTarget) {
return;
}
resetBlockedFocus();
}
const target = getTarget(event.nativeEvent);
if (isElement(target)) {
if (isMacSafari && !event.relatedTarget) {
if (!keyboardModalityRef.current && !isTypeableElement(target)) {
return;
}
} else if (!matchesFocusVisible(target)) {
return;
}
}
const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
const {
nativeEvent,
currentTarget
} = event;
if (store.select("open") && movedFromOtherEnabledTrigger || !delay) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
return;
}
timeout.start(delay, () => {
if (blockFocusRef.current) {
return;
}
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
});
},
onBlur(event) {
resetBlockedFocus();
const relatedTarget = event.relatedTarget;
const nativeEvent = event.nativeEvent;
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
timeout.start(0, () => {
const domReference = store.select("domReferenceElement");
const activeEl = activeElement(ownerDocument(domReference));
if (!relatedTarget && activeEl === domReference) {
return;
}
if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
return;
}
const nextFocusedElement = relatedTarget ?? activeEl;
if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent));
});
}
};
}, [dataRef, delay, store, timeout]);
return React33.useMemo(() => enabled ? {
reference,
trigger: reference
} : {}, [enabled, reference]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
var React34 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs
var HoverInteraction = class _HoverInteraction {
pointerType = void 0;
interactedInside = false;
handler = void 0;
blockMouseMove = true;
performedPointerEventsMutation = false;
pointerEventsScopeElement = null;
pointerEventsReferenceElement = null;
pointerEventsFloatingElement = null;
restTimeoutPending = false;
openChangeTimeout = new Timeout();
restTimeout = new Timeout();
handleCloseOptions = void 0;
static create() {
return new _HoverInteraction();
}
dispose = () => {
this.openChangeTimeout.clear();
this.restTimeout.clear();
};
disposeEffect = () => {
return this.dispose;
};
};
var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap();
function clearSafePolygonPointerEventsMutation(instance) {
if (!instance.performedPointerEventsMutation) {
return;
}
const scopeElement = instance.pointerEventsScopeElement;
if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {
instance.pointerEventsScopeElement?.style.removeProperty("pointer-events");
instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events");
instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events");
pointerEventsMutationOwnerByScopeElement.delete(scopeElement);
}
instance.performedPointerEventsMutation = false;
instance.pointerEventsScopeElement = null;
instance.pointerEventsReferenceElement = null;
instance.pointerEventsFloatingElement = null;
}
function applySafePolygonPointerEventsMutation(instance, options) {
const {
scopeElement,
referenceElement,
floatingElement
} = options;
const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);
if (existingOwner && existingOwner !== instance) {
clearSafePolygonPointerEventsMutation(existingOwner);
}
clearSafePolygonPointerEventsMutation(instance);
instance.performedPointerEventsMutation = true;
instance.pointerEventsScopeElement = scopeElement;
instance.pointerEventsReferenceElement = referenceElement;
instance.pointerEventsFloatingElement = floatingElement;
pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);
scopeElement.style.pointerEvents = "none";
referenceElement.style.pointerEvents = "auto";
floatingElement.style.pointerEvents = "auto";
}
function useHoverInteractionSharedState(store) {
const data = store.context.dataRef.current;
const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;
if (!data.hoverInteractionState) {
data.hoverInteractionState = instance;
}
useOnMount(data.hoverInteractionState.disposeEffect);
return data.hoverInteractionState;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
function useHoverFloatingInteraction(store, parameters = {}) {
const {
enabled = true,
closeDelay: closeDelayProp = 0,
nodeId: nodeIdProp
} = parameters;
const open2 = store.useState("open");
const floatingElement = store.useState("floatingElement");
const domReferenceElement = store.useState("domReferenceElement");
const {
dataRef
} = store.context;
const tree = useFloatingTree();
const parentId = useFloatingParentNodeId();
const instance = useHoverInteractionSharedState(store);
const childClosedTimeout = useTimeout();
const isClickLikeOpenEvent2 = useStableCallback(() => {
return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
});
const isHoverOpen = useStableCallback(() => {
return isHoverOpenEvent(dataRef.current.openEvent?.type);
});
const clearPointerEvents = useStableCallback(() => {
clearSafePolygonPointerEventsMutation(instance);
});
useIsoLayoutEffect(() => {
if (!open2) {
instance.pointerType = void 0;
instance.restTimeoutPending = false;
instance.interactedInside = false;
clearPointerEvents();
}
}, [open2, instance, clearPointerEvents]);
React34.useEffect(() => {
return clearPointerEvents;
}, [clearPointerEvents]);
useIsoLayoutEffect(() => {
if (!enabled) {
return void 0;
}
if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {
const ref = domReferenceElement;
const floatingEl = floatingElement;
const doc = ownerDocument(floatingElement);
const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating;
if (parentFloating) {
parentFloating.style.pointerEvents = "";
}
const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;
const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;
const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, "[data-rootownerid]") ?? doc.body;
applySafePolygonPointerEventsMutation(instance, {
scopeElement,
referenceElement: ref,
floatingElement: floatingEl
});
return () => {
clearPointerEvents();
};
}
return void 0;
}, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);
React34.useEffect(() => {
if (!enabled) {
return void 0;
}
function hasParentChildren() {
return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);
}
function closeWithDelay(event) {
const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType);
const close = () => {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
};
if (closeDelay) {
instance.openChangeTimeout.start(closeDelay, close);
} else {
instance.openChangeTimeout.clear();
close();
}
}
function handleInteractInside(event) {
const target = getTarget(event);
if (!isInteractiveElement(target)) {
instance.interactedInside = false;
return;
}
instance.interactedInside = closest(target, "[aria-haspopup]") != null;
}
function onFloatingMouseEnter() {
instance.openChangeTimeout.clear();
childClosedTimeout.clear();
tree?.events.off("floating.closed", onNodeClosed);
clearPointerEvents();
}
function onFloatingMouseLeave(event) {
if (hasParentChildren() && tree) {
tree.events.on("floating.closed", onNodeClosed);
return;
}
if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
return;
}
const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;
const relatedTarget = event.relatedTarget;
const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget));
if (isMovingIntoDescendantFloating) {
return;
}
if (instance.handler) {
instance.handler(event);
return;
}
clearPointerEvents();
if (isHoverOpen() && !isClickLikeOpenEvent2()) {
closeWithDelay(event);
}
}
function onNodeClosed(event) {
if (!tree || !parentId || hasParentChildren()) {
return;
}
childClosedTimeout.start(0, () => {
tree.events.off("floating.closed", onNodeClosed);
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree.events.emit("floating.closed", event);
});
}
const floating = floatingElement;
return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => {
tree?.events.off("floating.closed", onNodeClosed);
});
}, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs
var React35 = __toESM(require_react(), 1);
var ReactDOM4 = __toESM(require_react_dom(), 1);
var EMPTY_REF = {
current: null
};
function useHoverReferenceInteraction(store, props = {}) {
const {
enabled = true,
delay = 0,
handleClose = null,
mouseOnly = false,
restMs = 0,
move = true,
triggerElementRef = EMPTY_REF,
externalTree,
isActiveTrigger = true,
getHandleCloseContext,
isClosing,
shouldOpen: shouldOpenProp,
guardStaleOpen = false
} = props;
const {
dataRef,
events
} = store.context;
const tree = useFloatingTree(externalTree);
const instance = useHoverInteractionSharedState(store);
const isHoverCloseActiveRef = React35.useRef(false);
const handleCloseRef = useValueAsRef(handleClose);
const delayRef = useValueAsRef(delay);
const restMsRef = useValueAsRef(restMs);
const enabledRef = useValueAsRef(enabled);
const shouldOpenRef = useValueAsRef(shouldOpenProp);
const isClosingRef = useValueAsRef(isClosing);
const isClickLikeOpenEvent2 = useStableCallback(() => {
return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
});
const checkShouldOpen = useStableCallback(() => {
return shouldOpenRef.current?.() !== false;
});
const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {
const allTriggers = store.context.triggerElements;
if (allTriggers.hasElement(currentTarget)) {
return !currentDomReference || !contains(currentDomReference, currentTarget);
}
if (!isElement(target)) {
return false;
}
const targetElement = target;
return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));
});
const cleanupMouseMoveHandler = useStableCallback(() => {
if (!instance.handler) {
return;
}
const doc = ownerDocument(store.select("domReferenceElement"));
doc.removeEventListener("mousemove", instance.handler);
instance.handler = void 0;
});
const clearPointerEvents = useStableCallback(() => {
clearSafePolygonPointerEventsMutation(instance);
});
if (isActiveTrigger) {
instance.handleCloseOptions = handleClose?.__options;
}
React35.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);
React35.useEffect(() => {
if (!enabled) {
return void 0;
}
function onOpenChangeLocal(details) {
if (!details.open) {
isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover;
cleanupMouseMoveHandler();
instance.openChangeTimeout.clear();
instance.restTimeout.clear();
instance.blockMouseMove = true;
instance.restTimeoutPending = false;
} else {
isHoverCloseActiveRef.current = false;
}
}
events.on("openchange", onOpenChangeLocal);
return () => {
events.off("openchange", onOpenChangeLocal);
};
}, [enabled, events, instance, cleanupMouseMoveHandler]);
React35.useEffect(() => {
if (!enabled) {
return void 0;
}
function closeWithDelay(event, runElseBranch = true) {
const closeDelay = getDelay(delayRef.current, "close", instance.pointerType);
if (closeDelay) {
instance.openChangeTimeout.start(closeDelay, () => {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
});
} else if (runElseBranch) {
instance.openChangeTimeout.clear();
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
}
}
const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null);
if (!isElement(trigger)) {
return void 0;
}
function onMouseEnter(event) {
instance.openChangeTimeout.clear();
instance.blockMouseMove = false;
if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
return;
}
const restMsValue = getRestMs(restMsRef.current);
const openDelay = getDelay(delayRef.current, "open", instance.pointerType);
const eventTarget = getTarget(event);
const currentTarget = event.currentTarget ?? null;
const currentDomReference = store.select("domReferenceElement");
let triggerNode = currentTarget;
if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {
for (const triggerElement of store.context.triggerElements.elements()) {
if (contains(triggerElement, eventTarget)) {
triggerNode = triggerElement;
break;
}
}
}
if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {
triggerNode = currentDomReference;
}
const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);
const isOpen = store.select("open");
const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending";
const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;
const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;
const isRestOnlyDelay = restMsValue > 0 && !openDelay;
const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;
const shouldOpen = !isOpen || isOverInactive;
if (shouldOpenImmediately) {
if (checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
return;
}
if (isRestOnlyDelay) {
return;
}
if (openDelay) {
instance.openChangeTimeout.start(openDelay, () => {
if (shouldOpen && checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
});
} else if (shouldOpen) {
if (checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
}
}
function onMouseLeave(event) {
if (isClickLikeOpenEvent2()) {
clearPointerEvents();
return;
}
cleanupMouseMoveHandler();
const domReferenceElement = store.select("domReferenceElement");
const doc = ownerDocument(domReferenceElement);
instance.restTimeout.clear();
instance.restTimeoutPending = false;
const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();
if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
return;
}
if (handleCloseRef.current && handleCloseContextBase) {
if (!store.select("open")) {
instance.openChangeTimeout.clear();
}
const currentTrigger = triggerElementRef.current;
instance.handler = handleCloseRef.current({
...handleCloseContextBase,
tree,
x: event.clientX,
y: event.clientY,
onClose() {
clearPointerEvents();
cleanupMouseMoveHandler();
if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) {
closeWithDelay(event, true);
}
}
});
doc.addEventListener("mousemove", instance.handler);
instance.handler(event);
return;
}
const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true;
if (shouldClose) {
closeWithDelay(event);
}
}
function onMouseOut(event) {
if (contains(trigger, event.relatedTarget)) {
return;
}
instance.openChangeTimeout.clear();
instance.restTimeout.clear();
instance.restTimeoutPending = false;
}
const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0;
if (move) {
return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, {
once: true
}), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
}
return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
}, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);
return React35.useMemo(() => {
if (!enabled) {
return void 0;
}
function setPointerRef(event) {
instance.pointerType = event.pointerType;
}
return {
onPointerDown: setPointerRef,
onPointerEnter: setPointerRef,
onMouseMove(event) {
const {
nativeEvent
} = event;
const trigger = event.currentTarget;
const currentDomReference = store.select("domReferenceElement");
const currentOpen = store.select("open");
const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);
if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
return;
}
if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {
const floatingElement = store.select("floatingElement");
if (floatingElement) {
const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;
applySafePolygonPointerEventsMutation(instance, {
scopeElement,
referenceElement: trigger,
floatingElement
});
}
}
const restMsValue = getRestMs(restMsRef.current);
if (currentOpen && !isOverInactive || restMsValue === 0) {
return;
}
if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {
return;
}
instance.restTimeout.clear();
function handleMouseMove() {
instance.restTimeoutPending = false;
if (isClickLikeOpenEvent2()) {
return;
}
const latestOpen = store.select("open");
if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger));
}
}
if (instance.pointerType === "touch") {
ReactDOM4.flushSync(() => {
handleMouseMove();
});
} else if (isOverInactive && currentOpen) {
handleMouseMove();
} else {
instance.restTimeoutPending = true;
instance.restTimeout.start(restMsValue, handleMouseMove);
}
}
};
}, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
var React36 = __toESM(require_react(), 1);
function isStationaryWebKitPointer(event) {
return parts_exports.engine.webkit && event.movementX === 0 && event.movementY === 0;
}
function doSwitch(orientation, vertical, horizontal) {
switch (orientation) {
case "vertical":
return vertical;
case "horizontal":
return horizontal;
default:
return vertical || horizontal;
}
}
function isMainOrientationKey(key, orientation) {
const vertical = key === ARROW_UP || key === ARROW_DOWN;
const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;
return doSwitch(orientation, vertical, horizontal);
}
function isMainOrientationToEndKey(key, orientation, rtl) {
const vertical = key === ARROW_DOWN;
const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
return doSwitch(orientation, vertical, horizontal) || key === "Enter" || key === " " || key === "";
}
function isCrossOrientationOpenKey(key, orientation, rtl) {
const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
const horizontal = key === ARROW_DOWN;
return doSwitch(orientation, vertical, horizontal);
}
function isCrossOrientationCloseKey(key, orientation, rtl, grid) {
const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;
const horizontal = key === ARROW_UP;
if (orientation === "both" || orientation === "horizontal" && grid) {
return key === "Escape";
}
return doSwitch(orientation, vertical, horizontal);
}
function useListNavigation(store, props) {
const {
listRef,
activeIndex,
onNavigate: onNavigateProp = () => {
},
enabled = true,
selectedIndex = null,
allowEscape = false,
loopFocus = false,
nested = false,
rtl = false,
virtual = false,
focusItemOnOpen = "auto",
focusItemOnHover = true,
openOnArrowKeyDown = true,
disabledIndices = void 0,
orientation = "vertical",
triggerOrientation = orientation,
parentOrientation,
id,
resetOnPointerLeave = true,
externalTree,
nestedReturnFocusRef,
grid: navigateGrid
} = props;
const isGrid = navigateGrid != null;
if (true) {
if (allowEscape) {
if (!loopFocus) {
console.warn("`useListNavigation` looping must be enabled to allow escaping.");
}
if (!virtual) {
console.warn("`useListNavigation` must be virtual to allow escaping.");
}
}
if (orientation === "vertical" && isGrid) {
console.warn("In grid list navigation mode, the `orientation` should", 'be either "horizontal" or "both".');
}
}
const open2 = store.useState("open");
const floatingElement = store.useState("floatingElement");
const domReferenceElement = store.useState("domReferenceElement");
const dataRef = store.context.dataRef;
const floatingFocusElement = getFloatingFocusElement(floatingElement);
const typeableComboboxReference = isTypeableCombobox(domReferenceElement);
const floatingFocusElementRef = useValueAsRef(floatingFocusElement);
const parentId = useFloatingParentNodeId();
const tree = useFloatingTree(externalTree);
const focusItemOnOpenRef = React36.useRef(focusItemOnOpen);
const indexRef = React36.useRef(selectedIndex ?? -1);
const keyRef = React36.useRef(null);
const isPointerModalityRef = React36.useRef(true);
const onNavigate = useStableCallback((event) => {
onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);
});
const previousMountedRef = React36.useRef(!!floatingElement);
const previousOpenRef = React36.useRef(open2);
const forceSyncFocusRef = React36.useRef(false);
const forceScrollIntoViewRef = React36.useRef(false);
const cancelQueuedFocusRef = React36.useRef(null);
const disabledIndicesRef = useValueAsRef(disabledIndices);
const latestOpenRef = useValueAsRef(open2);
const selectedIndexRef = useValueAsRef(selectedIndex);
const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);
const focusFrame = useAnimationFrame();
const waitForListPopulatedFrame = useAnimationFrame();
const focusItem = useStableCallback(() => {
focusFrame.cancel();
function runFocus(item2) {
if (!virtual) {
cancelQueuedFocusRef.current = enqueueFocus(item2, {
sync: forceSyncFocusRef.current,
preventScroll: true
});
}
}
const initialItem = listRef.current[indexRef.current];
const forceScrollIntoView = forceScrollIntoViewRef.current;
if (initialItem) {
runFocus(initialItem);
}
const scheduler2 = forceSyncFocusRef.current ? (callback) => callback() : (callback) => focusFrame.request(callback);
scheduler2(() => {
const waitedItem = listRef.current[indexRef.current] || initialItem;
if (!waitedItem) {
return;
}
if (!initialItem) {
runFocus(waitedItem);
}
const shouldScrollIntoView = (
// eslint-disable-next-line @typescript-eslint/no-use-before-define
item && (forceScrollIntoView || !isPointerModalityRef.current)
);
if (shouldScrollIntoView) {
waitedItem.scrollIntoView?.({
block: "nearest",
inline: "nearest"
});
}
});
});
useIsoLayoutEffect(() => {
dataRef.current.orientation = orientation;
}, [dataRef, orientation]);
useIsoLayoutEffect(() => {
if (!open2) {
keyRef.current = null;
}
if (!open2 || focusItemOnOpen !== "auto") {
focusItemOnOpenRef.current = focusItemOnOpen;
}
}, [open2, focusItemOnOpen]);
useIsoLayoutEffect(() => {
if (!enabled) {
return;
}
if (open2 && floatingElement) {
indexRef.current = selectedIndex ?? -1;
if (focusItemOnOpenRef.current && selectedIndex != null) {
forceScrollIntoViewRef.current = true;
onNavigate();
}
} else if (previousMountedRef.current) {
indexRef.current = -1;
onNavigate();
}
}, [enabled, open2, floatingElement, selectedIndex, onNavigate]);
useIsoLayoutEffect(() => {
if (!enabled) {
return;
}
if (!open2) {
forceSyncFocusRef.current = false;
return;
}
if (!floatingElement) {
return;
}
if (activeIndex == null) {
forceSyncFocusRef.current = false;
if (selectedIndexRef.current != null) {
return;
}
if (previousMountedRef.current) {
indexRef.current = -1;
focusItem();
}
if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
let runs = 0;
const waitForListPopulated = () => {
if (listRef.current[0] == null) {
if (runs < 2) {
const scheduler2 = runs ? (callback) => waitForListPopulatedFrame.request(callback) : queueMicrotask;
scheduler2(waitForListPopulated);
}
runs += 1;
} else {
indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, triggerOrientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);
keyRef.current = null;
onNavigate();
}
};
waitForListPopulated();
}
} else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {
indexRef.current = activeIndex;
focusItem();
forceScrollIntoViewRef.current = false;
}
}, [enabled, open2, floatingElement, activeIndex, selectedIndexRef, nested, listRef, triggerOrientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);
useIsoLayoutEffect(() => {
if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {
return;
}
const nodes = tree.nodesRef.current;
const parent = nodes.find((node) => node.id === parentId)?.context?.elements.floating;
const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));
const treeContainsActiveEl = nodes.some((node) => node.context && contains(node.context.elements.floating, activeEl));
if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {
parent.focus({
preventScroll: true
});
}
}, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);
useIsoLayoutEffect(() => {
previousOpenRef.current = open2;
previousMountedRef.current = !!floatingElement;
});
const hasActiveIndex = activeIndex != null;
const syncCurrentTarget = useStableCallback((event) => {
if (!latestOpenRef.current) {
return;
}
const index2 = listRef.current.indexOf(event.currentTarget);
if (index2 !== -1 && (indexRef.current !== index2 || activeIndex !== index2)) {
indexRef.current = index2;
onNavigate(event);
}
});
const getParentOrientation = useStableCallback(() => {
return parentOrientation ?? tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.dataRef?.current.orientation;
});
const getMinEnabledIndex = useStableCallback(() => {
return getMinListIndex(listRef, disabledIndicesRef.current);
});
const commonOnKeyDown = useStableCallback((event) => {
isPointerModalityRef.current = false;
forceSyncFocusRef.current = true;
if (event.which === 229) {
return;
}
if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {
return;
}
if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {
if (!isMainOrientationKey(event.key, getParentOrientation())) {
stopEvent(event);
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent));
const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;
if (isHTMLElement(returnElement)) {
returnElement.focus();
}
return;
}
if (activeIndex != null && activeIndex !== indexRef.current && !isIndexOutOfListBounds(listRef.current, activeIndex)) {
indexRef.current = activeIndex;
}
const currentIndex = indexRef.current;
const minIndex = getMinListIndex(listRef, disabledIndices);
const maxIndex = getMaxListIndex(listRef, disabledIndices);
if (!typeableComboboxReference) {
if (event.key === "Home") {
stopEvent(event);
indexRef.current = minIndex;
onNavigate(event);
}
if (event.key === "End") {
stopEvent(event);
indexRef.current = maxIndex;
onNavigate(event);
}
}
if (navigateGrid != null) {
const index2 = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);
if (index2 != null && index2 !== indexRef.current) {
indexRef.current = index2;
onNavigate(event);
}
if (orientation === "both") {
return;
}
}
if (isMainOrientationKey(event.key, orientation)) {
stopEvent(event);
const focusedElement = activeElement(event.currentTarget.ownerDocument);
if (open2 && !virtual && contains(event.currentTarget, focusedElement) && !listRef.current.some((item2) => item2 != null && contains(item2, focusedElement))) {
indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
onNavigate(event);
if (activeIndex === indexRef.current) {
focusItem();
}
return;
}
const {
index: index2,
wrapped
} = getNextListIndex(listRef.current, currentIndex, {
decrement: !isMainOrientationToEndKey(event.key, orientation, rtl),
loopFocus,
allowEscape,
disabledIndices,
minIndex,
maxIndex
});
if (wrapped) {
forceSyncFocusRef.current = false;
}
indexRef.current = index2;
onNavigate(event);
}
});
const item = React36.useMemo(() => {
const itemProps = {
onFocus(event) {
forceSyncFocusRef.current = true;
syncCurrentTarget(event);
},
onClick({
currentTarget
}) {
if (!virtual) {
currentTarget.focus({
preventScroll: true
});
}
},
onMouseMove(event) {
if (isStationaryWebKitPointer(event)) {
return;
}
forceSyncFocusRef.current = true;
forceScrollIntoViewRef.current = false;
if (focusItemOnHover) {
syncCurrentTarget(event);
}
},
onPointerLeave(event) {
if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === "touch") {
return;
}
forceSyncFocusRef.current = true;
const relatedTarget = event.relatedTarget;
if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {
return;
}
if (!resetOnPointerLeaveRef.current) {
return;
}
cancelQueuedFocusRef.current?.();
cancelQueuedFocusRef.current = null;
indexRef.current = -1;
onNavigate(event);
if (!virtual) {
const floatingFocusEl = floatingFocusElementRef.current;
const activeEl = activeElement(ownerDocument(floatingFocusEl));
if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {
floatingFocusEl.focus({
preventScroll: true
});
}
}
}
};
return itemProps;
}, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);
const ariaActiveDescendantProp = React36.useMemo(() => {
return virtual && open2 && hasActiveIndex && {
"aria-activedescendant": `${id}-${activeIndex}`
};
}, [virtual, open2, hasActiveIndex, id, activeIndex]);
const floating = React36.useMemo(() => {
return {
...!typeableComboboxReference ? ariaActiveDescendantProp : {},
onKeyDown(event) {
if (event.key === "Tab" && event.shiftKey && open2 && !virtual) {
const target = getTarget(event.nativeEvent);
if (target && !contains(floatingFocusElementRef.current, target)) {
return;
}
stopEvent(event);
const details = createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent);
store.setOpen(false, details);
const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;
if (!details.isCanceled && isHTMLElement(returnElement)) {
returnElement.focus();
}
return;
}
commonOnKeyDown(event);
},
onPointerMove(event) {
if (isStationaryWebKitPointer(event)) {
return;
}
isPointerModalityRef.current = true;
}
};
}, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, typeableComboboxReference, store, open2, virtual, domReferenceElement, nestedReturnFocusRef]);
const trigger = React36.useMemo(() => {
function openOnNavigationKeyDown(event) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent, event.currentTarget));
}
function checkVirtualMouse(event) {
if (focusItemOnOpen === "auto" && isVirtualClick(event.nativeEvent)) {
focusItemOnOpenRef.current = !virtual;
}
}
function checkVirtualPointer(event) {
focusItemOnOpenRef.current = focusItemOnOpen;
if (focusItemOnOpen === "auto" && isVirtualPointerEvent(event.nativeEvent)) {
focusItemOnOpenRef.current = true;
}
}
return {
onKeyDown(event) {
const currentOpen = store.select("open");
isPointerModalityRef.current = false;
const isArrowKey = event.key.startsWith("Arrow");
const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);
const isMainKey = isMainOrientationKey(event.key, currentOpen ? orientation : triggerOrientation);
const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === "Enter" || event.key.trim() === "";
if (virtual && currentOpen && (!nested || isTypeableElement(event.currentTarget))) {
return commonOnKeyDown(event);
}
if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {
return void 0;
}
if (isNavigationKey) {
const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());
keyRef.current = nested && isParentMainKey ? null : event.key;
}
if (nested) {
if (isParentCrossOpenKey) {
stopEvent(event);
if (currentOpen) {
indexRef.current = getMinEnabledIndex();
onNavigate(event);
if (virtual) {
floatingFocusElementRef.current?.focus();
}
} else {
openOnNavigationKeyDown(event);
}
}
return void 0;
}
if (isMainKey) {
if (selectedIndexRef.current != null) {
indexRef.current = selectedIndexRef.current;
}
stopEvent(event);
if (!currentOpen && openOnArrowKeyDown) {
openOnNavigationKeyDown(event);
} else {
commonOnKeyDown(event);
}
if (currentOpen) {
onNavigate(event);
}
}
return void 0;
},
onFocus(event) {
if (event.target !== event.currentTarget) {
return;
}
if (store.select("open") && !virtual) {
indexRef.current = -1;
onNavigate(event);
}
},
onPointerDown: checkVirtualPointer,
onPointerEnter: checkVirtualPointer,
onMouseDown: checkVirtualMouse,
onClick: checkVirtualMouse
};
}, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, triggerOrientation, getParentOrientation, rtl, selectedIndexRef, virtual, floatingFocusElementRef]);
const reference = React36.useMemo(() => {
return {
...ariaActiveDescendantProp,
...trigger
};
}, [ariaActiveDescendantProp, trigger]);
return React36.useMemo(() => enabled ? {
reference,
floating,
item,
trigger
} : {}, [enabled, reference, floating, trigger, item]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
var React37 = __toESM(require_react(), 1);
function useTypeahead(store, props) {
const {
listRef,
elementsRef,
activeIndex,
onMatch: onMatchProp,
disabledIndices,
onTyping: onTypingProp,
enabled = true,
resetMs = 750,
selectedIndex = null
} = props;
const onTyping = useStableCallback(onTypingProp);
const open2 = store.useState("open");
const timeout = useTimeout();
const stringRef = React37.useRef("");
const prevIndexRef = React37.useRef(selectedIndex ?? activeIndex ?? -1);
const matchIndexRef = React37.useRef(null);
const onKeyDown = useStableCallback((event) => {
function getElement(index3) {
return elementsRef?.current[index3];
}
function isItemAvailable(index3) {
const element = getElement(index3);
if (element && !isElementVisible(element) || element?.matches(":disabled")) {
return false;
}
return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index3, disabledIndices);
}
function getMatchingIndex(list, string, startIndex2 = 0) {
if (list.length === 0) {
return -1;
}
const normalizedStartIndex = (startIndex2 % list.length + list.length) % list.length;
const lowerString = string.toLowerCase();
for (let offset4 = 0; offset4 < list.length; offset4 += 1) {
const index3 = (normalizedStartIndex + offset4) % list.length;
const text = list[index3];
if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index3)) {
continue;
}
return index3;
}
return -1;
}
const listContent = listRef.current;
if (stringRef.current.length > 0 && event.key === " ") {
stopEvent(event);
onTyping?.(true);
}
if (stringRef.current.length > 0 && stringRef.current[0] !== " ") {
if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== " ") {
onTyping?.(false);
}
}
if (listContent == null || // Character key.
event.key.length !== 1 || // Modifier key.
event.ctrlKey || event.metaKey || event.altKey) {
return;
}
if (open2 && event.key !== " ") {
stopEvent(event);
onTyping?.(true);
}
const isNewSession = stringRef.current === "";
if (isNewSession) {
prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;
}
const allowRapidSuccessionOfFirstLetter = listContent.every((text, index3) => text && isItemAvailable(index3) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);
if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {
stringRef.current = "";
prevIndexRef.current = matchIndexRef.current;
}
stringRef.current += event.key;
timeout.start(resetMs, () => {
stringRef.current = "";
prevIndexRef.current = matchIndexRef.current;
onTyping?.(false);
});
const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;
const startIndex = (prevIndex ?? 0) + 1;
const index2 = getMatchingIndex(listContent, stringRef.current, startIndex);
if (index2 !== -1) {
onMatchProp?.(index2, event);
matchIndexRef.current = index2;
} else if (event.key !== " ") {
stringRef.current = "";
onTyping?.(false);
}
});
const onBlur = useStableCallback((event) => {
const next = event.relatedTarget;
const currentDomReferenceElement = store.select("domReferenceElement");
const currentFloatingElement = store.select("floatingElement");
const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);
if (withinComposite) {
return;
}
timeout.clear();
stringRef.current = "";
prevIndexRef.current = matchIndexRef.current;
onTyping?.(false);
});
useIsoLayoutEffect(() => {
if (!open2 && selectedIndex !== null) {
return;
}
timeout.clear();
matchIndexRef.current = null;
if (stringRef.current !== "") {
stringRef.current = "";
onTyping?.(false);
}
}, [open2, selectedIndex, timeout, onTyping]);
const sharedProps = React37.useMemo(() => ({
onKeyDown,
onBlur
}), [onKeyDown, onBlur]);
return React37.useMemo(() => enabled ? {
reference: sharedProps,
floating: sharedProps
} : {}, [enabled, sharedProps]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs
var CURSOR_SPEED_THRESHOLD = 0.1;
var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;
var POLYGON_BUFFER = 0.5;
function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {
return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;
}
function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {
let isInsideValue = false;
if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {
isInsideValue = !isInsideValue;
}
return isInsideValue;
}
function isInsideRect(pointX, pointY, rect) {
return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;
}
function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {
const minX = Math.min(x1, x2);
const maxX = Math.max(x1, x2);
const minY = Math.min(y1, y2);
const maxY = Math.max(y1, y2);
return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;
}
function safePolygon(options = {}) {
const {
blockPointerEvents = false
} = options;
const timeout = new Timeout();
const fn = ({
x,
y,
placement,
elements,
onClose,
nodeId,
tree
}) => {
const side = placement?.split("-")[0];
let hasLanded = false;
let lastX = null;
let lastY = null;
let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
function isCursorMovingSlowly(nextX, nextY) {
const currentTime = performance.now();
const elapsedTime = currentTime - lastCursorTime;
if (lastX === null || lastY === null || elapsedTime === 0) {
lastX = nextX;
lastY = nextY;
lastCursorTime = currentTime;
return false;
}
const deltaX = nextX - lastX;
const deltaY = nextY - lastY;
const distanceSquared = deltaX * deltaX + deltaY * deltaY;
const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;
lastX = nextX;
lastY = nextY;
lastCursorTime = currentTime;
return distanceSquared < thresholdSquared;
}
function close() {
timeout.clear();
onClose();
}
return function onMouseMove(event) {
timeout.clear();
const domReference = elements.domReference;
const floating = elements.floating;
if (!domReference || !floating || side == null || x == null || y == null) {
return void 0;
}
const {
clientX,
clientY
} = event;
const target = getTarget(event);
const isLeave = event.type === "mouseleave";
const isOverFloatingEl = contains(floating, target);
const isOverReferenceEl = contains(domReference, target);
if (isOverFloatingEl) {
hasLanded = true;
if (!isLeave) {
return void 0;
}
}
if (isOverReferenceEl) {
hasLanded = false;
if (!isLeave) {
hasLanded = true;
return void 0;
}
}
if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {
return void 0;
}
function hasOpenChildNode() {
return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);
}
function closeIfNoOpenChild() {
if (!hasOpenChildNode()) {
close();
}
}
if (hasOpenChildNode()) {
return void 0;
}
const refRect = domReference.getBoundingClientRect();
const rect = floating.getBoundingClientRect();
const cursorLeaveFromRight = x > rect.right - rect.width / 2;
const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
const isFloatingWider = rect.width > refRect.width;
const isFloatingTaller = rect.height > refRect.height;
const left = (isFloatingWider ? refRect : rect).left;
const right = (isFloatingWider ? refRect : rect).right;
const top = (isFloatingTaller ? refRect : rect).top;
const bottom = (isFloatingTaller ? refRect : rect).bottom;
if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
closeIfNoOpenChild();
return void 0;
}
let isInsideTroughRect = false;
switch (side) {
case "top":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);
break;
case "bottom":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);
break;
case "left":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);
break;
case "right":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);
break;
default:
}
if (isInsideTroughRect) {
return void 0;
}
if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {
closeIfNoOpenChild();
return void 0;
}
if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {
closeIfNoOpenChild();
return void 0;
}
let isInsidePolygon = false;
switch (side) {
case "top": {
const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointY = y + POLYGON_BUFFER + 1;
const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;
const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
break;
}
case "bottom": {
const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointY = y - POLYGON_BUFFER;
const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;
const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
break;
}
case "left": {
const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointX = x + POLYGON_BUFFER + 1;
const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;
const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);
break;
}
case "right": {
const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointX = x - POLYGON_BUFFER;
const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;
const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);
break;
}
default:
}
if (!isInsidePolygon) {
closeIfNoOpenChild();
} else if (!hasLanded) {
timeout.start(40, closeIfNoOpenChild);
}
return void 0;
};
};
fn.__options = {
...options,
blockPointerEvents
};
return fn;
}
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const sideAxis = getSideAxis(placement);
const alignmentAxis = getAlignmentAxis(placement);
const alignLength = getAxisLength(alignmentAxis);
const side = getSide(placement);
const isVertical = sideAxis === "y";
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height / 2;
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
let coords;
switch (side) {
case "top":
coords = {
x: commonX,
y: reference.y - floating.height
};
break;
case "bottom":
coords = {
x: commonX,
y: reference.y + reference.height
};
break;
case "right":
coords = {
x: reference.x + reference.width,
y: commonY
};
break;
case "left":
coords = {
x: reference.x - floating.width,
y: commonY
};
break;
default:
coords = {
x: reference.x,
y: reference.y
};
}
const alignment = getAlignment(placement);
if (alignment) {
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
}
return coords;
}
async function detectOverflow(state, options) {
var _await$platform$isEle;
if (options === void 0) {
options = {};
}
const {
x,
y,
platform: platform3,
rects,
elements,
strategy
} = state;
const {
boundary = "clippingAncestors",
rootBoundary = "viewport",
elementContext = "floating",
altBoundary = false,
padding = 0
} = evaluate(options, state);
const paddingObject = getPaddingObject(padding);
const altContext = elementContext === "floating" ? "reference" : "floating";
const element = elements[altBoundary ? altContext : elementContext];
const clippingClientRect = rectToClientRect(await platform3.getClippingRect({
element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)),
boundary,
rootBoundary,
strategy
}));
const rect = elementContext === "floating" ? {
x,
y,
width: rects.floating.width,
height: rects.floating.height
} : rects.reference;
const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating));
const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || {
x: 1,
y: 1
};
const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({
elements,
rect,
offsetParent,
strategy
}) : rect);
return {
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
};
}
var MAX_RESET_COUNT = 50;
var computePosition = async (reference, floating, config) => {
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform: platform3
} = config;
const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : {
...platform3,
detectOverflow
};
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating));
let rects = await platform3.getElementRects({
reference,
floating,
strategy
});
let {
x,
y
} = computeCoordsFromPlacement(rects, placement, rtl);
let statefulPlacement = placement;
let resetCount = 0;
const middlewareData = {};
for (let i = 0; i < middleware.length; i++) {
const currentMiddleware = middleware[i];
if (!currentMiddleware) {
continue;
}
const {
name,
fn
} = currentMiddleware;
const {
x: nextX,
y: nextY,
data,
reset
} = await fn({
x,
y,
initialPlacement: placement,
placement: statefulPlacement,
strategy,
middlewareData,
rects,
platform: platformWithDetectOverflow,
elements: {
reference,
floating
}
});
x = nextX != null ? nextX : x;
y = nextY != null ? nextY : y;
middlewareData[name] = {
...middlewareData[name],
...data
};
if (reset && resetCount < MAX_RESET_COUNT) {
resetCount++;
if (typeof reset === "object") {
if (reset.placement) {
statefulPlacement = reset.placement;
}
if (reset.rects) {
rects = reset.rects === true ? await platform3.getElementRects({
reference,
floating,
strategy
}) : reset.rects;
}
({
x,
y
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
}
i = -1;
}
}
return {
x,
y,
placement: statefulPlacement,
strategy,
middlewareData
};
};
var flip = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "flip",
options,
async fn(state) {
var _middlewareData$arrow, _middlewareData$flip;
const {
placement,
middlewareData,
rects,
initialPlacement,
platform: platform3,
elements
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true,
fallbackPlacements: specifiedFallbackPlacements,
fallbackStrategy = "bestFit",
fallbackAxisSideDirection = "none",
flipAlignment = true,
...detectOverflowOptions
} = evaluate(options, state);
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
const side = getSide(placement);
const initialSideAxis = getSideAxis(initialPlacement);
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
}
const placements2 = [initialPlacement, ...fallbackPlacements];
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const overflows = [];
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
if (checkMainAxis) {
overflows.push(overflow[side]);
}
if (checkCrossAxis) {
const sides2 = getAlignmentSides(placement, rects, rtl);
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
}
overflowsData = [...overflowsData, {
placement,
overflows
}];
if (!overflows.every((side2) => side2 <= 0)) {
var _middlewareData$flip2, _overflowsData$filter;
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
const nextPlacement = placements2[nextIndex];
if (nextPlacement) {
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
// overflows the main axis.
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
return {
data: {
index: nextIndex,
overflows: overflowsData
},
reset: {
placement: nextPlacement
}
};
}
}
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
if (!resetPlacement) {
switch (fallbackStrategy) {
case "bestFit": {
var _overflowsData$filter2;
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
if (hasFallbackAxisSideDirection) {
const currentSideAxis = getSideAxis(d.placement);
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
// reading directions favoring greater width.
currentSideAxis === "y";
}
return true;
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
if (placement2) {
resetPlacement = placement2;
}
break;
}
case "initialPlacement":
resetPlacement = initialPlacement;
break;
}
}
if (placement !== resetPlacement) {
return {
reset: {
placement: resetPlacement
}
};
}
}
return {};
}
};
};
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
async function convertValueToCoords(state, options) {
const {
placement,
platform: platform3,
elements
} = state;
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
const side = getSide(placement);
const alignment = getAlignment(placement);
const isVertical = getSideAxis(placement) === "y";
const mainAxisMulti = originSides.has(side) ? -1 : 1;
const crossAxisMulti = rtl && isVertical ? -1 : 1;
const rawValue = evaluate(options, state);
let {
mainAxis,
crossAxis,
alignmentAxis
} = typeof rawValue === "number" ? {
mainAxis: rawValue,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: rawValue.mainAxis || 0,
crossAxis: rawValue.crossAxis || 0,
alignmentAxis: rawValue.alignmentAxis
};
if (alignment && typeof alignmentAxis === "number") {
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
}
return isVertical ? {
x: crossAxis * crossAxisMulti,
y: mainAxis * mainAxisMulti
} : {
x: mainAxis * mainAxisMulti,
y: crossAxis * crossAxisMulti
};
}
var offset = function(options) {
if (options === void 0) {
options = 0;
}
return {
name: "offset",
options,
async fn(state) {
var _middlewareData$offse, _middlewareData$arrow;
const {
x,
y,
placement,
middlewareData
} = state;
const diffCoords = await convertValueToCoords(state, options);
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
return {
x: x + diffCoords.x,
y: y + diffCoords.y,
data: {
...diffCoords,
placement
}
};
}
};
};
var shift = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "shift",
options,
async fn(state) {
const {
x,
y,
placement,
platform: platform3
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = false,
limiter = {
fn: (_ref) => {
let {
x: x2,
y: y2
} = _ref;
return {
x: x2,
y: y2
};
}
},
...detectOverflowOptions
} = evaluate(options, state);
const coords = {
x,
y
};
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const crossAxis = getSideAxis(placement);
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
if (checkMainAxis) {
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
}
if (checkCrossAxis) {
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
}
const limitedCoords = limiter.fn({
...state,
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
});
return {
...limitedCoords,
data: {
x: limitedCoords.x - x,
y: limitedCoords.y - y,
enabled: {
[mainAxis]: checkMainAxis,
[crossAxis]: checkCrossAxis
}
}
};
}
};
};
var limitShift = function(options) {
if (options === void 0) {
options = {};
}
return {
options,
fn(state) {
var _rawOffset$mainAxis, _rawOffset$crossAxis;
const {
x,
y,
placement,
rects,
middlewareData
} = state;
const {
offset: offset4 = 0,
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true
} = evaluate(options, state);
const coords = {
x,
y
};
const crossAxis = getSideAxis(placement);
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const rawOffset = evaluate(offset4, state);
const computedOffset = typeof rawOffset === "number" ? {
mainAxis: rawOffset,
crossAxis: 0
} : {
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
};
if (checkMainAxis) {
const len = mainAxis === "y" ? "height" : "width";
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
if (mainAxisCoord < limitMin) {
mainAxisCoord = limitMin;
} else if (mainAxisCoord > limitMax) {
mainAxisCoord = limitMax;
}
}
if (checkCrossAxis) {
var _middlewareData$offse, _middlewareData$offse2;
const len = mainAxis === "y" ? "width" : "height";
const isOriginSide = originSides.has(getSide(placement));
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
if (crossAxisCoord < limitMin) {
crossAxisCoord = limitMin;
} else if (crossAxisCoord > limitMax) {
crossAxisCoord = limitMax;
}
}
return {
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
};
}
};
};
var size = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "size",
options,
async fn(state) {
const {
placement,
rects,
platform: platform3,
elements
} = state;
const {
apply = () => {
},
...detectOverflowOptions
} = evaluate(options, state);
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const side = getSide(placement);
const alignment = getAlignment(placement);
const isYAxis = getSideAxis(placement) === "y";
const {
width,
height
} = rects.floating;
let heightSide;
let widthSide;
if (side === "top" || side === "bottom") {
heightSide = side;
widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
} else {
widthSide = side;
heightSide = alignment === "end" ? "top" : "bottom";
}
const maximumClippingHeight = height - overflow.top - overflow.bottom;
const maximumClippingWidth = width - overflow.left - overflow.right;
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
const shiftData = state.middlewareData.shift;
const noShift = !shiftData;
let availableHeight2 = overflowAvailableHeight;
let availableWidth2 = overflowAvailableWidth;
if (shiftData != null && shiftData.enabled.x) {
availableWidth2 = maximumClippingWidth;
}
if (shiftData != null && shiftData.enabled.y) {
availableHeight2 = maximumClippingHeight;
}
if (noShift && !alignment) {
if (isYAxis) {
availableWidth2 = width - 2 * max(overflow.left, overflow.right);
} else {
availableHeight2 = height - 2 * max(overflow.top, overflow.bottom);
}
}
await apply({
...state,
availableWidth: availableWidth2,
availableHeight: availableHeight2
});
const nextDimensions = await platform3.getDimensions(elements.floating);
if (width !== nextDimensions.width || height !== nextDimensions.height) {
return {
reset: {
rects: true
}
};
}
return {};
}
};
};
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
function getCssDimensions(element) {
const css = getComputedStyle2(element);
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height,
$: shouldFallback
};
}
function unwrapElement(element) {
return !isElement(element) ? element.contextElement : element;
}
function getScale(element) {
const domElement = unwrapElement(element);
if (!isHTMLElement(domElement)) {
return createCoords(1);
}
const rect = domElement.getBoundingClientRect();
const {
width,
height,
$
} = getCssDimensions(domElement);
let x = ($ ? round(rect.width) : rect.width) / width;
let y = ($ ? round(rect.height) : rect.height) / height;
if (!x || !Number.isFinite(x)) {
x = 1;
}
if (!y || !Number.isFinite(y)) {
y = 1;
}
return {
x,
y
};
}
var noOffsets = /* @__PURE__ */ createCoords(0);
function getVisualOffsets(element) {
const win = getWindow(element);
if (!isWebKit() || !win.visualViewport) {
return noOffsets;
}
return {
x: win.visualViewport.offsetLeft,
y: win.visualViewport.offsetTop
};
}
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
if (isFixed === void 0) {
isFixed = false;
}
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
}
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element.getBoundingClientRect();
const domElement = unwrapElement(element);
let scale = createCoords(1);
if (includeScale) {
if (offsetParent) {
if (isElement(offsetParent)) {
scale = getScale(offsetParent);
}
} else {
scale = getScale(element);
}
}
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
let x = (clientRect.left + visualOffsets.x) / scale.x;
let y = (clientRect.top + visualOffsets.y) / scale.y;
let width = clientRect.width / scale.x;
let height = clientRect.height / scale.y;
if (domElement && offsetParent) {
const win = getWindow(domElement);
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
let currentWin = win;
let currentIFrame = getFrameElement(currentWin);
while (currentIFrame && offsetWin !== currentWin) {
const iframeScale = getScale(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css = getComputedStyle2(currentIFrame);
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
x *= iframeScale.x;
y *= iframeScale.y;
width *= iframeScale.x;
height *= iframeScale.y;
x += left;
y += top;
currentWin = getWindow(currentIFrame);
currentIFrame = getFrameElement(currentWin);
}
}
return rectToClientRect({
width,
height,
x,
y
});
}
function getWindowScrollBarX(element, rect) {
const leftScroll = getNodeScroll(element).scrollLeft;
if (!rect) {
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
}
return rect.left + leftScroll;
}
function getHTMLOffset(documentElement, scroll) {
const htmlRect = documentElement.getBoundingClientRect();
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
const y = htmlRect.top + scroll.scrollTop;
return {
x,
y
};
}
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
let {
elements,
rect,
offsetParent,
strategy
} = _ref;
const isFixed = strategy === "fixed";
const documentElement = getDocumentElement(offsetParent);
const topLayer = elements ? isTopLayer(elements.floating) : false;
if (offsetParent === documentElement || topLayer && isFixed) {
return rect;
}
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
let scale = createCoords(1);
const offsets = createCoords(0);
const isOffsetParentAnElement = isHTMLElement(offsetParent);
if (isOffsetParentAnElement || !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent);
scale = getScale(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
return {
width: rect.width * scale.x,
height: rect.height * scale.y,
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
};
}
function getClientRects(element) {
return element.getClientRects ? Array.from(element.getClientRects()) : [];
}
function getDocumentRect(html) {
const scroll = getNodeScroll(html);
const body = html.ownerDocument.body;
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
const y = -scroll.scrollTop;
if (getComputedStyle2(body).direction === "rtl") {
x += max(html.clientWidth, body.clientWidth) - width;
}
return {
width,
height,
x,
y
};
}
var SCROLLBAR_MAX = 25;
function getViewportRect(element, strategy, rootBoundary) {
if (rootBoundary === void 0) {
rootBoundary = "viewport";
}
const isLayoutViewport = rootBoundary === "layoutViewport";
const win = getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x = 0;
let y = 0;
if (visualViewport) {
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
if (isLayoutViewport) {
if (!layoutRelativeClientCoords) {
x = -visualViewport.offsetLeft;
y = -visualViewport.offsetTop;
}
} else {
width = visualViewport.width;
height = visualViewport.height;
if (layoutRelativeClientCoords) {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
}
const windowScrollbarX = getWindowScrollBarX(html);
if (windowScrollbarX <= 0) {
const doc = html.ownerDocument;
const body = doc.body;
const bodyStyles = getComputedStyle(body);
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
if (gutter <= SCROLLBAR_MAX) {
width -= gutter;
}
}
return {
width,
height,
x,
y
};
}
function getInnerBoundingClientRect(element, strategy) {
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
const top = clientRect.top + element.clientTop;
const left = clientRect.left + element.clientLeft;
const scale = getScale(element);
const width = element.clientWidth * scale.x;
const height = element.clientHeight * scale.y;
const x = left * scale.x;
const y = top * scale.y;
return {
width,
height,
x,
y
};
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
let rect;
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
rect = getViewportRect(element, strategy, clippingAncestor);
} else if (clippingAncestor === "document") {
rect = getDocumentRect(getDocumentElement(element));
} else if (isElement(clippingAncestor)) {
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
} else {
const visualOffsets = getVisualOffsets(element);
rect = {
x: clippingAncestor.x - visualOffsets.x,
y: clippingAncestor.y - visualOffsets.y,
width: clippingAncestor.width,
height: clippingAncestor.height
};
}
return rectToClientRect(rect);
}
function getClippingElementAncestors(element, cache) {
const cachedResult = cache.get(element);
if (cachedResult) {
return cachedResult;
}
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
let lastKeptComputedStyle = null;
const elementIsFixed = getComputedStyle2(element).position === "fixed";
let currentNode = elementIsFixed ? getParentNode(element) : element;
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
const computedStyle = getComputedStyle2(currentNode);
const currentNodeIsContaining = isContainingBlock(currentNode);
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
if (shouldDropCurrentNode) {
result = result.filter((ancestor) => ancestor !== currentNode);
} else {
lastKeptComputedStyle = computedStyle;
}
currentNode = getParentNode(currentNode);
}
cache.set(element, result);
return result;
}
function getClippingRect(_ref) {
let {
element,
boundary,
rootBoundary,
strategy
} = _ref;
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
let top = firstRect.top;
let right = firstRect.right;
let bottom = firstRect.bottom;
let left = firstRect.left;
for (let i = 1; i < clippingAncestors.length; i++) {
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
top = max(rect.top, top);
right = min(rect.right, right);
bottom = min(rect.bottom, bottom);
left = max(rect.left, left);
}
return {
width: right - left,
height: bottom - top,
x: left,
y: top
};
}
function getDimensions(element) {
const {
width,
height
} = getCssDimensions(element);
return {
width,
height
};
}
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
const isOffsetParentAnElement = isHTMLElement(offsetParent);
const documentElement = getDocumentElement(offsetParent);
const isFixed = strategy === "fixed";
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
const offsets = createCoords(0);
if (isOffsetParentAnElement || !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
if (!isOffsetParentAnElement && documentElement) {
offsets.x = getWindowScrollBarX(documentElement);
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
return {
x,
y,
width: rect.width,
height: rect.height
};
}
function isStaticPositioned(element) {
return getComputedStyle2(element).position === "static";
}
function getTrueOffsetParent(element, polyfill) {
if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
return null;
}
if (polyfill) {
return polyfill(element);
}
let rawOffsetParent = element.offsetParent;
if (getDocumentElement(element) === rawOffsetParent) {
rawOffsetParent = rawOffsetParent.ownerDocument.body;
}
return rawOffsetParent;
}
function getOffsetParent(element, polyfill) {
const win = getWindow(element);
if (isTopLayer(element)) {
return win;
}
if (!isHTMLElement(element)) {
let svgOffsetParent = getParentNode(element);
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
return svgOffsetParent;
}
svgOffsetParent = getParentNode(svgOffsetParent);
}
return win;
}
let offsetParent = getTrueOffsetParent(element, polyfill);
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
}
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
return win;
}
return offsetParent || getContainingBlock(element) || win;
}
var getElementRects = async function(data) {
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
const getDimensionsFn = this.getDimensions;
const floatingDimensions = await getDimensionsFn(data.floating);
return {
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
floating: {
x: 0,
y: 0,
width: floatingDimensions.width,
height: floatingDimensions.height
}
};
};
function isRTL(element) {
return getComputedStyle2(element).direction === "rtl";
}
var platform2 = {
convertOffsetParentRelativeRectToViewportRelativeRect,
getDocumentElement,
getClippingRect,
getOffsetParent,
getElementRects,
getClientRects,
getDimensions,
getScale,
isElement,
isRTL
};
function rectsAreEqual(a, b) {
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
}
function observeMove(element, onMove, ancestorResize) {
let io = null;
let timeoutId;
const root2 = getDocumentElement(element);
function cleanup() {
var _io;
clearTimeout(timeoutId);
(_io = io) == null || _io.disconnect();
io = null;
}
function refresh(skip, threshold) {
if (skip === void 0) {
skip = false;
}
if (threshold === void 0) {
threshold = 1;
}
cleanup();
const elementRectForRootMargin = element.getBoundingClientRect();
const {
left,
top,
width,
height
} = elementRectForRootMargin;
if (!skip) {
onMove();
}
if (!width || !height) {
return;
}
const insetTop = floor(top);
const insetRight = floor(root2.clientWidth - (left + width));
const insetBottom = floor(root2.clientHeight - (top + height));
const insetLeft = floor(left);
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
const options = {
rootMargin,
threshold: max(0, min(1, threshold)) || 1
};
let isFirstUpdate = true;
function handleObserve(entries) {
const ratio = entries[0].intersectionRatio;
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
return refresh();
}
if (ratio !== threshold) {
if (!isFirstUpdate) {
return refresh();
}
if (!ratio) {
timeoutId = setTimeout(() => {
refresh(false, 1e-7);
}, 1e3);
} else {
refresh(false, ratio);
}
}
isFirstUpdate = false;
}
try {
io = new IntersectionObserver(handleObserve, {
...options,
// Handle <iframe>s
root: root2.ownerDocument
});
} catch (_e) {
io = new IntersectionObserver(handleObserve, options);
}
io.observe(element);
}
const win = getWindow(element);
const handleResize = () => refresh(ancestorResize);
win.addEventListener("resize", handleResize);
refresh(true);
return () => {
win.removeEventListener("resize", handleResize);
cleanup();
};
}
function autoUpdate(reference, floating, update2, options) {
if (options === void 0) {
options = {};
}
const {
ancestorScroll = true,
ancestorResize = true,
elementResize = typeof ResizeObserver === "function",
layoutShift = typeof IntersectionObserver === "function",
animationFrame = false
} = options;
const referenceEl = unwrapElement(reference);
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.addEventListener("scroll", update2);
ancestorResize && ancestor.addEventListener("resize", update2);
});
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null;
let reobserveFrame = -1;
let resizeObserver = null;
if (elementResize) {
resizeObserver = new ResizeObserver((_ref) => {
let [firstEntry] = _ref;
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
resizeObserver.unobserve(floating);
cancelAnimationFrame(reobserveFrame);
reobserveFrame = requestAnimationFrame(() => {
var _resizeObserver;
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
});
}
update2();
});
if (referenceEl && !animationFrame) {
resizeObserver.observe(referenceEl);
}
if (floating) {
resizeObserver.observe(floating);
}
}
let frameId;
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
if (animationFrame) {
frameLoop();
}
function frameLoop() {
const nextRefRect = getBoundingClientRect(reference);
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
update2();
}
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
}
update2();
return () => {
var _resizeObserver2;
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.removeEventListener("scroll", update2);
ancestorResize && ancestor.removeEventListener("resize", update2);
});
cleanupIo == null || cleanupIo();
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
resizeObserver = null;
if (animationFrame) {
cancelAnimationFrame(frameId);
}
};
}
var offset2 = offset;
var shift2 = shift;
var flip2 = flip;
var size2 = size;
var limitShift2 = limitShift;
var computePosition2 = (reference, floating, options) => {
const cache = /* @__PURE__ */ new Map();
const mergedOptions = options != null ? options : {};
const platformWithCache = {
...platform2,
...mergedOptions.platform,
_c: cache
};
return computePosition(reference, floating, {
...mergedOptions,
platform: platformWithCache
});
};
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
var React38 = __toESM(require_react(), 1);
var import_react2 = __toESM(require_react(), 1);
var ReactDOM5 = __toESM(require_react_dom(), 1);
var isClient = typeof document !== "undefined";
var noop2 = function noop3() {
};
var index = isClient ? import_react2.useLayoutEffect : noop2;
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (typeof a !== typeof b) {
return false;
}
if (typeof a === "function" && a.toString() === b.toString()) {
return true;
}
let length;
let i;
let keys;
if (a && b && typeof a === "object") {
if (Array.isArray(a)) {
length = a.length;
if (length !== b.length) return false;
for (i = length; i-- !== 0; ) {
if (!deepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) {
return false;
}
for (i = length; i-- !== 0; ) {
if (!{}.hasOwnProperty.call(b, keys[i])) {
return false;
}
}
for (i = length; i-- !== 0; ) {
const key = keys[i];
if (key === "_owner" && a.$$typeof) {
continue;
}
if (!deepEqual(a[key], b[key])) {
return false;
}
}
return true;
}
return a !== a && b !== b;
}
function getDPR(element) {
if (typeof window === "undefined") {
return 1;
}
const win = element.ownerDocument.defaultView || window;
return win.devicePixelRatio || 1;
}
function roundByDPR(element, value) {
const dpr = getDPR(element);
return Math.round(value * dpr) / dpr;
}
function useLatestRef(value) {
const ref = React38.useRef(value);
index(() => {
ref.current = value;
});
return ref;
}
function useFloating(options) {
if (options === void 0) {
options = {};
}
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform: platform3,
elements: {
reference: externalReference,
floating: externalFloating
} = {},
transform = true,
whileElementsMounted,
open: open2
} = options;
const [data, setData] = React38.useState({
x: 0,
y: 0,
strategy,
placement,
middlewareData: {},
isPositioned: false
});
const [latestMiddleware, setLatestMiddleware] = React38.useState(middleware);
if (!deepEqual(latestMiddleware, middleware)) {
setLatestMiddleware(middleware);
}
const [_reference, _setReference] = React38.useState(null);
const [_floating, _setFloating] = React38.useState(null);
const setReference = React38.useCallback((node) => {
if (node !== referenceRef.current) {
referenceRef.current = node;
_setReference(node);
}
}, []);
const setFloating = React38.useCallback((node) => {
if (node !== floatingRef.current) {
floatingRef.current = node;
_setFloating(node);
}
}, []);
const referenceEl = externalReference || _reference;
const floatingEl = externalFloating || _floating;
const referenceRef = React38.useRef(null);
const floatingRef = React38.useRef(null);
const dataRef = React38.useRef(data);
const hasWhileElementsMounted = whileElementsMounted != null;
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
const platformRef = useLatestRef(platform3);
const openRef = useLatestRef(open2);
const update2 = React38.useCallback(() => {
if (!referenceRef.current || !floatingRef.current) {
return;
}
const config = {
placement,
strategy,
middleware: latestMiddleware
};
if (platformRef.current) {
config.platform = platformRef.current;
}
computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
const fullData = {
...data2,
// The floating element's position may be recomputed while it's closed
// but still mounted (such as when transitioning out). To ensure
// `isPositioned` will be `false` initially on the next open, avoid
// setting it to `true` when `open === false` (must be specified).
isPositioned: openRef.current !== false
};
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
dataRef.current = fullData;
ReactDOM5.flushSync(() => {
setData(fullData);
});
}
});
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
index(() => {
if (open2 === false && dataRef.current.isPositioned) {
dataRef.current.isPositioned = false;
setData((data2) => ({
...data2,
isPositioned: false
}));
}
}, [open2]);
const isMountedRef = React38.useRef(false);
index(() => {
isMountedRef.current = true;
return () => {
isMountedRef.current = false;
};
}, []);
index(() => {
if (referenceEl) referenceRef.current = referenceEl;
if (floatingEl) floatingRef.current = floatingEl;
if (referenceEl && floatingEl) {
if (whileElementsMountedRef.current) {
return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
}
update2();
}
}, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
const refs = React38.useMemo(() => ({
reference: referenceRef,
floating: floatingRef,
setReference,
setFloating
}), [setReference, setFloating]);
const elements = React38.useMemo(() => ({
reference: referenceEl,
floating: floatingEl
}), [referenceEl, floatingEl]);
const floatingStyles = React38.useMemo(() => {
const initialStyles = {
position: strategy,
left: 0,
top: 0
};
if (!elements.floating) {
return initialStyles;
}
const x = roundByDPR(elements.floating, data.x);
const y = roundByDPR(elements.floating, data.y);
if (transform) {
return {
...initialStyles,
transform: "translate(" + x + "px, " + y + "px)",
...getDPR(elements.floating) >= 1.5 && {
willChange: "transform"
}
};
}
return {
position: strategy,
left: x,
top: y
};
}, [strategy, transform, elements.floating, data.x, data.y]);
return React38.useMemo(() => ({
...data,
update: update2,
refs,
elements,
floatingStyles
}), [data, update2, refs, elements, floatingStyles]);
}
var offset3 = (options, deps) => {
const result = offset2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var shift3 = (options, deps) => {
const result = shift2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var limitShift3 = (options, deps) => {
const result = limitShift2(options);
return {
fn: result.fn,
options: [options, deps]
};
};
var flip3 = (options, deps) => {
const result = flip2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var size3 = (options, deps) => {
const result = size2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/NullStore.mjs
var NullStore = class extends ReactStore {
// `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
// `setState` alone would neutralize them today. They are overridden explicitly so the store stays
// inert even if a future base-class change stops routing a mutator through `setState`.
setState(_newState) {
}
update(_changes) {
}
set(_key, _value) {
}
notifyAll() {
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/inertValue.mjs
function inertValue(value) {
if (isReactVersionAtLeast(19)) {
return value;
}
return value ? "true" : void 0;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/InternalBackdrop.mjs
var React39 = __toESM(require_react(), 1);
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
var InternalBackdrop = /* @__PURE__ */ React39.forwardRef(function InternalBackdrop2(props, ref) {
const {
cutout,
...otherProps
} = props;
let clipPath;
if (cutout) {
const rect = cutout.getBoundingClientRect();
clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;
}
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
ref,
role: "presentation",
"data-base-ui-inert": "",
...otherProps,
style: {
position: "fixed",
inset: 0,
userSelect: "none",
WebkitUserSelect: "none",
clipPath
}
});
});
if (true) InternalBackdrop.displayName = "InternalBackdrop";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
var React42 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
var React40 = __toESM(require_react(), 1);
function useEnhancedClickHandler(handler) {
const lastClickInteractionTypeRef = React40.useRef("");
const handlePointerDown = React40.useCallback((event) => {
if (event.defaultPrevented) {
return;
}
lastClickInteractionTypeRef.current = event.pointerType;
handler(event, event.pointerType);
}, [handler]);
const handleClick = React40.useCallback((event) => {
if (event.detail === 0) {
handler(event, "keyboard");
return;
}
if ("pointerType" in event) {
handler(event, event.pointerType);
} else {
handler(event, lastClickInteractionTypeRef.current);
}
lastClickInteractionTypeRef.current = "";
}, [handler]);
return {
onClick: handleClick,
onPointerDown: handlePointerDown
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useValueChanged.mjs
var React41 = __toESM(require_react(), 1);
function useValueChanged(value, onChange) {
const valueRef = React41.useRef(value);
const onChangeCallback = useStableCallback(onChange);
useIsoLayoutEffect(() => {
if (valueRef.current !== value) {
onChangeCallback(valueRef.current);
}
valueRef.current = value;
}, [value, onChangeCallback]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
function useOpenMethodTriggerProps(open2, setOpenMethod) {
const handleTriggerClick = useStableCallback((_, interactionType) => {
const isOpen = typeof open2 === "function" ? open2() : open2;
if (!isOpen) {
setOpenMethod(interactionType || // On iOS Safari, the hitslop around touch targets means tapping outside an element's
// bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
// will be "" in that case.
(parts_exports.os.ios ? "touch" : ""));
}
});
const {
onClick,
onPointerDown
} = useEnhancedClickHandler(handleTriggerClick);
return React42.useMemo(() => ({
onClick,
onPointerDown
}), [onClick, onPointerDown]);
}
function useOpenInteractionType(open2) {
const [openMethod, setOpenMethod] = React42.useState(null);
const triggerProps = useOpenMethodTriggerProps(open2, setOpenMethod);
useValueChanged(open2, (previousOpen) => {
if (previousOpen && !open2) {
setOpenMethod(null);
}
});
return React42.useMemo(() => ({
openMethod,
triggerProps
}), [openMethod, triggerProps]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/index.parts.mjs
var index_parts_exports = {};
__export(index_parts_exports, {
Arrow: () => ComboboxArrow,
Backdrop: () => ComboboxBackdrop,
Clear: () => ComboboxClear,
Collection: () => ComboboxCollection,
Empty: () => ComboboxEmpty,
Group: () => ComboboxGroup,
GroupLabel: () => ComboboxGroupLabel,
Icon: () => ComboboxIcon,
Input: () => ComboboxInput,
InputGroup: () => AutocompleteInputGroup,
Item: () => AutocompleteItem,
List: () => ComboboxList,
Popup: () => ComboboxPopup,
Portal: () => ComboboxPortal,
Positioner: () => ComboboxPositioner,
Root: () => AutocompleteRoot,
Row: () => ComboboxRow,
Separator: () => AutocompleteSeparator,
Status: () => ComboboxStatus,
Trigger: () => AutocompleteTrigger,
Value: () => AutocompleteValue,
useFilter: () => useCoreFilter,
useFilteredItems: () => useFilteredItems
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/root/AutocompleteRoot.mjs
var React53 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs
var React52 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useOnFirstRender.mjs
var React43 = __toESM(require_react(), 1);
function useOnFirstRender(fn) {
const ref = React43.useRef(true);
if (ref.current) {
ref.current = false;
fn();
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/gridNavigation.mjs
function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {
const nextIndex = getGridNavigatedIndex(listRef.current, {
event,
orientation,
loopFocus,
rtl,
cols,
disabledIndices,
minIndex,
maxIndex,
// An out-of-range previous index falls back to the first enabled item.
prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,
stopEvent: true
});
return isIndexOutOfListBounds(listRef.current, nextIndex) ? void 0 : nextIndex;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getHighlightReason.mjs
function getHighlightReason(event) {
if (event == null) {
return reason_parts_exports.none;
}
if (event.type.startsWith("key")) {
return reason_parts_exports.keyboard;
}
if (event.type.startsWith("mouse") || event.type.startsWith("pointer")) {
return reason_parts_exports.pointer;
}
return reason_parts_exports.none;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/ComboboxRootContext.mjs
var React44 = __toESM(require_react(), 1);
var ComboboxRootContext = /* @__PURE__ */ React44.createContext(void 0);
if (true) ComboboxRootContext.displayName = "ComboboxRootContext";
var ComboboxFloatingContext = /* @__PURE__ */ React44.createContext(void 0);
if (true) ComboboxFloatingContext.displayName = "ComboboxFloatingContext";
var ComboboxDerivedItemsContext = /* @__PURE__ */ React44.createContext(void 0);
if (true) ComboboxDerivedItemsContext.displayName = "ComboboxDerivedItemsContext";
var ComboboxHasItemsContext = /* @__PURE__ */ React44.createContext(false);
if (true) ComboboxHasItemsContext.displayName = "ComboboxHasItemsContext";
var ComboboxInputValueContext = /* @__PURE__ */ React44.createContext("");
if (true) ComboboxInputValueContext.displayName = "ComboboxInputValueContext";
function useComboboxRootContext() {
const context = React44.useContext(ComboboxRootContext);
if (!context) {
throw new Error(true ? "Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(22));
}
return context;
}
function useComboboxFloatingContext() {
const context = React44.useContext(ComboboxFloatingContext);
if (!context) {
throw new Error(true ? "Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(23));
}
return context;
}
function useComboboxDerivedItemsContext() {
const context = React44.useContext(ComboboxDerivedItemsContext);
if (!context) {
throw new Error(true ? "Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage_default(24));
}
return context;
}
function useComboboxInputValueContext() {
return React44.useContext(ComboboxInputValueContext);
}
function useComboboxHasItemsContext() {
return React44.useContext(ComboboxHasItemsContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/areArraysEqual.mjs
function areArraysEqual(array1, array2, itemComparer = Object.is) {
const {
length
} = array1;
if (length !== array2.length) {
return false;
}
for (let i = 0; i < length; i += 1) {
if (!itemComparer(array1[i], array2[i])) {
return false;
}
}
return true;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/itemEquality.mjs
var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
function compareItemEquality(itemValue, selectedValue, comparer) {
if (itemValue == null || selectedValue == null) {
return Object.is(itemValue, selectedValue);
}
return comparer(itemValue, selectedValue);
}
function isSelectedValueDirty(currentValue, initialValue, comparer) {
if (Array.isArray(currentValue) && Array.isArray(initialValue)) {
return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, comparer));
}
return currentValue !== initialValue;
}
function selectedValueIncludes(selectedValues, itemValue, comparer) {
if (!selectedValues) {
return false;
}
return selectedValues.some((selectedValue) => {
if (selectedValue === void 0) {
return false;
}
return compareItemEquality(itemValue, selectedValue, comparer);
});
}
function findItemIndex(itemValues, selectedValue, comparer) {
if (!itemValues) {
return -1;
}
return itemValues.findIndex((itemValue) => {
if (itemValue === void 0) {
return false;
}
return compareItemEquality(itemValue, selectedValue, comparer);
});
}
function createSelectionMatcher(selectedValues, comparer) {
if (comparer !== defaultItemEquality) {
return (itemValue) => selectedValueIncludes(selectedValues, itemValue, comparer);
}
const index2 = new Set(selectedValues);
index2.delete(void 0);
return (itemValue) => index2.has(itemValue) && (itemValue !== 0 || selectedValues.some((v) => Object.is(itemValue, v)));
}
function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {
const index2 = multiple && Array.isArray(selectedValue) ? (
// Anchor to the first selected item in rendered order so the index does not depend
// on the order in which the values were added to the array.
itemValues.findIndex(createSelectionMatcher(selectedValue, comparer))
) : findItemIndex(itemValues, selectedValue, comparer);
return index2 === -1 ? null : index2;
}
function resolveSelectedIndex(index2, itemValue, registry, selectedValues, comparer, currentIndex) {
if (selectedValueIncludes(selectedValues, itemValue, comparer)) {
return currentIndex != null && index2 > currentIndex && selectedValueIncludes(selectedValues, registry[currentIndex], comparer) ? currentIndex : index2;
}
return index2 === currentIndex ? findSelectionIndex(registry, selectedValues, comparer, true) : currentIndex;
}
function removeItem(selectedValues, itemValue, comparer) {
return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/resolveValueLabel.mjs
var React45 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/serializeValue.mjs
function serializeValue(value) {
if (value == null) {
return "";
}
if (typeof value === "string") {
return value;
}
try {
return JSON.stringify(value);
} catch {
return String(value);
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/resolveValueLabel.mjs
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
function isGroup(item) {
return typeof item === "object" && item != null && Array.isArray(item.items);
}
function isGroupedItems(items) {
return isGroup(items?.[0]);
}
function flattenLeafItems(items) {
return isGroupedItems(items) ? items.flatMap((group) => group.items) : items;
}
function hasNullItemLabel(items) {
if (!Array.isArray(items)) {
return items != null && "null" in items;
}
const arrayItems = items;
if (isGroupedItems(arrayItems)) {
for (const group of arrayItems) {
for (const item of group.items) {
if (item && item.value == null && item.label != null) {
return true;
}
}
}
return false;
}
for (const item of arrayItems) {
if (item && item.value == null && item.label != null) {
return true;
}
}
return false;
}
function stringifyAsLabel(item, itemToStringLabel) {
if (itemToStringLabel && item != null) {
return itemToStringLabel(item) ?? "";
}
if (item && typeof item === "object") {
if ("label" in item && item.label != null) {
return String(item.label);
}
if ("value" in item) {
return String(item.value);
}
}
return serializeValue(item);
}
function stringifyAsValue(item, itemToStringValue) {
if (itemToStringValue && item != null) {
return itemToStringValue(item) ?? "";
}
if (item && typeof item === "object" && "value" in item && "label" in item) {
return serializeValue(item.value);
}
return serializeValue(item);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/store.mjs
var selectors2 = {
id: (state) => state.id,
labelId: (state) => state.labelId,
items: (state) => state.items,
selectedValue: (state) => state.selectedValue,
hasSelectionChips: (state) => {
const selectedValue = state.selectedValue;
return Array.isArray(selectedValue) && selectedValue.length > 0;
},
hasSelectedValue: (state) => {
const {
selectedValue,
selectionMode
} = state;
if (selectedValue == null) {
return false;
}
if (selectionMode === "multiple" && Array.isArray(selectedValue)) {
return selectedValue.length > 0;
}
return true;
},
hasNullItemLabel: (state, enabled) => {
return enabled ? hasNullItemLabel(state.items) : false;
},
open: (state) => state.open,
mounted: (state) => state.mounted,
forceMounted: (state) => state.forceMounted,
inline: (state) => state.inline,
activeIndex: (state) => state.activeIndex,
selectedIndex: (state) => state.selectedIndex,
isActive: (state, index2) => state.activeIndex === index2,
isSelected: (state, itemValue) => {
const comparer = state.isItemEqualToValue;
const selectedValue = state.selectedValue;
if (Array.isArray(selectedValue)) {
return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
}
return compareItemEquality(itemValue, selectedValue, comparer);
},
transitionStatus: (state) => state.transitionStatus,
popupProps: (state) => state.popupProps,
listProps: (state) => state.listProps,
inputProps: (state) => state.inputProps,
triggerProps: (state) => state.triggerProps,
itemRoot: (state) => state.itemRoot,
positionerElement: (state) => state.positionerElement,
listElement: (state) => state.listElement,
popupId: (state) => state.popupId,
triggerElement: (state) => state.triggerElement,
inputElement: (state) => state.inputElement,
inputGroupElement: (state) => state.inputGroupElement,
popupSide: (state) => state.popupSide,
openMethod: (state) => state.openMethod,
inputInsidePopup: (state) => state.inputInsidePopup,
inputOwnsFormValue: (state) => state.inputOwnsFormValue,
selectionMode: (state) => state.selectionMode,
name: (state) => state.name,
form: (state) => state.form,
disabled: (state) => state.disabled,
readOnly: (state) => state.readOnly,
required: (state) => state.required,
grid: (state) => state.grid,
virtualized: (state) => state.virtualized,
itemToStringLabel: (state) => state.itemToStringLabel,
isItemEqualToValue: (state) => state.isItemEqualToValue,
modal: (state) => state.modal,
autoHighlight: (state) => state.autoHighlight
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
var React46 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
var valid = "data-valid";
var invalid = "data-invalid";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-constants/constants.mjs
var DEFAULT_VALIDITY_STATE = {
badInput: false,
customError: false,
patternMismatch: false,
rangeOverflow: false,
rangeUnderflow: false,
stepMismatch: false,
tooLong: false,
tooShort: false,
typeMismatch: false,
valid: null,
valueMissing: false
};
var DEFAULT_FIELD_STATE_ATTRIBUTES = {
valid: null,
touched: false,
dirty: false,
filled: false,
focused: false
};
var DEFAULT_FIELD_ROOT_STATE = {
disabled: false,
...DEFAULT_FIELD_STATE_ATTRIBUTES
};
var fieldValidityMapping = {
valid(value) {
if (value === null) {
return null;
}
if (value) {
return {
[valid]: ""
};
}
return {
[invalid]: ""
};
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
var DEFAULT_FIELD_ROOT_CONTEXT = {
invalid: void 0,
name: void 0,
validityData: {
state: DEFAULT_VALIDITY_STATE,
errors: [],
error: "",
value: "",
initialValue: null
},
setValidityData: NOOP,
disabled: void 0,
setTouched: NOOP,
setDirty: NOOP,
setFilled: NOOP,
setFocused: NOOP,
focusOwnerRef: {
current: void 0
},
validationMode: "onSubmit",
shouldValidateOnChange: () => false,
state: DEFAULT_FIELD_ROOT_STATE,
registerFieldControl: NOOP,
validation: {
getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
inputRef: {
current: null
},
registeredInputs: /* @__PURE__ */ new Map(),
registerInput: NOOP,
getInputControl: () => null,
commit: async () => {
},
change: NOOP
}
};
var FieldRootContext = /* @__PURE__ */ React46.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
if (true) FieldRootContext.displayName = "FieldRootContext";
function useFieldRootContext(optional = true) {
const context = React46.useContext(FieldRootContext);
if (context.setValidityData === NOOP && !optional) {
throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
const {
registerFieldControl
} = useFieldRootContext();
const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
useIsoLayoutEffect(() => {
const source = sourceRef.current;
if (!enabled) {
registerFieldControl(source, void 0);
return;
}
const registration = {
controlRef,
getValue: getFormValueOverride,
id,
name,
value
};
registerFieldControl(source, registration);
}, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);
useIsoLayoutEffect(() => {
const source = sourceRef.current;
return () => {
registerFieldControl(source, void 0);
};
}, [registerFieldControl, sourceRef]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/form-context/FormContext.mjs
var React47 = __toESM(require_react(), 1);
var FormContext = /* @__PURE__ */ React47.createContext({
elementRef: {
current: null
},
formRef: {
current: {
fields: /* @__PURE__ */ new Map()
}
},
errors: {},
clearErrors: NOOP,
validationMode: "onSubmit",
submitCountRef: {
current: 0
}
});
if (true) FormContext.displayName = "FormContext";
function useFormContext() {
return React47.useContext(FormContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
var React49 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
var React48 = __toESM(require_react(), 1);
var LabelableContext = /* @__PURE__ */ React48.createContext({
controlId: void 0,
registerControlId: NOOP,
resetControlId: NOOP,
labelId: void 0,
setLabelId: NOOP,
messageIds: [],
setMessageIds: NOOP,
getDescriptionProps: (externalProps) => externalProps
});
if (true) LabelableContext.displayName = "LabelableContext";
function useLabelableContext() {
return React48.useContext(LabelableContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
function useLabelableId(params = {}) {
const {
id,
enabled = true
} = params;
const {
controlId,
registerControlId,
resetControlId
} = useLabelableContext();
const defaultId = useBaseUiId();
const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
const hasRegisteredRef = React49.useRef(false);
const hadExplicitIdRef = React49.useRef(false);
const unregisterControlId = useStableCallback(() => {
if (!hasRegisteredRef.current || registerControlId === NOOP) {
return;
}
hasRegisteredRef.current = false;
registerControlId(controlSourceRef.current, void 0);
});
useIsoLayoutEffect(() => {
if (!enabled || registerControlId === NOOP) {
unregisterControlId();
return void 0;
}
let nextId;
if (id !== void 0) {
hadExplicitIdRef.current = true;
nextId = id;
} else if (hadExplicitIdRef.current) {
nextId = defaultId;
} else {
resetControlId();
return void 0;
}
if (nextId === void 0) {
unregisterControlId();
return void 0;
}
hasRegisteredRef.current = true;
registerControlId(controlSourceRef.current, nextId);
return void 0;
}, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
useIsoLayoutEffect(() => {
return unregisterControlId;
}, [unregisterControlId]);
return (enabled ? controlId : void 0) ?? id ?? defaultId;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/utils/index.mjs
function getComboboxPopupId(rootId) {
return rootId == null ? void 0 : `${rootId}-popup`;
}
function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
return (item, query) => {
if (item == null) {
return false;
}
return collatorFilter.contains(item, query, itemToStringLabel);
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs
var React50 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/stringifyLocale.mjs
function stringifyLocale(locale) {
if (Array.isArray(locale)) {
return locale.map((value) => stringifyLocale(value)).join(",");
}
if (locale == null) {
return "";
}
return String(locale);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/filter.mjs
var filterCache = /* @__PURE__ */ new Map();
function getFilter(options = {}) {
const {
locale,
...restOptions
} = options;
const collatorOptions = {
usage: "search",
sensitivity: "base",
ignorePunctuation: true,
...restOptions
};
const cacheKey = `${stringifyLocale(locale)}|${JSON.stringify(collatorOptions)}`;
const cachedFilter = filterCache.get(cacheKey);
if (cachedFilter) {
return cachedFilter;
}
const collator = new Intl.Collator(locale, collatorOptions);
const filter = {
contains(item, query, itemToString) {
if (!query) {
return true;
}
const itemString = stringifyAsLabel(item, itemToString);
for (let i = 0; i <= itemString.length - query.length; i += 1) {
if (collator.compare(itemString.slice(i, i + query.length), query) === 0) {
return true;
}
}
return false;
},
startsWith(item, query, itemToString) {
if (!query) {
return true;
}
const itemString = stringifyAsLabel(item, itemToString);
return collator.compare(itemString.slice(0, query.length), query) === 0;
},
endsWith(item, query, itemToString) {
if (!query) {
return true;
}
const itemString = stringifyAsLabel(item, itemToString);
const queryLength = query.length;
return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;
}
};
filterCache.set(cacheKey, filter);
return filter;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs
var useCoreFilter = getFilter;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/scrollable.mjs
function isScrollableY(element, allowOverflowIntent = false) {
const {
overflowY
} = getComputedStyle2(element);
if (overflowY !== "auto" && overflowY !== "scroll") {
return false;
}
return allowOverflowIntent ? element.clientHeight > 0 : element.scrollHeight > element.clientHeight;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/utils/constants.mjs
var NO_ACTIVE_VALUE = /* @__PURE__ */ Symbol("none");
var INITIAL_LAST_HIGHLIGHT = {
value: NO_ACTIVE_VALUE,
index: -1
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
var React51 = __toESM(require_react(), 1);
var DirectionContext = /* @__PURE__ */ React51.createContext(void 0);
if (true) DirectionContext.displayName = "DirectionContext";
function useDirection() {
const context = React51.useContext(DirectionContext);
return context?.direction ?? "ltr";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/items/itemCollection.mjs
function findCollectionItem(valueToItem, itemValue, isEqual) {
const exactItem = valueToItem.get(itemValue);
if (exactItem !== void 0 || isEqual === defaultItemEquality) {
return exactItem;
}
for (const [derivedValue, item] of valueToItem) {
if (compareItemEquality(derivedValue, itemValue, isEqual)) {
return item;
}
}
return void 0;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
function AriaCombobox(props) {
const {
id: idProp,
onOpenChangeComplete: onOpenChangeCompleteProp,
defaultSelectedValue = null,
selectedValue: selectedValueProp,
onSelectedValueChange,
defaultInputValue,
inputValue: inputValueProp,
open: openProp,
defaultOpen = false,
selectionMode,
onItemHighlighted: onItemHighlightedProp,
name: nameProp,
form,
disabled: disabledProp = false,
readOnly = false,
required = false,
inputRef: inputRefProp,
grid = false,
items: itemsProp,
filteredItems: filteredItemsProp,
filter: filterProp,
filterQuery: filterQueryProp,
openOnInputClick = true,
autoHighlight = false,
keepHighlight = false,
highlightItemOnHover = true,
loopFocus = true,
itemToStringLabel: itemToStringLabelProp,
itemToStringValue,
isItemEqualToValue = defaultItemEquality,
virtualized = false,
inline: inlineProp = false,
fillInputOnItemPress = true,
modal = false,
limit = -1,
autoComplete = "list",
formAutoComplete,
locale,
submitOnItemClick = false
} = props;
const {
clearErrors
} = useFormContext();
const {
setDirty,
validityData,
setFilled,
name: fieldName,
disabled: fieldDisabled,
setTouched,
setFocused,
validationMode,
validation
} = useFieldRootContext();
const direction = useDirection();
const id = useLabelableId({
id: idProp
});
const collatorFilter = useCoreFilter({
locale
});
const collection = Array.isArray(itemsProp) ? null : itemsProp;
if (collection && typeof collection.label !== "function") {
throw new Error(true ? "Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems" : formatErrorMessage_default(100));
}
const items = collection ? collection.data : itemsProp;
const itemToValue = collection?.value;
const storeItems = itemToValue ? void 0 : items;
const externalWindow = React52.useMemo(() => {
if (!filteredItemsProp || !itemToValue) {
return void 0;
}
const flat = flattenLeafItems(filteredItemsProp);
const values = flat.map(itemToValue);
let valueToItem;
return {
values,
findItem(itemValue, isEqual) {
if (!valueToItem) {
valueToItem = /* @__PURE__ */ new Map();
for (let i = 0; i < values.length; i += 1) {
if (!valueToItem.has(values[i])) {
valueToItem.set(values[i], flat[i]);
}
}
}
return findCollectionItem(valueToItem, itemValue, isEqual);
}
};
}, [filteredItemsProp, itemToValue]);
const itemToStringLabel = React52.useMemo(() => {
if (!collection) {
return itemToStringLabelProp;
}
return (itemValue) => {
return collection.label(itemValue, isItemEqualToValue, (unresolvedValue) => {
const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);
if (externalItem != null) {
return collection.itemLabel(externalItem);
}
return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);
});
};
}, [collection, itemToStringLabelProp, externalWindow, isItemEqualToValue]);
const filterItemToString = React52.useMemo(() => {
if (!collection) {
return itemToStringLabelProp;
}
return Object.assign((item) => collection.itemLabel(item), {
selected: (value) => stringifyAsLabel(value, itemToStringLabel)
});
}, [collection, itemToStringLabel, itemToStringLabelProp]);
function stringifyValueLabel(item) {
return stringifyAsLabel(item, itemToStringLabel);
}
const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React52.useState(false);
const [closeQuery, setCloseQuery] = React52.useState(null);
const previousCloseQueryRef = React52.useRef(closeQuery);
const listRef = React52.useRef([]);
const labelsRef = React52.useRef([]);
const popupRef = React52.useRef(null);
const inputRef = React52.useRef(null);
const startDismissRef = React52.useRef(null);
const endDismissRef = React52.useRef(null);
const emptyRef = React52.useRef(null);
const hadInputClearRef = React52.useRef(false);
const chipsContainerRef = React52.useRef(null);
const clearRef = React52.useRef(null);
const selectionEventRef = React52.useRef(null);
const lastHighlightRef = React52.useRef(INITIAL_LAST_HIGHLIGHT);
const pendingQueryHighlightRef = React52.useRef(null);
const valuesRef = React52.useRef([]);
const pointerDownItemRef = React52.useRef(null);
const disabled2 = fieldDisabled || disabledProp;
const name = fieldName ?? nameProp;
const multiple = selectionMode === "multiple";
const single = selectionMode === "single";
const hasInputValue = inputValueProp !== void 0 || defaultInputValue !== void 0;
const hasItems = items !== void 0;
const hasFilteredItemsProp = filteredItemsProp !== void 0;
let autoHighlightMode;
if (autoHighlight === "always") {
autoHighlightMode = "always";
} else {
autoHighlightMode = autoHighlight ? "input-change" : false;
}
const [selectedValue, setSelectedValueUnwrapped] = useControlled({
controlled: selectedValueProp,
default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,
name: "Combobox",
state: "selectedValue"
});
const filter = React52.useMemo(() => {
if (filterProp === null) {
return () => true;
}
if (filterProp !== void 0) {
return filterProp;
}
return createCollatorItemFilter(collatorFilter, filterItemToString);
}, [filterProp, collatorFilter, filterItemToString]);
const initialDefaultInputValue = useRefWithInit(() => {
if (hasInputValue) {
return defaultInputValue ?? "";
}
if (single) {
return stringifyValueLabel(selectedValue);
}
return "";
}).current;
const [inputValue, setInputValueUnwrapped] = useControlled({
controlled: inputValueProp,
default: initialDefaultInputValue,
name: "Combobox",
state: "inputValue"
});
const [open2, setOpenUnwrapped] = useControlled({
controlled: openProp,
default: defaultOpen,
name: "Combobox",
state: "open"
});
const isGrouped = isGroupedItems(items);
const query = !open2 && closeQuery !== null ? closeQuery : String(inputValue).trim();
const selectedLabelString = single ? stringifyValueLabel(selectedValue) : "";
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
const filterQuery = shouldBypassFiltering ? "" : filterQueryProp ?? query;
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));
const flatItems = React52.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);
const filteredItems = React52.useMemo(() => {
if (filteredItemsProp && !shouldIgnoreExternalFiltering) {
return filteredItemsProp;
}
if (!items) {
return EMPTY_ARRAY;
}
if (isGrouped) {
const groupedItems = items;
const resultingGroups = [];
let currentCount = 0;
for (const group of groupedItems) {
if (limit > -1 && currentCount >= limit) {
break;
}
const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
const itemsToTake = filterQuery === "" ? group.items.slice(0, remainingLimit) : [];
if (filterQuery !== "") {
for (const item of group.items) {
if (itemsToTake.length >= remainingLimit) {
break;
}
if (filter(item, filterQuery, filterItemToString)) {
itemsToTake.push(item);
}
}
}
if (itemsToTake.length > 0) {
const newGroup = {
...group,
items: itemsToTake
};
resultingGroups.push(newGroup);
currentCount += itemsToTake.length;
}
}
return resultingGroups;
}
if (filterQuery === "") {
return limit > -1 ? flatItems.slice(0, limit) : (
// The cast here is done as `flatItems` is readonly.
// valuesRef.current, a mutable ref, can be set to `flatFilteredValues`, which may
// reference this exact readonly value, creating a mutation risk.
// However, <Combobox.Item> can never mutate this value as the mutating effect
// bails early when `items` is provided, and this is only ever returned
// when `items` is provided due to the early return at the top of this hook.
flatItems
);
}
const limitedItems = [];
for (const item of flatItems) {
if (limit > -1 && limitedItems.length >= limit) {
break;
}
if (filter(item, filterQuery, filterItemToString)) {
limitedItems.push(item);
}
}
return limitedItems;
}, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, filterItemToString, flatItems]);
const flatFilteredValues = React52.useMemo(() => {
if (externalWindow && filteredItems === filteredItemsProp) {
return externalWindow.values;
}
const flat = flattenLeafItems(filteredItems);
return itemToValue ? flat.map((item) => itemToValue(item)) : flat;
}, [filteredItems, filteredItemsProp, externalWindow, itemToValue]);
const store = useRefWithInit(() => {
let initialSelectedIndex = null;
if (inlineProp && open2 && hasItems && selectionMode !== "none") {
initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);
}
return new ReactStore({
id,
labelId: void 0,
selectedValue,
open: open2,
items: storeItems,
selectionMode,
name,
form,
disabled: disabled2,
readOnly,
required,
grid,
virtualized,
openOnInputClick,
itemToStringLabel,
isItemEqualToValue,
modal,
autoHighlight: autoHighlightMode,
submitOnItemClick,
hasInputValue,
mounted: false,
forceMounted: false,
transitionStatus: "idle",
inline: inlineProp,
activeIndex: null,
selectedIndex: initialSelectedIndex,
popupProps: {},
listProps: {},
inputProps: {},
triggerProps: {},
itemRoot: {
props: EMPTY_OBJECT,
id,
selectionMode,
disabled: disabled2,
readOnly,
isItemEqualToValue
},
positionerElement: null,
listElement: null,
popupId: void 0,
triggerElement: null,
inputElement: null,
inputGroupElement: null,
popupSide: null,
openMethod: null,
inputInsidePopup: true,
// Avoid duplicate names in the server HTML. Popup inputs aren't rendered
// until after hydration, so the hidden input takes over then if needed.
inputOwnsFormValue: selectionMode === "none"
}, {
// Placeholder callbacks replaced on first render
onOpenChangeComplete: NOOP,
setOpen: NOOP,
setInputValue: NOOP,
setSelectedValue: NOOP,
setIndices: NOOP,
handleSelection: NOOP,
forceMount: NOOP,
requestSubmit: NOOP,
listRef,
labelsRef,
popupRef,
emptyRef,
inputRef,
startDismissRef,
endDismissRef,
chipsContainerRef,
clearRef,
valuesRef,
pointerDownItemRef,
selectionEventRef
}, selectors2);
}).current;
const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
const fieldStringValue = React52.useMemo(() => {
if (selectionMode === "none") {
return fieldRawValue;
}
if (Array.isArray(selectedValue)) {
return selectedValue.map((value) => stringifyAsValue(value, itemToStringValue));
}
return stringifyAsValue(selectedValue, itemToStringValue);
}, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
const activeIndex = store.useState("activeIndex");
const selectedIndex = store.useState("selectedIndex");
const positionerElement = store.useState("positionerElement");
const listElement = store.useState("listElement");
const triggerElement = store.useState("triggerElement");
const inputElement = store.useState("inputElement");
const inputGroupElement = store.useState("inputGroupElement");
const inline4 = store.useState("inline");
const inputInsidePopup = store.useState("inputInsidePopup");
const inputOwnsFormValue = store.useState("inputOwnsFormValue");
const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;
const triggerRef = useValueAsRef(triggerElement);
const {
openMethod,
triggerProps
} = useOpenInteractionType(open2);
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled2, nameProp);
const forceMount = useStableCallback(() => {
if (items) {
labelsRef.current = flatFilteredValues.map(stringifyValueLabel);
} else {
store.set("forceMounted", true);
}
});
const emitHighlight = useStableCallback((value, index2, type, event) => {
if (index2 === -1) {
if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) {
return;
}
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
} else {
lastHighlightRef.current = {
value,
index: index2
};
}
onItemHighlighted(value, createGenericEventDetails(type, event, {
index: index2
}));
});
const setIndices = useStableCallback((options) => {
const update2 = {};
if (options.activeIndex !== void 0) {
update2.activeIndex = options.activeIndex;
}
if (options.selectedIndex !== void 0) {
update2.selectedIndex = options.selectedIndex;
}
store.update(update2);
const activeIndexOption = options.activeIndex;
if (activeIndexOption === void 0) {
return;
}
const type = options.type || reason_parts_exports.none;
if (activeIndexOption === null) {
emitHighlight(void 0, -1, type, options.event);
} else {
emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type, options.event);
}
});
const setInputValue = useStableCallback((next, eventDetails) => {
props.onInputValueChange?.(next, eventDetails);
if (eventDetails.isCanceled) {
return;
}
hadInputClearRef.current = eventDetails.reason === reason_parts_exports.inputClear;
if (eventDetails.reason === reason_parts_exports.inputChange) {
if (open2 && closeQuery !== null) {
setCloseQuery(null);
}
const event = eventDetails.event;
const inputType = event.inputType;
const isTypedInput = event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText";
if (isTypedInput) {
const hasQuery = next.trim() !== "";
if (hasQuery) {
setQueryChangedAfterOpen(true);
}
pendingQueryHighlightRef.current = {
hasQuery
};
const list = store.state.listElement;
if (!store.state.virtualized && list) {
const popup = popupRef.current;
for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {
if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute("role") === "dialog")) {
break;
}
if (isScrollableY(ancestor)) {
ancestor.scrollTop = 0;
break;
}
}
}
if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open2 || inline4)) {
store.set("activeIndex", 0);
}
}
} else if (eventDetails.reason === reason_parts_exports.inputClear && next === "" && store.state.inputInsidePopup) {
pendingQueryHighlightRef.current = {
hasQuery: false,
selection: true
};
}
setInputValueUnwrapped(next);
});
const handleInterruptedReopen = useStableCallback((isInputChange) => {
const clearsPendingInput = !isInputChange && inputInsidePopup && !inline4 && inputValue !== "" && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);
if (!isInputChange && (clearsPendingInput || inputValue === "" || inputMatchesSelectedValue)) {
setQueryChangedAfterOpen(false);
}
setCloseQuery(null);
if (clearsPendingInput) {
setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear));
}
});
const [preventUnmountOnClose, setPreventUnmountOnClose] = React52.useState(false);
const setOpen = useStableCallback((nextOpen, eventDetails) => {
if (open2 === nextOpen) {
return;
}
if (eventDetails.reason === reason_parts_exports.escapeKey && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) {
eventDetails.allowPropagation();
}
const openEventDetails = eventDetails;
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);
props.onOpenChange?.(nextOpen, openEventDetails);
if (pendingQueryHighlightRef.current?.hasQuery && eventDetails.reason === reason_parts_exports.inputChange === eventDetails.isCanceled) {
pendingQueryHighlightRef.current = null;
}
if (eventDetails.isCanceled) {
return;
}
if (nextOpen && closeQuery !== null) {
handleInterruptedReopen(eventDetails.reason === reason_parts_exports.inputChange);
}
if (!nextOpen && queryChangedAfterOpen) {
if (single) {
if (!inline4) {
setCloseQuery(query);
}
if (query === "") {
setQueryChangedAfterOpen(false);
}
} else if (multiple) {
if (!inline4) {
setCloseQuery(query);
}
if (inputInsidePopup) {
setIndices({
activeIndex: null
});
}
if (!inputInsidePopup || inline4) {
setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear, eventDetails.event, void 0, {
isItemPress: eventDetails.reason === reason_parts_exports.itemPress
}));
}
}
}
if (!nextOpen) {
setPreventUnmountOnClose(shouldPreventUnmountOnClose());
}
setOpenUnwrapped(nextOpen);
if (!nextOpen && inputInsidePopup && (eventDetails.reason === reason_parts_exports.focusOut || eventDetails.reason === reason_parts_exports.outsidePress)) {
setTouched(true);
setFocused(false);
if (validationMode === "onBlur") {
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
validation.commit(valueToValidate);
}
}
});
const setSelectedValue = useStableCallback((nextValue, eventDetails) => {
onSelectedValueChange?.(nextValue, eventDetails);
if (eventDetails.isCanceled) {
return;
}
setSelectedValueUnwrapped(nextValue);
const shouldFillInput = selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;
if (shouldFillInput) {
setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));
}
});
const handleSelection = useStableCallback((event, itemValue) => {
const targetEl = getTarget(event);
const overrideEvent = selectionEventRef.current ?? event;
selectionEventRef.current = null;
const eventDetails = createChangeEventDetails(reason_parts_exports.itemPress, overrideEvent);
const href = closest(targetEl, "a")?.getAttribute("href");
if (href) {
if (href.startsWith("#")) {
setOpen(false, eventDetails);
}
return;
}
if (multiple) {
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);
const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];
setSelectedValue(nextValue, eventDetails);
if (eventDetails.isCanceled) {
return;
}
const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== "" : false;
if (!wasFiltering) {
return;
}
if (store.state.inputInsidePopup) {
setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear, eventDetails.event, void 0, {
isItemPress: true
}));
const pendingHighlight = pendingQueryHighlightRef.current;
if (pendingHighlight && !isCurrentlySelected) {
pendingHighlight.toggledValue = itemValue;
}
} else {
setOpen(false, eventDetails);
}
} else {
setSelectedValue(itemValue, eventDetails);
if (eventDetails.isCanceled) {
return;
}
setOpen(false, eventDetails);
}
});
const requestSubmit = useStableCallback(() => {
const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
if (formElement && typeof formElement.requestSubmit === "function") {
formElement.requestSubmit();
}
});
const handleUnmountCleanup = useStableCallback(() => {
onOpenChangeComplete?.(false);
setQueryChangedAfterOpen(false);
setCloseQuery(null);
if (selectionMode === "none") {
setIndices({
activeIndex: null,
selectedIndex: null
});
} else {
setIndices({
activeIndex: null
});
}
if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) {
setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear));
}
if (single) {
if (store.state.inputInsidePopup) {
if (inputRef.current && inputRef.current.value !== "") {
setInputValue("", createChangeEventDetails(reason_parts_exports.inputClear));
}
} else {
const stringVal = stringifyValueLabel(selectedValue);
if (inputRef.current && inputRef.current.value !== stringVal) {
const reason = stringVal === "" ? reason_parts_exports.inputClear : reason_parts_exports.none;
setInputValue(stringVal, createChangeEventDetails(reason));
}
}
}
});
const resolvedPopupRef = React52.useMemo(() => {
if (inline4 && positionerElement) {
return {
current: closest(positionerElement, '[role="dialog"]')
};
}
return popupRef;
}, [inline4, positionerElement]);
const {
mounted,
transitionStatus,
forceUnmount: handleUnmount
} = useUnmountAfterClose({
open: open2,
ref: resolvedPopupRef,
preventUnmountOnClose,
setPreventUnmountOnClose,
onUnmount: handleUnmountCleanup
});
React52.useImperativeHandle(props.actionsRef, () => ({
unmount: handleUnmount,
close: () => setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
}), [handleUnmount, setOpen]);
useIsoLayoutEffect(function syncSelectedIndex() {
const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;
previousCloseQueryRef.current = closeQuery;
if (open2 && (!closeQueryReleased || !hasItems)) {
return;
}
if (!open2) {
pointerDownItemRef.current = null;
}
if (selectionMode === "none") {
return;
}
const registry = hasItems ? flatFilteredValues : valuesRef.current;
setIndices({
selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple)
});
}, [open2, closeQuery, selectedValue, selectionMode, multiple, hasItems, flatFilteredValues, isItemEqualToValue, setIndices]);
useIsoLayoutEffect(() => {
if (items) {
valuesRef.current = flatFilteredValues;
listRef.current.length = flatFilteredValues.length;
}
}, [items, flatFilteredValues]);
useIsoLayoutEffect(() => {
if (!open2 && pendingQueryHighlightRef.current?.hasQuery) {
pendingQueryHighlightRef.current = null;
}
}, [open2]);
useIsoLayoutEffect(() => {
if (!open2 && inline4 && resolvedPopupRef.current) {
pendingQueryHighlightRef.current = null;
return;
}
const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
const pendingHighlight = pendingQueryHighlightRef.current;
if (pendingHighlight) {
const listIsNavigable = open2 || inline4 || store.state.positionerElement?.hidden === false;
if (pendingHighlight.hasQuery) {
const input = inputRef.current;
if (!autoHighlightMode || String(inputValue).trim() === "" || inline4 && autoHighlightMode !== "always" && (!input || activeElement(input.ownerDocument) !== input)) {
pendingQueryHighlightRef.current = null;
} else if (listIsNavigable && // Individually rendered items register without re-running this effect, and their
// registry has holes mid-reindex, so resolve their request immediately.
(candidateItems[0] !== void 0 || !hasItems && !hasFilteredItemsProp)) {
store.set("activeIndex", 0);
pendingQueryHighlightRef.current = null;
}
} else if (String(inputValue).trim() === "") {
pendingQueryHighlightRef.current = null;
if (listIsNavigable) {
const clearedBySelection = pendingHighlight.selection;
if (autoHighlightMode === "always" && !clearedBySelection && store.state.selectionMode === "none") {
store.set("activeIndex", 0);
}
queueMicrotask(() => {
if (!store.state.open && (!store.state.inline || resolvedPopupRef.current) || inputRef.current && inputRef.current.value.trim() !== "") {
return;
}
const currentSelectedValue = store.state.selectedValue;
const isMultiple = store.state.selectionMode === "multiple";
const hasSelection = isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== "none" && currentSelectedValue != null;
if (hasSelection) {
const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);
store.set("activeIndex", toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));
} else if (clearedBySelection) {
store.set("activeIndex", null);
} else if (autoHighlightMode === "always") {
store.set("activeIndex", 0);
}
});
}
}
}
if (!open2 && !inline4) {
return;
}
const storeActiveIndex = store.state.activeIndex;
if (storeActiveIndex == null) {
if (autoHighlightMode === "always" && candidateItems.length > 0) {
store.set("activeIndex", 0);
return;
}
emitHighlight(void 0, -1, reason_parts_exports.none);
return;
}
if (storeActiveIndex >= candidateItems.length) {
emitHighlight(void 0, -1, reason_parts_exports.none);
store.set("activeIndex", null);
return;
}
const itemValue = candidateItems[storeActiveIndex];
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
emitHighlight(itemValue, storeActiveIndex, reason_parts_exports.none);
}
}, [
activeIndex,
autoHighlightMode,
emitHighlight,
hasFilteredItemsProp,
hasItems,
flatFilteredValues,
inline4,
open2,
resolvedPopupRef,
store,
// Reruns the effect when the query changes without affecting the deps above, such as
// clearing the input when no items are filtered out (individually rendered items).
inputValue
]);
useIsoLayoutEffect(() => {
if (selectionMode === "none") {
setFilled(String(inputValue) !== "");
return;
}
setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);
}, [setFilled, selectionMode, inputValue, selectedValue, multiple]);
React52.useEffect(() => {
if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) {
setIndices({
activeIndex: null
});
}
}, [hasItems, autoHighlightMode, flatFilteredValues.length, setIndices]);
function handleQueryChanged() {
if (open2 && query !== "" && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) {
setQueryChangedAfterOpen(true);
}
}
function handleOpenChanged() {
if (open2 && closeQuery !== null) {
handleInterruptedReopen(false);
}
}
let syncedSelectedLabel = false;
function syncInputToSelectedLabel() {
if (!syncedSelectedLabel && inputValue !== selectedLabelString) {
syncedSelectedLabel = true;
setInputValue(selectedLabelString, createChangeEventDetails(reason_parts_exports.none));
}
}
function handleSelectedValueChanged() {
if (selectionMode === "none") {
return;
}
clearErrors(name);
setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));
validation.change(selectedValue);
if (single && !hasInputValue && !inputInsidePopup) {
syncInputToSelectedLabel();
}
}
function syncInputAfterItemsOrLabelChange() {
if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) {
syncInputToSelectedLabel();
}
}
function handleInputValueChanged() {
if (selectionMode !== "none") {
return;
}
clearErrors(name);
setDirty(inputValue !== validityData.initialValue);
validation.change(inputValue);
}
useValueChanged(query, handleQueryChanged);
useValueChanged(open2, handleOpenChanged);
useValueChanged(selectedValue, handleSelectedValueChanged);
useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);
useValueChanged(items, syncInputAfterItemsOrLabelChange);
useValueChanged(inputValue, handleInputValueChanged);
const floatingRootContext = useFloatingRootContext({
open: inline4 ? true : open2,
onOpenChange: setOpen,
elements: {
reference: inputInsidePopup ? triggerElement : inputElement,
floating: positionerElement
}
});
const ariaHasPopup = grid ? "grid" : "listbox";
const expanded = open2 || inline4;
const ariaExpanded = expanded ? "true" : "false";
const role = React52.useMemo(() => {
const isPlainInput = inputElement?.tagName === "INPUT";
const shouldTreatAsInput = inputElement == null || isPlainInput;
const shouldApplyAria = shouldTreatAsInput || expanded;
const reference = shouldTreatAsInput ? {
autoComplete: "off",
spellCheck: "false",
autoCorrect: "off",
autoCapitalize: "none"
} : {};
if (shouldApplyAria) {
reference.role = "combobox";
reference["aria-expanded"] = ariaExpanded;
reference["aria-haspopup"] = ariaHasPopup;
reference["aria-controls"] = expanded ? listElement?.id : void 0;
reference["aria-autocomplete"] = readOnly ? "none" : autoComplete;
}
return {
reference,
floating: {
role: "presentation"
}
};
}, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete, readOnly]);
const click = useClick(floatingRootContext, {
enabled: !disabled2 && openOnInputClick,
event: "mousedown-only",
toggle: false,
// Apply a small delay for touch to let mobile viewport/keyboard positioning settle.
// This avoids top-bottom flip flickers if the preferred position is "top" when first tapping.
touchOpenDelay: inputInsidePopup ? 0 : 100,
reason: reason_parts_exports.inputPress
});
const dismiss = useDismiss(floatingRootContext, {
enabled: !disabled2 && !inline4,
outsidePressEvent: {
mouse: "sloppy",
// The visual viewport (affected by the mobile software keyboard) can be
// somewhat small. The user may want to scroll the screen to see more of
// the popup.
touch: "intentional"
},
// Without a popup, let the Escape key bubble the event up to other popups' handlers.
bubbles: inline4 ? true : void 0,
outsidePress(event) {
const target = getTarget(event);
return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);
}
});
const listNavigation2 = useListNavigation(floatingRootContext, {
enabled: !disabled2,
id,
listRef,
activeIndex,
selectedIndex,
virtual: true,
loopFocus,
allowEscape: loopFocus && !autoHighlightMode,
focusItemOnOpen: queryChangedAfterOpen || selectionMode === "none" && !autoHighlightMode ? false : "auto",
focusItemOnHover: highlightItemOnHover,
resetOnPointerLeave: !keepHighlight,
orientation: grid ? "horizontal" : void 0,
rtl: direction === "rtl",
disabledIndices: EMPTY_ARRAY,
grid: grid ? gridNavigation : void 0,
onNavigate(nextActiveIndex, event) {
if (!event && !open2 && !(inline4 && nextActiveIndex === null) || transitionStatus === "ending") {
return;
}
setIndices({
activeIndex: nextActiveIndex,
type: getHighlightReason(event),
event: event?.nativeEvent
});
}
});
const inputProps = React52.useMemo(() => mergeProps(listNavigation2.reference, {
onKeyDown(event) {
if (grid && store.state.activeIndex == null && (event.key === "ArrowLeft" || event.key === "ArrowRight")) {
event.preventBaseUIHandler();
}
}
}, dismiss.reference, click.reference, role.reference), [listNavigation2.reference, dismiss.reference, click.reference, role.reference, grid, store]);
const popupProps = React52.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);
const listProps = React52.useMemo(() => mergeProps(listNavigation2.floating, role.floating), [listNavigation2.floating, role.floating]);
const itemRoot = React52.useMemo(() => {
const listNavigationItemProps = listNavigation2.item;
return {
// Combobox keeps focus on the input; item focus would incorrectly sync
// list navigation state from DOM focus.
props: listNavigationItemProps ? {
...listNavigationItemProps,
onFocus: void 0
} : EMPTY_OBJECT,
id,
selectionMode,
disabled: disabled2,
readOnly,
isItemEqualToValue
};
}, [listNavigation2.item, id, selectionMode, disabled2, readOnly, isItemEqualToValue]);
store.useContextCallback("setOpen", setOpen);
store.useContextCallback("setInputValue", setInputValue);
store.useContextCallback("setSelectedValue", setSelectedValue);
store.useContextCallback("setIndices", setIndices);
store.useContextCallback("handleSelection", handleSelection);
store.useContextCallback("forceMount", forceMount);
store.useContextCallback("requestSubmit", requestSubmit);
store.useContextCallback("onOpenChangeComplete", onOpenChangeCompleteProp);
useOnFirstRender(() => {
store.update({
inline: inlineProp,
popupProps,
listProps,
inputProps,
triggerProps,
itemRoot
});
});
const syncedValues = {
id,
selectedValue,
open: open2,
mounted,
transitionStatus,
items: storeItems,
inline: inlineProp,
popupProps,
listProps,
inputProps,
triggerProps,
itemRoot,
openMethod,
selectionMode,
name,
form,
disabled: disabled2,
readOnly,
required,
grid,
virtualized,
openOnInputClick,
itemToStringLabel,
modal,
autoHighlight: autoHighlightMode,
isItemEqualToValue,
submitOnItemClick,
hasInputValue
};
useIsoLayoutEffect(() => {
store.update({
...syncedValues,
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
});
}, [store, ...Object.values(syncedValues)]);
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
const itemsContextValue = React52.useMemo(() => ({
query,
hasItems,
filteredItems,
flatFilteredValues
}), [query, hasItems, filteredItems, flatFilteredValues]);
const serializedValue = React52.useMemo(() => {
if (Array.isArray(fieldRawValue)) {
return "";
}
return stringifyAsValue(fieldRawValue, itemToStringValue);
}, [fieldRawValue, itemToStringValue]);
const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;
const hiddenInputName = multiple || selectionMode === "none" && inputOwnsFormValue ? void 0 : name;
const hiddenInputs = React52.useMemo(() => {
if (!multiple || !Array.isArray(selectedValue) || !name) {
return null;
}
return selectedValue.map((value) => {
const currentSerializedValue = stringifyAsValue(value, itemToStringValue);
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", {
type: "hidden",
form,
name,
value: currentSerializedValue,
disabled: disabled2
}, currentSerializedValue);
});
}, [multiple, selectedValue, form, name, itemToStringValue, disabled2]);
const children = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(React52.Fragment, {
children: [props.children, /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", {
...validation.getValidationProps(disabled2, {
// Move focus when the hidden input is focused.
onFocus() {
if (inputInsidePopup) {
triggerElement?.focus();
return;
}
(inputRef.current || triggerElement)?.focus();
},
// Handle browser autofill.
onChange(event) {
if (event.nativeEvent.defaultPrevented || disabled2 || readOnly) {
return;
}
const nextValue = event.currentTarget.value;
const nextValueLower = nextValue.toLowerCase();
const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);
function handleChange() {
if (multiple) {
return;
}
if (selectionMode === "none") {
setInputValue(nextValue, details);
return;
}
let matchingIndex = findSerializedMatchIndex();
if (matchingIndex === -1) {
matchingIndex = valuesRef.current.findIndex((_, index2) => {
const renderedLabel = labelsRef.current[index2];
return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;
});
}
const matchingValue = matchingIndex === -1 ? void 0 : valuesRef.current[matchingIndex];
if (matchingValue != null) {
setSelectedValue?.(matchingValue, details);
}
}
if (single) {
forceMount();
if (items && findSerializedMatchIndex() === -1) {
store.set("forceMounted", true);
}
}
queueMicrotask(handleChange);
}
}),
id: id && hiddenInputName == null ? `${id}-hidden-input` : void 0,
form,
name: hiddenInputName,
autoComplete: formAutoComplete,
disabled: disabled2,
required: required && !hasMultipleSelection,
readOnly,
value: serializedValue,
ref: hiddenInputRef,
style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,
tabIndex: -1,
"aria-hidden": true,
suppressHydrationWarning: true
}), hiddenInputs]
});
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxRootContext.Provider, {
value: store,
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxFloatingContext.Provider, {
value: floatingRootContext,
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxHasItemsContext.Provider, {
value: hasItems,
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxDerivedItemsContext.Provider, {
value: itemsContextValue,
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxInputValueContext.Provider, {
value: inputValue,
children
})
})
})
})
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/root/AutocompleteRoot.mjs
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
function AutocompleteRoot(props) {
const {
openOnInputClick = false,
value,
defaultValue,
onValueChange,
mode = "list",
itemToStringValue,
...other
} = props;
const enableInline = (mode === "inline" || mode === "both") && !props.readOnly;
const staticItems = mode === "inline" || mode === "none";
const isControlled = value !== void 0;
const [internalValue, setInternalValue] = React53.useState(defaultValue ?? "");
const [inlineInputValue, setInlineInputValue] = React53.useState("");
React53.useEffect(() => {
if (isControlled || !enableInline) {
setInlineInputValue("");
}
}, [value, isControlled, enableInline]);
let resolvedInputValue;
if (enableInline && inlineInputValue !== "") {
resolvedInputValue = inlineInputValue;
} else if (isControlled) {
resolvedInputValue = value ?? "";
} else {
resolvedInputValue = internalValue;
}
const collator = useCoreFilter({
locale: other.locale
});
const resolvedQuery = String((isControlled ? value : internalValue) ?? "").trim();
const resolvedFilter = staticItems || other.filter === null ? null : other.filter ?? collator.contains;
function handleValueChange(nextValue, eventDetails) {
setInlineInputValue("");
if (!isControlled) {
setInternalValue(nextValue);
}
onValueChange?.(nextValue, eventDetails);
}
function handleItemHighlighted(highlightedValue, eventDetails) {
props.onItemHighlighted?.(highlightedValue, eventDetails);
if (eventDetails.reason === reason_parts_exports.pointer) {
return;
}
setInlineInputValue(enableInline && highlightedValue != null ? stringifyAsLabel(highlightedValue, itemToStringValue) : "");
}
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AriaCombobox, {
...other,
itemToStringLabel: itemToStringValue,
openOnInputClick,
selectionMode: "none",
fillInputOnItemPress: true,
filter: resolvedFilter,
filterQuery: (
// Inline completion temporarily changes the displayed input without changing this query.
mode === "both" ? resolvedQuery : void 0
),
autoComplete: mode,
inputValue: resolvedInputValue,
defaultInputValue: defaultValue,
onInputValueChange: handleValueChange,
onItemHighlighted: handleItemHighlighted
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/value/AutocompleteValue.mjs
var React54 = __toESM(require_react(), 1);
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
function AutocompleteValue(props) {
const {
children
} = props;
const inputValue = useComboboxInputValueContext();
let returnValue = null;
if (typeof children === "function") {
returnValue = children(String(inputValue));
} else if (children != null) {
returnValue = children;
} else {
returnValue = inputValue;
}
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(React54.Fragment, {
children: returnValue
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/trigger/ComboboxTrigger.mjs
var React55 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/input/ComboboxInputDataAttributes.mjs
var popupOpen3 = CommonTriggerDataAttributes_exports.popupOpen;
var pressed2 = CommonTriggerDataAttributes_exports.pressed;
var popupSide = "data-popup-side";
var listEmpty = "data-list-empty";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/utils/stateAttributesMapping.mjs
var triggerStateAttributesMapping = {
...pressableTriggerOpenStateMapping,
...fieldValidityMapping,
popupSide: (side) => side ? {
[popupSide]: side
} : null,
listEmpty: (empty) => empty ? {
[listEmpty]: ""
} : null
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-root-context/useSetFieldFocused.mjs
function useSetFieldFocused(disabled2, focusTargetRef, onFocusedChange) {
const {
setFocused,
focusOwnerRef
} = useFieldRootContext();
const setFieldFocused = useStableCallback((focused) => {
if (focused ? !disabled2 : focusOwnerRef.current === setFieldFocused) {
focusOwnerRef.current = focused && setFieldFocused;
onFocusedChange?.(focused);
setFocused(focused);
}
});
useIsoLayoutEffect(() => {
const el = focusTargetRef.current;
const root2 = el?.getRootNode();
if (root2?.activeElement === el) {
setFieldFocused(true);
}
return () => setFieldFocused(false);
}, [disabled2, focusTargetRef, setFieldFocused]);
return setFieldFocused;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs
var BOUNDARY_OFFSET = 5;
function isMouseWithinBounds(event, element) {
const bounds = getPseudoElementBounds(element);
return event.clientX >= bounds.left - BOUNDARY_OFFSET && event.clientX <= bounds.right + BOUNDARY_OFFSET && event.clientY >= bounds.top - BOUNDARY_OFFSET && event.clientY <= bounds.bottom + BOUNDARY_OFFSET;
}
function getPseudoElementBounds(element) {
const elementRect = element.getBoundingClientRect();
const win = getWindow(element);
if (parts_exports.env.jsdom) {
return elementRect;
}
const beforeStyles = win.getComputedStyle(element, "::before");
const afterStyles = win.getComputedStyle(element, "::after");
const hasPseudoElements = beforeStyles.content !== "none" || afterStyles.content !== "none";
if (!hasPseudoElements) {
return elementRect;
}
const beforeWidth = parseFloat(beforeStyles.width) || 0;
const beforeHeight = parseFloat(beforeStyles.height) || 0;
const afterWidth = parseFloat(afterStyles.width) || 0;
const afterHeight = parseFloat(afterStyles.height) || 0;
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
const widthDiff = totalWidth - elementRect.width;
const heightDiff = totalHeight - elementRect.height;
return {
left: elementRect.left - widthDiff / 2,
right: elementRect.right + widthDiff / 2,
top: elementRect.top - heightDiff / 2,
bottom: elementRect.bottom + heightDiff / 2
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
return fieldLabelId ?? localLabelId;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/utils/parts.mjs
function usePopupSide(store) {
const mounted = store.useState("mounted");
const popupSide2 = store.useState("popupSide");
const positionerElement = store.useState("positionerElement");
return mounted && positionerElement ? popupSide2 : null;
}
function useListEmpty() {
return useComboboxDerivedItemsContext().filteredItems.length === 0;
}
function getChipNavigationKeys(direction) {
return direction === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
}
function clickHighlightedItem(store, activeIndex, nativeEvent) {
const listItem = store.context.listRef.current[activeIndex];
if (listItem) {
store.context.selectionEventRef.current = nativeEvent;
listItem.click();
store.context.selectionEventRef.current = null;
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/trigger/ComboboxTrigger.mjs
var ComboboxTrigger = /* @__PURE__ */ React55.forwardRef(function ComboboxTrigger2(componentProps, forwardedRef) {
const {
render,
className,
nativeButton = true,
disabled: disabledProp = false,
id: idProp,
style,
...elementProps
} = componentProps;
const {
state: fieldState,
disabled: fieldDisabled,
setTouched,
validationMode,
validation
} = useFieldRootContext();
const {
labelId: fieldLabelId
} = useLabelableContext();
const store = useComboboxRootContext();
const selectionMode = store.useState("selectionMode");
const comboboxDisabled = store.useState("disabled");
const readOnly = store.useState("readOnly");
const required = store.useState("required");
const positionerElement = store.useState("positionerElement");
const listElement = store.useState("listElement");
const storedPopupId = store.useState("popupId");
const triggerProps = store.useState("triggerProps");
const inputInsidePopup = store.useState("inputInsidePopup");
const rootId = store.useState("id");
const comboboxLabelId = store.useState("labelId");
const open2 = store.useState("open");
const selectedValue = store.useState("selectedValue");
const activeIndex = store.useState("activeIndex");
const selectedIndex = store.useState("selectedIndex");
const hasSelectedValue = store.useState("hasSelectedValue");
const floatingRootContext = useComboboxFloatingContext();
const inputValue = useComboboxInputValueContext();
const focusTimeout = useTimeout();
const disabled2 = fieldDisabled || comboboxDisabled || disabledProp;
const listEmpty2 = useListEmpty();
const popupSide2 = usePopupSide(store);
const triggerRef = React55.useRef(null);
const setFocused = useSetFieldFocused(disabled2, triggerRef);
useLabelableId({
id: inputInsidePopup ? idProp : void 0
});
const id = inputInsidePopup ? idProp ?? rootId : idProp;
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, comboboxLabelId);
let ariaControls;
if (open2 && inputInsidePopup) {
ariaControls = storedPopupId ?? getComboboxPopupId(rootId);
} else if (open2) {
ariaControls = listElement?.id;
}
const currentPointerTypeRef = React55.useRef("");
function trackPointerType(event) {
currentPointerTypeRef.current = event.pointerType;
}
const {
reference: triggerTypeaheadProps
} = useTypeahead(floatingRootContext, {
// Typeahead on a closed trigger commits a value rather than moving a highlight, so it stays
// gated on `readOnly`.
enabled: !open2 && !readOnly && !comboboxDisabled && selectionMode === "single",
listRef: store.context.labelsRef,
activeIndex,
selectedIndex,
onMatch(index2) {
const nextSelectedValue = store.context.valuesRef.current[index2];
if (nextSelectedValue !== void 0) {
store.context.setSelectedValue(nextSelectedValue, createChangeEventDetails(reason_parts_exports.none));
}
}
});
const {
reference: triggerClickProps
} = useClick(floatingRootContext, {
enabled: !comboboxDisabled,
event: "mousedown"
});
const {
buttonRef,
getButtonProps
} = useButton({
native: nativeButton,
disabled: disabled2
});
const state = {
...fieldState,
readOnly,
open: open2,
disabled: disabled2,
popupSide: popupSide2,
listEmpty: listEmpty2,
placeholder: selectionMode === "none" ? false : !hasSelectedValue
};
const setTriggerElement = useStableCallback((element2) => {
store.set("triggerElement", element2);
});
const element = useRenderElement("button", componentProps, {
ref: [forwardedRef, buttonRef, triggerRef, setTriggerElement],
state,
props: [triggerProps, triggerClickProps, triggerTypeaheadProps, {
id,
tabIndex: inputInsidePopup ? 0 : -1,
role: inputInsidePopup ? "combobox" : void 0,
"aria-expanded": open2,
"aria-haspopup": inputInsidePopup ? "dialog" : "listbox",
"aria-controls": ariaControls,
"aria-required": inputInsidePopup ? required || void 0 : void 0,
// Only valid alongside the `combobox` role; without it the trigger is a plain button, and
// the `Combobox.Input` outside the popup already carries `aria-readonly`.
"aria-readonly": inputInsidePopup ? readOnly || void 0 : void 0,
"aria-labelledby": ariaLabelledBy,
onPointerDown: trackPointerType,
onPointerEnter: trackPointerType,
onFocus() {
setFocused(true);
if (disabled2) {
return;
}
focusTimeout.start(0, store.context.forceMount);
},
onBlur(event) {
if (contains(positionerElement, event.relatedTarget)) {
return;
}
setTouched(true);
setFocused(false);
if (validationMode === "onBlur") {
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
validation.commit(valueToValidate);
}
},
onMouseDown(event) {
if (disabled2) {
return;
}
if (!inputInsidePopup) {
floatingRootContext.set("domReferenceElement", event.currentTarget);
}
store.context.forceMount();
if (currentPointerTypeRef.current !== "touch") {
store.context.inputRef.current?.focus();
if (!inputInsidePopup) {
event.preventDefault();
}
}
if (open2) {
return;
}
const doc = ownerDocument(event.currentTarget);
function handleMouseUp(mouseEvent) {
const currentTriggerElement = store.state.triggerElement;
if (!currentTriggerElement) {
return;
}
const mouseUpTarget = getTarget(mouseEvent);
const positioner = store.state.positionerElement;
const list = store.state.listElement;
if (contains(currentTriggerElement, mouseUpTarget) || contains(positioner, mouseUpTarget) || contains(list, mouseUpTarget)) {
return;
}
if (isMouseWithinBounds(mouseEvent, currentTriggerElement)) {
return;
}
store.context.setOpen(false, createChangeEventDetails(reason_parts_exports.cancelOpen, mouseEvent));
}
if (inputInsidePopup) {
doc.addEventListener("mouseup", handleMouseUp, {
once: true
});
}
},
onKeyDown(event) {
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
stopEvent(event);
store.context.setOpen(true, createChangeEventDetails(reason_parts_exports.listNavigation, event.nativeEvent));
store.context.inputRef.current?.focus();
}
}
}, validation.getValidationProps(disabled2, elementProps), getButtonProps],
stateAttributesMapping: triggerStateAttributesMapping
});
return element;
});
if (true) ComboboxTrigger.displayName = "ComboboxTrigger";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/trigger/AutocompleteTrigger.mjs
var AutocompleteTrigger = ComboboxTrigger;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs
var React59 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/chips/ComboboxChipsContext.mjs
var React56 = __toESM(require_react(), 1);
var ComboboxChipsContext = /* @__PURE__ */ React56.createContext(void 0);
if (true) ComboboxChipsContext.displayName = "ComboboxChipsContext";
function useComboboxChipsContext() {
return React56.useContext(ComboboxChipsContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs
var React57 = __toESM(require_react(), 1);
var ComboboxPositionerContext = /* @__PURE__ */ React57.createContext(void 0);
if (true) ComboboxPositionerContext.displayName = "ComboboxPositionerContext";
function useComboboxPositionerContext(optional) {
const context = React57.useContext(ComboboxPositionerContext);
if (context === void 0 && !optional) {
throw new Error(true ? "Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component" : formatErrorMessage_default(21));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs
var React58 = __toESM(require_react(), 1);
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var ComboboxInternalDismissButton = /* @__PURE__ */ React58.forwardRef(function ComboboxInternalDismissButton2(_, forwardedRef) {
const store = useComboboxRootContext();
const {
buttonRef,
getButtonProps
} = useButton({
native: false
});
const mergedRef = useMergedRefs(forwardedRef, buttonRef);
function handleDismiss(event) {
store.context.setOpen(false, createChangeEventDetails(reason_parts_exports.closePress, event.nativeEvent, event.currentTarget));
}
const dismissProps = getButtonProps({
onClick: handleDismiss
});
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {
ref: mergedRef,
...dismissProps,
"aria-label": "Dismiss",
tabIndex: void 0,
style: visuallyHiddenInput
});
});
if (true) ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var ComboboxInput = /* @__PURE__ */ React59.forwardRef(function ComboboxInput2(componentProps, forwardedRef) {
const {
render,
className,
disabled: disabledProp = false,
id: idProp,
style,
...elementProps
} = componentProps;
const {
state: fieldState,
disabled: fieldDisabled,
setTouched,
validationMode,
validation
} = useFieldRootContext();
const {
labelId: fieldLabelId
} = useLabelableContext();
const comboboxChipsContext = useComboboxChipsContext();
const positioning = useComboboxPositionerContext(true);
const hasPositionerParent = Boolean(positioning);
const store = useComboboxRootContext();
const inputValue = useComboboxInputValueContext();
const direction = useDirection();
const required = store.useState("required");
const comboboxDisabled = store.useState("disabled");
const readOnly = store.useState("readOnly");
const name = store.useState("name");
const form = store.useState("form");
const selectionMode = store.useState("selectionMode");
const autoHighlightMode = store.useState("autoHighlight");
const inputProps = store.useState("inputProps");
const triggerProps = store.useState("triggerProps");
const open2 = store.useState("open");
const mounted = store.useState("mounted");
const selectedValue = store.useState("selectedValue");
const rootId = store.useState("id");
const inline4 = store.useState("inline");
const modal = store.useState("modal");
const autoHighlightEnabled = Boolean(autoHighlightMode);
const popupSide2 = usePopupSide(store);
const disabled2 = fieldDisabled || comboboxDisabled || disabledProp;
const listEmpty2 = useListEmpty();
const setFocused = useSetFieldFocused(disabled2, store.context.inputRef);
const isInsidePopup = hasPositionerParent || inline4;
const focusManagerModal = !isInsidePopup || modal;
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
const [composingValue, setComposingValue] = React59.useState(null);
const isComposingRef = React59.useRef(false);
const lastActiveIndexRef = React59.useRef(null);
useIsoLayoutEffect(() => {
if (!open2) {
lastActiveIndexRef.current = null;
}
}, [open2]);
const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
const setInputElement = useStableCallback((element2) => {
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
if (nextIsInsidePopup && !store.state.hasInputValue) {
store.context.setInputValue("", createChangeEventDetails(reason_parts_exports.none));
}
store.update({
inputElement: element2,
inputInsidePopup: nextIsInsidePopup,
inputOwnsFormValue
});
});
const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled2, elementProps);
function clearHighlight(event) {
store.context.setIndices({
activeIndex: null,
selectedIndex: null,
type: getHighlightReason(event),
event
});
}
const state = {
...fieldStateForInput,
open: open2,
disabled: disabled2,
readOnly,
popupSide: popupSide2,
listEmpty: listEmpty2
};
function handleKeyDown(event) {
if (!comboboxChipsContext) {
return void 0;
}
let nextIndex;
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
const [previousChipKey] = getChipNavigationKeys(direction);
if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
event.preventDefault();
nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
}
return nextIndex;
}
const element = useRenderElement("input", componentProps, {
state,
ref: [forwardedRef, store.context.inputRef, setInputElement],
props: [inputProps, triggerProps, {
value: composingValue ?? inputValue,
"aria-readonly": readOnly || void 0,
"aria-required": required || void 0,
"aria-labelledby": fieldLabelId,
disabled: disabled2,
readOnly,
required: selectionMode === "none" ? required : void 0,
form,
...inputOwnsFormValue && name && {
name
},
id,
onFocus() {
setFocused(true);
if (!inline4) {
return;
}
const nextActiveIndex = lastActiveIndexRef.current;
lastActiveIndexRef.current = null;
if (nextActiveIndex == null || // `valuesRef` can be sparse, so guard against restoring a removed slot.
!Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) {
return;
}
store.context.setIndices({
activeIndex: nextActiveIndex
});
},
onBlur() {
setTouched(true);
setFocused(false);
const activeIndex = store.state.activeIndex;
if (inline4 && activeIndex !== null && autoHighlightMode !== "always") {
lastActiveIndexRef.current = activeIndex;
store.context.setIndices({
activeIndex: null
});
}
if (validationMode === "onBlur") {
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
validation.commit(valueToValidate);
}
},
onCompositionStart(event) {
if (parts_exports.os.android) {
return;
}
isComposingRef.current = true;
setComposingValue(event.currentTarget.value);
},
onCompositionEnd(event) {
isComposingRef.current = false;
const next = event.currentTarget.value;
setComposingValue(null);
store.context.setInputValue(next, createChangeEventDetails(reason_parts_exports.inputChange, event.nativeEvent));
},
onChange(event) {
const nativeEvent = event.nativeEvent;
const inputType = nativeEvent.inputType;
const autofillLikeInput = !inputType || inputType === "insertReplacementText";
const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
function maybeOpenOnInput(trimmed) {
if (readOnly || disabled2 || !trimmed || !shouldOpenOnInput) {
return;
}
store.context.setOpen(true, createChangeEventDetails(reason_parts_exports.inputChange, nativeEvent));
if (!autoHighlightEnabled) {
clearHighlight(nativeEvent);
}
}
if (isComposingRef.current) {
const nextVal = event.currentTarget.value;
setComposingValue(nextVal);
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) {
store.context.setOpen(false, createChangeEventDetails(reason_parts_exports.inputClear, nativeEvent));
}
const trimmed = nextVal.trim();
const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
maybeOpenOnInput(trimmed);
if (open2 && store.state.activeIndex !== null && !shouldMaintainHighlight) {
clearHighlight(nativeEvent);
}
return;
}
const inputChangeDetails = createChangeEventDetails(reason_parts_exports.inputChange, nativeEvent);
store.context.setInputValue(event.currentTarget.value, inputChangeDetails);
if (inputChangeDetails.isCanceled) {
return;
}
const empty = event.currentTarget.value === "";
const clearDetails = createChangeEventDetails(reason_parts_exports.inputClear, nativeEvent);
if (empty && !store.state.inputInsidePopup) {
if (selectionMode === "single") {
store.context.setSelectedValue(null, clearDetails);
}
if (!store.state.openOnInputClick) {
store.context.setOpen(false, clearDetails);
}
}
maybeOpenOnInput(event.currentTarget.value.trim());
if (open2 && store.state.activeIndex !== null && !autoHighlightEnabled) {
clearHighlight(nativeEvent);
}
},
onKeyDown(event) {
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
return;
}
if (disabled2 || readOnly) {
if (readOnly && event.key === "Enter" && open2 && store.state.activeIndex !== null) {
stopEvent(event);
}
return;
}
const input = event.currentTarget;
const scrollAmount = input.scrollWidth - input.clientWidth;
const isRTL4 = direction === "rtl";
if (event.key === "Home") {
stopEvent(event);
const cursor = parts_exports.engine.gecko && isRTL4 ? input.value.length : 0;
input.setSelectionRange(cursor, cursor);
input.scrollLeft = 0;
return;
}
if (event.key === "End") {
stopEvent(event);
const cursor = parts_exports.engine.gecko && isRTL4 ? 0 : input.value.length;
input.setSelectionRange(cursor, cursor);
input.scrollLeft = isRTL4 ? -scrollAmount : scrollAmount;
return;
}
if (!mounted && event.key === "Escape") {
const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
const details = createChangeEventDetails(reason_parts_exports.escapeKey, event.nativeEvent);
const value = selectionMode === "multiple" ? [] : null;
store.context.setInputValue("", details);
store.context.setSelectedValue(value, details);
if (!isClear && !store.state.inline && !details.isPropagationAllowed) {
event.stopPropagation();
}
return;
}
if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && Array.isArray(selectedValue) && selectedValue.length > 0) {
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
const newValue = selectedValue.filter((_, index2) => index2 !== removalIndex);
clearHighlight(event.nativeEvent);
store.context.setSelectedValue(newValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent));
return;
}
const nextIndex = handleKeyDown(event);
if (nextIndex !== void 0) {
comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
}
if (event.which === 229) {
return;
}
if (event.key === "Enter" && open2) {
const activeIndex = store.state.activeIndex;
const nativeEvent = event.nativeEvent;
if (activeIndex === null) {
if (inline4) {
return;
}
store.context.setOpen(false, createChangeEventDetails(reason_parts_exports.none, nativeEvent));
return;
}
stopEvent(event);
clickHighlightedItem(store, activeIndex, nativeEvent);
}
}
}, validationProps],
stateAttributesMapping: triggerStateAttributesMapping
});
const renderedInput = hasPositionerParent ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldRootContext.Provider, {
value: DEFAULT_FIELD_ROOT_CONTEXT,
children: element
}) : element;
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(React59.Fragment, {
children: [open2 && focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ComboboxInternalDismissButton, {
ref: store.context.startDismissRef
}), renderedInput]
});
});
if (true) ComboboxInput.displayName = "ComboboxInput";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/input-group/ComboboxInputGroup.mjs
var React60 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/utils/handleInputPress.mjs
function handleInputPress(event, store, disabled2, shouldIgnoreTarget) {
if (event.baseUIHandlerPrevented) {
return;
}
const target = getTarget(event.nativeEvent);
const targetElement = isElement(target) ? target : null;
if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) {
return;
}
event.preventDefault();
if (disabled2) {
return;
}
store.context.inputRef.current?.focus();
if (store.state.openOnInputClick) {
store.context.setOpen(true, createChangeEventDetails(reason_parts_exports.inputPress, event.nativeEvent));
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/input-group/ComboboxInputGroup.mjs
var ComboboxInputGroup = /* @__PURE__ */ React60.forwardRef(function ComboboxInputGroup2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const {
state: fieldState
} = useFieldRootContext();
const store = useComboboxRootContext();
const open2 = store.useState("open");
const comboboxDisabled = store.useState("disabled");
const readOnly = store.useState("readOnly");
const hasSelectedValue = store.useState("hasSelectedValue");
const selectionMode = store.useState("selectionMode");
const popupSide2 = usePopupSide(store);
const disabled2 = comboboxDisabled;
const listEmpty2 = useListEmpty();
const placeholder = selectionMode === "none" ? false : !hasSelectedValue;
const state = {
...fieldState,
open: open2,
disabled: disabled2,
readOnly,
popupSide: popupSide2,
listEmpty: listEmpty2,
placeholder
};
const setInputGroupElement = useStableCallback((element) => {
store.set("inputGroupElement", element);
});
return useRenderElement("div", componentProps, {
ref: [forwardedRef, setInputGroupElement],
props: [{
role: "group",
onMouseDown(event) {
handleInputPress(event, store, disabled2, (target) => {
return contains(store.context.chipsContainerRef.current, target);
});
}
}, elementProps],
state,
stateAttributesMapping: triggerStateAttributesMapping
});
});
if (true) ComboboxInputGroup.displayName = "ComboboxInputGroup";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/input-group/AutocompleteInputGroup.mjs
var AutocompleteInputGroup = ComboboxInputGroup;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/icon/ComboboxIcon.mjs
var React61 = __toESM(require_react(), 1);
var ComboboxIcon = /* @__PURE__ */ React61.forwardRef(function ComboboxIcon2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const element = useRenderElement("span", componentProps, {
ref: forwardedRef,
props: [{
"aria-hidden": true,
children: "▼"
}, elementProps]
});
return element;
});
if (true) ComboboxIcon.displayName = "ComboboxIcon";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/clear/ComboboxClear.mjs
var React62 = __toESM(require_react(), 1);
var stateAttributesMapping = {
...transitionStatusMapping,
...triggerOpenStateMapping
};
var ComboboxClear = /* @__PURE__ */ React62.forwardRef(function ComboboxClear2(componentProps, forwardedRef) {
const {
render,
className,
disabled: disabledProp = false,
nativeButton = true,
keepMounted = false,
style,
...elementProps
} = componentProps;
const {
disabled: fieldDisabled
} = useFieldRootContext();
const store = useComboboxRootContext();
const selectionMode = store.useState("selectionMode");
const comboboxDisabled = store.useState("disabled");
const readOnly = store.useState("readOnly");
const open2 = store.useState("open");
const selectedValue = store.useState("selectedValue");
const hasSelectionChips = store.useState("hasSelectionChips");
const inputValue = useComboboxInputValueContext();
let visible = false;
if (selectionMode === "none") {
visible = inputValue !== "";
} else if (selectionMode === "single") {
visible = selectedValue != null;
} else {
visible = hasSelectionChips;
}
const disabled2 = fieldDisabled || comboboxDisabled || disabledProp;
const {
buttonRef,
getButtonProps
} = useButton({
native: nativeButton,
disabled: disabled2
});
const {
mounted,
transitionStatus,
setMounted
} = useTransitionStatus(visible);
const state = {
disabled: disabled2,
visible,
open: open2,
transitionStatus
};
useOpenChangeComplete({
open: visible,
ref: store.context.clearRef,
onComplete() {
if (!visible) {
setMounted(false);
}
}
});
const element = useRenderElement("button", componentProps, {
state,
ref: [forwardedRef, buttonRef, store.context.clearRef],
props: [{
tabIndex: -1,
children: "x",
// Avoid stealing focus from the input.
onMouseDown(event) {
event.preventDefault();
},
onClick(event) {
if (disabled2 || readOnly) {
return;
}
const type = getHighlightReason(event);
store.context.setInputValue("", createChangeEventDetails(reason_parts_exports.clearPress, event.nativeEvent));
if (selectionMode !== "none") {
store.context.setSelectedValue(Array.isArray(selectedValue) ? [] : null, createChangeEventDetails(reason_parts_exports.clearPress, event.nativeEvent));
store.context.setIndices({
activeIndex: null,
selectedIndex: null,
type,
event: event.nativeEvent
});
} else {
store.context.setIndices({
activeIndex: null,
type,
event: event.nativeEvent
});
}
store.context.inputRef.current?.focus();
}
}, elementProps, getButtonProps],
stateAttributesMapping
});
const shouldRender = keepMounted || mounted;
if (!shouldRender) {
return null;
}
return element;
});
if (true) ComboboxClear.displayName = "ComboboxClear";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs
var React65 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs
var React64 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/collection/GroupCollectionContext.mjs
var React63 = __toESM(require_react(), 1);
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var GroupCollectionContext = /* @__PURE__ */ React63.createContext(null);
if (true) GroupCollectionContext.displayName = "GroupCollectionContext";
function useGroupCollectionContext() {
return React63.useContext(GroupCollectionContext);
}
function GroupCollectionProvider(props) {
const {
children,
items
} = props;
const contextValue = React63.useMemo(() => ({
items
}), [items]);
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GroupCollectionContext.Provider, {
value: contextValue,
children
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
function ComboboxCollection(props) {
const {
children
} = props;
const {
filteredItems
} = useComboboxDerivedItemsContext();
const groupContext = useGroupCollectionContext();
const itemsToRender = groupContext ? groupContext.items : filteredItems;
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(React64.Fragment, {
children: itemsToRender.map(children)
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var ComboboxList = /* @__PURE__ */ React65.forwardRef(function ComboboxList2(componentProps, forwardedRef) {
var _ComboboxCollection;
const {
render,
className,
style,
children,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const floatingRootContext = useComboboxFloatingContext();
const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
const {
filteredItems,
hasItems
} = useComboboxDerivedItemsContext();
const selectionMode = store.useState("selectionMode");
const grid = store.useState("grid");
const readOnly = store.useState("readOnly");
const listProps = store.useState("listProps");
const virtualized = store.useState("virtualized");
const forceMounted = store.useState("forceMounted");
const multiple = selectionMode === "multiple";
const empty = filteredItems.length === 0;
const setPositionerElement = useStableCallback((element2) => {
store.set("positionerElement", element2);
});
const setListElement = useStableCallback((element2) => {
store.set("listElement", element2);
});
const resolvedChildren = React65.useMemo(() => {
if (typeof children === "function") {
return _ComboboxCollection || (_ComboboxCollection = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComboboxCollection, {
children
}));
}
return children;
}, [children]);
const state = {
empty
};
const floatingId = floatingRootContext.useState("floatingId");
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement],
props: [listProps, {
children: resolvedChildren,
tabIndex: -1,
id: floatingId,
role: grid ? "grid" : "listbox",
"aria-multiselectable": multiple ? "true" : void 0,
// On a grid the attribute describes cell editability, not selection, so it's left to the
// combobox element in that mode.
"aria-readonly": !grid && readOnly ? true : void 0,
onKeyDown(event) {
if (store.state.disabled || store.state.readOnly) {
return;
}
if (event.key === "Enter") {
const activeIndex = store.state.activeIndex;
if (activeIndex == null) {
return;
}
stopEvent(event);
clickHighlightedItem(store, activeIndex, event.nativeEvent);
}
}
}, elementProps]
});
if (virtualized) {
return element;
}
const labelsRef = hasItems && !forceMounted ? void 0 : store.context.labelsRef;
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompositeList, {
elementsRef: store.context.listRef,
labelsRef,
children: element
});
});
if (true) ComboboxList.displayName = "ComboboxList";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/status/ComboboxStatus.mjs
var React67 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useInitialLiveRegionTextMutation.mjs
var React66 = __toESM(require_react(), 1);
var LIVE_REGION_MARKER = "";
var INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200;
function findLastTextNode(root2) {
const walker = root2.ownerDocument.createTreeWalker(root2, NodeFilter.SHOW_TEXT);
let lastTextNode = null;
while (walker.nextNode()) {
const textNode = walker.currentNode;
if (textNode.nodeValue !== "") {
lastTextNode = textNode;
}
}
return lastTextNode;
}
function useInitialLiveRegionTextMutation(present = true) {
const timeout = useTimeout();
const rootRef = React66.useRef(null);
React66.useEffect(() => {
if (!present || parts_exports.os.ios) {
return void 0;
}
const root2 = rootRef.current;
if (root2 == null) {
return void 0;
}
const textNode = findLastTextNode(root2);
if (textNode == null) {
return void 0;
}
const originalValue = textNode.data;
const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;
textNode.nodeValue = markedValue;
timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => {
if (textNode.nodeValue === markedValue) {
textNode.nodeValue = originalValue;
}
});
return () => {
timeout.clear();
if (textNode.nodeValue === markedValue) {
textNode.nodeValue = originalValue;
}
};
}, [present, rootRef, timeout]);
return rootRef;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/status/ComboboxStatus.mjs
var ComboboxStatus = /* @__PURE__ */ React67.forwardRef(function ComboboxStatus2(componentProps, forwardedRef) {
const {
render,
className,
style,
children: childrenProp,
...elementProps
} = componentProps;
const statusRef = useInitialLiveRegionTextMutation();
return useRenderElement("div", componentProps, {
ref: [forwardedRef, statusRef],
props: [{
children: childrenProp,
role: "status",
"aria-live": "polite",
"aria-atomic": true
}, elementProps]
});
});
if (true) ComboboxStatus.displayName = "ComboboxStatus";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/portal/ComboboxPortal.mjs
var React69 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/portal/ComboboxPortalContext.mjs
var React68 = __toESM(require_react(), 1);
var ComboboxPortalContext = /* @__PURE__ */ React68.createContext(void 0);
if (true) ComboboxPortalContext.displayName = "ComboboxPortalContext";
function useComboboxPortalContext() {
const context = React68.useContext(ComboboxPortalContext);
if (context === void 0) {
throw new Error(true ? "Base UI: <Combobox.Portal> is missing." : formatErrorMessage_default(20));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/portal/ComboboxPortal.mjs
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
var ComboboxPortal = /* @__PURE__ */ React69.forwardRef(function ComboboxPortal2(props, forwardedRef) {
const {
keepMounted = false,
...portalProps
} = props;
const store = useComboboxRootContext();
const mounted = store.useState("mounted");
const forceMounted = store.useState("forceMounted");
const shouldRender = mounted || keepMounted || forceMounted;
if (!shouldRender) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComboboxPortalContext.Provider, {
value: keepMounted,
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FloatingPortal, {
ref: forwardedRef,
...portalProps
})
});
});
if (true) ComboboxPortal.displayName = "ComboboxPortal";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/backdrop/ComboboxBackdrop.mjs
var React70 = __toESM(require_react(), 1);
var stateAttributesMapping2 = {
...popupStateMapping,
...transitionStatusMapping
};
var ComboboxBackdrop = /* @__PURE__ */ React70.forwardRef(function ComboboxBackdrop2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const open2 = store.useState("open");
const mounted = store.useState("mounted");
const transitionStatus = store.useState("transitionStatus");
const state = {
open: open2,
transitionStatus
};
return useRenderElement("div", componentProps, {
state,
ref: forwardedRef,
stateAttributesMapping: stateAttributesMapping2,
props: [{
role: "presentation",
hidden: !mounted,
style: {
userSelect: "none",
WebkitUserSelect: "none"
}
}, elementProps]
});
});
if (true) ComboboxBackdrop.displayName = "ComboboxBackdrop";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/positioner/ComboboxPositioner.mjs
var React74 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
var React72 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
var React71 = __toESM(require_react(), 1);
function useBaseUIFloating(options) {
const {
nodeId,
externalTree,
rootContext: store
} = options;
const referenceElement = store.useState("referenceElement");
const floatingElement = store.useState("floatingElement");
const domReferenceElement = store.useState("domReferenceElement");
const open2 = store.useState("open");
const floatingId = store.useState("floatingId");
const [positionReference, setPositionReferenceRaw] = React71.useState(null);
const domReferenceRef = React71.useRef(null);
const tree = useFloatingTree(externalTree);
const storeElements = React71.useMemo(() => ({
reference: referenceElement,
floating: floatingElement,
domReference: domReferenceElement
}), [referenceElement, floatingElement, domReferenceElement]);
const position = useFloating({
...options,
elements: {
...storeElements,
...positionReference && {
reference: positionReference
}
}
});
const setPositionReference = React71.useCallback((node) => {
const computedPositionReference = isElement(node) ? {
getBoundingClientRect: () => node.getBoundingClientRect(),
getClientRects: () => node.getClientRects(),
contextElement: node
} : node;
setPositionReferenceRaw(computedPositionReference);
position.refs.setReference(computedPositionReference);
}, [position.refs]);
const refs = React71.useMemo(() => ({
...position.refs,
setPositionReference,
domReference: domReferenceRef
}), [position.refs, setPositionReference]);
const elements = React71.useMemo(() => ({
...position.elements,
domReference: domReferenceElement
}), [position.elements, domReferenceElement]);
const context = React71.useMemo(() => ({
...position,
dataRef: store.context.dataRef,
open: open2,
onOpenChange: store.setOpen,
events: store.context.events,
floatingId,
refs,
elements,
nodeId,
rootStore: store
}), [position, refs, elements, nodeId, store, open2, floatingId]);
useIsoLayoutEffect(() => {
if (domReferenceElement) {
domReferenceRef.current = domReferenceElement;
}
}, [domReferenceElement]);
useIsoLayoutEffect(() => {
store.context.dataRef.current.floatingContext = context;
const node = tree?.nodesRef.current.find((n) => n.id === nodeId);
if (node) {
node.context = context;
}
});
return React71.useMemo(() => ({
...position,
context,
refs,
elements,
rootStore: store
}), [position, refs, elements, context, store]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs
var baseArrow = (options) => ({
name: "arrow",
options,
async fn(state) {
const {
x,
y,
placement,
rects,
platform: platform3,
elements,
middlewareData
} = state;
const {
element,
padding = 0
} = evaluate(options, state) || {};
if (element == null) {
return {};
}
const paddingObject = getPaddingObject(padding);
const coords = {
x,
y
};
const axis = getAlignmentAxis(placement);
const length = getAxisLength(axis);
const arrowDimensions = await platform3.getDimensions(element);
const isYAxis = axis === "y";
const minProp = isYAxis ? "top" : "left";
const maxProp = isYAxis ? "bottom" : "right";
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
const startDiff = coords[axis] - rects.reference[axis];
const clientSize = elements.floating[clientProp] || rects.floating[length];
const centerToReference = endDiff / 2 - startDiff / 2;
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);
const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);
const min2 = minPadding;
const max2 = clientSize - arrowDimensions[length] - maxPadding;
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
const offset4 = clamp(min2, center, max2);
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
return {
[axis]: coords[axis] + alignmentOffset,
data: {
[axis]: offset4,
centerOffset: center - offset4 - alignmentOffset,
...shouldAddOffset && {
alignmentOffset
}
},
reset: shouldAddOffset
};
}
});
var arrow4 = (options, deps) => {
const {
name,
fn
} = baseArrow(options);
return {
name,
fn,
options: [options, deps]
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/hideMiddleware.mjs
var hide4 = {
name: "hide",
async fn(state) {
const {
width,
height,
x,
y
} = state.rects.reference;
const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0;
const overflow = await state.platform.detectOverflow(state, {
elementContext: "reference"
});
const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;
return {
data: {
referenceHidden: referenceHidden || anchorHidden2
}
};
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs
var DEFAULT_SIDES = {
sideX: "left",
sideY: "top"
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs
var availableWidth = "--available-width";
var availableHeight = "--available-height";
var anchorWidth = "--anchor-width";
var anchorHeight = "--anchor-height";
var transformOrigin = "--transform-origin";
var positionerWidth = "--positioner-width";
var positionerHeight = "--positioner-height";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
var AVAILABLE_WIDTH_VAR = availableWidth;
var AVAILABLE_HEIGHT_VAR = availableHeight;
function getLogicalSide(sideParam, renderedSide, isRtl) {
const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end";
const logicalRight = isRtl ? "inline-start" : "inline-end";
const logicalLeft = isRtl ? "inline-end" : "inline-start";
return {
top: "top",
right: isLogicalSideParam ? logicalRight : "right",
bottom: "bottom",
left: isLogicalSideParam ? logicalLeft : "left"
}[renderedSide];
}
function getOffsetData(state, sideParam, isRtl) {
const {
rects,
placement
} = state;
const data = {
side: getLogicalSide(sideParam, getSide(placement), isRtl),
align: getAlignment(placement) || "center",
anchor: {
width: rects.reference.width,
height: rects.reference.height
},
positioner: {
width: rects.floating.width,
height: rects.floating.height
}
};
return data;
}
function useAnchorPositioning(params) {
return useAnchorPositioningWithHook(params, useBaseUIFloating);
}
function useAnchorPositioningWithHook(params, useFloatingHook) {
const {
// Public parameters
anchor,
positionMethod = "absolute",
side: sideParam = "bottom",
sideOffset = 0,
align = "center",
alignOffset = 0,
collisionBoundary,
collisionPadding: collisionPaddingParam = 5,
sticky = false,
arrowPadding = 5,
disableAnchorTracking = false,
inline: inlineMiddleware,
// Private parameters
keepMounted = false,
floatingRootContext,
mounted,
collisionAvoidance,
shift: shift4,
nodeId,
adaptiveOrigin: adaptiveOrigin2,
lazyFlip = false,
externalTree
} = params;
const collisionAvoidanceSide = collisionAvoidance.side || "flip";
const collisionAvoidanceAlign = collisionAvoidance.align || "flip";
const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end";
const shiftCrossAxis = shift4?.crossAxis ?? false;
const shiftRootBoundary = shift4?.rootBoundary;
const anchorFn = typeof anchor === "function" ? anchor : void 0;
const anchorFnCallback = useStableCallback(anchorFn);
const anchorDep = anchorFn ? anchorFnCallback : anchor;
const anchorValueRef = useValueAsRef(anchor);
const mountedRef = useValueAsRef(mounted);
const direction = useDirection();
const isRtl = direction === "rtl";
const [mountPlacement, setMountPlacement] = React72.useState(null);
if (!mounted && mountPlacement !== null) {
setMountPlacement(null);
}
const lockAlign = lazyFlip === "placement";
const mountSide = mountPlacement ? getSide(mountPlacement) : null;
const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || "center" : null;
const side = mountSide || {
top: "top",
right: "right",
bottom: "bottom",
left: "left",
"inline-end": isRtl ? "left" : "right",
"inline-start": isRtl ? "right" : "left"
}[sideParam];
const placementAlign = mountAlign || align;
const placement = placementAlign === "center" ? side : `${side}-${placementAlign}`;
let collisionPadding = collisionPaddingParam;
if (typeof collisionPadding === "number") {
collisionPadding = {
top: collisionPadding,
right: collisionPadding,
bottom: collisionPadding,
left: collisionPadding
};
} else if (collisionPadding) {
collisionPadding = {
top: collisionPadding.top || 0,
right: collisionPadding.right || 0,
bottom: collisionPadding.bottom || 0,
left: collisionPadding.left || 0
};
}
const bias = 1;
const biasTop = sideParam === "bottom" ? bias : 0;
const biasBottom = sideParam === "top" ? bias : 0;
const biasLeft = sideParam === "right" ? bias : 0;
const biasRight = sideParam === "left" ? bias : 0;
const commonCollisionProps = {
boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary,
padding: collisionPadding
};
const arrowRef = React72.useRef(null);
const sideOffsetRef = useValueAsRef(sideOffset);
const alignOffsetRef = useValueAsRef(alignOffset);
const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0;
const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0;
const middleware = [];
if (inlineMiddleware) {
middleware.push(inlineMiddleware);
}
middleware.push(offset3((state) => {
const data = getOffsetData(state, sideParam, isRtl);
const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current;
const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current;
return {
mainAxis: sideAxis,
crossAxis: alignAxis,
alignmentAxis: alignAxis
};
}, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));
const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift";
const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift");
const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({
...commonCollisionProps,
// Ensure the popup flips if it's been limited by its --available-height and it resizes.
// Since the size() padding is smaller than the flip() padding, flip() will take precedence.
padding: {
top: collisionPadding.top + bias + biasTop,
right: collisionPadding.right + bias + biasRight,
bottom: collisionPadding.bottom + bias + biasBottom,
left: collisionPadding.left + bias + biasLeft
},
mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip",
crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false,
fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide
});
const shiftMiddleware = shiftDisabled ? null : shift3({
...commonCollisionProps,
// Use the Layout Viewport to avoid shifting around when pinch-zooming.
rootBoundary: shiftRootBoundary,
mainAxis: collisionAvoidanceAlign !== "none",
crossAxis: crossAxisShiftEnabled,
limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => {
if (!arrowRef.current) {
return {};
}
const {
width,
height
} = arrowRef.current.getBoundingClientRect();
const sideAxis = getSideAxis(getSide(limitData.placement));
const arrowSize = sideAxis === "y" ? width : height;
const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
return {
offset: arrowSize / 2 + offsetAmount / 2
};
})
}, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);
if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || placementAlign === "center") {
middleware.push(shiftMiddleware, flipMiddleware);
} else {
middleware.push(flipMiddleware, shiftMiddleware);
}
middleware.push(size3({
...commonCollisionProps,
apply({
elements: {
floating
},
availableWidth: availableWidth2,
availableHeight: availableHeight2,
rects
}) {
if (!mountedRef.current) {
return;
}
const floatingStyle = floating.style;
floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`);
floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`);
const dpr = getWindow(floating).devicePixelRatio || 1;
const {
x: x2,
y: y2,
width,
height
} = rects.reference;
const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr;
const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr;
floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`);
floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`);
}
}), arrow4((state) => ({
// `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
// we'll create a fake element.
element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"),
// No padding for the fake arrow: it would displace aligned popups on narrow anchors.
padding: arrowRef.current ? arrowPadding : 0
}), [arrowPadding]), {
name: "transformOrigin",
fn(state) {
const {
elements: {
floating
},
middlewareData: middlewareData2,
placement: renderedPlacement2,
platform: platform3,
rects,
y: y2
} = state;
const renderedSide2 = getSide(renderedPlacement2);
const renderedAlign2 = getAlignment(renderedPlacement2);
const isVertical = getSideAxis(renderedSide2) === "y";
const arrowEl = arrowRef.current;
const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;
let crossOrigin;
if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) {
crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%";
} else {
const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0;
const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0;
crossOrigin = `${arrowOffset + arrowSize / 2}px`;
}
let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`;
if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) {
sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y2}px`;
}
floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`);
return {};
}
}, hide4, adaptiveOrigin2);
useIsoLayoutEffect(() => {
if (!mounted && floatingRootContext) {
floatingRootContext.update({
referenceElement: null,
floatingElement: null,
domReferenceElement: null,
positionReference: null
});
}
}, [mounted, floatingRootContext]);
const autoUpdateOptions = React72.useMemo(() => ({
ancestorScroll: !disableAnchorTracking,
elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined",
layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined"
}), [disableAnchorTracking]);
const {
refs,
elements,
x,
y,
middlewareData,
update: update2,
placement: renderedPlacement,
context,
isPositioned,
floatingStyles: originalFloatingStyles
} = useFloatingHook({
rootContext: floatingRootContext,
open: keepMounted ? mounted : void 0,
placement,
middleware,
strategy: positionMethod,
whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions),
nodeId,
externalTree
});
const {
sideX,
sideY
} = middlewareData.adaptiveOrigin || DEFAULT_SIDES;
const resolvedPosition = isPositioned ? positionMethod : "fixed";
const floatingStyles = React72.useMemo(() => {
let base;
if (!isPositioned) {
base = {
position: resolvedPosition,
top: 0,
left: 0
};
} else if (adaptiveOrigin2) {
base = {
position: resolvedPosition,
[sideX]: x,
[sideY]: y
};
} else {
base = {
...originalFloatingStyles,
position: resolvedPosition
};
}
base[AVAILABLE_WIDTH_VAR] = "100vw";
base[AVAILABLE_HEIGHT_VAR] = "100vh";
if (!isPositioned) {
base.opacity = 0;
}
return base;
}, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);
const registeredPositionReferenceRef = React72.useRef(null);
useIsoLayoutEffect(() => {
if (!mounted) {
return;
}
const anchorValue = anchorValueRef.current;
const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue;
const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;
const finalAnchor = unwrappedElement || null;
if (finalAnchor !== registeredPositionReferenceRef.current) {
refs.setPositionReference(finalAnchor);
registeredPositionReferenceRef.current = finalAnchor;
}
}, [mounted, refs, anchorDep, anchorValueRef]);
React72.useEffect(() => {
if (!mounted) {
return;
}
const anchorValue = anchorValueRef.current;
if (typeof anchorValue === "function") {
return;
}
if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {
refs.setPositionReference(anchorValue.current);
registeredPositionReferenceRef.current = anchorValue.current;
}
}, [mounted, refs, anchorDep, anchorValueRef]);
React72.useEffect(() => {
if (keepMounted && mounted && elements.reference && elements.floating) {
return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions);
}
return void 0;
}, [keepMounted, mounted, elements, update2, autoUpdateOptions]);
const renderedSide = getSide(renderedPlacement);
const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
const renderedAlign = getAlignment(renderedPlacement) || "center";
const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden);
useIsoLayoutEffect(() => {
if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) {
setMountPlacement(renderedPlacement);
}
}, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]);
const arrowStyles = React72.useMemo(() => ({
position: "absolute",
top: middlewareData.arrow?.y,
left: middlewareData.arrow?.x
}), [middlewareData.arrow]);
const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;
return React72.useMemo(() => ({
positionerStyles: floatingStyles,
arrowStyles,
arrowRef,
arrowUncentered,
side: logicalRenderedSide,
align: renderedAlign,
physicalSide: renderedSide,
anchorHidden: anchorHidden2,
refs,
context,
isPositioned,
update: update2
}), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]);
}
function isRef(param) {
return param != null && "current" in param;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs
function getDisabledMountTransitionStyles(transitionStatus) {
return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePositioner.mjs
function usePositioner(componentProps, state, {
styles,
transitionStatus,
props,
refs,
hidden,
inert = false
}) {
const style = {
...styles
};
if (inert) {
style.pointerEvents = "none";
}
return useRenderElement("div", componentProps, {
state,
ref: refs,
props: [{
role: "presentation",
hidden,
style
}, getDisabledMountTransitionStyles(transitionStatus), props],
stateAttributesMapping: popupStateMapping
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
var React73 = __toESM(require_react(), 1);
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React73.useState(false);
useIsoLayoutEffect(() => {
if (!enabled || !touchOpen || positionerElement == null) {
setTouchOpenShouldLockScroll(false);
return;
}
const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
const popupWidth2 = positionerElement.offsetWidth;
setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth2 > 0 && popupWidth2 >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
}, [enabled, touchOpen, positionerElement]);
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/positioner/ComboboxPositioner.mjs
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
var ComboboxPositioner = /* @__PURE__ */ React74.forwardRef(function ComboboxPositioner2(componentProps, forwardedRef) {
const {
render,
className,
anchor,
// `useAnchorPositioning` applies the same defaults to the undefined values; the names
// remain destructured to exclude the props from `elementProps`.
positionMethod,
side,
align,
sideOffset,
alignOffset,
collisionBoundary = "clipping-ancestors",
collisionPadding,
arrowPadding,
sticky,
disableAnchorTracking = false,
collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,
style: styleProp,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const floatingRootContext = useComboboxFloatingContext();
const keepMounted = useComboboxPortalContext();
const modal = store.useState("modal");
const open2 = store.useState("open");
const mounted = store.useState("mounted");
const openMethod = store.useState("openMethod");
const positionerElement = store.useState("positionerElement");
const triggerElement = store.useState("triggerElement");
const inputElement = store.useState("inputElement");
const inputGroupElement = store.useState("inputGroupElement");
const inputInsidePopup = store.useState("inputInsidePopup");
const transitionStatus = store.useState("transitionStatus");
const empty = useListEmpty();
const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement);
const positioning = useAnchorPositioning({
anchor: resolvedAnchor,
floatingRootContext,
positionMethod,
mounted,
side,
sideOffset,
align,
alignOffset,
arrowPadding,
collisionBoundary,
collisionPadding,
sticky,
disableAnchorTracking,
keepMounted,
collisionAvoidance,
lazyFlip: true
});
useAnchoredPopupScrollLock(open2 && modal, openMethod === "touch", positionerElement, triggerElement);
const state = {
open: open2,
side: positioning.side,
align: positioning.align,
anchorHidden: positioning.anchorHidden,
empty
};
useIsoLayoutEffect(() => {
store.set("popupSide", positioning.side);
}, [store, positioning.side]);
const setPositionerElement = useStableCallback((element2) => {
store.set("positionerElement", element2);
});
const element = usePositioner(componentProps, state, {
styles: positioning.positionerStyles,
transitionStatus,
props: elementProps,
refs: [forwardedRef, setPositionerElement],
hidden: !mounted,
inert: !open2
});
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(ComboboxPositionerContext.Provider, {
value: positioning,
children: [mounted && modal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InternalBackdrop, {
inert: inertValue(!open2),
cutout: inputGroupElement ?? inputElement ?? triggerElement
}), element]
});
});
if (true) ComboboxPositioner.displayName = "ComboboxPositioner";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/popup/ComboboxPopup.mjs
var React75 = __toESM(require_react(), 1);
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var stateAttributesMapping3 = {
...popupStateMapping,
...transitionStatusMapping
};
var ComboboxPopup = /* @__PURE__ */ React75.forwardRef(function ComboboxPopup2(componentProps, forwardedRef) {
const {
render,
className,
style,
initialFocus,
finalFocus,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const positioning = useComboboxPositionerContext();
const floatingRootContext = useComboboxFloatingContext();
const mounted = store.useState("mounted");
const open2 = store.useState("open");
const openMethod = store.useState("openMethod");
const popupProps = store.useState("popupProps");
const transitionStatus = store.useState("transitionStatus");
const inputInsidePopup = store.useState("inputInsidePopup");
const inputElement = store.useState("inputElement");
const modal = store.useState("modal");
const rootId = store.useState("id");
const empty = useListEmpty();
const popupId = elementProps.id ?? (inputInsidePopup ? getComboboxPopupId(rootId) : void 0);
useIsoLayoutEffect(() => {
store.set("popupId", store.context.popupRef.current?.id || popupId);
return () => {
store.set("popupId", void 0);
};
}, [store, popupId]);
useOpenChangeComplete({
open: open2,
ref: store.context.popupRef,
onComplete() {
if (open2) {
store.context.onOpenChangeComplete(true);
}
}
});
const state = {
open: open2,
side: positioning.side,
align: positioning.align,
anchorHidden: positioning.anchorHidden,
transitionStatus,
empty
};
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, store.context.popupRef],
props: [popupProps, {
id: popupId,
role: inputInsidePopup ? "dialog" : "presentation",
onFocus(event) {
const target = getTarget(event.nativeEvent);
if (openMethod !== "touch" && (contains(store.state.listElement, target) || target === event.currentTarget)) {
store.context.inputRef.current?.focus();
}
}
}, getDisabledMountTransitionStyles(transitionStatus), elementProps],
stateAttributesMapping: stateAttributesMapping3
});
const computedDefaultInitialFocus = inputInsidePopup ? (interactionType) => interactionType === "touch" ? store.context.popupRef.current : inputElement : false;
const resolvedInitialFocus = initialFocus === void 0 ? computedDefaultInitialFocus : initialFocus;
let resolvedFinalFocus;
if (finalFocus != null) {
resolvedFinalFocus = finalFocus;
} else {
resolvedFinalFocus = inputInsidePopup ? void 0 : false;
}
const focusManagerModal = !inputInsidePopup || modal;
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FloatingFocusManager, {
context: floatingRootContext,
disabled: !mounted,
modal: focusManagerModal,
openInteractionType: openMethod,
initialFocus: resolvedInitialFocus,
returnFocus: resolvedFinalFocus,
getInsideElements: () => [store.context.startDismissRef.current, store.context.endDismissRef.current],
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(React75.Fragment, {
children: [element, focusManagerModal && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ComboboxInternalDismissButton, {
ref: store.context.endDismissRef
})]
})
});
});
if (true) ComboboxPopup.displayName = "ComboboxPopup";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/arrow/ComboboxArrow.mjs
var React76 = __toESM(require_react(), 1);
var ComboboxArrow = /* @__PURE__ */ React76.forwardRef(function ComboboxArrow2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const {
arrowRef,
side,
align,
arrowUncentered,
arrowStyles
} = useComboboxPositionerContext();
const open2 = store.useState("open");
const state = {
open: open2,
side,
align,
uncentered: arrowUncentered
};
return useRenderElement("div", componentProps, {
ref: [arrowRef, forwardedRef],
stateAttributesMapping: popupStateMapping,
state,
props: {
style: arrowStyles,
"aria-hidden": true,
...elementProps
}
});
});
if (true) ComboboxArrow.displayName = "ComboboxArrow";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs
var React78 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/group/ComboboxGroupContext.mjs
var React77 = __toESM(require_react(), 1);
var ComboboxGroupContext = /* @__PURE__ */ React77.createContext(void 0);
if (true) ComboboxGroupContext.displayName = "ComboboxGroupContext";
function useComboboxGroupContext() {
const context = React77.useContext(ComboboxGroupContext);
if (context === void 0) {
throw new Error(true ? "Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>." : formatErrorMessage_default(18));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var ComboboxGroup = /* @__PURE__ */ React78.forwardRef(function ComboboxGroup2(componentProps, forwardedRef) {
const {
render,
className,
style,
items,
...elementProps
} = componentProps;
const store = useComboboxRootContext();
const grid = store.useState("grid");
const [labelId, setLabelId] = React78.useState();
const contextValue = React78.useMemo(() => ({
labelId,
setLabelId,
items
}), [labelId, setLabelId, items]);
const element = useRenderElement("div", componentProps, {
ref: forwardedRef,
props: [{
// `group` is not a valid owned element of `grid`, and `row` must be owned
// by `grid`, `rowgroup`, or `treegrid`.
role: grid ? "rowgroup" : "group",
"aria-labelledby": labelId
}, elementProps]
});
const wrappedElement = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ComboboxGroupContext.Provider, {
value: contextValue,
children: element
});
if (items) {
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GroupCollectionProvider, {
items,
children: wrappedElement
});
}
return wrappedElement;
});
if (true) ComboboxGroup.displayName = "ComboboxGroup";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.mjs
var React79 = __toESM(require_react(), 1);
var ComboboxGroupLabel = /* @__PURE__ */ React79.forwardRef(function ComboboxGroupLabel2(componentProps, forwardedRef) {
const {
render,
className,
style,
id: idProp,
...elementProps
} = componentProps;
const {
setLabelId
} = useComboboxGroupContext();
const id = useBaseUiId(idProp);
useIsoLayoutEffect(() => {
setLabelId(id);
return () => {
setLabelId((currentId) => currentId === id ? void 0 : currentId);
};
}, [id, setLabelId]);
const element = useRenderElement("div", componentProps, {
ref: forwardedRef,
props: [{
id,
"aria-hidden": true
}, elementProps]
});
return element;
});
if (true) ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs
var React82 = __toESM(require_react(), 1);
var ReactDOM6 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/item/ComboboxItemContext.mjs
var React80 = __toESM(require_react(), 1);
var ComboboxItemContext = /* @__PURE__ */ React80.createContext(void 0);
if (true) ComboboxItemContext.displayName = "ComboboxItemContext";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/row/ComboboxRowContext.mjs
var React81 = __toESM(require_react(), 1);
var ComboboxRowContext = /* @__PURE__ */ React81.createContext(false);
if (true) ComboboxRowContext.displayName = "ComboboxRowContext";
function useComboboxRowContext() {
return React81.useContext(ComboboxRowContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
function ComboboxItemInner(props) {
const {
componentProps,
forwardedRef,
virtualized,
indexFromFilter
} = props;
const {
render,
className,
style,
value: itemValue = null,
index: indexProp,
disabled: disabledProp = false,
nativeButton = false,
...elementProps
} = componentProps;
const textRef = React82.useRef(null);
const listItem = useCompositeListItem({
guess: true,
index: indexProp,
textRef
});
const store = useComboboxRootContext();
const isRow = useComboboxRowContext();
const hasItems = useComboboxHasItemsContext();
const {
props: itemProps,
id: rootId,
selectionMode,
disabled: rootDisabled,
readOnly,
isItemEqualToValue
} = store.useState("itemRoot");
const disabled2 = rootDisabled || disabledProp;
const selectable = selectionMode !== "none";
const index2 = indexProp ?? indexFromFilter ?? listItem.index;
const hasRegistered = index2 !== -1;
const highlighted = store.useState("isActive", index2);
const matchesSelectedValue = store.useState("isSelected", itemValue);
const itemRef = React82.useRef(null);
const id = rootId != null && hasRegistered ? `${rootId}-${index2}` : void 0;
const selected = matchesSelectedValue && selectable;
useIsoLayoutEffect(() => {
const shouldRun = hasRegistered && (virtualized || indexProp != null);
if (!shouldRun) {
return void 0;
}
const list = store.context.listRef.current;
list[index2] = itemRef.current;
return () => {
delete list[index2];
};
}, [hasRegistered, virtualized, index2, indexProp, store]);
useIsoLayoutEffect(() => {
if (!hasRegistered || hasItems) {
return void 0;
}
const visibleValues = store.context.valuesRef.current;
visibleValues[index2] = itemValue;
return () => {
delete visibleValues[index2];
};
}, [hasRegistered, hasItems, index2, itemValue, store]);
useIsoLayoutEffect(() => {
if (!hasRegistered || hasItems) {
return;
}
const selectedValue = store.state.selectedValue;
let nextIndex = store.state.selectedIndex;
if (store.state.selectionMode === "multiple" && Array.isArray(selectedValue)) {
nextIndex = resolveSelectedIndex(index2, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);
} else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) {
nextIndex = index2;
}
store.set("selectedIndex", nextIndex);
}, [hasRegistered, hasItems, store, index2, itemValue, isItemEqualToValue]);
const {
getButtonProps,
buttonRef
} = useButton({
disabled: disabled2,
focusableWhenDisabled: true,
native: nativeButton,
composite: true
});
const state = {
disabled: disabled2,
selected,
highlighted
};
function commitSelection(nativeEvent) {
function selectItem() {
store.context.handleSelection(nativeEvent, itemValue);
}
if (store.state.submitOnItemClick) {
ReactDOM6.flushSync(selectItem);
store.context.requestSubmit();
} else {
selectItem();
}
}
const defaultProps = {
id,
role: isRow ? "gridcell" : "option",
"aria-selected": selectable ? selected : void 0,
// Focusable items steal focus from the input upon mouseup.
// Warn if the user renders a natively focusable element like `<button>`,
// as it should be a `<div>` instead.
tabIndex: void 0,
onPointerDownCapture(event) {
if (event.isPrimary) {
store.context.pointerDownItemRef.current = event.currentTarget;
}
event.preventDefault();
},
onMouseDown(event) {
event.preventDefault();
},
onClick(event) {
if (disabled2 || readOnly) {
return;
}
commitSelection(event.nativeEvent);
},
onMouseUp(event) {
const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;
store.context.pointerDownItemRef.current = null;
if (disabled2 || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) {
return;
}
commitSelection(event.nativeEvent);
}
};
const element = useRenderElement("div", componentProps, {
ref: [buttonRef, forwardedRef, listItem.ref, itemRef],
state,
props: [itemProps, defaultProps, elementProps, getButtonProps]
});
const contextValue = React82.useMemo(() => ({
selected,
textRef
}), [selected, textRef]);
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComboboxItemContext.Provider, {
value: contextValue,
children: element
});
}
function ComboboxItemVirtualizedIndex(props) {
const {
componentProps,
forwardedRef
} = props;
const store = useComboboxRootContext();
const isItemEqualToValue = store.useState("isItemEqualToValue");
const {
flatFilteredValues
} = useComboboxDerivedItemsContext();
const lookupValue = componentProps.value ?? null;
const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComboboxItemInner, {
componentProps,
forwardedRef,
virtualized: true,
indexFromFilter
});
}
var ComboboxItem = /* @__PURE__ */ React82.memo(/* @__PURE__ */ React82.forwardRef(function ComboboxItem2(componentProps, forwardedRef) {
const store = useComboboxRootContext();
const virtualized = store.useState("virtualized");
if (virtualized && componentProps.index == null) {
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComboboxItemVirtualizedIndex, {
componentProps,
forwardedRef
});
}
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComboboxItemInner, {
componentProps,
forwardedRef,
virtualized,
indexFromFilter: void 0
});
}));
if (true) ComboboxItem.displayName = "ComboboxItem";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/item/AutocompleteItem.mjs
var AutocompleteItem = ComboboxItem;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/row/ComboboxRow.mjs
var React83 = __toESM(require_react(), 1);
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var ComboboxRow = /* @__PURE__ */ React83.forwardRef(function ComboboxRow2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const element = useRenderElement("div", componentProps, {
ref: forwardedRef,
props: [{
role: "row"
}, elementProps]
});
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ComboboxRowContext.Provider, {
value: true,
children: element
});
});
if (true) ComboboxRow.displayName = "ComboboxRow";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.mjs
var React84 = __toESM(require_react(), 1);
var ComboboxEmpty = /* @__PURE__ */ React84.forwardRef(function ComboboxEmpty2(componentProps, forwardedRef) {
const {
render,
className,
style,
children: childrenProp,
...elementProps
} = componentProps;
const {
filteredItems
} = useComboboxDerivedItemsContext();
const store = useComboboxRootContext();
const emptyRef = useInitialLiveRegionTextMutation();
const children = filteredItems.length === 0 ? childrenProp : null;
return useRenderElement("div", componentProps, {
ref: [forwardedRef, store.context.emptyRef, emptyRef],
props: [{
children,
role: "status",
"aria-live": "polite",
"aria-atomic": true
}, elementProps]
});
});
if (true) ComboboxEmpty.displayName = "ComboboxEmpty";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/listbox-separator/ListboxSeparator.mjs
var React85 = __toESM(require_react(), 1);
var ListboxSeparator = /* @__PURE__ */ React85.forwardRef(function ListboxSeparator2(componentProps, forwardedRef) {
const {
className,
render,
orientation = "horizontal",
style,
...elementProps
} = componentProps;
const state = {
orientation
};
return useRenderElement("div", componentProps, {
state,
ref: forwardedRef,
props: [{
role: "presentation"
}, elementProps]
});
});
if (true) ListboxSeparator.displayName = "ListboxSeparator";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/autocomplete/separator/AutocompleteSeparator.mjs
var AutocompleteSeparator = ListboxSeparator;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/combobox/root/utils/useFilteredItems.mjs
function useFilteredItems() {
const items = useComboboxDerivedItemsContext();
return items.filteredItems;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/button/Button.mjs
var React86 = __toESM(require_react(), 1);
var Button = /* @__PURE__ */ React86.forwardRef(function Button2(componentProps, forwardedRef) {
const {
render,
className,
disabled: disabled2 = false,
focusableWhenDisabled = false,
nativeButton = true,
style,
...elementProps
} = componentProps;
const {
getButtonProps,
buttonRef
} = useButton({
disabled: disabled2,
focusableWhenDisabled,
native: nativeButton
});
const state = {
disabled: disabled2
};
return useRenderElement("button", componentProps, {
state,
ref: [forwardedRef, buttonRef],
props: [elementProps, getButtonProps]
});
});
if (true) Button.displayName = "Button";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/item/FieldItemContext.mjs
var React87 = __toESM(require_react(), 1);
var FieldItemContext = /* @__PURE__ */ React87.createContext({
disabled: false
});
if (true) FieldItemContext.displayName = "FieldItemContext";
function useFieldItemContext() {
const context = React87.useContext(FieldItemContext);
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/root/useFieldValidation.mjs
var React88 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
function getCombinedFieldValidityData(validityData, invalid2) {
return {
...validityData,
state: {
...validityData.state,
valid: !invalid2 && validityData.state.valid
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/root/useFieldValidation.mjs
var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
function isEligibleInput(input, formElement) {
if (input.matches(":disabled")) {
return false;
}
if (!formElement || input.form === formElement) {
return true;
}
return input.form === null && !input.hasAttribute("form");
}
function findRepresentativeInput(inputs, formElement) {
let fallback = null;
for (const input of inputs.keys()) {
if (!isEligibleInput(input, formElement)) {
continue;
}
if (!input.validity.valid) {
return input;
}
fallback ??= input;
}
return fallback;
}
function makeState(customError) {
return {
...DEFAULT_VALIDITY_STATE,
valid: !customError,
customError
};
}
function getNativeErrors(element) {
return element && element.validationMessage ? [element.validationMessage] : [];
}
function useFieldValidation(params) {
const {
elementRef,
formRef
} = useFormContext();
const {
setValidityData,
validate,
validityData,
validationDebounceTime,
invalid: invalid2,
markedDirtyRef,
state,
shouldValidateOnChange,
validationMode,
registeredFieldIdRef
} = params;
const {
controlId,
getDescriptionProps
} = useLabelableContext();
const timeout = useTimeout();
const inputRef = React88.useRef(null);
const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
const validationCommitIdRef = React88.useRef(0);
const customValidityRef = React88.useRef(null);
const registerInput = React88.useCallback((element, registration) => {
registeredInputs.set(element, registration);
return () => {
registeredInputs.delete(element);
};
}, [registeredInputs]);
const getInputControl = useStableCallback(() => {
const element = findRepresentativeInput(registeredInputs, elementRef.current);
return element && registeredInputs.get(element)?.controlRef.current || null;
});
const commit = useStableCallback(async (value, revalidate = false) => {
validationCommitIdRef.current += 1;
const validationCommitId = validationCommitIdRef.current;
function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
const fieldId = registeredFieldIdRef.current ?? controlId;
if (fieldId == null) {
return;
}
const currentFieldData = formRef.current.fields.get(fieldId);
if (!currentFieldData) {
return;
}
const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
formRef.current.fields.set(fieldId, {
...currentFieldData,
validityData: validityDataWithFormErrors
});
}
function makeValidityData(validityState, errorMessages) {
const errors = validityState.valid === false ? errorMessages : [];
return {
value,
state: validityState,
error: errors[0] ?? "",
errors,
initialValue: validityData.initialValue
};
}
function setCustomValidity(element2, message) {
const displaced = element2.validity.customError ? element2.validationMessage : "";
const ownedMessage = message.replace(/\r\n?/g, "\n");
element2.setCustomValidity(ownedMessage);
customValidityRef.current = [element2, ownedMessage, displaced];
}
function clearCustomValidity() {
const record = customValidityRef.current;
customValidityRef.current = null;
if (record && (!record[0].willValidate || record[0].validationMessage === record[1])) {
record[0].setCustomValidity(record[2]);
}
}
function publish(validityState, errorMessages, externalInvalid) {
const nextValidityData = makeValidityData(validityState, errorMessages);
updateRegisteredFieldValidity(nextValidityData, externalInvalid);
setValidityData(nextValidityData);
}
function getState(el) {
const computedState = validityKeys.reduce((acc, key) => {
acc[key] = el.validity[key];
return acc;
}, {});
let hasOnlyValueMissingError = false;
for (const key of validityKeys) {
if (key === "valid") {
continue;
}
if (key === "valueMissing" && computedState[key]) {
hasOnlyValueMissingError = true;
} else if (computedState[key]) {
return computedState;
}
}
if (hasOnlyValueMissingError && !markedDirtyRef.current) {
computedState.valid = true;
computedState.valueMissing = false;
}
return computedState;
}
function resolveRepresentativeInput() {
return registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
}
let element = resolveRepresentativeInput();
function refreshState() {
element = resolveRepresentativeInput();
return element?.willValidate ? getState(element) : makeState(false);
}
if (revalidate) {
if (state.valid !== false || !element) {
return;
}
if (!element.validity.valueMissing) {
clearCustomValidity();
const currentElement = resolveRepresentativeInput();
const foreign = currentElement?.validity.customError ? getNativeErrors(currentElement) : [];
publish(makeState(foreign.length > 0), foreign, false);
return;
}
for (const key of validityKeys) {
if (key !== "valid" && key !== "valueMissing" && key !== "customError" && element.validity[key]) {
return;
}
}
}
timeout.clear();
clearCustomValidity();
let nextState = refreshState();
let validationErrors = getNativeErrors(element);
const isValidatingOnChange = shouldValidateOnChange();
if (validationErrors.length === 0 || isValidatingOnChange) {
const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
if (field.name) {
acc[field.name] = field.getValue();
}
return acc;
}, {});
const resultOrPromise = validate(value, formValues);
let result;
if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) {
if (nextState.valid === false) {
publish(nextState, validationErrors);
} else if (validationMode === "onSubmit" || !validityData.state.customError) {
nextState.valid = null;
publish(nextState, validationErrors);
}
result = await resultOrPromise;
if (validationCommitId !== validationCommitIdRef.current) {
return;
}
nextState = refreshState();
} else {
result = resultOrPromise;
}
validationErrors = result ? [].concat(result).filter(Boolean) : [];
if (validationErrors.length > 0) {
nextState.valid = false;
nextState.customError = true;
if (element?.willValidate) {
setCustomValidity(element, validationErrors.join("\n"));
}
} else {
validationErrors = getNativeErrors(element);
}
}
publish(nextState, validationErrors);
});
const change = useStableCallback((value, cancelPending = false) => {
timeout.clear();
validationCommitIdRef.current += 1;
if (cancelPending) {
return;
}
const validateOnChange = shouldValidateOnChange();
if (validateOnChange && value !== "" && validationDebounceTime) {
timeout.start(validationDebounceTime, () => {
commit(value);
});
} else {
commit(value, !validateOnChange);
}
});
const getValidationProps = React88.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
"aria-invalid": true
} : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
return React88.useMemo(() => ({
getValidationProps,
inputRef,
registeredInputs,
registerInput,
getInputControl,
commit,
change
}), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
function useRegisteredLabelId(idProp, setLabelId) {
const id = useBaseUiId(idProp);
useIsoLayoutEffect(() => {
setLabelId(id);
return () => {
setLabelId((currentId) => currentId === id ? void 0 : currentId);
};
}, [id, setLabelId]);
return id;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
function useLabel(params = {}) {
const {
id: idProp,
fallbackControlId,
native = false,
setLabelId: setLabelIdProp,
focusControl: focusControlProp
} = params;
const {
controlId: contextControlId,
setLabelId: setContextLabelId
} = useLabelableContext();
const syncLabelId = useStableCallback((nextLabelId) => {
setContextLabelId(nextLabelId);
setLabelIdProp?.(nextLabelId);
});
const id = useRegisteredLabelId(idProp, syncLabelId);
const resolvedControlId = contextControlId ?? fallbackControlId;
function focusControl(event) {
if (focusControlProp) {
focusControlProp(event, resolvedControlId);
return;
}
if (!resolvedControlId) {
return;
}
const controlElement = getControlById(event.currentTarget, resolvedControlId);
if (isHTMLElement(controlElement)) {
focusElementWithVisible(controlElement);
}
}
function handleInteraction(event) {
const target = getTarget(event.nativeEvent);
if (closest(target, "button,input,select,textarea")) {
return;
}
if (!event.defaultPrevented && event.detail > 1) {
event.preventDefault();
}
if (native) {
return;
}
focusControl(event);
}
return native ? {
id,
htmlFor: resolvedControlId,
onMouseDown: handleInteraction
} : {
id,
onClick: handleInteraction,
onPointerDown(event) {
event.preventDefault();
}
};
}
function getControlById(label, id) {
let root2 = label.getRootNode();
while (isShadowRoot(root2)) {
const element = root2.getElementById(id);
if (element) {
return element;
}
root2 = root2.host.getRootNode();
}
return ownerDocument(label).getElementById(id);
}
function focusElementWithVisible(element) {
element.focus({
// Available from Chrome 144+ (January 2026).
// Safari and Firefox already support it.
focusVisible: true
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupViewport.mjs
var React92 = __toESM(require_react(), 1);
var ReactDOM7 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/usePreviousValue.mjs
var React89 = __toESM(require_react(), 1);
function usePreviousValue(value) {
const [state, setState] = React89.useState({
current: value,
previous: null
});
if (!Object.is(value, state.current)) {
setState({
current: value,
previous: state.current
});
}
return state.previous;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
var React90 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getCssDimensions.mjs
function getCssDimensions2(element) {
const css = getComputedStyle2(element);
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs
var popupWidth = "--popup-width";
var popupHeight = "--popup-height";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
function usePopupAutoResize(parameters) {
const {
popupElement,
positionerElement,
content,
mounted,
onMeasureLayout: onMeasureLayoutParam,
onMeasureLayoutComplete: onMeasureLayoutCompleteParam,
side,
direction
} = parameters;
const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true);
const animationFrame = useAnimationFrame();
const committedDimensionsRef = React90.useRef(null);
const onMeasureLayout = useStableCallback(onMeasureLayoutParam);
const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam);
const anchoringStyles = React90.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]);
useIsoLayoutEffect(() => {
if (!mounted) {
committedDimensionsRef.current = null;
return void 0;
}
if (!popupElement || !positionerElement) {
return void 0;
}
const restoreAnchoringStyles = applyElementStyles(popupElement, anchoringStyles);
setPopupCssSize(popupElement, "auto");
const restorePopupPosition = overrideElementStyle(popupElement, "position", "static");
const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none");
const restorePopupScale = overrideElementStyle(popupElement, "scale", "1");
const restorePositionerAvailableSize = applyElementStyles(positionerElement, {
[availableWidth]: "max-content",
[availableHeight]: "max-content"
});
function restoreMeasurementOverrides() {
restorePopupPosition();
restorePopupTransform();
restorePositionerAvailableSize();
restorePopupScale();
}
onMeasureLayout?.();
if (committedDimensionsRef.current === null) {
setPositionerCssSize(positionerElement, "max-content");
const dimensions = getCssDimensions2(popupElement);
committedDimensionsRef.current = dimensions;
setPositionerCssSize(positionerElement, dimensions);
restoreMeasurementOverrides();
onMeasureLayoutComplete?.(null, dimensions);
return restoreAnchoringStyles;
}
setPositionerCssSize(positionerElement, "max-content");
const previousDimensions = committedDimensionsRef.current;
const newDimensions = getCssDimensions2(popupElement);
committedDimensionsRef.current = newDimensions;
setPopupCssSize(popupElement, previousDimensions);
restoreMeasurementOverrides();
onMeasureLayoutComplete?.(previousDimensions, newDimensions);
setPositionerCssSize(positionerElement, newDimensions);
const abortController = new AbortController();
animationFrame.request(() => {
setPopupCssSize(popupElement, newDimensions);
runOnceAnimationsFinish(() => {
popupElement.style.setProperty(popupWidth, "auto");
popupElement.style.setProperty(popupHeight, "auto");
}, abortController.signal);
});
return () => {
abortController.abort();
animationFrame.cancel();
restoreAnchoringStyles();
};
}, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]);
}
function getPopupAnchoringStyles(side, direction) {
const isPhysicalTop = side === "top";
const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start");
if (!isPhysicalTop && !isPhysicalLeft) {
return EMPTY_OBJECT;
}
return {
position: "absolute",
[isPhysicalTop ? "bottom" : "top"]: "0",
[isPhysicalLeft ? "right" : "left"]: "0"
};
}
function overrideElementStyle(element, property, value) {
const originalValue = element.style.getPropertyValue(property);
element.style.setProperty(property, value);
return () => {
element.style.setProperty(property, originalValue);
};
}
function applyElementStyles(element, styles) {
const restorers = [];
for (const [key, value] of Object.entries(styles)) {
restorers.push(overrideElementStyle(element, key, value));
}
return restorers.length ? () => {
restorers.forEach((restore) => restore());
} : NOOP;
}
function setPopupCssSize(popupElement, size4) {
const width = size4 === "auto" ? "auto" : `${size4.width}px`;
const height = size4 === "auto" ? "auto" : `${size4.height}px`;
popupElement.style.setProperty(popupWidth, width);
popupElement.style.setProperty(popupHeight, height);
}
function setPositionerCssSize(positionerElement, size4) {
const width = size4 === "max-content" ? "max-content" : `${size4.width}px`;
const height = size4 === "max-content" ? "max-content" : `${size4.height}px`;
positionerElement.style.setProperty(positionerWidth, width);
positionerElement.style.setProperty(positionerHeight, height);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
var React91 = __toESM(require_react(), 1);
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
var DirectionProvider = function DirectionProvider2(props) {
const {
direction = "ltr"
} = props;
const contextValue = React91.useMemo(() => ({
direction
}), [direction]);
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DirectionContext.Provider, {
value: contextValue,
children: props.children
});
};
if (true) DirectionProvider.displayName = "DirectionProvider";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs
var adaptiveOrigin = {
name: "adaptiveOrigin",
async fn(state) {
const {
x: rawX,
y: rawY,
rects: {
floating: floatRect
},
elements: {
floating
},
platform: platform3,
strategy,
placement
} = state;
const win = getWindow(floating);
const styles = win.getComputedStyle(floating);
const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
if (!hasTransition) {
return {
x: rawX,
y: rawY,
data: DEFAULT_SIDES
};
}
const offsetParent = await platform3.getOffsetParent?.(floating);
let offsetDimensions = {
width: 0,
height: 0
};
if (strategy === "fixed" && win?.visualViewport) {
offsetDimensions = {
width: win.visualViewport.width,
height: win.visualViewport.height
};
} else if (offsetParent === win) {
const doc = ownerDocument(floating);
offsetDimensions = {
width: doc.documentElement.clientWidth,
height: doc.documentElement.clientHeight
};
} else if (await platform3.isElement?.(offsetParent)) {
offsetDimensions = await platform3.getDimensions(offsetParent);
}
const currentSide = getSide(placement);
let x = rawX;
let y = rawY;
if (currentSide === "left") {
x = offsetDimensions.width - (rawX + floatRect.width);
}
if (currentSide === "top") {
y = offsetDimensions.height - (rawY + floatRect.height);
}
const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX;
const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY;
return {
x,
y,
data: {
sideX,
sideY
}
};
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs
var activationDirection = "data-activation-direction";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupViewport.mjs
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
var popupViewportStateMapping = {
activationDirection: (value) => value ? {
[activationDirection]: value
} : null
};
function usePopupViewport(parameters) {
const {
store,
side,
children
} = parameters;
const direction = useDirection();
const activeTrigger = store.useState("activeTriggerElement");
const activeTriggerId = store.useState("activeTriggerId");
const open2 = store.useState("open");
const payload = store.useState("payload");
const mounted = store.useState("mounted");
const popupElement = store.useState("popupElement");
const positionerElement = store.useState("positionerElement");
const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null);
const currentContentKey = usePopupContentKey(activeTriggerId, payload);
const capturedNodeRef = React92.useRef(null);
const [previousContentNode, setPreviousContentNode] = React92.useState(null);
const [newTriggerOffset, setNewTriggerOffset] = React92.useState(null);
const currentContainerRef = React92.useRef(null);
const previousContainerRef = React92.useRef(null);
const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true);
const cleanupFrame = useAnimationFrame();
const cleanupControllerRef = React92.useRef(null);
const [previousContentDimensions, setPreviousContentDimensions] = React92.useState(null);
const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React92.useState(false);
useIsoLayoutEffect(() => {
store.set("adaptiveOrigin", adaptiveOrigin);
return () => {
store.set("adaptiveOrigin", void 0);
};
}, [store]);
const handleMeasureLayout = useStableCallback(() => {
currentContainerRef.current?.style.setProperty("animation", "none");
currentContainerRef.current?.style.setProperty("transition", "none");
previousContainerRef.current?.style.setProperty("display", "none");
});
const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => {
currentContainerRef.current?.style.removeProperty("animation");
currentContainerRef.current?.style.removeProperty("transition");
previousContainerRef.current?.style.removeProperty("display");
if (previousDimensions) {
setPreviousContentDimensions(previousDimensions);
}
});
const armViewportCleanup = useStableCallback(() => {
cleanupControllerRef.current?.abort();
const controller = new AbortController();
cleanupControllerRef.current = controller;
onAnimationsFinished(() => {
setPreviousContentNode(null);
setPreviousContentDimensions(null);
capturedNodeRef.current = null;
}, controller.signal);
});
const lastHandledTriggerRef = React92.useRef(null);
useIsoLayoutEffect(() => {
if (!open2 || !mounted) {
lastHandledTriggerRef.current = null;
}
}, [open2, mounted]);
useIsoLayoutEffect(() => {
if (open2 && activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
setPreviousContentNode(capturedNodeRef.current);
setShowStartingStyleAttribute(true);
const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
setNewTriggerOffset(offset4);
lastHandledTriggerRef.current = activeTrigger;
}
}, [open2, activeTrigger, previousActiveTrigger]);
useIsoLayoutEffect(() => {
if (previousContentNode == null) {
return;
}
cleanupControllerRef.current?.abort();
setShowStartingStyleAttribute(true);
cleanupFrame.request(() => {
ReactDOM7.flushSync(() => {
setShowStartingStyleAttribute(false);
});
armViewportCleanup();
});
}, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]);
useIsoLayoutEffect(() => {
const source = currentContainerRef.current;
if (!source) {
return;
}
const wrapper = ownerDocument(source).createElement("div");
for (const child of Array.from(source.childNodes)) {
wrapper.appendChild(child.cloneNode(true));
}
capturedNodeRef.current = wrapper;
});
const isTransitioning = previousContentNode != null;
let childrenToRender;
if (!isTransitioning) {
childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
"data-current": true,
ref: currentContainerRef,
children
}, currentContentKey);
} else {
childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(React92.Fragment, {
children: [/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
"data-previous": true,
inert: inertValue(true),
ref: previousContainerRef,
style: {
...previousContentDimensions ? {
[popupWidth]: `${previousContentDimensions.width}px`,
[popupHeight]: `${previousContentDimensions.height}px`
} : null,
position: "absolute"
},
"data-ending-style": showStartingStyleAttribute ? void 0 : ""
}, "previous"), /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {
"data-current": true,
ref: currentContainerRef,
"data-starting-style": showStartingStyleAttribute ? "" : void 0,
children
}, currentContentKey)]
});
}
useIsoLayoutEffect(() => {
const container = previousContainerRef.current;
if (!container || !previousContentNode) {
return;
}
container.replaceChildren(...Array.from(previousContentNode.childNodes));
}, [previousContentNode]);
usePopupAutoResize({
popupElement,
positionerElement,
mounted,
content: payload,
onMeasureLayout: handleMeasureLayout,
onMeasureLayoutComplete: handleMeasureLayoutComplete,
side,
direction
});
const state = {
activationDirection: getActivationDirection(newTriggerOffset),
transitioning: isTransitioning
};
return {
children: childrenToRender,
state
};
}
function getActivationDirection(offset4) {
if (!offset4) {
return void 0;
}
return `${getValueWithTolerance(offset4.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset4.vertical, 5, "down", "up")}`;
}
function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
if (value > tolerance) {
return positiveLabel;
}
if (value < -tolerance) {
return negativeLabel;
}
return "";
}
function calculateRelativePosition(from, to) {
const fromRect = from.getBoundingClientRect();
const toRect = to.getBoundingClientRect();
const fromCenter = {
x: fromRect.left + fromRect.width / 2,
y: fromRect.top + fromRect.height / 2
};
const toCenter = {
x: toRect.left + toRect.width / 2,
y: toRect.top + toRect.height / 2
};
return {
horizontal: toCenter.x - fromCenter.x,
vertical: toCenter.y - fromCenter.y
};
}
function usePopupContentKey(activeTriggerId, payload) {
const [contentKey, setContentKey] = React92.useState(0);
const previousActiveTriggerIdRef = React92.useRef(activeTriggerId);
const previousPayloadRef = React92.useRef(payload);
const pendingPayloadUpdateRef = React92.useRef(false);
useIsoLayoutEffect(() => {
const previousActiveTriggerId = previousActiveTriggerIdRef.current;
const previousPayload = previousPayloadRef.current;
const triggerIdChanged = activeTriggerId !== previousActiveTriggerId;
const payloadChanged = payload !== previousPayload;
if (triggerIdChanged) {
setContentKey((value) => value + 1);
pendingPayloadUpdateRef.current = !payloadChanged;
} else if (pendingPayloadUpdateRef.current && payloadChanged) {
setContentKey((value) => value + 1);
pendingPayloadUpdateRef.current = false;
}
previousActiveTriggerIdRef.current = activeTriggerId;
previousPayloadRef.current = payload;
}, [activeTriggerId, payload]);
return `${activeTriggerId ?? "current"}-${contentKey}`;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/index.parts.mjs
var index_parts_exports2 = {};
__export(index_parts_exports2, {
Control: () => FieldControl,
Description: () => FieldDescription,
Error: () => FieldError,
Item: () => FieldItem,
Label: () => FieldLabel,
Root: () => FieldRoot,
Validity: () => FieldValidity
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/root/FieldRoot.mjs
var React96 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
var React93 = __toESM(require_react(), 1);
var FieldsetRootContext = /* @__PURE__ */ React93.createContext(void 0);
if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
function useFieldsetRootContext(optional = false) {
const context = React93.useContext(FieldsetRootContext);
if (!context && !optional) {
throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
var React94 = __toESM(require_react(), 1);
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
var LabelableProvider = function LabelableProvider2(props) {
const defaultId = useBaseUiId();
const [controlIdState, setControlIdState] = React94.useState(defaultId);
const [labelId, setLabelId] = React94.useState();
const [messageIds, setMessageIds] = React94.useState([]);
const controlId = controlIdState === void 0 ? defaultId : controlIdState;
const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
const {
messageIds: parentMessageIds
} = useLabelableContext();
const registerControlId = useStableCallback((source, nextId) => {
const registrations = registrationsRef.current;
if (nextId === void 0) {
registrations.delete(source);
} else {
registrations.set(source, nextId);
}
setControlIdState((prev) => {
if (registrations.size === 0) {
return prev;
}
let nextControlId;
for (const id of registrations.values()) {
if (id === prev) {
return prev;
}
if (nextControlId === void 0) {
nextControlId = id;
}
}
return nextControlId;
});
});
const resetControlId = useStableCallback(() => {
if (registrationsRef.current.size === 0) {
setControlIdState(defaultId);
}
});
const getDescriptionProps = React94.useCallback((externalProps) => {
const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
ids.push(...parentMessageIds, ...messageIds);
return {
...externalProps,
"aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
};
}, [parentMessageIds, messageIds]);
const contextValue = React94.useMemo(() => ({
controlId,
registerControlId,
resetControlId,
labelId,
setLabelId,
messageIds,
setMessageIds,
getDescriptionProps
}), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelableContext.Provider, {
value: contextValue,
children: props.children
});
};
if (true) LabelableProvider.displayName = "LabelableProvider";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
var React95 = __toESM(require_react(), 1);
function useFieldControlRegistration(params) {
const {
change,
commit,
invalid: invalid2,
markedDirtyRef,
name,
setRegisteredFieldName,
registeredFieldIdRef,
setValidityData,
validityData
} = params;
const {
formRef
} = useFormContext();
const activeFieldControlSourceRef = React95.useRef(null);
const registrationRef = React95.useRef(null);
const initialValueCapturedRef = React95.useRef(false);
const getValueForForm = useStableCallback(() => {
const registration = registrationRef.current;
if (!registration) {
return void 0;
}
if (registration.getValue) {
return registration.getValue();
}
return registration.value;
});
function getRegistrationValue(registration) {
return registration.value === void 0 ? getValueForForm() : registration.value;
}
const validate = useStableCallback(() => {
const registration = registrationRef.current;
markedDirtyRef.current = true;
if (!registration) {
commit(validityData.value);
return;
}
commit(getRegistrationValue(registration));
});
function refreshRegistration() {
const registration = registrationRef.current;
if (!registration || !registration.id) {
return;
}
formRef.current.fields.set(registration.id, {
getValue: getValueForForm,
name: name ?? registration.name,
controlRef: registration.controlRef,
validityData: getCombinedFieldValidityData(validityData, invalid2),
validate
});
}
function deleteRegistration(id = registrationRef.current?.id) {
if (id) {
formRef.current.fields.delete(id);
}
}
function captureInitialValue(registration) {
if (initialValueCapturedRef.current) {
return;
}
initialValueCapturedRef.current = true;
const initialValue = getRegistrationValue(registration);
setValidityData((prev) => prev.initialValue === initialValue ? prev : {
...prev,
initialValue
});
}
useIsoLayoutEffect(() => {
const registration = registrationRef.current;
if (!registration || !registration.id) {
return;
}
setRegisteredFieldName(name ? void 0 : registration.name);
formRef.current.fields.set(registration.id, {
getValue: getValueForForm,
name: name ?? registration.name,
controlRef: registration.controlRef,
validityData: getCombinedFieldValidityData(validityData, invalid2),
validate
});
}, [formRef, getValueForForm, invalid2, name, setRegisteredFieldName, validate, validityData]);
useIsoLayoutEffect(() => {
const fields = formRef.current.fields;
return () => {
const id = registrationRef.current?.id;
if (id) {
fields.delete(id);
}
};
}, [formRef]);
const register2 = useStableCallback((source, registration) => {
if (!registration) {
if (activeFieldControlSourceRef.current === source) {
activeFieldControlSourceRef.current = null;
change(void 0, true);
deleteRegistration();
registrationRef.current = null;
setRegisteredFieldName(void 0);
registeredFieldIdRef.current = void 0;
}
return;
}
const previousId = registrationRef.current?.id;
const previousSource = activeFieldControlSourceRef.current;
if (previousSource && previousSource !== source) {
change(void 0, true);
}
activeFieldControlSourceRef.current = source;
registrationRef.current = registration;
if (!name) {
setRegisteredFieldName(registration.name);
}
registeredFieldIdRef.current = registration.id;
if (previousId && previousId !== registration.id) {
deleteRegistration(previousId);
}
captureInitialValue(registration);
refreshRegistration();
});
return [validate, register2];
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/root/FieldRoot.mjs
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
var FieldRootInner = /* @__PURE__ */ React96.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
const {
errors,
validationMode: formValidationMode,
submitCountRef
} = useFormContext();
const {
render,
className,
validate: validateProp,
validationDebounceTime = 0,
validationMode = formValidationMode,
name,
disabled: disabledProp = false,
invalid: invalidProp,
dirty: dirtyProp,
touched: touchedProp,
actionsRef,
style,
...elementProps
} = componentProps;
const disabledFieldset = useFieldsetRootContext(true)?.disabled;
const validate = useStableCallback(validateProp || (() => null));
const disabled2 = disabledFieldset || disabledProp;
const [touchedState, setTouchedUnwrapped] = React96.useState(false);
const [dirtyState, setDirtyUnwrapped] = React96.useState(false);
const [filled, setFilled] = React96.useState(false);
const [focused, setFocused] = React96.useState(false);
const focusOwnerRef = React96.useRef(void 0);
const dirty = dirtyProp ?? dirtyState;
const touched = touchedProp ?? touchedState;
const markedDirtyRef = React96.useRef(dirty);
const registeredFieldIdRef = React96.useRef(void 0);
const [registeredFieldName, setRegisteredFieldName] = React96.useState();
const effectiveName = name ?? registeredFieldName;
useIsoLayoutEffect(() => {
if (dirtyProp !== void 0) {
markedDirtyRef.current = dirtyProp;
}
}, [dirtyProp]);
const setDirty = useStableCallback((value) => {
if (dirtyProp !== void 0) {
return;
}
if (value) {
markedDirtyRef.current = true;
}
setDirtyUnwrapped(value);
});
const setTouched = useStableCallback((value) => {
if (touchedProp !== void 0) {
return;
}
setTouchedUnwrapped(value);
});
const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
const invalid2 = invalidProp === true || hasFormError;
const [validityData, setValidityData] = React96.useState({
state: DEFAULT_VALIDITY_STATE,
error: "",
errors: [],
value: null,
initialValue: null
});
const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
const state = React96.useMemo(() => ({
disabled: disabled2,
touched,
dirty,
valid: valid2,
filled,
focused
}), [disabled2, touched, dirty, valid2, filled, focused]);
const validation = useFieldValidation({
setValidityData,
validate,
validityData,
validationDebounceTime,
invalid: invalid2,
markedDirtyRef,
state,
shouldValidateOnChange,
validationMode,
registeredFieldIdRef
});
const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
change: validation.change,
commit: validation.commit,
invalid: invalid2,
markedDirtyRef,
name,
setRegisteredFieldName,
registeredFieldIdRef,
setValidityData,
validityData
});
React96.useImperativeHandle(actionsRef, () => ({
validate: validateFieldControl
}), [validateFieldControl]);
const contextValue = React96.useMemo(() => ({
invalid: invalid2,
name: effectiveName,
validityData,
setValidityData,
disabled: disabled2,
setTouched,
setDirty,
setFilled,
setFocused,
focusOwnerRef,
validationMode,
shouldValidateOnChange,
state,
registerFieldControl,
validation
}), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
const element = useRenderElement("div", componentProps, {
ref: forwardedRef,
state,
props: elementProps,
stateAttributesMapping: fieldValidityMapping
});
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FieldRootContext.Provider, {
value: contextValue,
children: element
});
});
if (true) FieldRootInner.displayName = "FieldRootInner";
var FieldRoot = /* @__PURE__ */ React96.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LabelableProvider, {
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FieldRootInner, {
...componentProps,
ref: forwardedRef
})
});
});
if (true) FieldRoot.displayName = "FieldRoot";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/label/FieldLabel.mjs
var React97 = __toESM(require_react(), 1);
var FieldLabel = /* @__PURE__ */ React97.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
const {
render,
className,
style,
id: idProp,
nativeLabel = true,
...elementProps
} = componentProps;
const fieldRootContext = useFieldRootContext(false);
const fieldItemContext = useFieldItemContext();
const {
labelId
} = useLabelableContext();
const state = {
...fieldRootContext.state,
disabled: fieldRootContext.disabled || fieldItemContext.disabled
};
const labelRef = React97.useRef(null);
const labelProps = useLabel({
id: labelId ?? idProp,
native: nativeLabel
});
if (true) {
React97.useEffect(() => {
if (!labelRef.current) {
return;
}
const isLabelTag = labelRef.current.tagName === "LABEL";
if (nativeLabel) {
if (!isLabelTag) {
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
const message = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`.";
error(`${message}${ownerStackMessage}`);
}
} else if (isLabelTag) {
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
const message = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`.";
error(`${message}${ownerStackMessage}`);
}
}, [nativeLabel]);
}
const element = useRenderElement("label", componentProps, {
ref: [forwardedRef, labelRef],
state,
props: [labelProps, elementProps],
stateAttributesMapping: fieldValidityMapping
});
return element;
});
if (true) FieldLabel.displayName = "FieldLabel";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/error/FieldError.mjs
var React98 = __toESM(require_react(), 1);
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var stateAttributesMapping4 = {
...fieldValidityMapping,
...transitionStatusMapping
};
var FieldError = /* @__PURE__ */ React98.forwardRef(function FieldError2(componentProps, forwardedRef) {
const {
render,
id: idProp,
className,
match,
style,
...elementProps
} = componentProps;
const id = useBaseUiId(idProp);
const {
validityData,
state: fieldState,
name
} = useFieldRootContext(false);
const {
setMessageIds
} = useLabelableContext();
const {
errors
} = useFormContext();
const formError = name && Object.hasOwn(errors, name) ? errors[name] : null;
const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
const hasSpecificMatch = typeof match === "string";
let rendered = false;
if (match === true) {
rendered = true;
} else if (fieldState.disabled) {
rendered = false;
} else if (hasSpecificMatch) {
rendered = Boolean(validityData.state[match]);
} else {
rendered = hasFormError || validityData.state.valid === false;
}
const {
mounted,
transitionStatus,
setMounted
} = useTransitionStatus(rendered);
useIsoLayoutEffect(() => {
if (!rendered || !id) {
return void 0;
}
setMessageIds((v) => v.concat(id));
return () => {
setMessageIds((v) => v.filter((item) => item !== id));
};
}, [rendered, id, setMessageIds]);
const errorRef = React98.useRef(null);
const [lastRenderedMessage, setLastRenderedMessage] = React98.useState(null);
const [lastRenderedMessageKey, setLastRenderedMessageKey] = React98.useState(null);
let error2 = validityData.error;
if (!hasSpecificMatch && hasFormError) {
error2 = formError;
} else if (validityData.errors.length > 1) {
error2 = validityData.errors;
}
let errorMessage = error2;
if (Array.isArray(error2)) {
errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("ul", {
children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("li", {
children: message
}, message))
}) : error2[0];
}
const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2;
if (rendered && errorKey !== lastRenderedMessageKey) {
setLastRenderedMessageKey(errorKey);
setLastRenderedMessage(errorMessage);
}
useOpenChangeComplete({
open: rendered,
ref: errorRef,
onComplete() {
if (!rendered) {
setMounted(false);
}
}
});
const state = {
...fieldState,
transitionStatus
};
const element = useRenderElement("div", componentProps, {
ref: [forwardedRef, errorRef],
state,
props: [{
id,
children: rendered ? errorMessage : lastRenderedMessage
}, elementProps],
stateAttributesMapping: stateAttributesMapping4,
enabled: mounted
});
if (!mounted) {
return null;
}
return element;
});
if (true) FieldError.displayName = "FieldError";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/description/FieldDescription.mjs
var React99 = __toESM(require_react(), 1);
var FieldDescription = /* @__PURE__ */ React99.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
const {
render,
id: idProp,
className,
style,
...elementProps
} = componentProps;
const id = useBaseUiId(idProp);
const fieldRootContext = useFieldRootContext(false);
const fieldItemContext = useFieldItemContext();
const {
setMessageIds
} = useLabelableContext();
const state = {
...fieldRootContext.state,
disabled: fieldRootContext.disabled || fieldItemContext.disabled
};
useIsoLayoutEffect(() => {
if (!id) {
return void 0;
}
setMessageIds((v) => v.concat(id));
return () => {
setMessageIds((v) => v.filter((item) => item !== id));
};
}, [id, setMessageIds]);
const element = useRenderElement("p", componentProps, {
ref: forwardedRef,
state,
props: [{
id
}, elementProps],
stateAttributesMapping: fieldValidityMapping
});
return element;
});
if (true) FieldDescription.displayName = "FieldDescription";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/control/FieldControl.mjs
var React100 = __toESM(require_react(), 1);
var FieldControl = /* @__PURE__ */ React100.forwardRef(function FieldControl2(componentProps, forwardedRef) {
const {
render,
className,
id: idProp,
name: nameProp,
value,
disabled: disabledProp = false,
onValueChange,
defaultValue,
autoFocus = false,
style,
...elementProps
} = componentProps;
const {
state: fieldState,
name: fieldName,
disabled: fieldDisabled,
setTouched,
setDirty,
validityData,
setFilled,
validationMode,
validation
} = useFieldRootContext();
const {
clearErrors,
elementRef: formElementRef,
submitCountRef
} = useFormContext();
const disabled2 = fieldDisabled || disabledProp;
const name = fieldName ?? nameProp;
const state = {
...fieldState,
disabled: disabled2
};
const {
labelId
} = useLabelableContext();
const id = useLabelableId({
id: idProp
});
const isControlled = value !== void 0;
const serializedValue = value == null ? void 0 : String(value);
const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled2, nameProp);
useIsoLayoutEffect(() => {
const currentValue = serializedValue ?? validation.inputRef.current?.value;
if (currentValue !== void 0) {
setFilled(currentValue !== "");
}
}, [serializedValue, defaultValue, validation.inputRef, setFilled]);
useValueChanged(serializedValue, () => {
if (serializedValue === void 0) {
return;
}
clearErrors(name);
setDirty(serializedValue !== (validityData.initialValue ?? ""));
validation.change(serializedValue);
});
const inputRef = React100.useRef(null);
const setFocused = useSetFieldFocused(disabled2, inputRef);
const enterValidationTimeout = useTimeout();
const element = useRenderElement("input", componentProps, {
ref: [forwardedRef, inputRef],
state,
props: [{
id,
disabled: disabled2,
name,
ref: validation.inputRef,
"aria-labelledby": labelId,
autoFocus,
...isControlled ? {
value
} : {
defaultValue
},
onChange(event) {
const inputValue = event.currentTarget.value;
const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
onValueChange?.(inputValue, details);
if (isControlled) {
return;
}
setDirty(inputValue !== (validityData.initialValue ?? ""));
setFilled(inputValue !== "");
if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
clearErrors(name);
validation.change(inputValue);
}
},
onFocus() {
setFocused(true);
},
onBlur(event) {
setTouched(true);
setFocused(false);
if (validationMode === "onBlur") {
const inputValue = event.currentTarget.value;
validation.commit(inputValue);
if (isControlled) {
queueMicrotask(() => {
const nextValue = validation.inputRef.current?.value;
if (nextValue !== void 0 && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? "")) {
validation.commit(nextValue);
}
});
}
}
},
onKeyDown(event) {
if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
setTouched(true);
const value2 = event.currentTarget.value;
const form = event.currentTarget.form;
if (form && form === formElementRef.current && !event.defaultPrevented) {
const input = event.currentTarget;
const submitCount = submitCountRef.current;
enterValidationTimeout.start(0, () => {
if (submitCountRef.current === submitCount) {
validation.commit(input.value);
}
});
} else {
validation.commit(value2);
}
}
}
}, elementProps, (props) => validation.getValidationProps(disabled2, props)],
stateAttributesMapping: fieldValidityMapping
});
return element;
});
if (true) FieldControl.displayName = "FieldControl";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/validity/FieldValidity.mjs
var React101 = __toESM(require_react(), 1);
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var FieldValidity = function FieldValidity2(props) {
const {
children
} = props;
const {
validityData,
invalid: invalid2
} = useFieldRootContext(false);
const combinedFieldValidityData = React101.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
const isInvalid = combinedFieldValidityData.state.valid === false;
const {
transitionStatus
} = useTransitionStatus(isInvalid);
const fieldValidityState = React101.useMemo(() => {
return {
...combinedFieldValidityData,
validity: combinedFieldValidityData.state,
transitionStatus
};
}, [combinedFieldValidityData, transitionStatus]);
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(React101.Fragment, {
children: children(fieldValidityState)
});
};
if (true) FieldValidity.displayName = "FieldValidity";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/field/item/FieldItem.mjs
var React102 = __toESM(require_react(), 1);
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var FieldItem = /* @__PURE__ */ React102.forwardRef(function FieldItem2(componentProps, forwardedRef) {
const {
render,
className,
style,
disabled: disabledProp = false,
...elementProps
} = componentProps;
const {
state: fieldState,
disabled: rootDisabled
} = useFieldRootContext(false);
const disabled2 = rootDisabled || disabledProp;
const state = {
...fieldState,
disabled: disabled2
};
const fieldItemContext = React102.useMemo(() => ({
disabled: disabled2
}), [disabled2]);
const element = useRenderElement("div", componentProps, {
ref: forwardedRef,
state,
props: elementProps,
stateAttributesMapping: fieldValidityMapping
});
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LabelableProvider, {
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldItemContext.Provider, {
value: fieldItemContext,
children: element
})
});
});
if (true) FieldItem.displayName = "FieldItem";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/input/Input.mjs
var React103 = __toESM(require_react(), 1);
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var Input = /* @__PURE__ */ React103.forwardRef(function Input2(props, forwardedRef) {
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(index_parts_exports2.Control, {
ref: forwardedRef,
...props
});
});
if (true) Input.displayName = "Input";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs
var React104 = __toESM(require_react(), 1);
var ReactDOM8 = __toESM(require_react_dom(), 1);
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var FloatingPortalLite = /* @__PURE__ */ React104.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) {
const {
children,
container,
className,
render,
style,
...elementProps
} = componentProps;
const {
node: portalNode,
subtree: portalSubtree
} = useFloatingPortalNode({
container,
ref: forwardedRef,
componentProps,
elementProps
});
if (!portalSubtree && !portalNode) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(React104.Fragment, {
children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM8.createPortal(children, portalNode)]
});
});
if (true) FloatingPortalLite.displayName = "FloatingPortalLite";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/index.parts.mjs
var index_parts_exports3 = {};
__export(index_parts_exports3, {
Arrow: () => TooltipArrow,
Handle: () => TooltipHandle,
Popup: () => TooltipPopup,
Portal: () => TooltipPortal,
Positioner: () => TooltipPositioner,
Provider: () => TooltipProvider,
Root: () => TooltipRoot,
Trigger: () => TooltipTrigger,
Viewport: () => TooltipViewport,
createHandle: () => createTooltipHandle
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
var React107 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs
var React105 = __toESM(require_react(), 1);
var TooltipRootContext = /* @__PURE__ */ React105.createContext(void 0);
if (true) TooltipRootContext.displayName = "TooltipRootContext";
function useTooltipRootContext(optional) {
const context = React105.useContext(TooltipRootContext);
if (context === void 0 && !optional) {
throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs
var React106 = __toESM(require_react(), 1);
var selectors3 = {
...popupStoreSelectors,
disabled: (state) => state.disabled,
instantType: (state) => state.instantType,
isInstantPhase: (state) => state.isInstantPhase,
trackCursorAxis: (state) => state.trackCursorAxis,
disableHoverablePopup: (state) => state.disableHoverablePopup,
lastOpenChangeReason: (state) => state.openChangeReason,
closeOnClick: (state) => state.closeOnClick,
// Active and inactive trigger props are the same object, so a constant for triggers that discard
// them keeps those triggers from re-rendering when the props change.
appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : void 0,
closeDelay: (state) => state.closeDelay,
adaptiveOrigin: (state) => state.adaptiveOrigin
};
var TooltipStore = class extends ReactStore {
constructor(initialState, floatingId, nested) {
const triggerElements = new PopupTriggerMap();
super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors3);
}
setOpen = (nextOpen, eventDetails) => {
applyPopupOpenChange(this, nextOpen, eventDetails, {
extraState: {
openChangeReason: eventDetails.reason
}
});
};
// Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.
cancelPendingOpen(event) {
this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event));
}
};
function createNullTooltipStore() {
const triggerElements = new PopupTriggerMap();
const store = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors3);
return Object.assign(store, {
setOpen: NOOP,
cancelPendingOpen: NOOP
});
}
function createInitialState(initialState, triggerElements, floatingId, nested = false) {
const state = {
...createInitialPopupStoreState(triggerElements, floatingId, nested),
disabled: false,
instantType: void 0,
isInstantPhase: false,
trackCursorAxis: "none",
disableHoverablePopup: false,
openChangeReason: null,
closeOnClick: true,
closeDelay: 0,
adaptiveOrigin: void 0,
...initialState
};
return state;
}
function createInitialContext(triggerElements) {
return {
popupRef: /* @__PURE__ */ React106.createRef(),
onOpenChange: void 0,
onOpenChangeComplete: void 0,
triggerElements
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var TooltipRoot = fastComponent(function TooltipRoot2(props) {
const {
disabled: disabled2 = false,
defaultOpen = false,
open: openProp,
disableHoverablePopup = false,
trackCursorAxis = "none",
actionsRef,
onOpenChange,
onOpenChangeComplete,
handle,
triggerId: triggerIdProp,
defaultTriggerId: defaultTriggerIdProp = null,
children
} = props;
const store = usePopupRootStore((floatingId, nested) => new TooltipStore({
open: defaultOpen,
openProp,
activeTriggerId: defaultTriggerIdProp,
triggerIdProp
}, floatingId, nested));
store.useControlledProp("openProp", openProp);
store.useControlledProp("triggerIdProp", triggerIdProp);
store.useContextCallback("onOpenChange", onOpenChange);
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
const openState = store.useState("open");
const open2 = !disabled2 && openState;
const activeTriggerId = store.useState("activeTriggerId");
const mounted = store.useState("mounted");
const payload = store.useState("payload");
store.useSyncedValues({
trackCursorAxis,
disableHoverablePopup,
disabled: disabled2
});
useImplicitActiveTrigger(store, {
closeOnActiveTriggerUnmount: true
});
const {
forceUnmount,
transitionStatus
} = useOpenStateTransitions(open2, store);
const isInstantPhase = store.useState("isInstantPhase");
const instantType = store.useState("instantType");
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
const previousInstantTypeRef = React107.useRef(null);
useIsoLayoutEffect(() => {
if (openState && disabled2) {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled));
}
}, [openState, disabled2, store]);
useIsoLayoutEffect(() => {
if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) {
if (instantType !== "delay") {
previousInstantTypeRef.current = instantType;
}
store.set("instantType", "delay");
} else if (previousInstantTypeRef.current !== null) {
store.set("instantType", previousInstantTypeRef.current);
previousInstantTypeRef.current = null;
}
}, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);
useIsoLayoutEffect(() => {
if (open2) {
if (activeTriggerId == null) {
store.set("payload", void 0);
}
}
}, [store, activeTriggerId, open2]);
React107.useImperativeHandle(actionsRef, () => ({
unmount: forceUnmount,
close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
}), [forceUnmount, store]);
const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none";
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TooltipRootContext.Provider, {
value: store,
children: [handle && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PopupHandleAttachment, {
handle,
store
}), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipInteractions, {
store,
disabled: disabled2,
trackCursorAxis
}), typeof children === "function" ? children({
payload
}) : children]
});
});
if (true) TooltipRoot.displayName = "TooltipRoot";
function TooltipInteractions({
store,
disabled: disabled2,
trackCursorAxis
}) {
const floatingRootContext = store.useState("floatingRootContext");
const dismiss = useDismiss(floatingRootContext, {
enabled: !disabled2,
referencePress: () => store.select("closeOnClick")
});
const clientPoint = useClientPoint(floatingRootContext, {
enabled: !disabled2 && trackCursorAxis !== "none",
axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis
});
const triggerProps = React107.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);
usePopupInteractionProps(store, {
activeTriggerProps: triggerProps,
inactiveTriggerProps: triggerProps,
popupProps: dismiss.floating ?? EMPTY_OBJECT
});
return null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
var React109 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs
var React108 = __toESM(require_react(), 1);
var TooltipProviderContext = /* @__PURE__ */ React108.createContext(void 0);
if (true) TooltipProviderContext.displayName = "TooltipProviderContext";
function useTooltipProviderContext() {
return React108.useContext(TooltipProviderContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/utils/constants.mjs
var OPEN_DELAY = 600;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger";
function getTargetElement(event) {
const target = getTarget(event);
return isElement(target) ? target : null;
}
var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) {
const {
render,
className,
style,
handle,
payload,
disabled: disabledProp,
delay,
closeOnClick = true,
closeDelay,
id: idProp,
...elementProps
} = componentProps;
const rootContext = useTooltipRootContext(true);
const handleStore = usePopupHandleStore(handle);
const store = handleStore ?? rootContext;
if (!store) {
throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82));
}
const thisTriggerId = useBaseUiId(idProp);
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
const floatingRootContext = store.useState("floatingRootContext");
const triggerElementRef = React109.useRef(null);
const closeDelayWithDefault = closeDelay ?? 0;
const {
registerTrigger,
isMountedByThisTrigger
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
payload,
closeOnClick,
closeDelay: closeDelayWithDefault
});
const providerDelay = useTooltipProviderContext();
const {
activeIdRef,
delayRef,
isInstantPhase,
hasProvider
} = useDelayGroup(floatingRootContext, {
open: isOpenedByThisTrigger
});
const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);
store.useSyncedValue("isInstantPhase", isInstantPhase);
const rootDisabled = store.useState("disabled");
const disabled2 = disabledProp ?? rootDisabled;
const disabledRef = useValueAsRef(disabled2);
const trackCursorAxis = store.useState("trackCursorAxis");
const disableHoverablePopup = store.useState("disableHoverablePopup");
const isNestedTriggerHoveredRef = React109.useRef(false);
const nestedTriggerOpenTimeout = useTimeout();
const pointerTypeRef = React109.useRef(void 0);
function getOpenDelay() {
if (hasProvider && activeIdRef.current != null) {
return 0;
}
return delay ?? providerDelay ?? OPEN_DELAY;
}
function isEnabledNestedTriggerTarget(target) {
const triggerEl = triggerElementRef.current;
if (!triggerEl || !target) {
return false;
}
const nearestTrigger = closest(target, `[${TOOLTIP_TRIGGER_IDENTIFIER}]`);
return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);
}
function detectNestedTriggerHover(target) {
const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);
isNestedTriggerHoveredRef.current = nestedTriggerHovered;
if (nestedTriggerHovered) {
hoverInteraction.openChangeTimeout.clear();
hoverInteraction.restTimeout.clear();
hoverInteraction.restTimeoutPending = false;
nestedTriggerOpenTimeout.clear();
}
return nestedTriggerHovered;
}
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
enabled: !disabled2,
mouseOnly: true,
move: false,
handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null,
restMs: getOpenDelay,
delay() {
if (closeDelay == null && hasProvider) {
return {
close: getDelay(delayRef.current, "close")
};
}
return {
close: closeDelayWithDefault
};
},
triggerElementRef,
isActiveTrigger: isTriggerActive,
isClosing: () => store.select("transitionStatus") === "ending",
shouldOpen() {
return !isNestedTriggerHoveredRef.current;
}
});
const focusProps = useFocus(floatingRootContext, {
enabled: !disabled2
}).reference;
const handleNestedTriggerHover = (event) => {
const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;
const target = getTargetElement(event);
const nestedTriggerHovered = detectNestedTriggerHover(target);
const triggerEl = triggerElementRef.current;
const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);
if (nestedTriggerHovered && store.select("open") && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
return;
}
if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.
isMouseLikePointerType(pointerTypeRef.current)) {
const open2 = () => {
if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select("open")) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl));
}
};
const openDelay = getOpenDelay();
if (openDelay === 0) {
nestedTriggerOpenTimeout.clear();
open2();
} else {
nestedTriggerOpenTimeout.start(openDelay, open2);
}
}
};
const rootTriggerProps = store.useState("appliedTriggerProps", isMountedByThisTrigger || trackCursorAxis !== "none");
const state = {
open: isOpenedByThisTrigger
};
const element = useRenderElement("button", componentProps, {
state,
ref: [forwardedRef, registerTrigger, triggerElementRef],
props: [hoverProps, focusProps, rootTriggerProps, {
onMouseOver(event) {
handleNestedTriggerHover(event.nativeEvent);
},
onFocus(event) {
if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {
event.preventBaseUIHandler();
}
},
onMouseLeave() {
isNestedTriggerHoveredRef.current = false;
nestedTriggerOpenTimeout.clear();
pointerTypeRef.current = void 0;
},
onPointerEnter(event) {
pointerTypeRef.current = event.pointerType;
},
onPointerDown(event) {
pointerTypeRef.current = event.pointerType;
store.set("closeOnClick", closeOnClick);
if (closeOnClick && !store.select("open")) {
store.cancelPendingOpen(event.nativeEvent);
}
},
onClick(event) {
if (closeOnClick && !store.select("open")) {
store.cancelPendingOpen(event.nativeEvent);
}
},
id: thisTriggerId,
[triggerDisabled]: disabled2 ? "" : void 0,
[TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : ""
}, elementProps],
stateAttributesMapping: triggerOpenStateMapping
});
return element;
});
if (true) TooltipTrigger.displayName = "TooltipTrigger";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
var React111 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs
var React110 = __toESM(require_react(), 1);
var TooltipPortalContext = /* @__PURE__ */ React110.createContext(void 0);
if (true) TooltipPortalContext.displayName = "TooltipPortalContext";
function useTooltipPortalContext() {
const value = React110.useContext(TooltipPortalContext);
if (value === void 0) {
throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70));
}
return value;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var TooltipPortal = /* @__PURE__ */ React111.forwardRef(function TooltipPortal2(props, forwardedRef) {
const {
keepMounted = false,
...portalProps
} = props;
const store = useTooltipRootContext();
const mounted = store.useState("mounted");
const shouldRender = mounted || keepMounted;
if (!shouldRender) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipPortalContext.Provider, {
value: keepMounted,
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FloatingPortalLite, {
ref: forwardedRef,
...portalProps
})
});
});
if (true) TooltipPortal.displayName = "TooltipPortal";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
var React113 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs
var React112 = __toESM(require_react(), 1);
var TooltipPositionerContext = /* @__PURE__ */ React112.createContext(void 0);
if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext";
function useTooltipPositionerContext() {
const context = React112.useContext(TooltipPositionerContext);
if (context === void 0) {
throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
var TooltipPositioner = /* @__PURE__ */ React113.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) {
const {
render,
className,
anchor,
positionMethod = "absolute",
side = "top",
align = "center",
sideOffset = 0,
alignOffset = 0,
collisionBoundary = "clipping-ancestors",
collisionPadding = 5,
arrowPadding = 5,
sticky = false,
disableAnchorTracking = false,
collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const keepMounted = useTooltipPortalContext();
const open2 = store.useState("open");
const mounted = store.useState("mounted");
const trackCursorAxis = store.useState("trackCursorAxis");
const disableHoverablePopup = store.useState("disableHoverablePopup");
const floatingRootContext = store.useState("floatingRootContext");
const instantType = store.useState("instantType");
const transitionStatus = store.useState("transitionStatus");
const adaptiveOrigin2 = store.useState("adaptiveOrigin");
const positioning = useAnchorPositioning({
anchor,
positionMethod,
floatingRootContext,
mounted,
side,
sideOffset,
align,
alignOffset,
collisionBoundary,
collisionPadding,
sticky,
arrowPadding,
disableAnchorTracking,
keepMounted,
collisionAvoidance,
adaptiveOrigin: adaptiveOrigin2
});
const state = React113.useMemo(() => ({
open: open2,
side: positioning.side,
align: positioning.align,
anchorHidden: positioning.anchorHidden,
instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType
}), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);
const element = usePositioner(componentProps, state, {
styles: positioning.positionerStyles,
transitionStatus,
props: elementProps,
refs: [forwardedRef, store.useStateSetter("positionerElement")],
hidden: !mounted,
inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup
});
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipPositionerContext.Provider, {
value: positioning,
children: element
});
});
if (true) TooltipPositioner.displayName = "TooltipPositioner";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs
var React114 = __toESM(require_react(), 1);
var TooltipPopup = /* @__PURE__ */ React114.forwardRef(function TooltipPopup2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const {
side,
align
} = useTooltipPositionerContext();
const open2 = store.useState("open");
const instantType = store.useState("instantType");
const transitionStatus = store.useState("transitionStatus");
const popupProps = store.useState("popupProps");
const floatingContext = store.useState("floatingRootContext");
const disabled2 = store.useState("disabled");
const closeDelay = store.useState("closeDelay");
useOpenChangeComplete({
open: open2,
ref: store.context.popupRef,
onComplete() {
if (open2) {
store.context.onOpenChangeComplete?.(true);
}
}
});
useHoverFloatingInteraction(floatingContext, {
enabled: !disabled2,
closeDelay
});
const setPopupElement = store.useStateSetter("popupElement");
const state = {
open: open2,
side,
align,
instant: instantType,
transitionStatus
};
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, store.context.popupRef, setPopupElement],
props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],
stateAttributesMapping: popupTransitionStateMapping
});
return element;
});
if (true) TooltipPopup.displayName = "TooltipPopup";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs
var React115 = __toESM(require_react(), 1);
var TooltipArrow = /* @__PURE__ */ React115.forwardRef(function TooltipArrow2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const {
arrowRef,
side,
align,
arrowUncentered,
arrowStyles
} = useTooltipPositionerContext();
const open2 = store.useState("open");
const instantType = store.useState("instantType");
const state = {
open: open2,
side,
align,
uncentered: arrowUncentered,
instant: instantType
};
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, arrowRef],
props: [{
style: arrowStyles,
"aria-hidden": true
}, elementProps],
stateAttributesMapping: popupStateMapping
});
return element;
});
if (true) TooltipArrow.displayName = "TooltipArrow";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs
var React116 = __toESM(require_react(), 1);
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
var TooltipProvider = function TooltipProvider2(props) {
const {
delay,
closeDelay,
timeout = 400
} = props;
const delayValue = React116.useMemo(() => ({
open: delay,
close: closeDelay
}), [delay, closeDelay]);
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipProviderContext.Provider, {
value: delay,
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FloatingDelayGroup, {
delay: delayValue,
timeoutMs: timeout,
children: props.children
})
});
};
if (true) TooltipProvider.displayName = "TooltipProvider";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs
var React117 = __toESM(require_react(), 1);
var TooltipViewport = /* @__PURE__ */ React117.forwardRef(function TooltipViewport2(componentProps, forwardedRef) {
const {
render,
className,
style,
children,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const positioner = useTooltipPositionerContext();
const instantType = store.useState("instantType");
const {
children: childrenToRender,
state: viewportState
} = usePopupViewport({
store,
side: positioner.side,
children
});
const state = {
activationDirection: viewportState.activationDirection,
transitioning: viewportState.transitioning,
instant: instantType
};
return useRenderElement("div", componentProps, {
state,
ref: forwardedRef,
props: [elementProps, {
children: childrenToRender
}],
stateAttributesMapping: popupViewportStateMapping
});
});
if (true) TooltipViewport.displayName = "TooltipViewport";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs
var TooltipHandle = class extends BasePopupHandle {
constructor() {
super(createNullTooltipStore(), "Tooltip");
}
/**
* Opens the tooltip and associates it with the trigger with the given id.
*
* This method should only be called in an event handler or an effect (not during rendering).
*
* @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching
* `Tooltip.Trigger` with this handle passed as a prop.
*/
open(triggerId) {
this.openByTrigger(triggerId);
}
/**
* Closes the tooltip.
*
* This method should only be called in an event handler or an effect (not during rendering).
*/
close() {
this.closePopup();
}
/**
* Whether the tooltip is currently open. Returns `false` while no root is attached to the handle.
*/
get isOpen() {
return this.attachedStore?.select("open") ?? false;
}
};
function createTooltipHandle() {
return new TooltipHandle();
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/use-render/useRender.mjs
function useRender(params) {
return useRenderElement(params.defaultTagName ?? "div", params, params);
}
// packages/ui/build-module/text/text.mjs
var import_element18 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
function getRuntime() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
return true;
}
}
return false;
}
function injectStyle(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument(targetDocument) {
const runtime = getRuntime();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle(hash, css) {
const runtime = getRuntime();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle("09bae534ff", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._9745ffa515d864cf__text{text-wrap:pretty;margin:0}._8882b6a7feb4fd3d__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._664e3e7687c45603__heading-xl,._8882b6a7feb4fd3d__heading-2xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._664e3e7687c45603__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.dac661a5de0ed2bd__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}._59c7f3f740e2f96e__heading-md,.dac661a5de0ed2bd__heading-lg{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}._59c7f3f740e2f96e__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.cf052fbad8d93b7e__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._212b9cfef57a0af4__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._07f57bc0aa36b2c6__body-lg,._212b9cfef57a0af4__body-xl{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._07f57bc0aa36b2c6__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._0c6da4457aec9e62__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0c6da4457aec9e62__body-md,.b998f87ff17b7bec__body-sm{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.b998f87ff17b7bec__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
}
var style_default = { "text": "_9745ffa515d864cf__text", "heading-2xl": "_8882b6a7feb4fd3d__heading-2xl", "heading-xl": "_664e3e7687c45603__heading-xl", "heading-lg": "dac661a5de0ed2bd__heading-lg", "heading-md": "_59c7f3f740e2f96e__heading-md", "heading-sm": "cf052fbad8d93b7e__heading-sm", "body-xl": "_212b9cfef57a0af4__body-xl", "body-lg": "_07f57bc0aa36b2c6__body-lg", "body-md": "_0c6da4457aec9e62__body-md", "body-sm": "b998f87ff17b7bec__body-sm" };
if (typeof process === "undefined" || true) {
registerStyle("726f348f3f", "._78c10a0773e51a91__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}._5b33aa2d48624b4f__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6)._326aee4184d261fd__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}.e9576240835601ba__a,.e9576240835601ba__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}._3f05789653864a73__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" };
var Text = (0, import_element18.forwardRef)(
function UnforwardedText({ variant = "body-md", render, className, ...props }, ref) {
const element = useRender({
render,
defaultTagName: "span",
ref,
props: mergeProps(props, {
className: clsx_default(
style_default.text,
global_css_defense_default.heading,
global_css_defense_default.p,
style_default[variant],
className
)
})
});
return element;
}
);
// packages/ui/build-module/button/button.mjs
var import_element20 = __toESM(require_element(), 1);
var import_i18n = __toESM(require_i18n(), 1);
import { speak } from "@wordpress/a11y";
// packages/ui/build-module/spinner/spinner.mjs
var import_element19 = __toESM(require_element(), 1);
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
function getRuntime2() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument2(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash2(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE2}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
return true;
}
}
return false;
}
function injectStyle2(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime2();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash2(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument2(targetDocument) {
const runtime = getRuntime2();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle2(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle2(hash, css) {
const runtime = getRuntime2();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle2(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle2("b081213352", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.da418dc15e63be57__spinner{background-color:transparent;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}._8b83deccaefa3c92__indicator{fill:transparent;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;transform-origin:50% 50%;@media (forced-colors:active){stroke:CanvasText}animation:_0da63cf2c7b08803__spinner-spin 1.4s linear infinite both}@keyframes _0da63cf2c7b08803__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}");
}
var style_default2 = { "spinner": "da418dc15e63be57__spinner", "indicator": "_8b83deccaefa3c92__indicator", "spinner-spin": "_0da63cf2c7b08803__spinner-spin" };
var Spinner = (0, import_element19.forwardRef)(
function UnforwardedSpinner({ className, color, style, ...props }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
"svg",
{
className: clsx_default(style_default2.spinner, className),
style: color === void 0 ? style : { ...style, color },
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg",
role: "presentation",
focusable: "false",
...props,
ref,
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
"path",
{
className: style_default2.indicator,
d: "m 12 0 a 12 12 0 0 1 0 24"
}
)
}
);
}
);
// packages/ui/build-module/button/button.mjs
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
function getRuntime3() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument3(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash3(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE3}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
return true;
}
}
return false;
}
function injectStyle3(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime3();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash3(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument3(targetDocument) {
const runtime = getRuntime3();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle3(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle3(hash, css) {
const runtime = getRuntime3();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle3(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle3("06ca4dbe45", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.e01b07636421375d__button,.ec10ae721bc68934__is-unstyled{appearance:none;padding:0}.e01b07636421375d__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._414eb921eb9928fa__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}}._36aecfa8aa1c059c__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._6e27e09880945492__icon{margin:var(--wp-ui-button-icon-margin)}.e861e38ec209c386__is-brand{&._126c37d7228179eb__is-outline,&._52d3a0733adabb28__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&._52d3a0733adabb28__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}._4f1e6661283d0b09__is-neutral{&._52d3a0733adabb28__is-minimal[aria-pressed=true],&._7b8ab25ed58515d2__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline,&._52d3a0733adabb28__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&._52d3a0733adabb28__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.ec10ae721bc68934__is-unstyled{background:none;border:none;min-width:unset}.df99f7773c9c8915__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._414eb921eb9928fa__is-loading:not(.ec10ae721bc68934__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}>:not(._20f9e334daee91a7__spinner){opacity:0}}}@layer compositions{._20f9e334daee91a7__spinner{color:var(--wp-ui-button-foreground-color);height:var(--wp-ui-button-font-size);inset:0;margin:auto;pointer-events:none;position:absolute;width:var(--wp-ui-button-font-size);>*{stroke-width:2.75}@media (prefers-reduced-motion){>*{animation:none}}@media (forced-colors:active){>*{stroke:ButtonText}}}}}');
}
var style_default3 = { "button": "e01b07636421375d__button", "is-unstyled": "ec10ae721bc68934__is-unstyled", "is-loading": "_414eb921eb9928fa__is-loading", "is-small": "_36aecfa8aa1c059c__is-small", "icon": "_6e27e09880945492__icon", "is-brand": "e861e38ec209c386__is-brand", "is-outline": "_126c37d7228179eb__is-outline", "is-minimal": "_52d3a0733adabb28__is-minimal", "is-neutral": "_4f1e6661283d0b09__is-neutral", "is-solid": "_7b8ab25ed58515d2__is-solid", "is-compact": "df99f7773c9c8915__is-compact", "spinner": "_20f9e334daee91a7__spinner" };
if (typeof process === "undefined" || true) {
registerStyle3("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default = { "box-sizing": "ccc29f9575c4c758__box-sizing" };
if (typeof process === "undefined" || true) {
registerStyle3("c13e206e92", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._0f52be5f1d4ce686__outset-ring--focus-within:focus-within,._8f922cee854f2408__outset-ring--focus-visible:focus-visible,.accedd6ae8fd878e__outset-ring--focus:focus{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within,.c20f61b115485a7f__outset-ring--focus-except-active:focus{outline:none}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c20f61b115485a7f__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
}
var focus_module_default = { "outset-ring--focus": "accedd6ae8fd878e__outset-ring--focus", "outset-ring--focus-visible": "_8f922cee854f2408__outset-ring--focus-visible", "outset-ring--focus-within": "_0f52be5f1d4ce686__outset-ring--focus-within", "outset-ring--focus-except-active": "c20f61b115485a7f__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3ad2c88c126f2bdd__outset-ring--focus-within-except-active" };
if (typeof process === "undefined" || true) {
registerStyle3("726f348f3f", "._78c10a0773e51a91__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}._5b33aa2d48624b4f__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6)._326aee4184d261fd__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}.e9576240835601ba__a,.e9576240835601ba__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}._3f05789653864a73__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default2 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" };
var Button3 = (0, import_element20.forwardRef)(
function UnforwardedButton({
tone = "brand",
variant = "solid",
size: size4 = "default",
className,
focusableWhenDisabled = true,
disabled: disabled2,
loading,
loadingAnnouncement = (0, import_i18n.__)("Loading"),
children,
...props
}, ref) {
const mergedClassName = clsx_default(
global_css_defense_default2.button,
resets_default["box-sizing"],
focus_module_default["outset-ring--focus-except-active"],
variant !== "unstyled" && style_default3.button,
style_default3[`is-${tone}`],
style_default3[`is-${variant}`],
style_default3[`is-${size4}`],
loading && style_default3["is-loading"],
className
);
(0, import_element20.useEffect)(() => {
if (loading && loadingAnnouncement) {
speak(loadingAnnouncement);
}
}, [loading, loadingAnnouncement]);
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
Button,
{
ref,
className: mergedClassName,
focusableWhenDisabled,
disabled: disabled2 ?? loading,
...props,
children: [
children,
loading && variant !== "unstyled" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Spinner, { className: style_default3.spinner })
]
}
);
}
);
// packages/ui/build-module/button/icon.mjs
var import_element21 = __toESM(require_element(), 1);
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
function getRuntime4() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument4(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash4(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE4}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
return true;
}
}
return false;
}
function injectStyle4(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime4();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash4(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument4(targetDocument) {
const runtime = getRuntime4();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle4(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle4(hash, css) {
const runtime = getRuntime4();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle4(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle4("06ca4dbe45", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.e01b07636421375d__button,.ec10ae721bc68934__is-unstyled{appearance:none;padding:0}.e01b07636421375d__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._414eb921eb9928fa__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}}._36aecfa8aa1c059c__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._6e27e09880945492__icon{margin:var(--wp-ui-button-icon-margin)}.e861e38ec209c386__is-brand{&._126c37d7228179eb__is-outline,&._52d3a0733adabb28__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&._52d3a0733adabb28__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}._4f1e6661283d0b09__is-neutral{&._52d3a0733adabb28__is-minimal[aria-pressed=true],&._7b8ab25ed58515d2__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline,&._52d3a0733adabb28__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._126c37d7228179eb__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&._52d3a0733adabb28__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.ec10ae721bc68934__is-unstyled{background:none;border:none;min-width:unset}.df99f7773c9c8915__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._414eb921eb9928fa__is-loading:not(.ec10ae721bc68934__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}>:not(._20f9e334daee91a7__spinner){opacity:0}}}@layer compositions{._20f9e334daee91a7__spinner{color:var(--wp-ui-button-foreground-color);height:var(--wp-ui-button-font-size);inset:0;margin:auto;pointer-events:none;position:absolute;width:var(--wp-ui-button-font-size);>*{stroke-width:2.75}@media (prefers-reduced-motion){>*{animation:none}}@media (forced-colors:active){>*{stroke:ButtonText}}}}}');
}
var style_default4 = { "button": "e01b07636421375d__button", "is-unstyled": "ec10ae721bc68934__is-unstyled", "is-loading": "_414eb921eb9928fa__is-loading", "is-small": "_36aecfa8aa1c059c__is-small", "icon": "_6e27e09880945492__icon", "is-brand": "e861e38ec209c386__is-brand", "is-outline": "_126c37d7228179eb__is-outline", "is-minimal": "_52d3a0733adabb28__is-minimal", "is-neutral": "_4f1e6661283d0b09__is-neutral", "is-solid": "_7b8ab25ed58515d2__is-solid", "is-compact": "df99f7773c9c8915__is-compact", "spinner": "_20f9e334daee91a7__spinner" };
var ButtonIcon = (0, import_element21.forwardRef)(
function UnforwardedButtonIcon({ className, icon, ...props }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
Icon,
{
ref,
icon,
className: clsx_default(style_default4.icon, className),
size: 24,
...props
}
);
}
);
// packages/ui/build-module/button/index.mjs
ButtonIcon.displayName = "Button.Icon";
var Button4 = Object.assign(Button3, {
/**
* An icon component specifically designed to work well when rendered inside
* a `Button` component.
*/
Icon: ButtonIcon
});
// packages/icons/build-module/library/close-small.mjs
var import_primitives2 = __toESM(require_primitives(), 1);
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives2.Path, { d: "M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75" }) });
// packages/icons/build-module/library/search.mjs
var import_primitives3 = __toESM(require_primitives(), 1);
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
var search_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives3.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z" }) });
// packages/ui/build-module/utils/keyboard-shortcut.mjs
var import_element23 = __toESM(require_element(), 1);
var import_i18n2 = __toESM(require_i18n(), 1);
// packages/ui/build-module/visually-hidden/visually-hidden.mjs
var import_element22 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
function getRuntime5() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument5(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash5(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE5}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
return true;
}
}
return false;
}
function injectStyle5(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime5();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash5(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument5(targetDocument) {
const runtime = getRuntime5();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle5(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle5(hash, css) {
const runtime = getRuntime5();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle5(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle5("7caae29f9e", ".e2c3cbe6ada7d785__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}");
}
var style_default5 = { "visually-hidden": "e2c3cbe6ada7d785__visually-hidden" };
var VisuallyHidden = (0, import_element22.forwardRef)(
function UnforwardedVisuallyHidden({ render, ...restProps }, ref) {
const element = useRender({
render,
ref,
props: mergeProps(
{ className: style_default5["visually-hidden"] },
restProps,
{
// @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
"data-visually-hidden": ""
}
)
});
return element;
}
);
// packages/ui/build-module/utils/keyboard-shortcut.mjs
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
function useKeyboardShortcutProps({
"aria-describedby": ariaDescribedBy,
"aria-keyshortcuts": ariaKeyShortcuts,
shortcut
}) {
const generatedDescriptionId = (0, import_element23.useId)();
const descriptionId = shortcut ? generatedDescriptionId : void 0;
const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ");
return {
descriptionId,
targetProps: {
"aria-describedby": describedBy || void 0,
"aria-keyshortcuts": shortcut?.ariaKeyShortcut ?? ariaKeyShortcuts
}
};
}
var KeyboardShortcutDescription = (0, import_element23.forwardRef)(function UnforwardedKeyboardShortcutDescription({ descriptionId, shortcut }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
VisuallyHidden,
{
id: descriptionId,
"aria-hidden": "true",
render: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { ref }),
children: (0, import_i18n2.sprintf)(
/* translators: %s: keyboard shortcut. */
(0, import_i18n2.__)("Keyboard shortcut: %s"),
shortcut.label ?? shortcut.ariaKeyShortcut
)
}
);
});
var KeyboardShortcutDisplay = (0, import_element23.forwardRef)(function UnforwardedKeyboardShortcutDisplay({ className, shortcut }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { ref, "aria-hidden": "true", className, dir: "ltr", children: shortcut.displayShortcut });
});
// packages/ui/build-module/utils/item-popup/item-content.mjs
var import_element24 = __toESM(require_element(), 1);
var VALIDATION_ENABLED = true;
function parseItemContent(children, { Label, Description, validationMessage }) {
const childArray = import_element24.Children.toArray(children);
const [label, ...descriptions] = childArray;
const hasLabel = (0, import_element24.isValidElement)(label) && label.type === Label;
const descriptionElements = descriptions.filter(
(description) => (0, import_element24.isValidElement)(description) && description.type === Description
);
if (VALIDATION_ENABLED && (!hasLabel || descriptionElements.length !== descriptions.length)) {
throw new Error(validationMessage);
}
return {
descriptionIds: descriptionElements.map(
(description) => description.props.id
),
hasLabel,
labelId: hasLabel ? label.props.id : void 0
};
}
function useItemContent(children, components, {
"aria-describedby": ariaDescribedBy,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy
} = {}) {
const generatedLabelId = (0, import_element24.useId)();
const generatedDescriptionId = (0, import_element24.useId)();
const { descriptionIds, hasLabel, labelId } = parseItemContent(
children,
components
);
const resolvedLabelId = hasLabel ? labelId ?? generatedLabelId : void 0;
const resolvedDescriptionIds = descriptionIds.map(
(descriptionId, index2) => descriptionId ?? `${generatedDescriptionId}-${index2}`
);
const itemDescribedBy = Array.from(
/* @__PURE__ */ new Set([
...ariaDescribedBy?.split(/\s+/).filter(Boolean) ?? [],
...resolvedDescriptionIds
])
).join(" ");
let descriptionIndex = 0;
const { Label, Description, descriptionValidationToken } = components;
const contentChildren = import_element24.Children.map(children, (child) => {
if (!(0, import_element24.isValidElement)(child)) {
return child;
}
if (child.type === Label) {
return child.props.id === resolvedLabelId ? child : (0, import_element24.cloneElement)(child, { id: resolvedLabelId });
}
if (child.type !== Description) {
return child;
}
const descriptionId = resolvedDescriptionIds[descriptionIndex++];
if (!descriptionValidationToken && child.props.id === descriptionId) {
return child;
}
return (0, import_element24.cloneElement)(child, {
id: descriptionId,
...descriptionValidationToken && {
validationToken: descriptionValidationToken
}
});
});
const labelledBy = ariaLabelledBy ?? (ariaLabel ? void 0 : resolvedLabelId);
return {
contentChildren,
resolvedLabelId,
itemAriaProps: {
"aria-describedby": itemDescribedBy || void 0,
"aria-label": ariaLabel,
"aria-labelledby": labelledBy
}
};
}
// packages/ui/build-module/utils/render-slot-with-children.mjs
var import_element25 = __toESM(require_element(), 1);
function renderSlotWithChildren(slot, defaultSlot, children) {
return (0, import_element25.cloneElement)(
slot ?? defaultSlot,
{ children }
);
}
// packages/ui/build-module/utils/wp-compat-overlay-slot.mjs
var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
function getRuntime6() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument6(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash6(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE6}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
return true;
}
}
return false;
}
function injectStyle6(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime6();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash6(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument6(targetDocument) {
const runtime = getRuntime6();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle6(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle6(hash, css) {
const runtime = getRuntime6();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle6(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle6("40df669685", "._9e7887c25dedb459__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._9e7887c25dedb459__slot>*{pointer-events:auto}}}");
}
var wp_compat_overlay_slot_default = { "slot": "_9e7887c25dedb459__slot" };
var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
function resolveOwnerDocument() {
return typeof document === "undefined" ? null : document;
}
function isInWordPressEnvironment() {
let topWp;
try {
topWp = window.top?.wp;
} catch {
}
const wp = topWp ?? window.wp;
return typeof wp?.components === "object" && wp.components !== null;
}
var cachedSlot = null;
function ensureSlotIsAccessible(element) {
element.setAttribute("aria-hidden", "false");
return element;
}
function createSlot(ownerDocument2) {
const element = ownerDocument2.createElement("div");
element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, "");
if (wp_compat_overlay_slot_default.slot) {
element.classList.add(wp_compat_overlay_slot_default.slot);
}
ownerDocument2.body.appendChild(element);
return element;
}
function getWpCompatOverlaySlot() {
if (typeof window === "undefined") {
return void 0;
}
if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) {
return void 0;
}
const ownerDocument2 = resolveOwnerDocument();
if (!ownerDocument2 || !ownerDocument2.body) {
return void 0;
}
if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) {
return ensureSlotIsAccessible(cachedSlot);
}
const existing = ownerDocument2.querySelector(
`[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]`
);
if (existing instanceof HTMLDivElement) {
cachedSlot = ensureSlotIsAccessible(existing);
return cachedSlot;
}
if (cachedSlot?.isConnected) {
cachedSlot.remove();
}
cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2));
return cachedSlot;
}
// packages/ui/build-module/form/primitives/constants.mjs
var ITEM_POPUP_POSITIONER_PROPS = {
align: "start",
sideOffset: 8,
collisionPadding: 12
};
// packages/ui/build-module/utils/direction-provider.mjs
var import_i18n3 = __toESM(require_i18n(), 1);
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
function DirectionProvider3({ children }) {
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children });
}
// packages/ui/build-module/tooltip/popup.mjs
var import_element28 = __toESM(require_element(), 1);
// packages/ui/build-module/tooltip/portal.mjs
var import_element26 = __toESM(require_element(), 1);
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
var Portal = (0, import_element26.forwardRef)(
function TooltipPortal3({ container, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
index_parts_exports3.Portal,
{
container: container === void 0 ? getWpCompatOverlaySlot() : container,
...restProps,
ref
}
);
}
);
// packages/ui/build-module/tooltip/positioner.mjs
var import_element27 = __toESM(require_element(), 1);
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
function getRuntime7() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument7(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash7(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE7}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
return true;
}
}
return false;
}
function injectStyle7(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime7();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash7(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument7(targetDocument) {
const runtime = getRuntime7();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle7(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle7(hash, css) {
const runtime = getRuntime7();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle7(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle7("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default2 = { "box-sizing": "ccc29f9575c4c758__box-sizing" };
if (typeof process === "undefined" || true) {
registerStyle7("aaf79ac691", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b9266862d9435660__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._7bb3fd8a0810be6d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
}
var style_default6 = { "positioner": "b9266862d9435660__positioner", "popup": "_7bb3fd8a0810be6d__popup" };
var Positioner = (0, import_element27.forwardRef)(
function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
index_parts_exports3.Positioner,
{
ref,
align,
side,
sideOffset,
...props,
className: clsx_default(
resets_default2["box-sizing"],
style_default6.positioner,
className
)
}
);
}
);
// packages/ui/build-module/utils/theme-provider.mjs
var theme = __toESM(require_theme(), 1);
// packages/ui/build-module/lock-unlock.mjs
var import_private_apis = __toESM(require_private_apis(), 1);
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/ui"
);
// packages/ui/build-module/utils/theme-provider.mjs
function getThemeProvider() {
const themePackage = theme;
if (themePackage.ThemeProvider) {
return themePackage.ThemeProvider;
}
if (!themePackage.privateApis) {
throw new Error(
"@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`."
);
}
return unlock(
themePackage.privateApis
).ThemeProvider;
}
var ThemeProvider = getThemeProvider();
// packages/ui/build-module/tooltip/popup.mjs
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
function getRuntime8() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument8(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash8(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE8}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
return true;
}
}
return false;
}
function injectStyle8(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime8();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash8(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument8(targetDocument) {
const runtime = getRuntime8();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle8(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle8(hash, css) {
const runtime = getRuntime8();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle8(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle8("aaf79ac691", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b9266862d9435660__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._7bb3fd8a0810be6d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
}
var style_default7 = { "positioner": "b9266862d9435660__positioner", "popup": "_7bb3fd8a0810be6d__popup" };
var POPUP_COLOR = { background: "#1e1e1e" };
var Popup = (0, import_element28.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) {
const popupContent = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
index_parts_exports3.Popup,
{
ref,
className: clsx_default(style_default7.popup, className),
...props,
children
}
) });
const positionedPopup = renderSlotWithChildren(
positioner,
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Positioner, {}),
popupContent
);
return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Portal, {}), positionedPopup);
});
// packages/ui/build-module/tooltip/trigger.mjs
var import_element29 = __toESM(require_element(), 1);
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
var Trigger = (0, import_element29.forwardRef)(
function TooltipTrigger3(props, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports3.Trigger, { ref, ...props });
}
);
// packages/ui/build-module/tooltip/root.mjs
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
function Root(props) {
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(index_parts_exports3.Root, { ...props }) });
}
// packages/ui/build-module/icon-button/icon-button.mjs
var import_element30 = __toESM(require_element(), 1);
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash";
function getRuntime9() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument9(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash9(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE9}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) {
return true;
}
}
return false;
}
function injectStyle9(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime9();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash9(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument9(targetDocument) {
const runtime = getRuntime9();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle9(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle9(hash, css) {
const runtime = getRuntime9();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle9(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle9("2a111665b3", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{._7f5dbf30e44a43dd__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0px;--wp-ui-button-min-width:unset}._1b3c0d159ecbf3d5__icon{margin:-1px}}}");
}
var style_default8 = { "icon-button": "_7f5dbf30e44a43dd__icon-button", "icon": "_1b3c0d159ecbf3d5__icon" };
var IconButton = (0, import_element30.forwardRef)(
function UnforwardedIconButton({
label,
className,
// Prevent accidental forwarding of `children`
children: _children,
disabled: disabled2,
focusableWhenDisabled = true,
icon,
size: size4,
shortcut,
positioner,
"aria-describedby": ariaDescribedBy,
"aria-keyshortcuts": ariaKeyShortcuts,
...restProps
}, ref) {
const classes = clsx_default(style_default8["icon-button"], className);
const { descriptionId, targetProps } = useKeyboardShortcutProps({
"aria-describedby": ariaDescribedBy,
"aria-keyshortcuts": ariaKeyShortcuts,
shortcut
});
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Root, { children: [
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
Trigger,
{
ref,
...targetProps,
disabled: disabled2 && !focusableWhenDisabled,
render: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
Button4,
{
...restProps,
size: size4,
"aria-label": label,
disabled: disabled2,
focusableWhenDisabled
}
),
className: classes,
children: [
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon, size: 24, className: style_default8.icon }),
shortcut && descriptionId && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
KeyboardShortcutDescription,
{
descriptionId,
shortcut
}
)
]
}
),
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Popup, { positioner, children: [
label,
shortcut && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
" ",
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KeyboardShortcutDisplay, { shortcut })
] })
] })
] });
}
);
// packages/ui/build-module/form/primitives/autocomplete/index.mjs
var autocomplete_exports = {};
__export(autocomplete_exports, {
Clear: () => Clear,
Collection: () => Collection,
Empty: () => Empty,
Group: () => Group,
GroupLabel: () => GroupLabel,
Input: () => Input4,
InputGroup: () => InputGroup,
Item: () => Item,
ItemDescription: () => ForwardedItemDescription,
ItemLabel: () => ForwardedItemLabel,
List: () => List,
ListBody: () => ListBody,
Popup: () => Popup2,
Portal: () => Portal2,
Positioner: () => Positioner2,
Root: () => Root2,
Row: () => Row,
Separator: () => Separator,
Status: () => Status,
Value: () => Value,
useFilteredItems: () => useFilteredItems2
});
// packages/ui/build-module/form/primitives/autocomplete/clear.mjs
var import_element31 = __toESM(require_element(), 1);
var import_i18n4 = __toESM(require_i18n(), 1);
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
var DEFAULT_RENDER = ({
"aria-label": ariaLabel = (0, import_i18n4.__)("Clear"),
...props
}, { disabled: disabled2 }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
IconButton,
{
icon: close_small_default,
focusableWhenDisabled: false,
disabled: disabled2,
"aria-hidden": disabled2 || void 0,
size: "small",
variant: "minimal",
tone: "neutral",
label: ariaLabel,
...props
}
);
var Clear = (0, import_element31.forwardRef)(
function UnforwardedClear({ render = DEFAULT_RENDER, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
index_parts_exports.Clear,
{
ref,
render,
...restProps
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/collection.mjs
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
function Collection({
children,
...restProps
}) {
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(index_parts_exports.Collection, { ...restProps, children });
}
// packages/ui/build-module/form/primitives/autocomplete/empty.mjs
var import_element32 = __toESM(require_element(), 1);
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash";
function getRuntime10() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument10(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash10(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE10}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) {
return true;
}
}
return false;
}
function injectStyle10(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime10();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash10(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument10(targetDocument) {
const runtime = getRuntime10();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle10(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle10(hash, css) {
const runtime = getRuntime10();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle10(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle10("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var Empty = (0, import_element32.forwardRef)(
function UnforwardedEmpty({ className, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
index_parts_exports.Empty,
{
className: clsx_default(item_popup_default.empty, className),
ref,
...restProps
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/group.mjs
var import_element33 = __toESM(require_element(), 1);
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash";
function getRuntime11() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument11(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash11(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE11}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) {
return true;
}
}
return false;
}
function injectStyle11(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime11();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash11(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument11(targetDocument) {
const runtime = getRuntime11();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle11(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle11(hash, css) {
const runtime = getRuntime11();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle11(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle11("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default2 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var Group = (0, import_element33.forwardRef)(
function UnforwardedGroup({ className, children, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
index_parts_exports.Group,
{
className: clsx_default(item_popup_default2.group, className),
ref,
...restProps,
children
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/group-label.mjs
var import_element34 = __toESM(require_element(), 1);
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash";
function getRuntime12() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument12(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash12(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE12}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) {
return true;
}
}
return false;
}
function injectStyle12(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime12();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash12(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument12(targetDocument) {
const runtime = getRuntime12();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle12(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle12(hash, css) {
const runtime = getRuntime12();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle12(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle12("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default3 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var GroupLabel = (0, import_element34.forwardRef)(function UnforwardedGroupLabel({ className, children, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
Text,
{
variant: "heading-sm",
className: clsx_default(item_popup_default3["group-label"], className),
render: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(index_parts_exports.GroupLabel, { ref, ...restProps }),
children
}
);
});
// packages/ui/build-module/form/primitives/autocomplete/input-group.mjs
var import_element35 = __toESM(require_element(), 1);
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
var InputGroup = (0, import_element35.forwardRef)(function UnforwardedInputGroup(props, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(index_parts_exports.InputGroup, { ref, ...props });
});
// packages/ui/build-module/form/primitives/autocomplete/input.mjs
var import_element39 = __toESM(require_element(), 1);
// packages/ui/build-module/form/primitives/input/input.mjs
var import_element38 = __toESM(require_element(), 1);
// packages/ui/build-module/form/primitives/input-layout/input-layout.mjs
var import_element36 = __toESM(require_element(), 1);
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash";
function getRuntime13() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument13(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash13(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE13}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) {
return true;
}
}
return false;
}
function injectStyle13(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime13();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash13(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument13(targetDocument) {
const runtime = getRuntime13();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle13(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle13(hash, css) {
const runtime = getRuntime13();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle13(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle13("726f348f3f", "._78c10a0773e51a91__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}._5b33aa2d48624b4f__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6)._326aee4184d261fd__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}.e9576240835601ba__a,.e9576240835601ba__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}._3f05789653864a73__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default3 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" };
if (typeof process === "undefined" || true) {
registerStyle13("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default3 = { "box-sizing": "ccc29f9575c4c758__box-sizing" };
if (typeof process === "undefined" || true) {
registerStyle13("a933c8f665", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b58f09bec1a5dbde__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);height:var(--wpds-dimension-size-lg,40px);line-height:1;&.c6959524c70627d6__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&.aa52ad890a16cc91__is-size-small,&.c6959524c70627d6__is-size-compact{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.aa52ad890a16cc91__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._50a72abb47530e8a__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._33a5f404fc55a9f2__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._33a5f404fc55a9f2__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._7ef4bcd6bfde61ae__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._50a72abb47530e8a__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._33a5f404fc55a9f2__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}._7c0c0ce7b5c57b8f__slot-wrapper{display:contents}._7ef4bcd6bfde61ae__input-layout-slot{align-items:center;display:flex;&._50d0eced305893d5__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
}
var style_default9 = { "input-layout": "b58f09bec1a5dbde__input-layout", "is-size-compact": "c6959524c70627d6__is-size-compact", "is-size-small": "aa52ad890a16cc91__is-size-small", "is-disabled": "_50a72abb47530e8a__is-disabled", "is-borderless": "_33a5f404fc55a9f2__is-borderless", "input-layout-slot": "_7ef4bcd6bfde61ae__input-layout-slot", "slot-wrapper": "_7c0c0ce7b5c57b8f__slot-wrapper", "is-padding-minimal": "_50d0eced305893d5__is-padding-minimal" };
var InputLayout = (0, import_element36.forwardRef)(
function UnforwardedInputLayout({
className,
children,
visuallyDisabled,
size: size4 = "default",
isBorderless,
prefix,
suffix,
...restProps
}, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
"div",
{
ref,
className: clsx_default(
global_css_defense_default3.div,
resets_default3["box-sizing"],
style_default9["input-layout"],
style_default9[`is-size-${size4}`],
visuallyDisabled && style_default9["is-disabled"],
isBorderless && style_default9["is-borderless"],
className
),
...restProps,
children: [
import_element36.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
"div",
{
className: style_default9["slot-wrapper"],
"data-slot-type": "prefix",
children: prefix
}
),
children,
import_element36.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
"div",
{
className: style_default9["slot-wrapper"],
"data-slot-type": "suffix",
children: suffix
}
)
]
}
);
}
);
// packages/ui/build-module/form/primitives/input-layout/slot.mjs
var import_element37 = __toESM(require_element(), 1);
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash";
function getRuntime14() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument14(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash14(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE14}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) {
return true;
}
}
return false;
}
function injectStyle14(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime14();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash14(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument14(targetDocument) {
const runtime = getRuntime14();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle14(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle14(hash, css) {
const runtime = getRuntime14();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle14(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle14("a933c8f665", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b58f09bec1a5dbde__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);height:var(--wpds-dimension-size-lg,40px);line-height:1;&.c6959524c70627d6__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&.aa52ad890a16cc91__is-size-small,&.c6959524c70627d6__is-size-compact{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.aa52ad890a16cc91__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._50a72abb47530e8a__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._33a5f404fc55a9f2__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._33a5f404fc55a9f2__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._7ef4bcd6bfde61ae__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._50a72abb47530e8a__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._33a5f404fc55a9f2__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}._7c0c0ce7b5c57b8f__slot-wrapper{display:contents}._7ef4bcd6bfde61ae__input-layout-slot{align-items:center;display:flex;&._50d0eced305893d5__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
}
var style_default10 = { "input-layout": "b58f09bec1a5dbde__input-layout", "is-size-compact": "c6959524c70627d6__is-size-compact", "is-size-small": "aa52ad890a16cc91__is-size-small", "is-disabled": "_50a72abb47530e8a__is-disabled", "is-borderless": "_33a5f404fc55a9f2__is-borderless", "input-layout-slot": "_7ef4bcd6bfde61ae__input-layout-slot", "slot-wrapper": "_7c0c0ce7b5c57b8f__slot-wrapper", "is-padding-minimal": "_50d0eced305893d5__is-padding-minimal" };
var InputLayoutSlot = (0, import_element37.forwardRef)(function UnforwardedInputLayoutSlot({ padding = "default", className, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
"div",
{
ref,
className: clsx_default(
style_default10["input-layout-slot"],
style_default10[`is-padding-${padding}`],
className
),
...restProps
}
);
});
InputLayoutSlot.displayName = "InputLayout.Slot";
// packages/ui/build-module/form/primitives/input-layout/index.mjs
var InputLayout2 = Object.assign(InputLayout, {
Slot: InputLayoutSlot
});
// packages/ui/build-module/form/primitives/input/input.mjs
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash";
function getRuntime15() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument15(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash15(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE15}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) {
return true;
}
}
return false;
}
function injectStyle15(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime15();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash15(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument15(targetDocument) {
const runtime = getRuntime15();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle15(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle15(hash, css) {
const runtime = getRuntime15();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle15(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle15("726f348f3f", "._78c10a0773e51a91__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}._5b33aa2d48624b4f__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6)._326aee4184d261fd__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}.e9576240835601ba__a,.e9576240835601ba__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}._3f05789653864a73__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default4 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" };
if (typeof process === "undefined" || true) {
registerStyle15("c13e206e92", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._0f52be5f1d4ce686__outset-ring--focus-within:focus-within,._8f922cee854f2408__outset-ring--focus-visible:focus-visible,.accedd6ae8fd878e__outset-ring--focus:focus{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within,.c20f61b115485a7f__outset-ring--focus-except-active:focus{outline:none}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c20f61b115485a7f__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
}
var focus_module_default2 = { "outset-ring--focus": "accedd6ae8fd878e__outset-ring--focus", "outset-ring--focus-visible": "_8f922cee854f2408__outset-ring--focus-visible", "outset-ring--focus-within": "_0f52be5f1d4ce686__outset-ring--focus-within", "outset-ring--focus-except-active": "c20f61b115485a7f__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3ad2c88c126f2bdd__outset-ring--focus-within-except-active" };
if (typeof process === "undefined" || true) {
registerStyle15("a53cd10a80", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._9edfcd97eeaee9dc__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);--_gcd-input-font-size:max(var(--wpds-typography-font-size-md,13px),16px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;@media (min-width:600px){--_gcd-input-font-size:inherit}&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}@layer compositions{.edc52bf0fe80b57f__layout{font-size:max(var(--wpds-typography-font-size-md,13px),16px);@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}}}}");
}
var style_default11 = { "input": "_9edfcd97eeaee9dc__input", "layout": "edc52bf0fe80b57f__layout" };
var Input3 = (0, import_element38.forwardRef)(
function UnforwardedInput({ className, size: size4 = "default", prefix, suffix, style, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
InputLayout2,
{
className: clsx_default(
style_default11.layout,
focus_module_default2["outset-ring--focus-within"],
className
),
style,
size: size4,
visuallyDisabled: restProps.disabled,
prefix,
suffix,
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
Input,
{
ref,
className: clsx_default(global_css_defense_default4.input, style_default11.input),
...restProps
}
)
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/input.mjs
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Input3, { ...props });
var Input4 = (0, import_element39.forwardRef)(
function UnforwardedInput2({ render = DEFAULT_RENDER2, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
index_parts_exports.Input,
{
ref,
render,
...restProps
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/item.mjs
var import_element42 = __toESM(require_element(), 1);
// packages/ui/build-module/form/primitives/autocomplete/item-description.mjs
var import_element40 = __toESM(require_element(), 1);
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash";
function getRuntime16() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument16(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash16(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE16}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) {
return true;
}
}
return false;
}
function injectStyle16(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime16();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash16(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument16(targetDocument) {
const runtime = getRuntime16();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle16(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle16(hash, css) {
const runtime = getRuntime16();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle16(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle16("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default4 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var ITEM_DESCRIPTION_DIRECT_CHILD = /* @__PURE__ */ Symbol();
var ForwardedItemDescription = (0, import_element40.forwardRef)(function ItemDescription(props, ref) {
const { className, validationToken, ...restProps } = props;
if (validationToken !== ITEM_DESCRIPTION_DIRECT_CHILD) {
throw new Error(
"Autocomplete.ItemDescription: Missing direct autocomplete item parent. Render <Autocomplete.ItemDescription> as a direct child of <Autocomplete.Item>."
);
}
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
Text,
{
ref,
variant: "body-sm",
className: clsx_default(
item_popup_default4["item-description"],
className
),
...restProps
}
);
});
// packages/ui/build-module/form/primitives/autocomplete/item-label.mjs
var import_element41 = __toESM(require_element(), 1);
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash";
function getRuntime17() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument17(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash17(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE17}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) {
return true;
}
}
return false;
}
function injectStyle17(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime17();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash17(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument17(targetDocument) {
const runtime = getRuntime17();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle17(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle17(hash, css) {
const runtime = getRuntime17();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle17(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle17("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default5 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var ForwardedItemLabel = (0, import_element41.forwardRef)(function ItemLabel({ className, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
Text,
{
ref,
variant: "body-md",
className: clsx_default(item_popup_default5["item-label"], className),
...restProps
}
);
});
// packages/ui/build-module/form/primitives/autocomplete/item.mjs
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash";
function getRuntime18() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument18(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash18(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE18}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) {
return true;
}
}
return false;
}
function injectStyle18(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime18();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash18(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE18, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument18(targetDocument) {
const runtime = getRuntime18();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle18(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle18(hash, css) {
const runtime = getRuntime18();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle18(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle18("726f348f3f", "._78c10a0773e51a91__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}._5b33aa2d48624b4f__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6)._326aee4184d261fd__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}.e9576240835601ba__a,.e9576240835601ba__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}._3f05789653864a73__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default5 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" };
if (typeof process === "undefined" || true) {
registerStyle18("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default6 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
if (typeof process === "undefined" || true) {
registerStyle18("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default4 = { "box-sizing": "ccc29f9575c4c758__box-sizing" };
var ITEM_CONTENT_COMPONENTS = {
Label: ForwardedItemLabel,
Description: ForwardedItemDescription,
descriptionValidationToken: ITEM_DESCRIPTION_DIRECT_CHILD,
validationMessage: "Autocomplete.ItemLabel must be the first direct child of every autocomplete item, followed only by Autocomplete.ItemDescription components."
};
var Item = (0, import_element42.forwardRef)(
function UnforwardedItem({
className,
children,
"aria-describedby": ariaDescribedBy,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy,
...restProps
}, ref) {
const { contentChildren, itemAriaProps } = useItemContent(
children,
ITEM_CONTENT_COMPONENTS,
{
"aria-describedby": ariaDescribedBy,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy
}
);
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
index_parts_exports.Item,
{
className: clsx_default(
global_css_defense_default5.div,
resets_default4["box-sizing"],
item_popup_default6.item,
className
),
ref,
...itemAriaProps,
...restProps,
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: item_popup_default6["item-text"], children: contentChildren })
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/list.mjs
var import_element43 = __toESM(require_element(), 1);
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE19 = "data-wp-hash";
function getRuntime19() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument19(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash19(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE19}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE19) === hash) {
return true;
}
}
return false;
}
function injectStyle19(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime19();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash19(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE19, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument19(targetDocument) {
const runtime = getRuntime19();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle19(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle19(hash, css) {
const runtime = getRuntime19();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle19(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle19("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default7 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var List = (0, import_element43.forwardRef)(
function UnforwardedList({ className, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
index_parts_exports.List,
{
className: clsx_default(item_popup_default7.list, className),
ref,
...restProps
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/list-body.mjs
var import_element44 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE20 = "data-wp-hash";
function getRuntime20() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument20(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash20(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE20}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE20) === hash) {
return true;
}
}
return false;
}
function injectStyle20(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime20();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash20(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE20, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument20(targetDocument) {
const runtime = getRuntime20();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle20(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle20(hash, css) {
const runtime = getRuntime20();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle20(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle20("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default8 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var ListBody = (0, import_element44.forwardRef)(
function UnforwardedListBody({ render, ...props }, ref) {
const element = useRender({
defaultTagName: "div",
render,
ref,
props: mergeProps(
{ className: item_popup_default8["list-scrollable-container"] },
props
)
});
return element;
}
);
// packages/ui/build-module/form/primitives/autocomplete/popup.mjs
var import_element47 = __toESM(require_element(), 1);
// packages/ui/build-module/utils/css/item-popup.mjs
var STYLE_HASH_ATTRIBUTE21 = "data-wp-hash";
function getRuntime21() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument21(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash21(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE21}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE21) === hash) {
return true;
}
}
return false;
}
function injectStyle21(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime21();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash21(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE21, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument21(targetDocument) {
const runtime = getRuntime21();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle21(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle21(hash, css) {
const runtime = getRuntime21();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle21(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle21("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default9 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
function getItemPopupWidthClassName(width = "anchor") {
switch (width) {
case "available":
return item_popup_default9["is-width-available"];
case "content":
return item_popup_default9["is-width-content"];
case "lg":
return item_popup_default9["is-width-lg"];
case "md":
return item_popup_default9["is-width-md"];
case "sm":
return item_popup_default9["is-width-sm"];
case "anchor":
return item_popup_default9["is-width-anchor"];
default:
return false;
}
}
// packages/ui/build-module/form/primitives/autocomplete/portal.mjs
var import_element45 = __toESM(require_element(), 1);
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
var Portal2 = (0, import_element45.forwardRef)(
function AutocompletePortal({ container, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
index_parts_exports.Portal,
{
container: container === void 0 ? getWpCompatOverlaySlot() : container,
...restProps,
ref
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/positioner.mjs
var import_element46 = __toESM(require_element(), 1);
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE22 = "data-wp-hash";
function getRuntime22() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument22(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash22(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE22}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE22) === hash) {
return true;
}
}
return false;
}
function injectStyle22(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime22();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash22(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE22, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument22(targetDocument) {
const runtime = getRuntime22();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle22(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle22(hash, css) {
const runtime = getRuntime22();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle22(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle22("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default5 = { "box-sizing": "ccc29f9575c4c758__box-sizing" };
if (typeof process === "undefined" || true) {
registerStyle22("1820ca84c7", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.da630a66fcf72216__positioner{z-index:var(--wp-ui-autocomplete-z-index,initial)}}}");
}
var style_default12 = { "positioner": "da630a66fcf72216__positioner" };
var Positioner2 = (0, import_element46.forwardRef)(
function AutocompletePositioner({ className, ...props }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
index_parts_exports.Positioner,
{
...ITEM_POPUP_POSITIONER_PROPS,
...props,
ref,
className: clsx_default(
resets_default5["box-sizing"],
style_default12.positioner,
className
)
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/popup.mjs
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE23 = "data-wp-hash";
function getRuntime23() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument23(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash23(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE23}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE23) === hash) {
return true;
}
}
return false;
}
function injectStyle23(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime23();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash23(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE23, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument23(targetDocument) {
const runtime = getRuntime23();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle23(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle23(hash, css) {
const runtime = getRuntime23();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle23(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle23("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default10 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var Popup2 = (0, import_element47.forwardRef)(
function UnforwardedPopup({ className, portal, positioner, width, ...restProps }, ref) {
const popupContent = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
index_parts_exports.Popup,
{
ref,
className: clsx_default(
item_popup_default10.popup,
getItemPopupWidthClassName(width),
className
),
...restProps
}
);
const positionedPopup = renderSlotWithChildren(
positioner,
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Positioner2, {}),
popupContent
);
return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Portal2, {}), positionedPopup);
}
);
// packages/ui/build-module/form/primitives/autocomplete/context.mjs
var import_element48 = __toESM(require_element(), 1);
var AutocompleteGridContext = (0, import_element48.createContext)(false);
var useAutocompleteGridContext = () => (0, import_element48.useContext)(AutocompleteGridContext);
// packages/ui/build-module/form/primitives/autocomplete/root.mjs
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
var Root2 = function Root22(props) {
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AutocompleteGridContext.Provider, { value: Boolean(props.grid), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(index_parts_exports.Root, { ...props }) }) });
};
// packages/ui/build-module/form/primitives/autocomplete/row.mjs
var import_element49 = __toESM(require_element(), 1);
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
var Row = (0, import_element49.forwardRef)(
function UnforwardedRow({ children, ...restProps }, ref) {
const isGrid = useAutocompleteGridContext();
if (!isGrid) {
throw new Error(
"Autocomplete.Row: Missing parent <Autocomplete.Root grid>. Render <Autocomplete.Row> inside <Autocomplete.Root grid>."
);
}
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(index_parts_exports.Row, { ref, ...restProps, children });
}
);
// packages/ui/build-module/form/primitives/autocomplete/separator.mjs
var import_element50 = __toESM(require_element(), 1);
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE24 = "data-wp-hash";
function getRuntime24() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument24(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash24(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE24}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE24) === hash) {
return true;
}
}
return false;
}
function injectStyle24(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime24();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash24(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE24, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument24(targetDocument) {
const runtime = getRuntime24();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle24(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle24(hash, css) {
const runtime = getRuntime24();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle24(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle24("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default11 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var Separator = (0, import_element50.forwardRef)(function AutocompleteSeparator2({
className,
orientation: _orientation,
...props
}, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
index_parts_exports.Separator,
{
ref,
className: clsx_default(item_popup_default11.separator, className),
...props
}
);
});
// packages/ui/build-module/form/primitives/autocomplete/status.mjs
var import_element51 = __toESM(require_element(), 1);
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE25 = "data-wp-hash";
function getRuntime25() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument25(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash25(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE25}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE25) === hash) {
return true;
}
}
return false;
}
function injectStyle25(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime25();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash25(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE25, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument25(targetDocument) {
const runtime = getRuntime25();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle25(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle25(hash, css) {
const runtime = getRuntime25();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle25(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle25("b23b7cb703", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._069972d5e326bada__dropdown-motion,._66136bf671f00b1f__dropdown-motion--fade-only{--wp-ui-dropdown-slide-distance:4px;--wp-ui-dropdown-slide-duration:var(--wpds-motion-duration-md,200ms);--wp-ui-dropdown-slide-easing:var(--wpds-motion-easing-expressive,cubic-bezier(0.25,0,0,1));--wp-ui-dropdown-fade-duration:var(--wpds-motion-duration-sm,100ms);--wp-ui-dropdown-fade-easing:linear;@media not (prefers-reduced-motion){transition-duration:var(--wp-ui-dropdown-slide-duration),var(--wp-ui-dropdown-fade-duration);transition-property:transform,opacity;transition-timing-function:var(--wp-ui-dropdown-slide-easing),var(--wp-ui-dropdown-fade-easing);will-change:transform,opacity}opacity:1;&[data-instant]{transition:none}&[data-ending-style],&[data-starting-style]{opacity:0}}._069972d5e326bada__dropdown-motion{transform:translate(0);&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{transform:translateY(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{transform:translateY(var(--wp-ui-dropdown-slide-distance))}&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-start][data-ending-style],&:dir(rtl)[data-side=inline-start][data-starting-style]{transform:translateX(calc(var(--wp-ui-dropdown-slide-distance)*-1))}&:dir(rtl)[data-side=inline-end][data-ending-style],&:dir(rtl)[data-side=inline-end][data-starting-style]{transform:translateX(var(--wp-ui-dropdown-slide-distance))}}}}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._5335cd5bb8455f41__popup{--wp-ui-popup-padding:var(--wpds-dimension-padding-xs,4px);--_wp-ui-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-md);display:grid;grid-template-areas:"header" "status" "main";grid-template-rows:auto auto minmax(0,1fr);max-height:min(var(--available-height),480px,60dvh);max-width:var(--available-width);min-width:var(--anchor-width);&._3e30324432f8a0ba__is-width-anchor{width:var(--anchor-width)}&._69804edb5684d0de__is-width-content{width:auto}&.aead2ac91ebbd7f3__is-width-sm{width:min(var(--available-width),var(--wpds-dimension-surface-width-sm,320px))}&._4b2a84626e787a42__is-width-md{width:min(var(--available-width),var(--wpds-dimension-surface-width-md,400px))}&.a8f561c37fca5c42__is-width-lg{width:min(var(--available-width),var(--wpds-dimension-surface-width-lg,560px))}&._5d668d5dd129920b__is-width-available{width:var(--available-width)}}._6d2cfb9153b0c938__is-align-item-with-trigger[data-side=none] ._5335cd5bb8455f41__popup{max-height:none}.e4376cf77e5f8c10__list-chrome{--_wp-ui-popup-selection-offset:0px;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);grid-area:main;line-height:var(--wpds-typography-line-height-sm,20px);&:has(._18aeb8ecadbe028a__item-icon){--_wp-ui-popup-selection-offset:calc(var(--wpds-dimension-size-2xs, 16px) + var(--wpds-dimension-gap-xs, 4px) - var(--wpds-dimension-padding-xs, 4px))}}._0d547d8d12e7949b__list{display:grid;grid-template-areas:"scrollable" "footer";grid-template-rows:minmax(0,1fr) auto}.bc39b141c9020768__list-scrollable-container{grid-area:scrollable;overflow-block:auto;overscroll-behavior:contain;scroll-padding-block:var(--wp-ui-popup-padding);&:not(:empty){padding-block:var(--wp-ui-popup-padding)}}._7ad64dd8fb579ebd__list-footer{grid-area:footer;padding-block:var(--wp-ui-popup-padding);.bc39b141c9020768__list-scrollable-container:not(:empty)+&{border-block-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb)}}.eecb2b96fb759ddb__group:not(:first-child){margin-block-start:var(--wpds-dimension-gap-sm,8px)}._21713f6a8b364bdc__group-label{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;min-height:var(--wpds-dimension-size-sm,24px);padding-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));padding-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset))}._7175902c6945a4aa__separator{background-color:var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);height:var(--wpds-border-width-xs,1px);margin-block:var(--wpds-dimension-gap-xs,4px);margin-inline-end:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px));margin-inline-start:calc(var(--wp-ui-popup-padding) + var(--wpds-dimension-padding-sm, 8px) + var(--_wp-ui-popup-selection-offset));@media (forced-colors:active){background-color:CanvasText}}._5a3ec04667f370ba__item{--wp-ui-popup-item-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:var(--wpds-dimension-padding-xs,4px);align-items:center;border-radius:var(--wpds-border-radius-sm,2px);display:flex;gap:var(--wpds-dimension-gap-xs,4px);justify-content:flex-start;margin-inline:var(--wp-ui-popup-padding);min-height:var(--wp-ui-popup-item-height);min-width:0;overflow-wrap:anywhere;padding-block:var(--wp-ui-popup-item-padding-block);padding-inline:var(--wp-ui-popup-item-padding-inline);user-select:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}&:has(>._18aeb8ecadbe028a__item-icon){align-content:center;align-items:start;display:grid;grid-template-columns:auto minmax(0,1fr);padding-inline-start:calc(var(--wp-ui-popup-item-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}&.b0d64a5aba50876b__is-size-small{--wp-ui-popup-item-height:var(--wpds-dimension-size-sm,24px);--wp-ui-popup-item-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-popup-item-padding-block:2px}&:not([data-selected]){.b96a828999b82cab__item-indicator-icon{opacity:0}}&[data-highlighted]:not([data-disabled]){background-color:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));color:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);outline:none;@media (forced-colors:active){background-color:Highlight;color:HighlightText;forced-color-adjust:none}}&[data-disabled]{background-color:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}}}._18aeb8ecadbe028a__item-icon{align-items:center;display:flex;height:var(--wpds-typography-line-height-sm,20px);pointer-events:none}.b96a828999b82cab__item-indicator-icon{translate:0 1px}._4644c31284588879__item-content{align-items:center;display:flex;gap:var(--wpds-dimension-gap-xs,4px);min-width:0}._62786562a38ba3e7__item-text{display:flex;flex-direction:column;min-width:0}._309ea6d5fe862ce0__item-label{--_gcd-heading-color:currentColor;min-width:0}._09b1f5d1966ef88f__item-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._5a3ec04667f370ba__item[data-disabled] ._09b1f5d1966ef88f__item-description,._5a3ec04667f370ba__item[data-highlighted]:not([data-disabled]) ._09b1f5d1966ef88f__item-description{--_gcd-heading-color:currentColor;color:inherit}.bfcc7d1447777d6a__status{grid-area:status}._2cb4b7243f751484__empty:not(:empty){grid-area:main}._2cb4b7243f751484__empty:not(:empty),.bfcc7d1447777d6a__status:not(:empty):not(:has([data-visually-hidden])){--wp-ui-popup-empty-min-height:var(--wpds-dimension-size-md,32px);--wp-ui-popup-empty-padding-inline:var(--wpds-dimension-padding-md,12px);align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px);min-height:var(--wp-ui-popup-empty-min-height);padding-inline:var(--wp-ui-popup-empty-padding-inline)}}}');
}
var item_popup_default12 = { "popup": "_5335cd5bb8455f41__popup _069972d5e326bada__dropdown-motion", "is-width-anchor": "_3e30324432f8a0ba__is-width-anchor", "is-width-content": "_69804edb5684d0de__is-width-content", "is-width-sm": "aead2ac91ebbd7f3__is-width-sm", "is-width-md": "_4b2a84626e787a42__is-width-md", "is-width-lg": "a8f561c37fca5c42__is-width-lg", "is-width-available": "_5d668d5dd129920b__is-width-available", "is-align-item-with-trigger": "_6d2cfb9153b0c938__is-align-item-with-trigger", "list-chrome": "e4376cf77e5f8c10__list-chrome", "item-icon": "_18aeb8ecadbe028a__item-icon", "list": "_0d547d8d12e7949b__list e4376cf77e5f8c10__list-chrome", "list-scrollable-container": "bc39b141c9020768__list-scrollable-container", "list-footer": "_7ad64dd8fb579ebd__list-footer", "group": "eecb2b96fb759ddb__group", "group-label": "_21713f6a8b364bdc__group-label", "separator": "_7175902c6945a4aa__separator", "item": "_5a3ec04667f370ba__item", "is-size-small": "b0d64a5aba50876b__is-size-small", "item-indicator-icon": "b96a828999b82cab__item-indicator-icon", "item-content": "_4644c31284588879__item-content", "item-text": "_62786562a38ba3e7__item-text", "item-label": "_309ea6d5fe862ce0__item-label", "item-description": "_09b1f5d1966ef88f__item-description", "status": "bfcc7d1447777d6a__status", "empty": "_2cb4b7243f751484__empty" };
var Status = (0, import_element51.forwardRef)(
function UnforwardedStatus({ className, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
index_parts_exports.Status,
{
className: clsx_default(item_popup_default12.status, className),
ref,
...restProps
}
);
}
);
// packages/ui/build-module/form/primitives/autocomplete/use-filtered-items.mjs
function useFilteredItems2() {
return index_parts_exports.useFilteredItems();
}
// packages/ui/build-module/form/primitives/autocomplete/value.mjs
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
function Value(props) {
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(index_parts_exports.Value, { ...props });
}
// packages/workflow/build-module/components/workflow-menu.mjs
var import_data = __toESM(require_data(), 1);
var import_element52 = __toESM(require_element(), 1);
var import_i18n6 = __toESM(require_i18n(), 1);
var import_components = __toESM(require_components(), 1);
var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
var import_keycodes = __toESM(require_keycodes(), 1);
import { executeAbility, store as abilitiesStore } from "@wordpress/abilities";
// packages/workflow/build-module/utils/get-error-message.mjs
var import_html_entities = __toESM(require_html_entities(), 1);
var import_i18n5 = __toESM(require_i18n(), 1);
function getErrorMessage(error2) {
let message = "";
if (typeof error2 === "object" && error2 !== null) {
if ("message" in error2 && typeof error2.message === "string") {
message = error2.message;
}
if (!message && "name" in error2 && typeof error2.name === "string") {
message = error2.name;
}
} else if (error2 !== null && error2 !== void 0) {
message = String(error2);
}
if (!message) {
return (0, import_i18n5.__)(
"This ability couldn’t run. Check the browser console for details."
);
}
return (0, import_html_entities.decodeEntities)(message);
}
// packages/workflow/build-module/components/workflow-menu.mjs
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && (typeof process === "undefined" || true) && !document.head.querySelector("style[data-wp-hash='715ff4efd0']")) {
const style = document.createElement("style");
style.setAttribute("data-wp-hash", "715ff4efd0");
style.appendChild(document.createTextNode(":root{--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223;--wp-bound-block-color:var(--wp-block-synced-color);--wp-editor-canvas-background:#ddd;--wp-admin-theme-color:#3858e9;--wp-admin-theme-color--rgb:56,88,233;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-10--rgb:33.0384615385,68.7307692308,230.4615384615;--wp-admin-theme-color-darker-20:#183ad6;--wp-admin-theme-color-darker-20--rgb:23.6923076923,58.1538461538,214.3076923077;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}body.admin-color-fresh{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,160.5;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){body.admin-color-fresh{--wp-admin-border-width-focus:1.5px}}.workflows-workflow-menu{border-radius:4px;margin:auto;max-width:400px;position:relative;top:calc(5% + 64px);width:calc(100% - 32px)}@media (min-width:600px){.workflows-workflow-menu{top:calc(10% + 64px)}}.workflows-workflow-menu .components-modal__content{margin:0;padding:0}.workflows-workflow-menu__overlay{align-items:start;display:block}.workflows-workflow-menu__container{will-change:transform}.workflows-workflow-menu__container:focus{outline:none}.workflows-workflow-menu__input{margin:8px}.workflows-workflow-menu__list{max-height:376px}.workflows-workflow-menu__list-body{padding:0 8px 8px}.workflows-workflow-menu__item-label{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workflows-workflow-menu__item mark{background:unset;color:inherit;font-weight:var(--wpds-typography-font-weight-emphasis,600)}.workflows-workflow-menu__output{padding:16px}.workflows-workflow-menu__output-header{border-bottom:1px solid #ddd;margin-bottom:16px;padding-bottom:8px}.workflows-workflow-menu__output-header h3{color:#1e1e1e;font-size:16px;font-weight:var(--wpds-typography-font-weight-emphasis,600);margin:0 0 4px}.workflows-workflow-menu__output-hint{color:#757575;font-size:12px;margin:0}.workflows-workflow-menu__output-content{max-height:400px;overflow:auto}.workflows-workflow-menu__output-content pre{background:#f0f0f0;border-radius:2px;color:#1e1e1e;font-size:12px;line-height:1.5;margin:0;overflow-wrap:anywhere;padding:12px;white-space:pre-wrap}.workflows-workflow-menu__output-error{background:#e0e0e0;border:1px solid #9e1313;border-radius:2px;color:#cc1818;padding:12px}.workflows-workflow-menu__output-error p{font-size:13px;margin:0}.workflows-workflow-menu__empty:not(:empty),.workflows-workflow-menu__executing:not(:empty){justify-content:center;padding:8px 0 16px}"));
document.head.appendChild(style);
}
var EMPTY_ARRAY2 = [];
var inputLabel = (0, import_i18n6.__)("Run abilities and workflows");
function WorkflowMenu() {
const { registerShortcut } = (0, import_data.useDispatch)(import_keyboard_shortcuts.store);
const [isOpen, setIsOpen] = (0, import_element52.useState)(false);
(0, import_element52.useEffect)(() => {
registerShortcut({
name: "core/workflows",
category: "global",
description: (0, import_i18n6.__)("Open the workflow palette."),
keyCombination: {
modifier: "primary",
character: "j"
}
});
}, [registerShortcut]);
(0, import_keyboard_shortcuts.useShortcut)(
"core/workflows",
(0, import_keycodes.withIgnoreIMEEvents)((event) => {
if (event.defaultPrevented) {
return;
}
event.preventDefault();
setIsOpen((open2) => !open2);
})
);
(0, import_element52.useEffect)(() => {
if (isOpen) {
import("@wordpress/core-abilities");
}
}, [isOpen]);
if (!isOpen) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(WorkflowPalette, { onClose: () => setIsOpen(false) });
}
function WorkflowPalette({ onClose }) {
const [search, setSearch] = (0, import_element52.useState)("");
const [abilityOutput, setAbilityOutput] = (0, import_element52.useState)(null);
const [isExecuting, setIsExecuting] = (0, import_element52.useState)(false);
const containerRef = (0, import_element52.useRef)(null);
const inputRef = (0, import_element52.useRef)(null);
const abilities = (0, import_data.useSelect)((select) => {
const allAbilities = select(abilitiesStore).getAbilities();
return allAbilities || EMPTY_ARRAY2;
}, []);
const filteredAbilities = (0, import_element52.useMemo)(() => {
if (!search) {
return abilities;
}
const searchLower = search.toLowerCase();
return abilities.filter(
(ability) => ability.label.toLowerCase().includes(searchLower) || ability.name.toLowerCase().includes(searchLower)
);
}, [abilities, search]);
(0, import_element52.useEffect)(() => {
if (abilityOutput && containerRef.current) {
containerRef.current.focus();
}
}, [abilityOutput]);
(0, import_element52.useEffect)(() => {
if (!abilityOutput) {
inputRef.current?.focus();
}
}, [abilityOutput]);
const goBack = () => {
setAbilityOutput(null);
setIsExecuting(false);
setSearch("");
};
const handleExecuteAbility = async (ability) => {
setIsExecuting(true);
const details = {
name: ability.name,
label: ability.label || ability.name,
description: ability.description || ""
};
try {
const result = await executeAbility(ability.name);
setAbilityOutput({ ...details, success: true, data: result });
} catch (error2) {
setAbilityOutput({
...details,
success: false,
error: getErrorMessage(error2)
});
} finally {
setIsExecuting(false);
}
};
const onContainerKeyDown = (event) => {
if (abilityOutput && (event.key === "Escape" || event.key === "Backspace" || event.key === "Delete")) {
event.preventDefault();
event.stopPropagation();
goBack();
}
};
const items = isExecuting ? EMPTY_ARRAY2 : filteredAbilities;
const showEmpty = !isExecuting && !!search && !filteredAbilities.length;
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
import_components.Modal,
{
className: "workflows-workflow-menu",
overlayClassName: "workflows-workflow-menu__overlay",
onRequestClose: abilityOutput ? goBack : onClose,
__experimentalHideHeader: true,
contentLabel: (0, import_i18n6.__)("Workflow palette"),
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
"div",
{
className: "workflows-workflow-menu__container",
onKeyDown: (0, import_keycodes.withIgnoreIMEEvents)(onContainerKeyDown),
ref: containerRef,
tabIndex: -1,
role: "presentation",
children: abilityOutput ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "workflows-workflow-menu__output", children: [
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "workflows-workflow-menu__output-header", children: [
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("h3", { children: abilityOutput.label }),
abilityOutput.description && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "workflows-workflow-menu__output-hint", children: abilityOutput.description })
] }),
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "workflows-workflow-menu__output-content", children: abilityOutput.success ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("pre", { children: JSON.stringify(
abilityOutput.data,
null,
2
) }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "workflows-workflow-menu__output-error", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { children: abilityOutput.error }) }) })
] }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
autocomplete_exports.Root,
{
items: abilities,
filteredItems: items,
mode: "list",
value: search,
onValueChange: setSearch,
open: true,
inline: true,
autoHighlight: true,
children: [
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
autocomplete_exports.Input,
{
ref: inputRef,
placeholder: inputLabel,
"aria-label": inputLabel,
className: "workflows-workflow-menu__input",
render: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
Input3,
{
prefix: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(InputLayout2.Slot, { padding: "minimal", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
Icon,
{
icon: search_default,
style: (0, import_i18n6.isRTL)() ? void 0 : {
transform: "scaleX(-1)"
}
}
) })
}
)
}
),
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Status, { className: "workflows-workflow-menu__executing", children: isExecuting ? (0, import_i18n6.__)("Executing ability…") : null }),
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Empty, { className: "workflows-workflow-menu__empty", children: showEmpty ? (0, import_i18n6.__)("No results found.") : null }),
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
autocomplete_exports.List,
{
className: "workflows-workflow-menu__list",
"aria-label": (0, import_i18n6.__)("Workflow suggestions"),
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.ListBody, { className: "workflows-workflow-menu__list-body", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
autocomplete_exports.Item,
{
value: item,
className: "workflows-workflow-menu__item",
onClick: () => handleExecuteAbility(item),
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(autocomplete_exports.ItemLabel, { className: "workflows-workflow-menu__item-label", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
import_components.TextHighlight,
{
text: item.label,
highlight: search
}
) })
},
item.name
) }) })
}
)
]
}
)
}
)
}
);
}
// packages/workflow/build-module/index.mjs
var root = document.createElement("div");
document.body.appendChild(root);
(0, import_element53.createRoot)(root).render((0, import_element53.createElement)(WorkflowMenu));
/*! Bundled license information:
use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
(**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
(**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/
No other release has this exact content. See every version of this file.