klt-bos-business-flow.html 843 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" data-theme="dark" data-preset="classic">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="archify 3.2.0">
  7. <meta name="archify-reader-contract" content="declared-wide-v1">
  8. <title>恪澜通 · 运营支撑系统端到端业务流程(业务口径)</title>
  9. <script>
  10. // Resolve the theme before first paint so light-preference users don't
  11. // see a dark flash. The toolbar script below re-applies with UI state.
  12. (function () {
  13. try {
  14. var theme = null;
  15. try {
  16. var param = new URLSearchParams(window.location.search).get('theme');
  17. if (param === 'light' || param === 'dark') theme = param;
  18. if (new URLSearchParams(window.location.search).get('embed') === '1') {
  19. document.documentElement.setAttribute('data-embed', 'true');
  20. }
  21. if (new URLSearchParams(window.location.search).get('present') === '1') {
  22. document.documentElement.setAttribute('data-present', 'true');
  23. }
  24. } catch (_) {}
  25. if (!theme) {
  26. try { theme = localStorage.getItem('archify-theme'); } catch (_) {}
  27. }
  28. if (theme !== 'light' && theme !== 'dark') {
  29. theme = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
  30. }
  31. document.documentElement.setAttribute('data-theme', theme);
  32. } catch (_) {}
  33. })();
  34. </script>
  35. <style id="archify-fonts">
  36. /*
  37. JetBrains Mono variable WOFF2 subsets from Google Fonts service revision v24.
  38. These fixed bytes are shared by the viewer and its SVG/raster exports.
  39. No local() source: an installed copy must not override the bundled font.
  40. Uncovered characters (including CJK) still use the system fallback stack.
  41. Upstream: https://github.com/JetBrains/JetBrainsMono
  42. cyrillic-ext 1664 bytes sha256 9343de2ca5d9549f792e7962375af8efb0f320c7643bfd36c884b5a30e5c396f
  43. cyrillic 8892 bytes sha256 4995a9a43ac659ec32fcd8b463755cd6a07b31a6e6b3894a6a153b661cf490e2
  44. greek 6800 bytes sha256 49c3da6c9a2b279b0f1f860f5cfb1f5dc38d88a5c7be9c9b1837bbc4e3db6111
  45. vietnamese 5872 bytes sha256 d44eb1936043a56038eb02dd70b243f379bef65783f94ec12f277550720411f1
  46. latin-ext 11596 bytes sha256 9c38cb2d0d2d93c1ee6e21fa78db76f13ea7e15e15cc64214c7ca89b6aaa35c4
  47. latin 31340 bytes sha256 2c32b9b3ee358c119e210f6f5195f9bd34894d78a785ff2e95d60e718e400af4
  48. Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
  49. This Font Software is licensed under the SIL Open Font License, Version 1.1.
  50. This license is copied below, and is also available with a FAQ at:
  51. https://openfontlicense.org
  52. -----------------------------------------------------------
  53. SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
  54. -----------------------------------------------------------
  55. PREAMBLE
  56. The goals of the Open Font License (OFL) are to stimulate worldwide
  57. development of collaborative font projects, to support the font creation
  58. efforts of academic and linguistic communities, and to provide a free and
  59. open framework in which fonts may be shared and improved in partnership
  60. with others.
  61. The OFL allows the licensed fonts to be used, studied, modified and
  62. redistributed freely as long as they are not sold by themselves. The
  63. fonts, including any derivative works, can be bundled, embedded,
  64. redistributed and/or sold with any software provided that any reserved
  65. names are not used by derivative works. The fonts and derivatives,
  66. however, cannot be released under any other type of license. The
  67. requirement for fonts to remain under this license does not apply
  68. to any document created using the fonts or their derivatives.
  69. DEFINITIONS
  70. "Font Software" refers to the set of files released by the Copyright
  71. Holder(s) under this license and clearly marked as such. This may
  72. include source files, build scripts and documentation.
  73. "Reserved Font Name" refers to any names specified as such after the
  74. copyright statement(s).
  75. "Original Version" refers to the collection of Font Software components as
  76. distributed by the Copyright Holder(s).
  77. "Modified Version" refers to any derivative made by adding to, deleting,
  78. or substituting -- in part or in whole -- any of the components of the
  79. Original Version, by changing formats or by porting the Font Software to a
  80. new environment.
  81. "Author" refers to any designer, engineer, programmer, technical
  82. writer or other person who contributed to the Font Software.
  83. PERMISSION & CONDITIONS
  84. Permission is hereby granted, free of charge, to any person obtaining
  85. a copy of the Font Software, to use, study, copy, merge, embed, modify,
  86. redistribute, and sell modified and unmodified copies of the Font
  87. Software, subject to the following conditions:
  88. 1) Neither the Font Software nor any of its individual components,
  89. in Original or Modified Versions, may be sold by itself.
  90. 2) Original or Modified Versions of the Font Software may be bundled,
  91. redistributed and/or sold with any software, provided that each copy
  92. contains the above copyright notice and this license. These can be
  93. included either as stand-alone text files, human-readable headers or
  94. in the appropriate machine-readable metadata fields within text or
  95. binary files as long as those fields can be easily viewed by the user.
  96. 3) No Modified Version of the Font Software may use the Reserved Font
  97. Name(s) unless explicit written permission is granted by the corresponding
  98. Copyright Holder. This restriction only applies to the primary font name as
  99. presented to the users.
  100. 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
  101. Software shall not be used to promote, endorse or advertise any
  102. Modified Version, except to acknowledge the contribution(s) of the
  103. Copyright Holder(s) and the Author(s) or with their explicit written
  104. permission.
  105. 5) The Font Software, modified or unmodified, in part or in whole,
  106. must be distributed entirely under this license, and must not be
  107. distributed under any other license. The requirement for fonts to
  108. remain under this license does not apply to any document created
  109. using the Font Software.
  110. TERMINATION
  111. This license becomes null and void if any of the above conditions are
  112. not met.
  113. DISCLAIMER
  114. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  115. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
  116. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
  117. OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
  118. COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  119. INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
  120. DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  121. FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
  122. OTHER DEALINGS IN THE FONT SOFTWARE.
  123. */
  124. /* cyrillic-ext */
  125. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  126. src: url(data:font/woff2;base64,d09GMgABAAAAAAaAABIAAAAADMwAAAYdAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbHhwoBmA/U1RBVIEgJx4AdC9MEQgKhGSEAAsgADCDOgE2AiQDOgQgBYdGB4EUGw8LIxEmZHIexT8PYy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YDnxx12XKnZdW8xwffa+T/9X0zlV0njyBweD9owcOHTh2n2FAHud8JQFzrt7/+PFb/z9+gWrZar9mPtORGfJlWLMw08XUJbNw2BcFN+w8BazvOcvp4+Mp5iNjx1grXfjjDbHQaFsg8w865aWZ4azb//nbiNW3z4b6lWXDvMxevjRbMMxufnvrnJ7/1lsG0vtsanX9+SbPe/OT9sQyyFJH9kETE422CTL/oF3y9OVK9Wbrjx9/R6z//fyuo5Ut5m+n812WtPPX1f3j+dVpxvMf596UQ+OTJw8cE9QsU6n8/++JyywnhmlHJyTGRcv8uMT4qDEJzQr540cu0xiSTHmWWpVIKad0lsb3l+Z/vrOp/vwBvcnwHyCQVlAf85sVNRjFf9NWy18C3rm8vQl45/bFz16aW+emiPwoKgkEn2Z12skn6P/wOYSJ9u20WvUMBf5uUN0zHgEAfC7Aq05gYJ5slpyeTTp6nK8bR9HC08mZwDA9FZj043fMVosnsbBYXIGlqXEcVhaJTRL7VojxmYJuNLHQj9+x1PUvVpp+xYaxPsaO5dyLXcs4DXuWsAX2rWQiDnS1/+ZQG9sgpGgyWdrQJIS4smFtkrWgCcm0ykPIEFb5AOvr0ua5EZIREk3sruRYNoeLhRBqJ+XBNpRfUAk5TouzilHr9FBRXohPoA3witRyrWIt+TU8FlcLIbk2rQIdS0gi0JFa8AXZUrrcE7Z9rvxyWEuqjyJknC1jCctY2tKFyllm49ySS1ct2WTYJedoTXV87+YpCLluLW8kODW7FLCMbEcD7sTpLVtpQfkiGDeJbW3tb20lWvzntJB3tx1I6Gdpx+lWty9CKmivAQbdPJ+PZMptjYUi3PMA87wcyWqRo4gyqmjI0YxWtKNTrb1PC+7AWu1HCIOXWzsNhawfzSf908vHlAfuLZXShddLrR2c1t3GkN63vQ3/MIvgz1kYfbtt2aVWaAAAAAA=) format('woff2');
  127. unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
  128. /* cyrillic */
  129. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  130. src: url(data:font/woff2;base64,d09GMgABAAAAACK8ABIAAAAARmAAACJTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoE1G4JgHIFaBmA/U1RBVIEgJx4AgkwvTBEICrporgMLggoAMKw6ATYCJAOEBAQgBYdGB4kHG7Q9RQdy2DiAAS7vZkS1alhU/18T1IqxA6flgFcrUbKj5VbNnlXLwaeDwbp1QnuC56gjzYrVYUfM09q5suLaHUkQV50dVYOIj26jU47IlZS6HX26O7S6VQJNqV6RcRcvsUAQII6oCK8Iu2mJiGj0lbNNfv915sno33zICElmoYK1snoO9x4ZgoQycWQEkjCsiF3igH/+3aw/UUIgZoRc8CIaKNsy7I6Id8U6+0QMmicmH98m2lGjQsWg7fC4rX/GRXlV6hVOVBAYeQzG3oA5QhhREzZSDsy8ai/KX1lexQ/5fdfe77h/t2zmAwnMQNS8XJNTe71y53BmES9PtGhcdjddmYF5Hvnplektv8fZF9WsH3X2PpAUWbLj5IgLgGPnKbJze4ety/rXAlKO0AEFDOJ5270/ol1gXWCBR5AATa2Byydp0/756aEcCuM5BMYhlMWoWVg4td0VrEW873we4D6NuDiaDTigbNtFBA01zRucdKtyYsbau/Ylw818WV/15quCBtElSPDFNq1gu4PrCh3/MpoYAQSwsw76HuYAm+/vVdX1P0E4ga5gKphK+cI7pGsY08qWYSxrnz7wBZKfn7QAUHJA0XQIi76AKhdQ8l3pcEVabVO+qBTbaVJKLWMrU+3rlnFM5vD81z3j5r+Di4FRsw+auZu0mKdlKUaQMGUyVONOtki2UuHREIwdOn6N/8daxcfsuGwuatyWeAwS/gwJkdjWvc6rQxDIip5TBBqvgGEfo3k41TziVqCQURGjeeJomYwOU85jm4boTuboAdboYY7oce7oWUH6BOQ8ntYQfVacvgoY0dfqpO+CXMAEMVsE4p6jwRAtBMjDAsYwo7OnQYAkVH73x/BEilZ+blxNESQAvZluhQoTgXIeUkRVxjGF8DLSwUESHtwWNyzRJ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vPufXPP/uL/xRy/vzPXhAAAA) format('woff2');
  131. unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
  132. /* greek */
  133. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  134. src: url(data:font/woff2;base64,d09GMgABAAAAABqQABIAAAAANggAABopAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGnwbHhyBWgZgP1NUQVSBICceAIFiL0wRCAqrfKMTC4FmADCgXAE2AiQDg0QEIAWHRgeHQRt7L1UHctg4AONHDw/J/98StCEx8OvQuaoS6nSKOb1TAFiw0Fg4OrHmUFx9lE0RHuCAwNZTYLzu0qIYrA2BIRRRhOaLtZ08a/sp9zYCdQA8KAuMM8JgShJLBIph0a9CVKNU5Kz3C6kz9f9u+04Z3maEJLM+PW3a+3+XBRaLKxEnQkSEEoEu1rSppBKruKauuYp7ciJWOcmUo7nhJS8iHiFtjmq7+WH3ih3OVZkJbJviPSALIQK9R2ufHSCVMDwf3t6dTUbxJMCBZZzEHGDq/dW5+BuhCCwAyNGp7Qbfqz4neKAyTZqkGLqcOXD2yAf6S9CXBKjiYHe7/6RBBJEETaIBSYQfAEpOU/IgUnwldDH6e5eQmMaEF7GNOjhvxlN4rPb8O1d9ZTAkFFEhK06K6oYYy9vXX9FcKceGqruiyWE2JCclRgHFyIg66EQRUWcsdUzg/vg/XWk7f2d14NAqqA3ePkfv6RIuurMrd3UqjTRrwUg5rbL7vDodg9Y+ExzrQgidzOugHCAuSqIOqEyXok1RVKmsstSQWe1WWYkPCB2v22Tun9a18LCMh7GGEmM6XPw5a4EAkANqUzghYDwPnpH3EcgHC+HV1Hy4cD5SFB8jho+XzGulG7k3nqCAJyjlCap5At3xCRr0RWDiCSxAMgAPn2dCCl+VdZCABQC7HQBgbrxidHmvu3FUC5SwCxOQ6poAHfAe0QaloTJaGWDAQSf/xZSacW2eDz4yws0e48wXgakYTRmcfIB1YrQBABIopChcNDhxSYyuFQkBLWkY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GBRDsuKMALQvvoAkNj4q2dvy3Ke6yaDMys/Qwoi8pK6qmG6ZlO67H6xOACsKEhEXgCCQKjcHiRMXw4nr16Tdg0JBhI0aNGTdh0pSEpJQjjjqWDVKdcNIpp51x1jnnmSw2h8vjC0xMzczjqILfNVWWYchvbWNrlyXqHBydnBV3qZnh3f0d16+pTEpINJPFu2uS/MS8Qb8i0iS/+nIJ6sO2VW86iWlDK7vsmdZjJ9d7Dru33D7feGRCPjiD86zYfOUR6rZCC42WGp2Rr74P/2ntaI14mx90h8NW4T18/HC+ErzOJ2xnfb1Hu/LzJJ6C/g40HY9xqtYYAmrJlEsKybqgNeHDCbrq5rthkzAXbafuP620/ZELm2jHHQUmhQtPhImM0Z9ZKPBkmvhDglUC8R0/KNYW8jX00uiLnKg5WNisEz8mklcAFKeBQUTuLiXKiySyC2PPZ8UaekxY87W9XgiaVew0K9qvrECVdCYFgs+TcAnl0F4oSOHb75vWbuJ7krbIHBWfF6H29siCNkklk/eLT5Ur/3XvXTqIvrf733vVumw7TrFoj1RDrZ1tGQAAAAA=) format('woff2');
  135. unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
  136. /* vietnamese */
  137. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  138. src: url(data:font/woff2;base64,d09GMgABAAAAABbwABIAAAAAP8wAABaJAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoEYG4YcHIIWBmA/U1RBVIEgJx4AgwQvTBEICrBAp3ILgjgAMKEmATYCJAOEKAQgBYdGB4xOGw05JeOYFbBxAJizfwap/v9LAidj5+rgVi2AmnKs4xCdVNzZFtedQQYTHrvu9fJjcffSRGkQNsblzkX3scG0IVTkKwtieRAjQYIYSTEMHWyen+61Gx9Jw60vaxE6DsqpIySZ9eH5bf657z2M9+hFIWIMA5WBjUx4aGPSw8RGG91QWchkJcv4GeEvf3Tx8P1+7dy/5kDURCg2nSEy5E24JCq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0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
  140. /* latin-ext */
  141. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  142. src: url(data:font/woff2;base64,d09GMgABAAAAAC1MABIAAAAAdAQAACzjAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoJLG4ouHIM+BmA/U1RBVIEgJx4AhTovTBEICuBkzjkLhAwAMMVKATYCJAOIEgQgBYdGB5FVG4xnNXjTMeV2EEi463Muilo1Semz//9z0jFkDP0YgPnK6IQkTGZVRXZVMlEhJrRAsqq2tIQeZfVhf0qr17jt0HuNqAthhO/aPDdxgAtjFWuBDJd7eOb6YRSNJoVoApre9AOKGEQaSY8rp20yx+r3B4Hkct+7VO3Onuv/+YAPXOfnBs8qtx2hsU9yefja7/Xc3RdkVWJUX5VYkkJyGd/6WgQhy5Id2YSPp239PNYAjDwbxACVEIlell0QRUDBVRRXQsTC6Dvvzqv2Ir0q735l86PrKmfZPa2RRiPZsr1aIK9rHQD6vvBFAm8If3mFf6n8EJ/hI9IBycnKMJYsS0OVDWB1zZ5HgCbgDBZFPEEghCf+1Qv/yj3z5lYfxMrYvmGFEV9x+aJ60/v4+cvh/v9VTMYcW0jrpEBaSFtCG/6f/mLn/l20wDJOmkkpsBQCfpM6Uw7asmUZSLLAsULPPBWmXuduU/JK5/W/CDCwbW7Xcpypj4o2uhqCyR6/WcNmLn0v+dIKKAZhUJLB4f//XPlewNw7f0vMwjTwM7zAM7O65cRm7CKosuqpqmbFy6Z2L/vKAs0FmaRg/Pwezl1hck9JvEXu1hBAMR2P3M1zALeHgi9dmWql02gsBVEO8uBbqF74x3so+nQBUlV4b6L7IPqPdmcADBa7ABdLQgQBUgLN3YHHM6C7B89yAUFamlfhpHPO7HlK7/jG+twYE3obZC6NvnKXuyAOXkV0hey4hS1wOvetf/8dpubhELe3Oy+im4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THTFfu6lvhQPZR5M4rZuhwqPFgFV0KlVaKQlulXgkirmUDaoala1JyTN3TqfoWaNOMRN/2iLoKnb6XQraK3Wg4hQ7jMl9CXWSd6a5iEbGnlRCSghYiJiYg4qcaMyMlETGBi1o0ylisERGjxGPQSDimWTiUoQaGKMnzs9h6MKm+f8RNGov+fXlcDk9YnTRa2LK8TLnGZ008ikV7Zc+z6JmtbqhfmXHENXoPXxwy5Oo+gY4XBGfo0xu1LT3KPcdlY0CXQigBACAYBBEBwgvMRP/Me5xP6e6wMPqEQaEUF/7yfJXYxebBAYljzdjbyeTFusYyVmX1Ya8dwgc/MvjOZWsRpiyKdvjCHM1ZS6232xGr+PZkqh0XP0ej2eAf7ZPn93+ckEiEFNfwpMlPBEfyV67F8ss2EiBE7fuj6fq3NhFEGJcjoBxj9jZvRG7RWB2JkzXGa0k2KmyAMyiBFVx3kFV+F3BrwwJOs/obXzjaMTPJNjD2pwjDZBQAAAA==) format('woff2');
  143. unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  144. /* latin */
  145. @font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  146. src: url(data:font/woff2;base64,d09GMgABAAAAAHpsABIAAAABMqgAAHoCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoE4G4caHIGacgZgP1NUQVSBICceAIUiL0wRCAqB3DiBrC4LhhYAMIGcXgE2AiQDjBoEIAWHRgejDFtJFnGBsU2lnge5WVVyxx2bn8k4NuF2FGQmX4ZnRm0XabU42f//JyUdMjTEGqDSdar2O+SQccghITKCZESYriN72BqZaY6RUJB0uPlEx4STwvdgyWM3TuN0dmkHp1ih39djHtzlZcqjBEH+ukP3Wz2Jw710mcz4TFNrmNOowSgzl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Appe/TplnFb8KaaqRSFIlDk7YDUIXBwkk7bzRe6U8VZufX2Us2C8eHJ+lwrxATkSNdSQUPNF4pwDVKYv2Pr1LO4dn6JR/Jn+eoq7ltPCnngDq88an2NdKoXqdm0GGBl9oD+iCgJquEFpPPT4IlJVxt2bVNyhnIDb79BtuqmL0/UC4p84EzV3O04zpcu2hHTvclQQHPraEFXLbC3gTNBbCw81EPB6YbgVhi7SQq59Ez3MnLKitWcJJJOl9CMpn2ngu6AGy9lEF+k1iAM4nyWBwIEwpxODYS0qRUgMnuo2+S0bUJGj9PBNnBZeVsBozZ/wB2g69LwLrOVINXQ3jP3/Vw71ve2/7zs=) format('woff2');
  147. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  148. </style>
  149. <style>
  150. /* ==========================================================
  151. THEME VARIABLES — switch by toggling [data-theme] on <html>
  152. ========================================================== */
  153. :root,
  154. [data-theme="dark"] {
  155. --bg: #020617;
  156. --grid: #1e293b;
  157. --canvas-dot: rgba(148, 163, 184, 0.16);
  158. --text: #ffffff;
  159. --text-muted: #94a3b8;
  160. --text-dim: #475569;
  161. /* UI chrome and menu hints need more contrast than SVG .t-dim accents */
  162. --text-faint: #7d8da1;
  163. --panel: rgba(15, 23, 42, 0.5);
  164. --panel-border: #1e293b;
  165. --lane-fill: rgba(15, 23, 42, 0.22);
  166. --lane-stroke: #334155;
  167. --arrow: #94a3b8;
  168. --arrow-emphasis: #34d399;
  169. /* Opaque mask color used behind semi-transparent component fills
  170. so the arrows drawn underneath are properly hidden. */
  171. --mask: #0f172a;
  172. --frontend-fill: rgba(8, 51, 68, 0.4);
  173. --frontend-stroke: #22d3ee;
  174. --backend-fill: rgba(6, 78, 59, 0.4);
  175. --backend-stroke: #34d399;
  176. --database-fill: rgba(76, 29, 149, 0.4);
  177. --database-stroke: #a78bfa;
  178. --cloud-fill: rgba(120, 53, 15, 0.3);
  179. --cloud-stroke: #fbbf24;
  180. --security-fill: rgba(136, 19, 55, 0.4);
  181. --security-stroke: #fb7185;
  182. --messagebus-fill: rgba(251, 146, 60, 0.3);
  183. --messagebus-stroke:#fb923c;
  184. --external-fill: rgba(30, 41, 59, 0.5);
  185. --external-stroke: #94a3b8;
  186. --toolbar-bg: rgba(15, 23, 42, 0.8);
  187. --toolbar-border: #334155;
  188. --toolbar-text: #e2e8f0;
  189. --toolbar-hover: rgba(15, 23, 42, 0.95);
  190. --toolbar-menu-bg: #0f172a;
  191. }
  192. [data-theme="light"] {
  193. --bg: #f4f5f7;
  194. --grid: #e9edf2;
  195. --canvas-dot: #e2e7ec;
  196. --text: #111827;
  197. --text-muted: #5b6474;
  198. --text-dim: #9aa3b2;
  199. --text-faint: #6b7280;
  200. --panel: #ffffff;
  201. --panel-border: #e5e7eb;
  202. --lane-fill: rgba(248, 250, 252, 0.65);
  203. --lane-stroke: #cbd5e1;
  204. --arrow: #64748b;
  205. --arrow-emphasis: #059669;
  206. --mask: #ffffff;
  207. --frontend-fill: rgba(34, 211, 238, 0.15);
  208. --frontend-stroke: #0891b2;
  209. --backend-fill: rgba(52, 211, 153, 0.18);
  210. --backend-stroke: #059669;
  211. --database-fill: rgba(167, 139, 250, 0.2);
  212. --database-stroke: #7c3aed;
  213. --cloud-fill: rgba(251, 191, 36, 0.18);
  214. --cloud-stroke: #d97706;
  215. --security-fill: rgba(251, 113, 133, 0.15);
  216. --security-stroke: #e11d48;
  217. --messagebus-fill: rgba(251, 146, 60, 0.15);
  218. --messagebus-stroke: #ea580c;
  219. --external-fill: rgba(148, 163, 184, 0.18);
  220. --external-stroke: #64748b;
  221. --toolbar-bg: rgba(255, 255, 255, 0.92);
  222. --toolbar-border: #cbd5e1;
  223. --toolbar-text: #334155;
  224. --toolbar-hover: #ffffff;
  225. --toolbar-menu-bg: #ffffff;
  226. }
  227. /* ==========================================================
  228. SIGNAL FLOW — an opt-in, motion-forward visual preset.
  229. The variables also target a standalone exported SVG, whose
  230. root carries data-preset and data-theme directly.
  231. ========================================================== */
  232. [data-preset="signal-flow"][data-theme="dark"] {
  233. --bg: #030711;
  234. --grid: #15233a;
  235. --panel: rgba(6, 14, 28, 0.78);
  236. --panel-border: #1d3350;
  237. --lane-fill: rgba(9, 22, 40, 0.5);
  238. --lane-stroke: #2c4564;
  239. --text: #f5fbff;
  240. --text-muted: #9eb0c7;
  241. --text-dim: #52667f;
  242. --text-faint: #7890ad;
  243. --mask: #07101e;
  244. --frontend-fill: rgba(6, 182, 212, 0.14);
  245. --frontend-stroke: #67e8f9;
  246. --backend-fill: rgba(16, 185, 129, 0.14);
  247. --backend-stroke: #5eead4;
  248. --database-fill: rgba(139, 92, 246, 0.16);
  249. --database-stroke: #c4b5fd;
  250. --cloud-fill: rgba(245, 158, 11, 0.13);
  251. --cloud-stroke: #fcd34d;
  252. --security-fill: rgba(244, 63, 94, 0.13);
  253. --security-stroke: #fda4af;
  254. --messagebus-fill: rgba(249, 115, 22, 0.13);
  255. --messagebus-stroke: #fdba74;
  256. --external-fill: rgba(71, 85, 105, 0.24);
  257. --external-stroke: #a5b4c7;
  258. --arrow: #7890ad;
  259. --arrow-emphasis: #2dd4bf;
  260. --toolbar-bg: rgba(7, 16, 30, 0.86);
  261. --toolbar-border: #29415f;
  262. --toolbar-menu-bg: #07101e;
  263. }
  264. [data-preset="signal-flow"][data-theme="light"] {
  265. --bg: #f4f9fc;
  266. --grid: #d4e5ee;
  267. --panel: rgba(255, 255, 255, 0.82);
  268. --panel-border: #bfd5e2;
  269. --lane-fill: rgba(232, 243, 248, 0.62);
  270. --lane-stroke: #a9c5d5;
  271. --text: #102638;
  272. --text-muted: #587287;
  273. --text-dim: #8aa2b4;
  274. --text-faint: #668397;
  275. --mask: #ffffff;
  276. --frontend-fill: rgba(6, 182, 212, 0.09);
  277. --frontend-stroke: #0789a1;
  278. --backend-fill: rgba(5, 150, 105, 0.09);
  279. --backend-stroke: #087f69;
  280. --database-fill: rgba(124, 58, 237, 0.09);
  281. --database-stroke: #7254c7;
  282. --cloud-fill: rgba(217, 119, 6, 0.08);
  283. --cloud-stroke: #b9670b;
  284. --security-fill: rgba(225, 29, 72, 0.08);
  285. --security-stroke: #c53a59;
  286. --messagebus-fill: rgba(234, 88, 12, 0.08);
  287. --messagebus-stroke: #c65f27;
  288. --external-fill: rgba(100, 116, 139, 0.1);
  289. --external-stroke: #607a8c;
  290. --arrow: #7b97aa;
  291. --arrow-emphasis: #0d9488;
  292. }
  293. /* ==========================================================
  294. BLUEPRINT — a review-first drafting preset for deployment,
  295. infrastructure, and technical design documentation. It keeps
  296. the same semantic palette and geometry while trading glow for
  297. precise grid contrast, squared materials, and drafting marks.
  298. ========================================================== */
  299. [data-preset="blueprint"][data-theme="dark"] {
  300. --bg: #06131f;
  301. --grid: #17425a;
  302. --panel: rgba(7, 27, 43, 0.9);
  303. --panel-border: #27627f;
  304. --lane-fill: rgba(10, 43, 66, 0.36);
  305. --lane-stroke: #34799a;
  306. --text: #e3f6ff;
  307. --text-muted: #91b8ca;
  308. --text-dim: #557e92;
  309. --text-faint: #739caf;
  310. --mask: #0a2031;
  311. --frontend-fill: rgba(26, 157, 193, 0.14);
  312. --frontend-stroke: #66d9ef;
  313. --backend-fill: rgba(31, 155, 124, 0.13);
  314. --backend-stroke: #69dfbd;
  315. --database-fill: rgba(120, 105, 196, 0.14);
  316. --database-stroke: #b4a8ff;
  317. --cloud-fill: rgba(197, 145, 43, 0.13);
  318. --cloud-stroke: #ffd166;
  319. --security-fill: rgba(199, 76, 104, 0.13);
  320. --security-stroke: #ff8da1;
  321. --messagebus-fill: rgba(207, 112, 49, 0.13);
  322. --messagebus-stroke: #ffad66;
  323. --external-fill: rgba(84, 119, 139, 0.18);
  324. --external-stroke: #a7cad9;
  325. --arrow: #78a3b7;
  326. --arrow-emphasis: #64dfc1;
  327. --toolbar-bg: rgba(7, 28, 45, 0.92);
  328. --toolbar-border: #34799a;
  329. --toolbar-text: #d8f3ff;
  330. --toolbar-hover: rgba(18, 58, 83, 0.95);
  331. --toolbar-menu-bg: #0a2031;
  332. }
  333. [data-preset="blueprint"][data-theme="light"] {
  334. --bg: #edf7fa;
  335. --grid: #b5d5e1;
  336. --panel: rgba(249, 253, 255, 0.94);
  337. --panel-border: #78aabd;
  338. --lane-fill: rgba(210, 232, 240, 0.42);
  339. --lane-stroke: #83b2c4;
  340. --text: #123344;
  341. --text-muted: #4e7486;
  342. --text-dim: #86a6b4;
  343. --text-faint: #668c9d;
  344. --mask: #f9fdff;
  345. --frontend-fill: rgba(8, 145, 178, 0.08);
  346. --frontend-stroke: #087f9c;
  347. --backend-fill: rgba(5, 128, 101, 0.08);
  348. --backend-stroke: #08755f;
  349. --database-fill: rgba(100, 75, 180, 0.08);
  350. --database-stroke: #6757a8;
  351. --cloud-fill: rgba(181, 120, 15, 0.08);
  352. --cloud-stroke: #a86609;
  353. --security-fill: rgba(190, 48, 80, 0.07);
  354. --security-stroke: #b32f50;
  355. --messagebus-fill: rgba(196, 81, 22, 0.07);
  356. --messagebus-stroke: #b65120;
  357. --external-fill: rgba(79, 112, 128, 0.08);
  358. --external-stroke: #506f7e;
  359. --arrow: #6d93a5;
  360. --arrow-emphasis: #087f69;
  361. --toolbar-bg: rgba(247, 252, 254, 0.94);
  362. --toolbar-border: #8ab5c5;
  363. --toolbar-text: #294f61;
  364. --toolbar-hover: #ffffff;
  365. --toolbar-menu-bg: #f9fdff;
  366. }
  367. /* ==========================================================
  368. EDITORIAL — a warm, publication-minded preset for design
  369. reviews, launch notes, and documentation. The diagram keeps
  370. the same semantic palette and exact geometry, but trades
  371. software chrome for paper, ink, ruled structure, and one
  372. restrained vermilion accent.
  373. ========================================================== */
  374. [data-preset="editorial"][data-theme="dark"] {
  375. --bg: #181611;
  376. --grid: #39342a;
  377. --panel: rgba(35, 31, 24, 0.96);
  378. --panel-border: #625a4a;
  379. --lane-fill: rgba(52, 46, 35, 0.46);
  380. --lane-stroke: #726957;
  381. --text: #f4eddf;
  382. --text-muted: #b9ae9b;
  383. --text-dim: #776e60;
  384. --text-faint: #9d917e;
  385. --mask: #231f18;
  386. --frontend-fill: rgba(43, 133, 142, 0.16);
  387. --frontend-stroke: #7fc6c7;
  388. --backend-fill: rgba(63, 132, 92, 0.16);
  389. --backend-stroke: #8fc29e;
  390. --database-fill: rgba(117, 91, 141, 0.17);
  391. --database-stroke: #c0a4d0;
  392. --cloud-fill: rgba(170, 119, 49, 0.16);
  393. --cloud-stroke: #d8ad68;
  394. --security-fill: rgba(157, 69, 65, 0.17);
  395. --security-stroke: #df9085;
  396. --messagebus-fill: rgba(174, 79, 42, 0.16);
  397. --messagebus-stroke: #df946f;
  398. --external-fill: rgba(126, 115, 96, 0.18);
  399. --external-stroke: #b8ad99;
  400. --arrow: #948978;
  401. --arrow-emphasis: #dd6b3d;
  402. --toolbar-bg: rgba(35, 31, 24, 0.92);
  403. --toolbar-border: #625a4a;
  404. --toolbar-text: #eee5d5;
  405. --toolbar-hover: #302a20;
  406. --toolbar-menu-bg: #231f18;
  407. }
  408. [data-preset="editorial"][data-theme="light"] {
  409. --bg: #f2eee5;
  410. --grid: #d8d0c2;
  411. --panel: rgba(251, 248, 241, 0.97);
  412. --panel-border: #c4b9a6;
  413. --lane-fill: rgba(229, 221, 207, 0.42);
  414. --lane-stroke: #b8aa94;
  415. --text: #242018;
  416. --text-muted: #6f6658;
  417. --text-dim: #a09788;
  418. --text-faint: #817767;
  419. --mask: #fbf8f1;
  420. --frontend-fill: rgba(31, 117, 126, 0.09);
  421. --frontend-stroke: #287e84;
  422. --backend-fill: rgba(42, 119, 75, 0.09);
  423. --backend-stroke: #397b53;
  424. --database-fill: rgba(105, 75, 130, 0.09);
  425. --database-stroke: #765d86;
  426. --cloud-fill: rgba(157, 103, 31, 0.1);
  427. --cloud-stroke: #9a671f;
  428. --security-fill: rgba(153, 58, 52, 0.09);
  429. --security-stroke: #9e463f;
  430. --messagebus-fill: rgba(182, 70, 27, 0.09);
  431. --messagebus-stroke: #ad4b25;
  432. --external-fill: rgba(101, 91, 75, 0.09);
  433. --external-stroke: #746b5e;
  434. --arrow: #8a806f;
  435. --arrow-emphasis: #bb4c23;
  436. --toolbar-bg: rgba(251, 248, 241, 0.94);
  437. --toolbar-border: #c4b9a6;
  438. --toolbar-text: #40392f;
  439. --toolbar-hover: #fffdf8;
  440. --toolbar-menu-bg: #fbf8f1;
  441. }
  442. * { margin: 0; padding: 0; box-sizing: border-box; }
  443. body {
  444. --archify-page-top: 2rem;
  445. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
  446. -webkit-font-smoothing: antialiased;
  447. background: var(--bg);
  448. min-height: 100vh;
  449. padding: var(--archify-page-top) 2rem 2rem;
  450. color: var(--text);
  451. /* Theme surfaces change together; animating the page background leaves it
  452. visibly out of sync with the SVG and panel for the first 200ms. */
  453. }
  454. html[data-preset="signal-flow"] body {
  455. background-image:
  456. radial-gradient(circle at 18% -8%, rgba(34, 211, 238, 0.14), transparent 34rem),
  457. radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.12), transparent 30rem);
  458. background-attachment: fixed;
  459. }
  460. html[data-preset="signal-flow"][data-theme="light"] body {
  461. background-image:
  462. radial-gradient(circle at 18% -8%, rgba(6, 182, 212, 0.12), transparent 34rem),
  463. radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.08), transparent 30rem);
  464. }
  465. html[data-preset="blueprint"] body {
  466. background-image:
  467. linear-gradient(var(--grid) 1px, transparent 1px),
  468. linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  469. background-size: 32px 32px;
  470. background-position: -1px -1px;
  471. background-attachment: fixed;
  472. }
  473. html[data-preset="editorial"] body {
  474. background-image:
  475. linear-gradient(90deg, transparent 0, transparent 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) 5.4rem, color-mix(in srgb, var(--security-stroke) 18%, transparent) calc(5.4rem + 1px), transparent calc(5.4rem + 1px)),
  476. repeating-linear-gradient(0deg, transparent 0, transparent 31px, color-mix(in srgb, var(--grid) 36%, transparent) 31px, color-mix(in srgb, var(--grid) 36%, transparent) 32px);
  477. background-attachment: fixed;
  478. }
  479. /* Gallery/embed mode keeps the generated artifact as the source of truth
  480. while presenting only its diagram surface inside a proof card. */
  481. html[data-embed="true"] body {
  482. min-height: 0;
  483. padding: 0;
  484. overflow: hidden;
  485. background: var(--bg);
  486. background-image: none;
  487. }
  488. html[data-embed="true"] .toolbar,
  489. html[data-embed="true"] .header,
  490. html[data-embed="true"] .cards,
  491. html[data-embed="true"] .diagram-nav,
  492. html[data-embed="true"] .overview-map,
  493. html[data-embed="true"] .focus-chip,
  494. html[data-embed="true"] .route-probe,
  495. html[data-embed="true"] .semantic-lens,
  496. html[data-embed="true"] .diagram-guide,
  497. html[data-embed="true"] .node-finder,
  498. html[data-embed="true"] .node-outline { display: none !important; }
  499. html[data-embed="true"] .container { max-width: none; }
  500. html[data-embed="true"] .diagram-container {
  501. padding: 0.5rem;
  502. border: 0;
  503. border-radius: 0;
  504. box-shadow: none;
  505. }
  506. html[data-embed="true"] .diagram-container svg { min-width: 0; }
  507. /* Presentation Stage is a viewer-only layer: it gives the live diagram
  508. the viewport while keeping guided views, theme, focus, and exports real.
  509. Embed mode wins when both query parameters are present. */
  510. html[data-present="true"]:not([data-embed="true"]) body {
  511. --archify-page-top: 1rem;
  512. height: 100dvh;
  513. min-height: 0;
  514. padding: 1rem;
  515. overflow: hidden;
  516. }
  517. html[data-present="true"]:not([data-embed="true"]) .container {
  518. display: flex;
  519. flex-direction: column;
  520. gap: 0.75rem;
  521. width: 100%;
  522. max-width: none;
  523. height: calc(100dvh - 2rem);
  524. }
  525. html[data-present="true"]:not([data-embed="true"]) .header {
  526. flex: none;
  527. min-width: 0;
  528. margin: 0;
  529. padding-right: 23rem;
  530. }
  531. html[data-present="true"]:not([data-embed="true"]) .header-row { margin-bottom: 0.25rem; }
  532. html[data-present="true"]:not([data-embed="true"]) .subtitle {
  533. overflow: hidden;
  534. text-overflow: ellipsis;
  535. white-space: nowrap;
  536. }
  537. html[data-present="true"]:not([data-embed="true"]) .diagram-container {
  538. display: flex;
  539. flex: 1 1 auto;
  540. align-items: center;
  541. justify-content: center;
  542. min-height: 0;
  543. padding: 0.75rem;
  544. padding-bottom: calc(0.75rem + var(--archify-nav-reserve));
  545. }
  546. html[data-present="true"]:not([data-embed="true"]) .diagram-container > svg {
  547. flex: 1 1 auto;
  548. height: 100%;
  549. min-height: 0;
  550. width: 100%;
  551. min-width: 0;
  552. }
  553. html[data-present="true"]:not([data-embed="true"]) .cards { display: none; }
  554. html[data-present="true"]:not([data-embed="true"]) #btn-present {
  555. border-color: var(--frontend-stroke);
  556. color: var(--frontend-stroke);
  557. }
  558. /* The reader owns only the outer scale. Compact automatic sequences fit at
  559. their authored text size or larger. Long sequences and waterfall rows
  560. favor reading width and page scroll; other diagrams keep height fitting.
  561. Small automatic canvases retain a modest scale inside a usable shell.
  562. Every strategy preserves the authored SVG/viewBox and semantic geometry. */
  563. .container {
  564. width: 100%;
  565. max-width: var(--archify-reader-width, 1440px);
  566. margin: 0 auto;
  567. }
  568. html[data-reader-area="true"] .diagram-container {
  569. min-height: var(--archify-diagram-min-height);
  570. display: flex;
  571. align-items: center;
  572. }
  573. html[data-reader-area="true"] .diagram-container > svg { flex-shrink: 0; }
  574. /* The original SVG legend can use the outer corner while the capped or fitted
  575. diagram stays centered. The container still clips all outer paint. */
  576. .diagram-container:has([data-reader-legend-corner]) > svg { overflow: visible; }
  577. .diagram-container [data-reader-legend-corner] {
  578. transform-origin: 0 0;
  579. transform-box: view-box;
  580. transform: var(--archify-reader-legend-transform);
  581. }
  582. html[data-reader-narrow="true"]:not([data-present="true"]) .diagram-container > svg {
  583. min-width: 0;
  584. max-width: var(--archify-diagram-max-width);
  585. margin-inline: auto;
  586. }
  587. @media (min-width: 768px) and (max-height: 920px) {
  588. .header { margin-bottom: 1rem; }
  589. .diagram-container { padding: 1rem; }
  590. .cards { margin-top: 1rem; }
  591. .card { padding: 1rem; }
  592. }
  593. .header { margin-bottom: 1.5rem; padding-right: 29.5rem; }
  594. html[data-preset="signal-flow"] .header,
  595. html[data-preset="blueprint"] .header,
  596. html[data-preset="editorial"] .header { padding-right: 29.5rem; }
  597. .header-row {
  598. display: flex;
  599. align-items: center;
  600. gap: 0.75rem;
  601. min-height: 2.75rem;
  602. margin-bottom: 0.25rem;
  603. }
  604. .pulse-dot {
  605. flex: none;
  606. width: 10px;
  607. height: 10px;
  608. background: var(--frontend-stroke);
  609. border-radius: 50%;
  610. box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);
  611. animation: none;
  612. }
  613. html[data-motion-capable="true"] .pulse-dot { animation: pulse 2s infinite; }
  614. @keyframes pulse {
  615. 0%, 100% { opacity: 1; }
  616. 50% { opacity: 0.5; }
  617. }
  618. h1 {
  619. font-size: 1.5rem;
  620. font-weight: 650;
  621. line-height: 1.25;
  622. letter-spacing: -0.015em;
  623. }
  624. .subtitle {
  625. color: var(--text-muted);
  626. font-size: 0.875rem;
  627. line-height: 1.55;
  628. margin-left: 1.375rem;
  629. }
  630. html[data-preset="signal-flow"] .header-row::after {
  631. content: attr(data-preset-badge-signal-flow);
  632. flex: none;
  633. margin-left: 0.25rem;
  634. color: var(--frontend-stroke);
  635. border: 1px solid var(--frontend-stroke);
  636. border-radius: 999px;
  637. padding: 0.28rem 0.6rem;
  638. font-size: 0.625rem;
  639. letter-spacing: 0.12em;
  640. opacity: 0.82;
  641. box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
  642. white-space: nowrap;
  643. }
  644. html[data-preset="blueprint"] .pulse-dot {
  645. width: 10px;
  646. height: 10px;
  647. border: 1px solid var(--frontend-stroke);
  648. border-radius: 1px;
  649. background: transparent;
  650. box-shadow: inset 0 0 0 2px var(--bg);
  651. transform: rotate(45deg);
  652. animation: none;
  653. }
  654. html[data-preset="blueprint"] .header-row::after {
  655. content: attr(data-preset-badge-blueprint);
  656. flex: none;
  657. margin-left: 0.25rem;
  658. padding: 0.28rem 0.55rem;
  659. border-top: 1px solid var(--frontend-stroke);
  660. border-bottom: 1px solid var(--frontend-stroke);
  661. color: var(--frontend-stroke);
  662. font-size: 0.5625rem;
  663. font-weight: 700;
  664. letter-spacing: 0.14em;
  665. white-space: nowrap;
  666. }
  667. html[data-preset="editorial"] h1,
  668. html[data-preset="editorial"] .card h3 {
  669. font-family: Georgia, 'Times New Roman', 'Songti SC', STSong, serif;
  670. letter-spacing: -0.02em;
  671. }
  672. html[data-preset="editorial"] h1 { font-size: 1.72rem; font-weight: 600; }
  673. html[data-preset="editorial"] .pulse-dot {
  674. width: 9px;
  675. height: 9px;
  676. border: 1px solid var(--arrow-emphasis);
  677. border-radius: 0;
  678. background: var(--arrow-emphasis);
  679. box-shadow: 0 0 0 3px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);
  680. transform: rotate(45deg);
  681. animation: none;
  682. }
  683. html[data-preset="editorial"] .header-row::after {
  684. content: attr(data-preset-badge-editorial);
  685. flex: none;
  686. margin-left: 0.25rem;
  687. padding: 0.32rem 0 0.24rem;
  688. border-bottom: 2px solid var(--arrow-emphasis);
  689. color: var(--arrow-emphasis);
  690. font-family: Georgia, 'Times New Roman', serif;
  691. font-size: 0.625rem;
  692. font-style: italic;
  693. font-weight: 600;
  694. letter-spacing: 0.08em;
  695. white-space: nowrap;
  696. }
  697. .diagram-container {
  698. --archify-nav-reserve: 0px;
  699. background: var(--panel);
  700. border-radius: 1rem;
  701. border: 1px solid var(--panel-border);
  702. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);
  703. padding: 1.5rem;
  704. padding-bottom: calc(1.5rem + var(--archify-nav-reserve));
  705. overflow: hidden;
  706. position: relative;
  707. }
  708. html[data-preset="signal-flow"] .diagram-container {
  709. position: relative;
  710. overflow: hidden;
  711. background: linear-gradient(180deg, rgba(8, 20, 38, 0.82), rgba(3, 8, 18, 0.94));
  712. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.34);
  713. }
  714. html[data-preset="signal-flow"][data-theme="light"] .diagram-container {
  715. background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 246, 250, 0.94));
  716. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 60px rgba(45, 78, 99, 0.12);
  717. }
  718. html[data-preset="blueprint"] .diagram-container {
  719. border-color: var(--panel-border);
  720. border-radius: 0.35rem;
  721. background: var(--panel);
  722. box-shadow:
  723. inset 0 0 0 1px color-mix(in srgb, var(--panel-border) 34%, transparent),
  724. 0 18px 48px rgba(0, 0, 0, 0.16);
  725. }
  726. html[data-preset="blueprint"] .diagram-container::after {
  727. content: "";
  728. position: absolute;
  729. z-index: 10;
  730. inset: 0.7rem;
  731. pointer-events: none;
  732. background:
  733. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1.35rem 1px no-repeat,
  734. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left top / 1px 1.35rem no-repeat,
  735. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1.35rem 1px no-repeat,
  736. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right top / 1px 1.35rem no-repeat,
  737. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1.35rem 1px no-repeat,
  738. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) left bottom / 1px 1.35rem no-repeat,
  739. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1.35rem 1px no-repeat,
  740. linear-gradient(var(--frontend-stroke), var(--frontend-stroke)) right bottom / 1px 1.35rem no-repeat;
  741. opacity: 0.58;
  742. }
  743. html[data-preset="editorial"] .diagram-container {
  744. overflow: hidden;
  745. border-color: var(--panel-border);
  746. border-radius: 0.38rem;
  747. background:
  748. linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 12%),
  749. var(--panel);
  750. box-shadow:
  751. 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent),
  752. 0 18px 48px color-mix(in srgb, #000 19%, transparent);
  753. }
  754. html[data-preset="editorial"] .diagram-container::after {
  755. position: absolute;
  756. z-index: 10;
  757. top: 0.72rem;
  758. right: 1.25rem;
  759. padding: 0.2rem 0.52rem;
  760. border: 1px solid var(--panel-border);
  761. background: var(--panel);
  762. color: var(--arrow-emphasis);
  763. content: attr(data-preset-badge-editorial-plate);
  764. font-family: Georgia, 'Times New Roman', serif;
  765. font-size: 0.52rem;
  766. font-style: italic;
  767. font-weight: 600;
  768. letter-spacing: 0.09em;
  769. pointer-events: none;
  770. }
  771. html[data-embed="true"][data-preset="editorial"] .diagram-container::after { display: none; }
  772. html[data-motion-capable="true"][data-preset="signal-flow"][data-ambient-entry="running"] .diagram-container::before {
  773. content: "";
  774. position: absolute;
  775. inset: 0;
  776. pointer-events: none;
  777. background: linear-gradient(115deg, transparent 28%, rgba(103, 232, 249, 0.035) 48%, transparent 68%);
  778. transform: translateX(-70%);
  779. animation: archify-signal-scan 4.8s ease-in-out 1 both;
  780. }
  781. /* Motion Governor gives the reader a real static state and gives the
  782. strongest semantic action the only motion budget. Atmosphere resets to
  783. its authored base instead of freezing mid-cycle. Static artifacts never
  784. start a decorative pulse or scan. */
  785. html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {
  786. animation: none !important;
  787. }
  788. html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
  789. animation: none !important;
  790. }
  791. html[data-motion="still"] .pulse-dot,
  792. html[data-motion="still"] .diagram-container::before,
  793. html[data-motion="still"] svg[data-animation="trace"] [data-animate],
  794. html[data-motion-owner] .pulse-dot,
  795. html[data-motion-owner] .diagram-container::before,
  796. html[data-motion-owner] svg[data-animation="trace"] [data-animate],
  797. html[data-embed="true"] .pulse-dot,
  798. html[data-embed="true"] .diagram-container::before,
  799. html[data-share-playback="true"] .pulse-dot,
  800. html[data-share-playback="true"] .diagram-container::before,
  801. html[data-document-hidden="true"] .pulse-dot,
  802. html[data-document-hidden="true"] .diagram-container::before,
  803. html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate],
  804. html[data-motion="still"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
  805. html[data-motion-owner] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
  806. html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
  807. html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
  808. html[data-document-hidden="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
  809. animation: none !important;
  810. }
  811. html[data-motion="still"] .diagram-container::before,
  812. html[data-motion-owner] .diagram-container::before,
  813. html[data-embed="true"] .diagram-container::before,
  814. html[data-share-playback="true"] .diagram-container::before {
  815. opacity: 0;
  816. }
  817. html[data-motion="still"] .intent-trace-flow,
  818. html[data-motion="still"] .route-probe-flow,
  819. html[data-motion="still"] .route-journey-flow,
  820. html[data-motion="still"] .semantic-lens-flow,
  821. html[data-motion="still"] .diagram-guide,
  822. html[data-motion="still"] .overview-map-live,
  823. html[data-document-hidden="true"] .intent-trace-flow,
  824. html[data-document-hidden="true"] .route-probe-flow,
  825. html[data-document-hidden="true"] .route-journey-flow,
  826. html[data-document-hidden="true"] .semantic-lens-flow,
  827. html[data-document-hidden="true"] .diagram-guide,
  828. html[data-document-hidden="true"] .overview-map-live {
  829. animation: none !important;
  830. }
  831. html[data-motion="still"] .intent-trace-flow,
  832. html[data-motion="still"] .route-probe-flow {
  833. stroke-dasharray: none;
  834. stroke-dashoffset: 0;
  835. opacity: 0.72;
  836. }
  837. html[data-motion="still"] .route-journey-overlay,
  838. html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }
  839. html[data-motion="still"] .relationship-pulse-overlay { display: none !important; }
  840. html[data-motion="still"] svg [data-node-id],
  841. html[data-motion="still"] svg [data-edge-from],
  842. html[data-motion="still"] svg [data-detail],
  843. html[data-motion="still"] svg [data-detail-anchor],
  844. html[data-motion="still"] svg [data-legend-hit],
  845. html[data-motion="still"] svg {
  846. transition: none !important;
  847. }
  848. svg {
  849. font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
  850. width: 100%;
  851. min-width: min(900px, 100%);
  852. display: block;
  853. transform-origin: 0 0;
  854. transition: transform 0.18s ease;
  855. }
  856. .diagram-container.is-camera-moving svg {
  857. transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  858. }
  859. .diagram-container.is-camera-transaction svg { transition: none; }
  860. .diagram-container.is-pannable { cursor: grab; }
  861. .diagram-container.is-panning { cursor: grabbing; user-select: none; }
  862. .diagram-container.is-panning svg { transition: none; }
  863. .diagram-nav {
  864. position: absolute;
  865. right: 1rem;
  866. bottom: 1rem;
  867. z-index: 12;
  868. translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
  869. display: inline-flex;
  870. align-items: center;
  871. max-width: calc(100% - 2rem);
  872. padding: 0.25rem;
  873. gap: 0.0625rem;
  874. overflow-x: auto;
  875. border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
  876. border-radius: 0.75rem;
  877. background: color-mix(in srgb, var(--panel) 84%, transparent);
  878. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);
  879. backdrop-filter: blur(14px) saturate(1.2);
  880. scrollbar-width: none;
  881. }
  882. .diagram-nav::-webkit-scrollbar { display: none; }
  883. .diagram-nav button,
  884. .focus-chip button {
  885. border: 0;
  886. background: transparent;
  887. color: var(--toolbar-text);
  888. font: inherit;
  889. cursor: pointer;
  890. }
  891. .diagram-nav button {
  892. min-width: 2rem;
  893. height: 2rem;
  894. padding: 0 0.4rem;
  895. border-radius: 0.5rem;
  896. color: var(--text-muted);
  897. font-size: 0.75rem;
  898. font-weight: 500;
  899. letter-spacing: 0;
  900. transition: background 0.15s, color 0.15s;
  901. }
  902. .diagram-nav button:hover,
  903. .diagram-nav button:focus-visible {
  904. color: var(--text);
  905. background: color-mix(in srgb, var(--text) 6%, transparent);
  906. }
  907. .diagram-nav button:hover,
  908. .diagram-nav button:focus-visible,
  909. .focus-chip button:hover,
  910. .focus-chip button:focus-visible { background: var(--toolbar-hover); }
  911. .diagram-nav button:focus-visible,
  912. .focus-chip button:focus-visible {
  913. outline: 2px solid var(--frontend-stroke);
  914. outline-offset: 1px;
  915. }
  916. .diagram-nav button:disabled { opacity: 0.38; cursor: default; }
  917. /* The Guide stays on the ? shortcut; Map only earns dock space once the
  918. reader has zoomed past the full diagram (or opened it from the keyboard). */
  919. .diagram-nav button[hidden] { display: none; }
  920. .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }
  921. .diagram-nav button:disabled:hover { background: transparent; }
  922. .diagram-nav #btn-route-probe,
  923. .diagram-nav #btn-overview-map,
  924. .diagram-nav #btn-semantic-lens {
  925. min-width: auto;
  926. padding-inline: 0.6rem;
  927. color: var(--text-muted);
  928. font-weight: 500;
  929. }
  930. .diagram-nav #btn-node-finder,
  931. .diagram-nav [data-view="out"] {
  932. position: relative;
  933. margin-left: 0.375rem;
  934. }
  935. .diagram-nav #btn-node-finder::before,
  936. .diagram-nav [data-view="out"]::before {
  937. position: absolute;
  938. top: 0.55rem;
  939. bottom: 0.55rem;
  940. left: -0.19rem;
  941. width: 1px;
  942. background: color-mix(in srgb, var(--panel-border) 90%, transparent);
  943. content: "";
  944. pointer-events: none;
  945. }
  946. .diagram-nav-icon {
  947. display: block;
  948. width: 0.95rem;
  949. height: 0.95rem;
  950. margin: auto;
  951. background: currentColor;
  952. -webkit-mask-position: center;
  953. -webkit-mask-repeat: no-repeat;
  954. -webkit-mask-size: contain;
  955. mask-position: center;
  956. mask-repeat: no-repeat;
  957. mask-size: contain;
  958. }
  959. .diagram-nav-icon.find {
  960. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  961. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='4.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m12 12 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  962. }
  963. .diagram-nav-icon.guide {
  964. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  965. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.8 7.3a2.4 2.4 0 014.6.9c0 1.8-2.4 2-2.4 3.7M10 14.9h.01' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  966. }
  967. .diagram-nav-icon.minus {
  968. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  969. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  970. }
  971. .diagram-nav-icon.plus {
  972. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  973. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  974. }
  975. .diagram-nav [data-view="reset"] {
  976. display: inline-flex;
  977. align-items: center;
  978. justify-content: center;
  979. gap: 0.2rem;
  980. min-width: 3.1rem;
  981. padding-inline: 0.35rem;
  982. }
  983. .diagram-nav [data-view="reset"][data-detail-visible] {
  984. min-width: 3.8rem;
  985. }
  986. .diagram-nav-detail {
  987. color: color-mix(in srgb, var(--toolbar-text) 52%, transparent);
  988. font-size: 0.44rem;
  989. font-weight: 700;
  990. line-height: 1;
  991. letter-spacing: 0.07em;
  992. }
  993. .diagram-nav-percent {
  994. color: var(--text-muted);
  995. font-size: 0.75rem;
  996. font-weight: 500;
  997. font-variant-numeric: tabular-nums;
  998. line-height: 1;
  999. }
  1000. /* Mode buttons carry a small glyph so the dock reads as one icon language. */
  1001. .diagram-nav #btn-route-probe,
  1002. .diagram-nav #btn-overview-map,
  1003. .diagram-nav #btn-semantic-lens {
  1004. display: inline-flex;
  1005. align-items: center;
  1006. gap: 0.375rem;
  1007. padding-inline: 0.55rem 0.65rem;
  1008. }
  1009. .diagram-nav #btn-route-probe::before,
  1010. .diagram-nav #btn-overview-map::before,
  1011. .diagram-nav #btn-semantic-lens::before {
  1012. flex: none;
  1013. width: 0.95rem;
  1014. height: 0.95rem;
  1015. background: currentColor;
  1016. content: "";
  1017. opacity: 0.85;
  1018. -webkit-mask: var(--nav-glyph) center / contain no-repeat;
  1019. mask: var(--nav-glyph) center / contain no-repeat;
  1020. }
  1021. .diagram-nav #btn-route-probe { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E"); }
  1022. .diagram-nav #btn-overview-map { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E"); }
  1023. .diagram-nav #btn-semantic-lens { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E"); }
  1024. /* Zoom out / level / zoom in join into one stepper well. */
  1025. .diagram-nav [data-view="out"],
  1026. .diagram-nav [data-view="reset"],
  1027. .diagram-nav [data-view="in"] {
  1028. position: relative;
  1029. border-radius: 0;
  1030. background: color-mix(in srgb, var(--panel-border) 38%, transparent);
  1031. }
  1032. .diagram-nav [data-view="out"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }
  1033. .diagram-nav [data-view="out"]::before { display: none; }
  1034. .diagram-nav [data-view="reset"],
  1035. .diagram-nav [data-view="in"] { margin-left: -0.0625rem; }
  1036. .diagram-nav [data-view="in"] { border-radius: 0 0.5rem 0.5rem 0; }
  1037. .diagram-nav [data-view="reset"]::after,
  1038. .diagram-nav [data-view="in"]::after {
  1039. position: absolute;
  1040. top: 0.55rem;
  1041. bottom: 0.55rem;
  1042. left: 0;
  1043. width: 1px;
  1044. background: color-mix(in srgb, var(--panel-border) 75%, transparent);
  1045. content: "";
  1046. pointer-events: none;
  1047. }
  1048. .diagram-nav [data-view="out"]:hover,
  1049. .diagram-nav [data-view="reset"]:hover,
  1050. .diagram-nav [data-view="in"]:hover { background: color-mix(in srgb, var(--panel-border) 60%, transparent); }
  1051. .diagram-nav [data-view="out"]:disabled,
  1052. .diagram-nav [data-view="in"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }
  1053. .diagram-nav [data-view="out"]:disabled:hover,
  1054. .diagram-nav [data-view="in"]:disabled:hover { background: color-mix(in srgb, var(--panel-border) 38%, transparent); }
  1055. .diagram-nav [data-view="reset"] { min-width: 3.25rem; }
  1056. .diagram-container[data-camera-indicator="true"] .diagram-nav-detail,
  1057. .diagram-container[data-camera-indicator="true"] .diagram-nav-percent { color: var(--frontend-stroke); }
  1058. .diagram-nav #btn-diagram-guide[aria-expanded="true"] {
  1059. color: var(--cloud-stroke);
  1060. background: var(--toolbar-hover);
  1061. }
  1062. /* Semantic Radar is a deliberately simplified, viewer-only overview. It
  1063. uses authored node bounds and the live camera viewport rather than
  1064. cloning the canonical SVG, so IDs, filters, animation, and export state
  1065. stay singular and deterministic. */
  1066. .overview-map {
  1067. position: absolute;
  1068. right: 1rem;
  1069. bottom: calc(4.15rem + var(--archify-nav-reserve));
  1070. z-index: 12;
  1071. width: 11.25rem;
  1072. overflow: hidden;
  1073. border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));
  1074. border-radius: 0.78rem;
  1075. background: var(--toolbar-menu-bg);
  1076. color: var(--toolbar-text);
  1077. box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
  1078. backdrop-filter: blur(16px);
  1079. font-size: 0.625rem;
  1080. }
  1081. .overview-map[hidden] { display: none; }
  1082. .overview-map[data-docked="true"] {
  1083. position: fixed;
  1084. right: var(--archify-radar-right, 1rem);
  1085. top: var(--archify-radar-top, 1rem);
  1086. bottom: auto;
  1087. }
  1088. .overview-map[data-docked="true"][data-dock-side="left"] {
  1089. right: auto;
  1090. left: var(--archify-radar-left, 1rem);
  1091. }
  1092. html[data-preset="blueprint"] .overview-map { border-radius: 0.28rem; }
  1093. .overview-map-head {
  1094. display: grid;
  1095. grid-template-columns: auto minmax(0, 1fr) auto;
  1096. align-items: center;
  1097. gap: 0.45rem;
  1098. min-height: 2.25rem;
  1099. padding: 0.42rem 0.48rem 0.38rem 0.55rem;
  1100. border-bottom: 1px solid var(--toolbar-border);
  1101. background: linear-gradient(110deg, color-mix(in srgb, var(--frontend-fill) 45%, transparent), transparent 68%);
  1102. cursor: grab;
  1103. touch-action: none;
  1104. user-select: none;
  1105. }
  1106. .overview-map[data-panel-dragging="true"] .overview-map-head { cursor: grabbing; }
  1107. .overview-map[data-placement-invalid="true"] {
  1108. border-color: var(--security-stroke);
  1109. box-shadow: 0 0 0 2px color-mix(in srgb, var(--security-stroke) 34%, transparent), 0 16px 42px rgba(0, 0, 0, 0.3);
  1110. }
  1111. .overview-map[data-compact="true"] {
  1112. width: 7.4rem;
  1113. }
  1114. .overview-map[data-compact="true"] .overview-map-head {
  1115. grid-template-columns: minmax(0, 1fr) auto;
  1116. gap: 0.24rem;
  1117. min-height: 1.5rem;
  1118. padding: 0.05rem 0.16rem 0.05rem 0.32rem;
  1119. border-bottom: 0;
  1120. }
  1121. .overview-map[data-compact="true"] .overview-map-live,
  1122. .overview-map[data-compact="true"] .overview-map-copy,
  1123. .overview-map[data-compact="true"] .overview-map-surface,
  1124. .overview-map[data-compact="true"] .overview-map-hint {
  1125. display: none;
  1126. }
  1127. .overview-map[data-compact="true"] .overview-map-expand { display: inline-flex; }
  1128. .overview-map[data-compact="true"] .overview-map-close {
  1129. width: 1.15rem;
  1130. height: 1.15rem;
  1131. font-size: 0.72rem;
  1132. }
  1133. .overview-map-live {
  1134. width: 0.42rem;
  1135. height: 0.42rem;
  1136. border-radius: 50%;
  1137. background: var(--backend-stroke);
  1138. box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent);
  1139. animation: archify-radar-live 2.4s ease-out infinite;
  1140. }
  1141. .overview-map-copy { min-width: 0; line-height: 1.1; }
  1142. .overview-map-copy strong {
  1143. display: block;
  1144. overflow: hidden;
  1145. color: var(--frontend-stroke);
  1146. font-size: 0.59rem;
  1147. letter-spacing: 0.12em;
  1148. text-transform: uppercase;
  1149. white-space: nowrap;
  1150. text-overflow: ellipsis;
  1151. }
  1152. .overview-map-copy small {
  1153. display: block;
  1154. margin-top: 0.18rem;
  1155. overflow: hidden;
  1156. color: var(--text-faint);
  1157. font-size: 0.52rem;
  1158. letter-spacing: 0.04em;
  1159. white-space: nowrap;
  1160. text-overflow: ellipsis;
  1161. }
  1162. .overview-map-expand {
  1163. display: none;
  1164. align-items: center;
  1165. justify-content: center;
  1166. min-width: 0;
  1167. height: 1.2rem;
  1168. padding: 0 0.34rem;
  1169. overflow: hidden;
  1170. border: 0;
  1171. border-radius: 0.3rem;
  1172. background: transparent;
  1173. color: var(--frontend-stroke);
  1174. font: inherit;
  1175. font-size: 0.49rem;
  1176. font-weight: 700;
  1177. letter-spacing: 0.06em;
  1178. text-transform: uppercase;
  1179. white-space: nowrap;
  1180. cursor: pointer;
  1181. }
  1182. .overview-map-close {
  1183. width: 1.55rem;
  1184. height: 1.55rem;
  1185. padding: 0;
  1186. border: 0;
  1187. border-radius: 0.34rem;
  1188. background: transparent;
  1189. color: var(--toolbar-text);
  1190. font: inherit;
  1191. font-size: 0.9rem;
  1192. cursor: pointer;
  1193. }
  1194. .overview-map-expand:hover,
  1195. .overview-map-expand:focus-visible,
  1196. .overview-map-close:hover,
  1197. .overview-map-close:focus-visible { background: var(--toolbar-hover); }
  1198. .overview-map-expand:focus-visible,
  1199. .overview-map-close:focus-visible,
  1200. .overview-map-surface:focus-visible,
  1201. .overview-map-node:focus-visible {
  1202. outline: 2px solid var(--frontend-stroke);
  1203. outline-offset: 1px;
  1204. }
  1205. .overview-map-surface {
  1206. position: relative;
  1207. height: 7rem;
  1208. margin: 0.42rem;
  1209. overflow: hidden;
  1210. border: 1px solid color-mix(in srgb, var(--panel-border) 72%, transparent);
  1211. border-radius: 0.42rem;
  1212. background:
  1213. linear-gradient(color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),
  1214. linear-gradient(90deg, color-mix(in srgb, var(--panel-border) 26%, transparent) 1px, transparent 1px),
  1215. color-mix(in srgb, var(--bg) 86%, transparent);
  1216. background-size: 12px 12px;
  1217. cursor: crosshair;
  1218. touch-action: none;
  1219. }
  1220. html[data-preset="blueprint"] .overview-map-surface { border-radius: 0.1rem; }
  1221. .overview-map-surface > svg {
  1222. width: 100%;
  1223. height: 100%;
  1224. min-width: 0;
  1225. transform: none !important;
  1226. transition: none !important;
  1227. display: block;
  1228. overflow: visible;
  1229. }
  1230. .overview-map-node {
  1231. fill: var(--backend-stroke);
  1232. fill-opacity: 0.52;
  1233. stroke: var(--backend-stroke);
  1234. stroke-opacity: 0.86;
  1235. vector-effect: non-scaling-stroke;
  1236. cursor: pointer;
  1237. transition: fill-opacity 140ms ease, stroke-width 140ms ease, filter 140ms ease;
  1238. }
  1239. .overview-map-node[data-kind="frontend"],
  1240. .overview-map-node[data-kind="start"] { fill: var(--frontend-stroke); stroke: var(--frontend-stroke); }
  1241. .overview-map-node[data-kind="database"],
  1242. .overview-map-node[data-kind="success"] { fill: var(--database-stroke); stroke: var(--database-stroke); }
  1243. .overview-map-node[data-kind="cloud"],
  1244. .overview-map-node[data-kind="waiting"] { fill: var(--cloud-stroke); stroke: var(--cloud-stroke); }
  1245. .overview-map-node[data-kind="messagebus"] { fill: var(--messagebus-stroke); stroke: var(--messagebus-stroke); }
  1246. .overview-map-node[data-kind="security"],
  1247. .overview-map-node[data-kind="decision"],
  1248. .overview-map-node[data-kind="failure"] { fill: var(--security-stroke); stroke: var(--security-stroke); }
  1249. .overview-map-node[data-kind="external"],
  1250. .overview-map-node[data-kind="neutral"] { fill: var(--external-stroke); stroke: var(--external-stroke); }
  1251. .overview-map-node[data-radar-active="true"],
  1252. .overview-map-node:hover,
  1253. .overview-map-node:focus-visible {
  1254. fill-opacity: 0.92;
  1255. stroke-width: 2.2;
  1256. filter: drop-shadow(0 0 3px currentColor);
  1257. }
  1258. .overview-map-viewport {
  1259. fill: color-mix(in srgb, var(--frontend-fill) 56%, transparent);
  1260. stroke: var(--frontend-stroke);
  1261. stroke-width: 2;
  1262. vector-effect: non-scaling-stroke;
  1263. pointer-events: none;
  1264. filter: drop-shadow(0 0 3px color-mix(in srgb, var(--frontend-stroke) 54%, transparent));
  1265. }
  1266. .overview-map-hint {
  1267. display: flex;
  1268. justify-content: space-between;
  1269. gap: 0.5rem;
  1270. padding: 0 0.52rem 0.46rem;
  1271. color: var(--text-faint);
  1272. font-size: 0.49rem;
  1273. letter-spacing: 0.06em;
  1274. text-transform: uppercase;
  1275. }
  1276. .diagram-nav #btn-overview-map[aria-expanded="true"] {
  1277. color: var(--frontend-stroke);
  1278. background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);
  1279. }
  1280. .overview-map-feedback {
  1281. position: absolute;
  1282. right: 1rem;
  1283. bottom: 4.15rem;
  1284. z-index: 13;
  1285. max-width: min(16rem, calc(100% - 2rem));
  1286. padding: 0.38rem 0.55rem;
  1287. border: 1px solid color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));
  1288. border-radius: 0.5rem;
  1289. background: var(--toolbar-menu-bg);
  1290. color: var(--toolbar-text);
  1291. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  1292. font-size: 0.52rem;
  1293. line-height: 1.35;
  1294. pointer-events: none;
  1295. }
  1296. .overview-map-feedback[hidden] { display: none; }
  1297. .focus-chip[data-radar-yielded="true"] { display: none !important; }
  1298. .diagram-nav #btn-route-probe[aria-pressed="true"] {
  1299. color: var(--backend-stroke);
  1300. background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);
  1301. }
  1302. .diagram-nav #btn-semantic-lens[aria-expanded="true"],
  1303. .diagram-nav #btn-semantic-lens[aria-pressed="true"] {
  1304. color: var(--database-stroke);
  1305. background: color-mix(in srgb, var(--database-stroke) 11%, transparent);
  1306. }
  1307. /* Semantic Lens turns the compiled node-kind palette into an analytical
  1308. legend. One kind reveals its real traffic; two kinds compare only their
  1309. direct authored relationships. Geometry and the canonical SVG stay put. */
  1310. .semantic-lens {
  1311. position: absolute;
  1312. right: 1rem;
  1313. bottom: calc(4.15rem + var(--archify-nav-reserve));
  1314. z-index: 24;
  1315. width: min(20rem, calc(100% - 2rem));
  1316. overflow: hidden;
  1317. border: 1px solid color-mix(in srgb, var(--database-stroke) 58%, var(--toolbar-border));
  1318. border-radius: 0.82rem;
  1319. background:
  1320. linear-gradient(135deg, color-mix(in srgb, var(--database-fill) 34%, transparent), transparent 48%),
  1321. var(--toolbar-menu-bg);
  1322. color: var(--toolbar-text);
  1323. box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  1324. backdrop-filter: blur(18px);
  1325. animation: archify-lens-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
  1326. }
  1327. .semantic-lens[hidden] { display: none; }
  1328. .semantic-lens[data-dock-side="left"] { left: 1rem; right: auto; }
  1329. .semantic-lens[data-dock-side="right"] { left: auto; right: 1rem; }
  1330. html[data-preset="blueprint"] .semantic-lens { border-radius: 0.28rem; }
  1331. .semantic-lens-head {
  1332. display: grid;
  1333. grid-template-columns: minmax(0, 1fr) auto;
  1334. align-items: start;
  1335. gap: 0.75rem;
  1336. padding: 0.72rem 0.78rem 0.62rem;
  1337. border-bottom: 1px solid var(--toolbar-border);
  1338. }
  1339. .semantic-lens-eyebrow {
  1340. display: block;
  1341. color: var(--database-stroke);
  1342. font-size: 0.5rem;
  1343. font-weight: 800;
  1344. letter-spacing: 0.16em;
  1345. text-transform: uppercase;
  1346. }
  1347. .semantic-lens-title {
  1348. display: block;
  1349. margin-top: 0.16rem;
  1350. color: var(--text);
  1351. font-size: 0.82rem;
  1352. letter-spacing: -0.02em;
  1353. }
  1354. .semantic-lens-close {
  1355. width: 1.75rem;
  1356. height: 1.75rem;
  1357. padding: 0;
  1358. border: 0;
  1359. border-radius: 0.35rem;
  1360. background: transparent;
  1361. color: var(--toolbar-text);
  1362. font: inherit;
  1363. font-size: 1rem;
  1364. cursor: pointer;
  1365. }
  1366. .semantic-lens-close:hover,
  1367. .semantic-lens-close:focus-visible { background: var(--toolbar-hover); }
  1368. .semantic-lens-instruction {
  1369. margin: 0;
  1370. padding: 0.52rem 0.78rem 0.48rem;
  1371. color: var(--text-faint);
  1372. font-size: 0.55rem;
  1373. line-height: 1.45;
  1374. }
  1375. .semantic-lens-kinds {
  1376. display: grid;
  1377. grid-template-columns: 1fr 1fr;
  1378. gap: 0.3rem;
  1379. max-height: min(15rem, 40vh);
  1380. padding: 0 0.5rem 0.5rem;
  1381. overflow-y: auto;
  1382. scrollbar-width: thin;
  1383. }
  1384. .semantic-lens-kind {
  1385. --lens-color: var(--external-stroke);
  1386. display: grid;
  1387. grid-template-columns: auto minmax(0, 1fr) auto;
  1388. align-items: center;
  1389. gap: 0.42rem;
  1390. min-width: 0;
  1391. min-height: 2.15rem;
  1392. padding: 0.35rem 0.42rem;
  1393. border: 1px solid color-mix(in srgb, var(--lens-color) 24%, var(--toolbar-border));
  1394. border-radius: 0.45rem;
  1395. background: color-mix(in srgb, var(--panel) 76%, transparent);
  1396. color: var(--toolbar-text);
  1397. font: inherit;
  1398. text-align: left;
  1399. cursor: pointer;
  1400. transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
  1401. }
  1402. html[data-preset="blueprint"] .semantic-lens-kind { border-radius: 0.12rem; }
  1403. .semantic-lens-kind[data-kind="frontend"],
  1404. .semantic-lens-kind[data-kind="start"] { --lens-color: var(--frontend-stroke); }
  1405. .semantic-lens-kind[data-kind="backend"],
  1406. .semantic-lens-kind[data-kind="active"] { --lens-color: var(--backend-stroke); }
  1407. .semantic-lens-kind[data-kind="database"],
  1408. .semantic-lens-kind[data-kind="success"] { --lens-color: var(--database-stroke); }
  1409. .semantic-lens-kind[data-kind="cloud"],
  1410. .semantic-lens-kind[data-kind="waiting"] { --lens-color: var(--cloud-stroke); }
  1411. .semantic-lens-kind[data-kind="messagebus"] { --lens-color: var(--messagebus-stroke); }
  1412. .semantic-lens-kind[data-kind="security"],
  1413. .semantic-lens-kind[data-kind="decision"],
  1414. .semantic-lens-kind[data-kind="failure"] { --lens-color: var(--security-stroke); }
  1415. .semantic-lens-kind:hover,
  1416. .semantic-lens-kind:focus-visible,
  1417. .semantic-lens-kind[aria-pressed="true"] {
  1418. border-color: color-mix(in srgb, var(--lens-color) 78%, var(--toolbar-border));
  1419. background: color-mix(in srgb, var(--lens-color) 11%, var(--panel));
  1420. }
  1421. .semantic-lens-kind:focus-visible,
  1422. .semantic-lens-close:focus-visible,
  1423. .semantic-lens-actions button:focus-visible {
  1424. outline: 2px solid var(--database-stroke);
  1425. outline-offset: 1px;
  1426. }
  1427. .semantic-lens-kind:disabled { opacity: 0.34; cursor: default; }
  1428. .semantic-lens-swatch {
  1429. width: 0.48rem;
  1430. height: 0.48rem;
  1431. border-radius: 50%;
  1432. background: var(--lens-color);
  1433. box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color) 58%, transparent);
  1434. }
  1435. .semantic-lens-kind strong {
  1436. overflow: hidden;
  1437. color: var(--text);
  1438. font-size: 0.61rem;
  1439. text-overflow: ellipsis;
  1440. white-space: nowrap;
  1441. }
  1442. .semantic-lens-kind em {
  1443. color: var(--lens-color);
  1444. font-size: 0.54rem;
  1445. font-style: normal;
  1446. font-weight: 800;
  1447. }
  1448. .semantic-lens-status {
  1449. min-height: 2.5rem;
  1450. margin: 0;
  1451. padding: 0.55rem 0.78rem;
  1452. border-top: 1px solid var(--toolbar-border);
  1453. color: var(--text-faint);
  1454. font-size: 0.55rem;
  1455. line-height: 1.45;
  1456. }
  1457. .semantic-lens-status strong { color: var(--database-stroke); font-weight: 800; }
  1458. .semantic-lens-actions {
  1459. display: flex;
  1460. justify-content: flex-end;
  1461. gap: 0.28rem;
  1462. padding: 0 0.62rem 0.62rem;
  1463. }
  1464. .semantic-lens-actions button {
  1465. min-height: 1.8rem;
  1466. padding: 0.28rem 0.48rem;
  1467. border: 0;
  1468. border-radius: 0.35rem;
  1469. background: transparent;
  1470. color: var(--toolbar-text);
  1471. font: inherit;
  1472. font-size: 0.56rem;
  1473. cursor: pointer;
  1474. }
  1475. .semantic-lens-actions button:hover { background: var(--toolbar-hover); }
  1476. .semantic-lens-actions #semantic-lens-copy { color: var(--database-stroke); }
  1477. @keyframes archify-lens-in {
  1478. from { opacity: 0; transform: translateY(5px) scale(0.985); }
  1479. to { opacity: 1; transform: translateY(0) scale(1); }
  1480. }
  1481. /* Route Probe answers a reader question over the compiled semantic graph:
  1482. choose two stable nodes and reveal the shortest authored directed route.
  1483. The receipt and signal live entirely in the viewer layer. */
  1484. .route-probe {
  1485. position: absolute;
  1486. left: 1rem;
  1487. bottom: calc(1rem + var(--archify-nav-reserve));
  1488. z-index: 12;
  1489. width: min(46rem, calc(100% - 25rem));
  1490. min-width: 18rem;
  1491. overflow: hidden;
  1492. border: 1px solid color-mix(in srgb, var(--backend-stroke) 62%, var(--toolbar-border));
  1493. border-radius: 0.82rem;
  1494. background:
  1495. linear-gradient(115deg, color-mix(in srgb, var(--backend-fill) 50%, transparent), transparent 62%),
  1496. var(--toolbar-menu-bg);
  1497. color: var(--toolbar-text);
  1498. box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  1499. backdrop-filter: blur(16px);
  1500. font-size: 0.75rem;
  1501. }
  1502. .route-probe[hidden] { display: none; }
  1503. /* Picking needs one line of guidance, not a wide empty card; the panel
  1504. widens only when there is a traced route to show. */
  1505. .route-probe:not([data-state="result"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }
  1506. .route-probe-path:has(> .route-probe-placeholder:only-child) { display: none; }
  1507. .route-probe[data-route-dock="top"] {
  1508. top: 1rem;
  1509. bottom: auto;
  1510. }
  1511. html[data-preset="blueprint"] .route-probe { border-radius: 0.25rem; }
  1512. .route-probe-head {
  1513. display: grid;
  1514. grid-template-columns: minmax(0, 1fr) auto;
  1515. align-items: start;
  1516. gap: 0.65rem;
  1517. padding: 0.625rem 0.75rem 0.5rem;
  1518. border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);
  1519. }
  1520. .route-probe-copy { min-width: 0; }
  1521. .route-probe-eyebrow {
  1522. display: block;
  1523. color: var(--backend-stroke);
  1524. font-size: 0.6875rem;
  1525. font-weight: 600;
  1526. letter-spacing: 0.02em;
  1527. }
  1528. .route-probe-title {
  1529. display: block;
  1530. margin-top: 0.14rem;
  1531. overflow: hidden;
  1532. color: var(--toolbar-text);
  1533. font-size: 0.875rem;
  1534. font-weight: 600;
  1535. line-height: 1.3;
  1536. white-space: nowrap;
  1537. text-overflow: ellipsis;
  1538. }
  1539. .route-probe-actions { display: flex; gap: 0.2rem; }
  1540. .route-probe button {
  1541. min-height: 1.55rem;
  1542. padding: 0.25rem 0.42rem;
  1543. border: 0;
  1544. border-radius: 0.36rem;
  1545. background: transparent;
  1546. color: var(--toolbar-text);
  1547. font: inherit;
  1548. cursor: pointer;
  1549. }
  1550. .route-probe button:hover,
  1551. .route-probe button:focus-visible { background: var(--toolbar-hover); }
  1552. .route-probe button:focus-visible {
  1553. outline: 2px solid var(--backend-stroke);
  1554. outline-offset: 1px;
  1555. }
  1556. .route-probe-copy-link { color: var(--frontend-stroke) !important; }
  1557. .route-probe-find { color: var(--backend-stroke) !important; }
  1558. .route-probe-copy-link[hidden] { display: none; }
  1559. .route-probe-find[hidden] { display: none; }
  1560. .route-probe-path {
  1561. display: flex;
  1562. align-items: center;
  1563. min-height: 2.2rem;
  1564. padding: 0.42rem 0.58rem 0.24rem;
  1565. overflow-x: auto;
  1566. scrollbar-width: thin;
  1567. white-space: nowrap;
  1568. }
  1569. .route-probe-node,
  1570. .route-probe button.route-probe-node {
  1571. flex: none;
  1572. max-width: 9.5rem;
  1573. overflow: hidden;
  1574. min-height: 1.75rem !important;
  1575. padding: 0.22rem 0.38rem;
  1576. border: 1px solid color-mix(in srgb, var(--backend-stroke) 46%, var(--toolbar-border));
  1577. border-radius: 999px;
  1578. background: color-mix(in srgb, var(--backend-fill) 52%, transparent);
  1579. color: var(--text);
  1580. font-size: 0.56rem;
  1581. font-weight: 700;
  1582. text-overflow: ellipsis;
  1583. white-space: nowrap;
  1584. }
  1585. .route-probe-node[data-endpoint="start"] {
  1586. border-color: var(--frontend-stroke);
  1587. color: var(--frontend-stroke);
  1588. }
  1589. .route-probe-node[data-endpoint="end"] {
  1590. border-color: var(--security-stroke);
  1591. color: var(--security-stroke);
  1592. }
  1593. .route-probe-node[data-route-journey-state="past"] { opacity: 0.66; }
  1594. .route-probe-node[data-route-journey-state="future"] { opacity: 0.48; }
  1595. .route-probe-node[aria-current="step"] {
  1596. border-color: var(--backend-stroke);
  1597. background: color-mix(in srgb, var(--backend-fill) 82%, var(--toolbar-menu-bg));
  1598. color: var(--text);
  1599. box-shadow: 0 0 0 1px color-mix(in srgb, var(--backend-stroke) 42%, transparent), 0 0 14px color-mix(in srgb, var(--backend-stroke) 34%, transparent);
  1600. opacity: 1;
  1601. }
  1602. html[data-preset="blueprint"] .route-probe-node[aria-current="step"] {
  1603. border-style: double;
  1604. border-width: 3px;
  1605. border-radius: 0.2rem;
  1606. box-shadow: none;
  1607. }
  1608. .route-probe-arrow {
  1609. flex: none;
  1610. padding: 0 0.28rem;
  1611. color: var(--text-faint);
  1612. font-size: 0.65rem;
  1613. }
  1614. .route-probe-placeholder {
  1615. color: var(--text-faint);
  1616. font-size: 0.75rem;
  1617. }
  1618. .route-probe-status {
  1619. display: block;
  1620. min-height: 1.45rem;
  1621. padding: 0.5rem 0.75rem 0.625rem;
  1622. color: var(--text-muted, var(--text-faint));
  1623. font-size: 0.75rem;
  1624. line-height: 1.45;
  1625. }
  1626. .route-journey-controls {
  1627. display: grid;
  1628. grid-template-columns: 2rem minmax(5.8rem, auto) 2rem minmax(4.8rem, auto);
  1629. justify-content: start;
  1630. gap: 0.22rem;
  1631. padding: 0.08rem 0.58rem 0.28rem;
  1632. }
  1633. .route-journey-controls[hidden] { display: none; }
  1634. .route-journey-controls button {
  1635. min-height: 1.8rem;
  1636. border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);
  1637. background: color-mix(in srgb, var(--toolbar-bg) 72%, transparent);
  1638. font-size: 0.54rem;
  1639. font-weight: 700;
  1640. }
  1641. .route-journey-controls button:disabled {
  1642. cursor: default;
  1643. opacity: 0.34;
  1644. }
  1645. .route-journey-play { color: var(--backend-stroke) !important; }
  1646. .route-journey-overview { color: var(--frontend-stroke) !important; }
  1647. .route-journey-controls[data-playing="true"] .route-journey-play {
  1648. border-color: color-mix(in srgb, var(--backend-stroke) 64%, var(--toolbar-border));
  1649. background: color-mix(in srgb, var(--backend-fill) 62%, transparent);
  1650. }
  1651. .route-probe[data-state="error"] {
  1652. border-color: color-mix(in srgb, var(--security-stroke) 72%, var(--toolbar-border));
  1653. }
  1654. .route-probe[data-state="error"] .route-probe-status { color: var(--security-stroke); }
  1655. .focus-chip {
  1656. position: absolute;
  1657. left: 1rem;
  1658. top: 1rem;
  1659. z-index: 12;
  1660. display: block;
  1661. width: min(22rem, calc(100% - 13rem));
  1662. max-width: calc(100% - 13rem);
  1663. overflow: hidden;
  1664. border: 1px solid var(--frontend-stroke);
  1665. border-radius: 0.85rem;
  1666. background: var(--toolbar-menu-bg);
  1667. color: var(--toolbar-text);
  1668. box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  1669. backdrop-filter: blur(16px);
  1670. font-size: 0.6875rem;
  1671. }
  1672. .focus-chip[hidden] { display: none; }
  1673. html[data-preset="blueprint"] .focus-chip { border-radius: 0.3rem; }
  1674. .focus-chip button {
  1675. flex: none;
  1676. padding: 0.3rem 0.45rem;
  1677. border-radius: 0.35rem;
  1678. font-size: 0.625rem;
  1679. }
  1680. .relationship-lens-head {
  1681. position: relative;
  1682. display: grid;
  1683. grid-template-columns: minmax(0, 1fr) auto;
  1684. align-items: start;
  1685. gap: 0.75rem;
  1686. padding: 0.9rem 0.75rem 0.65rem;
  1687. border-bottom: 1px solid var(--toolbar-border);
  1688. background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);
  1689. }
  1690. .relationship-lens-drag-handle {
  1691. position: absolute;
  1692. top: 0.12rem;
  1693. left: 50%;
  1694. width: 2.5rem;
  1695. height: 0.78rem;
  1696. padding: 0 !important;
  1697. transform: translateX(-50%);
  1698. color: var(--text-faint) !important;
  1699. cursor: grab;
  1700. touch-action: none;
  1701. user-select: none;
  1702. }
  1703. .relationship-lens-drag-handle::before {
  1704. content: "";
  1705. display: block;
  1706. width: 1.25rem;
  1707. margin: auto;
  1708. border-top: 2px dotted currentColor;
  1709. opacity: 0.72;
  1710. }
  1711. .focus-chip[data-panel-dragging="true"] .relationship-lens-drag-handle { cursor: grabbing; }
  1712. @media (hover: none), (pointer: coarse) {
  1713. .relationship-lens-drag-handle { display: none; }
  1714. }
  1715. .relationship-lens-copy { min-width: 0; }
  1716. .relationship-lens-actions {
  1717. display: flex;
  1718. flex-direction: column;
  1719. align-items: flex-end;
  1720. gap: 0.18rem;
  1721. }
  1722. .relationship-lens-actions button { white-space: nowrap; }
  1723. .relationship-lens-actions #btn-focus-clear {
  1724. display: grid;
  1725. width: 1.75rem;
  1726. height: 1.75rem;
  1727. padding: 0;
  1728. place-items: center;
  1729. color: var(--text-muted);
  1730. font-size: 1rem;
  1731. line-height: 1;
  1732. }
  1733. .relationship-lens-actions #btn-focus-clear:hover,
  1734. .relationship-lens-actions #btn-focus-clear:focus-visible {
  1735. background: var(--toolbar-hover);
  1736. color: var(--text);
  1737. }
  1738. .relationship-lens-actions #btn-focus-copy { color: var(--frontend-stroke); }
  1739. .relationship-lens-actions #btn-focus-relations { display: none; }
  1740. .relationship-lens-eyebrow {
  1741. display: block;
  1742. margin-bottom: 0.18rem;
  1743. color: var(--frontend-stroke);
  1744. font-size: 0.5rem;
  1745. font-weight: 800;
  1746. letter-spacing: 0.14em;
  1747. text-transform: uppercase;
  1748. }
  1749. .relationship-lens-title {
  1750. display: block;
  1751. overflow: hidden;
  1752. color: var(--text);
  1753. font-size: 0.8rem;
  1754. line-height: 1.35;
  1755. text-overflow: ellipsis;
  1756. white-space: nowrap;
  1757. }
  1758. .semantic-passport-detail {
  1759. display: block;
  1760. margin-top: 0.12rem;
  1761. overflow: hidden;
  1762. color: var(--text-muted);
  1763. font-size: 0.625rem;
  1764. line-height: 1.4;
  1765. text-overflow: ellipsis;
  1766. white-space: nowrap;
  1767. }
  1768. .semantic-passport-detail[hidden] { display: none; }
  1769. .semantic-passport-meta {
  1770. display: flex;
  1771. flex-wrap: wrap;
  1772. gap: 0.24rem;
  1773. margin-top: 0.42rem;
  1774. }
  1775. .semantic-passport-meta span,
  1776. .semantic-passport-meta code {
  1777. max-width: 100%;
  1778. overflow: hidden;
  1779. padding: 0.14rem 0.34rem;
  1780. border: 1px solid color-mix(in srgb, var(--toolbar-border) 82%, transparent);
  1781. border-radius: 999px;
  1782. background: color-mix(in srgb, var(--panel) 68%, transparent);
  1783. color: var(--text-faint);
  1784. font: inherit;
  1785. font-size: 0.5rem;
  1786. letter-spacing: 0.04em;
  1787. text-overflow: ellipsis;
  1788. white-space: nowrap;
  1789. }
  1790. .semantic-passport-meta [data-passport="kind"] {
  1791. border-color: color-mix(in srgb, var(--frontend-stroke) 50%, var(--toolbar-border));
  1792. color: var(--frontend-stroke);
  1793. font-weight: 800;
  1794. text-transform: uppercase;
  1795. }
  1796. .semantic-passport-meta [data-passport="tag"] { color: var(--cloud-stroke); }
  1797. .semantic-passport-meta [data-passport="brand"] {
  1798. border-color: color-mix(in srgb, var(--messagebus-stroke) 52%, var(--toolbar-border));
  1799. color: var(--messagebus-stroke);
  1800. font-weight: 700;
  1801. }
  1802. .semantic-passport-meta [hidden] { display: none; }
  1803. html[data-preset="blueprint"] .semantic-passport-meta span,
  1804. html[data-preset="blueprint"] .semantic-passport-meta code { border-radius: 0.1rem; }
  1805. .semantic-passport-evidence {
  1806. margin-top: 0.52rem;
  1807. padding: 0.5rem;
  1808. border: 1px solid color-mix(in srgb, var(--backend-stroke) 32%, var(--toolbar-border));
  1809. border-radius: 0.55rem;
  1810. background: color-mix(in srgb, var(--backend-fill) 18%, var(--panel));
  1811. }
  1812. .semantic-passport-evidence[hidden] { display: none; }
  1813. html[data-preset="blueprint"] .semantic-passport-evidence { border-radius: 0.18rem; }
  1814. .semantic-passport-evidence-head {
  1815. display: flex;
  1816. align-items: center;
  1817. justify-content: space-between;
  1818. gap: 0.55rem;
  1819. margin-bottom: 0.35rem;
  1820. }
  1821. .semantic-passport-evidence-status {
  1822. display: inline-flex;
  1823. align-items: center;
  1824. gap: 0.28rem;
  1825. color: var(--backend-stroke);
  1826. font-size: 0.5rem;
  1827. font-weight: 800;
  1828. letter-spacing: 0.08em;
  1829. text-transform: uppercase;
  1830. }
  1831. .semantic-passport-evidence-status::before {
  1832. content: '';
  1833. width: 0.38rem;
  1834. height: 0.38rem;
  1835. border-radius: 50%;
  1836. background: var(--backend-stroke);
  1837. box-shadow: 0 0 0 3px color-mix(in srgb, var(--backend-stroke) 14%, transparent);
  1838. }
  1839. .semantic-passport-repository {
  1840. min-width: 0;
  1841. overflow: hidden;
  1842. color: var(--text-faint);
  1843. font-size: 0.5rem;
  1844. text-decoration: none;
  1845. text-overflow: ellipsis;
  1846. white-space: nowrap;
  1847. }
  1848. .semantic-passport-repository:hover,
  1849. .semantic-passport-repository:focus-visible { color: var(--backend-stroke); }
  1850. .semantic-passport-evidence-links { display: grid; gap: 0.22rem; }
  1851. .semantic-passport-source {
  1852. display: grid;
  1853. grid-template-columns: minmax(0, 1fr) auto;
  1854. gap: 0.15rem 0.45rem;
  1855. align-items: center;
  1856. padding: 0.34rem 0.4rem;
  1857. border: 1px solid transparent;
  1858. border-radius: 0.38rem;
  1859. color: var(--text-muted);
  1860. text-decoration: none;
  1861. }
  1862. a.semantic-passport-source:hover,
  1863. a.semantic-passport-source:focus-visible {
  1864. border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);
  1865. background: color-mix(in srgb, var(--backend-fill) 32%, transparent);
  1866. color: var(--text);
  1867. }
  1868. .semantic-passport-source strong {
  1869. overflow: hidden;
  1870. font-size: 0.5625rem;
  1871. text-overflow: ellipsis;
  1872. white-space: nowrap;
  1873. }
  1874. .semantic-passport-source code {
  1875. color: var(--backend-stroke);
  1876. font: inherit;
  1877. font-size: 0.5rem;
  1878. }
  1879. .semantic-passport-source small {
  1880. grid-column: 1 / -1;
  1881. overflow: hidden;
  1882. color: var(--text-faint);
  1883. font-size: 0.5rem;
  1884. text-overflow: ellipsis;
  1885. white-space: nowrap;
  1886. }
  1887. .relationship-lens-summary {
  1888. display: block;
  1889. margin-top: 0.12rem;
  1890. color: var(--text-faint);
  1891. font-size: 0.5625rem;
  1892. }
  1893. .semantic-passport-reach {
  1894. display: grid;
  1895. gap: 0.28rem;
  1896. margin-top: 0.52rem;
  1897. padding-top: 0.48rem;
  1898. border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 76%, transparent);
  1899. }
  1900. .semantic-passport-reach[hidden] { display: none; }
  1901. .semantic-passport-reach-label {
  1902. color: var(--text-faint);
  1903. font-size: 0.5rem;
  1904. font-weight: 800;
  1905. letter-spacing: 0.1em;
  1906. text-transform: uppercase;
  1907. }
  1908. .semantic-passport-reach-actions {
  1909. display: grid;
  1910. grid-template-columns: repeat(2, minmax(0, 1fr));
  1911. gap: 0.25rem;
  1912. }
  1913. .semantic-passport-reach-actions button {
  1914. display: flex;
  1915. align-items: center;
  1916. justify-content: space-between;
  1917. gap: 0.5rem;
  1918. min-width: 0;
  1919. min-height: 2rem;
  1920. padding: 0.32rem 0.42rem;
  1921. border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent);
  1922. background: color-mix(in srgb, var(--panel) 70%, transparent);
  1923. color: var(--text-muted);
  1924. text-align: left;
  1925. }
  1926. .semantic-passport-reach-actions button:hover:not(:disabled),
  1927. .semantic-passport-reach-actions button:focus-visible {
  1928. border-color: color-mix(in srgb, var(--frontend-stroke) 62%, var(--toolbar-border));
  1929. color: var(--text);
  1930. }
  1931. .semantic-passport-reach-actions button:focus-visible {
  1932. outline: 2px solid var(--frontend-stroke);
  1933. outline-offset: 1px;
  1934. }
  1935. .semantic-passport-reach-actions button:disabled {
  1936. cursor: default;
  1937. opacity: 0.5;
  1938. }
  1939. .semantic-passport-reach-actions button[aria-pressed="true"] {
  1940. border-color: color-mix(in srgb, var(--reach-color, var(--frontend-stroke)) 72%, var(--toolbar-border));
  1941. background: color-mix(in srgb, var(--reach-fill, var(--frontend-fill)) 48%, transparent);
  1942. color: var(--text);
  1943. }
  1944. #btn-reach-upstream {
  1945. --reach-color: var(--database-stroke);
  1946. --reach-fill: var(--database-fill);
  1947. }
  1948. #btn-reach-downstream {
  1949. --reach-color: var(--backend-stroke);
  1950. --reach-fill: var(--backend-fill);
  1951. }
  1952. .semantic-passport-reach-actions strong {
  1953. color: var(--reach-color, var(--frontend-stroke));
  1954. font-size: 0.625rem;
  1955. }
  1956. .semantic-passport-reach-status {
  1957. color: var(--text-faint);
  1958. font-size: 0.525rem;
  1959. line-height: 1.4;
  1960. }
  1961. .semantic-passport-reach-status[hidden] { display: none; }
  1962. .relationship-lens-list {
  1963. max-height: min(18rem, 46vh);
  1964. overflow: auto;
  1965. padding: 0.4rem;
  1966. scrollbar-width: thin;
  1967. scrollbar-color: var(--frontend-stroke) transparent;
  1968. }
  1969. .relationship-lens-list::-webkit-scrollbar { width: 4px; }
  1970. .relationship-lens-list::-webkit-scrollbar-thumb {
  1971. border-radius: 999px;
  1972. background: color-mix(in srgb, var(--frontend-stroke) 68%, transparent);
  1973. }
  1974. .relationship-lens-group + .relationship-lens-group { margin-top: 0.35rem; }
  1975. .relationship-lens-group-title {
  1976. display: block;
  1977. padding: 0.24rem 0.38rem 0.16rem;
  1978. color: var(--text-faint);
  1979. font-size: 0.5rem;
  1980. font-weight: 800;
  1981. letter-spacing: 0.12em;
  1982. text-transform: uppercase;
  1983. }
  1984. .relationship-lens-row {
  1985. display: grid;
  1986. grid-template-columns: 2.1rem minmax(0, 1fr);
  1987. gap: 0.06rem 0.45rem;
  1988. width: 100%;
  1989. padding: 0.45rem 0.5rem !important;
  1990. text-align: left;
  1991. }
  1992. .relationship-lens-row:hover,
  1993. .relationship-lens-row:focus-visible,
  1994. .relationship-lens-row[data-preview-active="true"] {
  1995. background: var(--toolbar-hover);
  1996. box-shadow: inset 2px 0 0 var(--frontend-stroke);
  1997. }
  1998. .relationship-lens-row:focus-visible {
  1999. outline: 2px solid var(--frontend-stroke);
  2000. outline-offset: -2px;
  2001. }
  2002. .relationship-lens-direction {
  2003. grid-row: 1 / 3;
  2004. align-self: center;
  2005. color: var(--frontend-stroke);
  2006. font-size: 0.5rem;
  2007. font-weight: 800;
  2008. letter-spacing: 0.08em;
  2009. }
  2010. .relationship-lens-row[data-direction="in"] .relationship-lens-direction { color: var(--database-stroke); }
  2011. .relationship-lens-row[data-direction="loop"] .relationship-lens-direction { color: var(--security-stroke); }
  2012. .relationship-lens-row strong {
  2013. overflow: hidden;
  2014. color: var(--text);
  2015. font-size: 0.6875rem;
  2016. text-overflow: ellipsis;
  2017. white-space: nowrap;
  2018. }
  2019. .relationship-lens-row small {
  2020. overflow: hidden;
  2021. color: var(--text-faint);
  2022. font-size: 0.5625rem;
  2023. text-overflow: ellipsis;
  2024. white-space: nowrap;
  2025. }
  2026. .relationship-lens-empty {
  2027. margin: 0;
  2028. padding: 0.75rem;
  2029. color: var(--text-faint);
  2030. font-size: 0.625rem;
  2031. text-align: center;
  2032. }
  2033. /* Diagram Guide keeps the artifact's growing reader vocabulary
  2034. discoverable without widening the permanent control bar. It derives
  2035. honest counts at runtime and delegates every action to an existing
  2036. production interaction instead of creating a second command system. */
  2037. .diagram-guide {
  2038. position: absolute;
  2039. top: 1rem;
  2040. right: 1rem;
  2041. z-index: 26;
  2042. width: min(32rem, calc(100% - 2rem));
  2043. max-height: min(42rem, calc(100% - 2rem));
  2044. overflow: auto;
  2045. border: 1px solid color-mix(in srgb, var(--cloud-stroke) 58%, var(--toolbar-border));
  2046. border-radius: 0.82rem;
  2047. background:
  2048. linear-gradient(135deg, color-mix(in srgb, var(--cloud-fill) 32%, transparent), transparent 42%),
  2049. var(--toolbar-menu-bg);
  2050. color: var(--toolbar-text);
  2051. box-shadow: 0 22px 64px rgba(0, 0, 0, 0.4);
  2052. backdrop-filter: blur(18px);
  2053. animation: archify-guide-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
  2054. }
  2055. .diagram-guide[hidden] { display: none; }
  2056. html[data-preset="blueprint"] .diagram-guide { border-radius: 0.28rem; }
  2057. .diagram-guide-head {
  2058. display: grid;
  2059. grid-template-columns: minmax(0, 1fr) auto;
  2060. align-items: start;
  2061. gap: 1rem;
  2062. padding: 0.82rem 0.9rem 0.68rem;
  2063. border-bottom: 1px solid var(--toolbar-border);
  2064. }
  2065. .diagram-guide-eyebrow {
  2066. display: block;
  2067. color: var(--cloud-stroke);
  2068. font-size: 0.5rem;
  2069. font-weight: 800;
  2070. letter-spacing: 0.16em;
  2071. text-transform: uppercase;
  2072. }
  2073. .diagram-guide-title {
  2074. display: block;
  2075. margin-top: 0.16rem;
  2076. color: var(--text);
  2077. font-size: 0.86rem;
  2078. letter-spacing: -0.02em;
  2079. }
  2080. .diagram-guide-close {
  2081. width: 1.8rem;
  2082. height: 1.8rem;
  2083. border: 0;
  2084. border-radius: 0.35rem;
  2085. background: transparent;
  2086. color: var(--toolbar-text);
  2087. font: inherit;
  2088. font-size: 1rem;
  2089. cursor: pointer;
  2090. }
  2091. .diagram-guide-close:hover,
  2092. .diagram-guide-close:focus-visible { background: var(--toolbar-hover); }
  2093. .diagram-guide-stats {
  2094. display: flex;
  2095. align-items: center;
  2096. gap: 0.5rem;
  2097. margin: 0;
  2098. padding: 0.54rem 0.9rem;
  2099. border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);
  2100. color: var(--text-faint);
  2101. font-size: 0.56rem;
  2102. letter-spacing: 0.025em;
  2103. }
  2104. .diagram-guide-stats::before {
  2105. content: '';
  2106. width: 0.42rem;
  2107. height: 0.42rem;
  2108. flex: none;
  2109. border-radius: 50%;
  2110. background: var(--backend-stroke);
  2111. box-shadow: 0 0 10px color-mix(in srgb, var(--backend-stroke) 72%, transparent);
  2112. }
  2113. .diagram-guide-actions {
  2114. display: grid;
  2115. grid-template-columns: 1fr 1fr;
  2116. gap: 0.38rem;
  2117. padding: 0.62rem;
  2118. }
  2119. .diagram-guide-action {
  2120. --guide-accent: var(--frontend-stroke);
  2121. display: grid;
  2122. grid-template-columns: auto minmax(0, 1fr) auto;
  2123. align-items: center;
  2124. gap: 0.55rem;
  2125. min-height: 4.15rem;
  2126. padding: 0.55rem 0.58rem;
  2127. border: 1px solid color-mix(in srgb, var(--guide-accent) 22%, var(--toolbar-border));
  2128. border-radius: 0.55rem;
  2129. background: color-mix(in srgb, var(--panel) 78%, transparent);
  2130. color: var(--toolbar-text);
  2131. font: inherit;
  2132. text-align: left;
  2133. cursor: pointer;
  2134. transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  2135. }
  2136. .diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }
  2137. .diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }
  2138. .diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }
  2139. .diagram-guide-action[data-guide-action="present"] {
  2140. --guide-accent: var(--cloud-stroke);
  2141. }
  2142. .diagram-guide-action:hover,
  2143. .diagram-guide-action:focus-visible {
  2144. border-color: color-mix(in srgb, var(--guide-accent) 76%, var(--toolbar-border));
  2145. background: color-mix(in srgb, var(--guide-accent) 9%, var(--panel));
  2146. transform: translateY(-1px);
  2147. }
  2148. .diagram-guide-action:focus-visible,
  2149. .diagram-guide-close:focus-visible {
  2150. outline: 2px solid var(--cloud-stroke);
  2151. outline-offset: 1px;
  2152. }
  2153. .diagram-guide-action:disabled {
  2154. opacity: 0.42;
  2155. cursor: default;
  2156. transform: none;
  2157. }
  2158. .diagram-guide-index {
  2159. display: grid;
  2160. place-items: center;
  2161. width: 1.65rem;
  2162. height: 1.65rem;
  2163. border: 1px solid color-mix(in srgb, var(--guide-accent) 64%, var(--toolbar-border));
  2164. border-radius: 0.35rem;
  2165. color: var(--guide-accent);
  2166. font-size: 0.5rem;
  2167. font-weight: 800;
  2168. letter-spacing: 0.06em;
  2169. }
  2170. .diagram-guide-action-copy { min-width: 0; }
  2171. .diagram-guide-action strong {
  2172. display: block;
  2173. overflow: hidden;
  2174. color: var(--text);
  2175. font-size: 0.66rem;
  2176. text-overflow: ellipsis;
  2177. white-space: nowrap;
  2178. }
  2179. .diagram-guide-action small {
  2180. display: -webkit-box;
  2181. margin-top: 0.18rem;
  2182. overflow: hidden;
  2183. color: var(--text-faint);
  2184. font-size: 0.5rem;
  2185. line-height: 1.35;
  2186. -webkit-box-orient: vertical;
  2187. -webkit-line-clamp: 2;
  2188. }
  2189. .diagram-guide kbd {
  2190. align-self: start;
  2191. min-width: 1.45rem;
  2192. padding: 0.12rem 0.3rem;
  2193. border: 1px solid var(--toolbar-border);
  2194. border-radius: 0.25rem;
  2195. color: var(--text-faint);
  2196. font: inherit;
  2197. font-size: 0.5rem;
  2198. text-align: center;
  2199. }
  2200. .diagram-guide-shortcuts {
  2201. display: flex;
  2202. flex-wrap: wrap;
  2203. gap: 0.34rem 0.62rem;
  2204. padding: 0.58rem 0.9rem 0.68rem;
  2205. border-top: 1px solid var(--toolbar-border);
  2206. color: var(--text-faint);
  2207. font-size: 0.5rem;
  2208. }
  2209. .diagram-guide-shortcuts span {
  2210. display: inline-flex;
  2211. align-items: center;
  2212. gap: 0.28rem;
  2213. white-space: nowrap;
  2214. }
  2215. .diagram-guide-feedback {
  2216. min-height: 1rem;
  2217. margin: -0.18rem 0.9rem 0.62rem;
  2218. color: var(--security-stroke);
  2219. font-size: 0.5rem;
  2220. }
  2221. .diagram-guide-feedback:empty { display: none; }
  2222. .diagram-guide-credit {
  2223. display: flex;
  2224. align-items: center;
  2225. justify-content: space-between;
  2226. gap: 0.6rem;
  2227. padding: 0.46rem 0.9rem 0.56rem;
  2228. border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 74%, transparent);
  2229. color: var(--text-faint);
  2230. font-size: 0.5rem;
  2231. letter-spacing: 0.02em;
  2232. text-decoration: none;
  2233. }
  2234. .diagram-guide-credit-link {
  2235. display: inline-flex;
  2236. align-items: center;
  2237. gap: 0.28rem;
  2238. flex: none;
  2239. opacity: 0.72;
  2240. transition: opacity 120ms ease, color 120ms ease;
  2241. }
  2242. .diagram-guide-star {
  2243. width: 0.62rem;
  2244. height: 0.62rem;
  2245. background: currentColor;
  2246. -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6l1.9 3.9 4.3.6-3.1 3 .7 4.3L8 11.4l-3.8 2 .7-4.3-3.1-3 4.3-.6z' fill='none' stroke='black' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  2247. mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6l1.9 3.9 4.3.6-3.1 3 .7 4.3L8 11.4l-3.8 2 .7-4.3-3.1-3 4.3-.6z' fill='none' stroke='black' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  2248. }
  2249. .diagram-guide-credit:hover .diagram-guide-star,
  2250. .diagram-guide-credit:focus-visible .diagram-guide-star {
  2251. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6l1.9 3.9 4.3.6-3.1 3 .7 4.3L8 11.4l-3.8 2 .7-4.3-3.1-3 4.3-.6z' stroke='black' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
  2252. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6l1.9 3.9 4.3.6-3.1 3 .7 4.3L8 11.4l-3.8 2 .7-4.3-3.1-3 4.3-.6z' stroke='black' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E");
  2253. }
  2254. .diagram-guide-credit:hover .diagram-guide-credit-link,
  2255. .diagram-guide-credit:focus-visible .diagram-guide-credit-link { opacity: 1; color: var(--cloud-stroke); }
  2256. .diagram-guide-credit:focus-visible { outline: 2px solid var(--cloud-stroke); outline-offset: -2px; }
  2257. @keyframes archify-guide-in {
  2258. from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  2259. to { opacity: 1; transform: translateY(0) scale(1); }
  2260. }
  2261. .node-finder {
  2262. position: absolute;
  2263. top: 1rem;
  2264. left: 1rem;
  2265. z-index: 24;
  2266. display: flex;
  2267. flex-direction: column;
  2268. width: min(22rem, calc(100% - 2rem));
  2269. max-height: calc(100% - 2rem);
  2270. overflow: hidden;
  2271. border: 1px solid var(--toolbar-border);
  2272. border-radius: 0.85rem;
  2273. background: var(--toolbar-menu-bg);
  2274. color: var(--toolbar-text);
  2275. box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);
  2276. backdrop-filter: blur(16px);
  2277. }
  2278. .node-finder[hidden] { display: none; }
  2279. .node-finder[data-context="route-source"] {
  2280. border-color: color-mix(in srgb, var(--frontend-stroke) 68%, var(--toolbar-border));
  2281. }
  2282. .node-finder[data-context="route-target"] {
  2283. border-color: color-mix(in srgb, var(--security-stroke) 68%, var(--toolbar-border));
  2284. }
  2285. html[data-preset="blueprint"] .node-finder { border-radius: 0.3rem; }
  2286. .node-finder-head {
  2287. display: flex;
  2288. align-items: center;
  2289. justify-content: space-between;
  2290. gap: 1rem;
  2291. padding: 0.7rem 0.8rem 0.45rem;
  2292. }
  2293. .node-finder-head strong {
  2294. color: var(--text);
  2295. font-size: 0.6875rem;
  2296. letter-spacing: 0.08em;
  2297. text-transform: uppercase;
  2298. }
  2299. .node-finder[data-context="route-source"] .node-finder-head strong { color: var(--frontend-stroke); }
  2300. .node-finder[data-context="route-target"] .node-finder-head strong { color: var(--security-stroke); }
  2301. .node-finder-close {
  2302. width: 1.75rem;
  2303. height: 1.75rem;
  2304. border: 0;
  2305. border-radius: 0.35rem;
  2306. background: transparent;
  2307. color: var(--toolbar-text);
  2308. font: inherit;
  2309. font-size: 1rem;
  2310. cursor: pointer;
  2311. }
  2312. .node-finder-close:hover,
  2313. .node-finder-close:focus-visible { background: var(--toolbar-hover); }
  2314. .node-finder-close:focus-visible,
  2315. .node-finder-result:focus-visible {
  2316. outline: 2px solid var(--frontend-stroke);
  2317. outline-offset: -2px;
  2318. }
  2319. .node-finder-search {
  2320. display: grid;
  2321. grid-template-columns: auto minmax(0, 1fr) auto;
  2322. align-items: center;
  2323. gap: 0.55rem;
  2324. margin: 0 0.55rem 0.55rem;
  2325. padding: 0 0.7rem;
  2326. min-height: 2.35rem;
  2327. border: 1px solid var(--toolbar-border);
  2328. border-radius: 0.55rem;
  2329. background: color-mix(in srgb, var(--panel) 78%, transparent);
  2330. transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
  2331. }
  2332. html[data-preset="blueprint"] .node-finder-search { border-radius: 0.18rem; }
  2333. .node-finder-search > span { color: var(--frontend-stroke); font-size: 0.875rem; }
  2334. .node-finder-search:focus-within {
  2335. border-color: var(--frontend-stroke);
  2336. box-shadow: 0 0 0 2px color-mix(in srgb, var(--frontend-stroke) 14%, transparent);
  2337. }
  2338. .node-finder-input {
  2339. appearance: none;
  2340. width: 100%;
  2341. min-width: 0;
  2342. border: 0;
  2343. outline: 0;
  2344. background: transparent;
  2345. color: var(--text);
  2346. font: inherit;
  2347. font-size: 0.75rem;
  2348. }
  2349. .node-finder-input:focus-visible { outline: none; }
  2350. .node-finder-input::placeholder { color: var(--text-faint); }
  2351. .node-finder kbd {
  2352. padding: 0.1rem 0.32rem;
  2353. border: 1px solid var(--toolbar-border);
  2354. border-radius: 0.25rem;
  2355. color: var(--text-faint);
  2356. font: inherit;
  2357. font-size: 0.5625rem;
  2358. }
  2359. .node-finder-results {
  2360. display: grid;
  2361. flex: 1 1 auto;
  2362. gap: 0;
  2363. min-height: 0;
  2364. max-height: min(18rem, 48vh);
  2365. margin: 0 0.55rem 0.45rem;
  2366. padding: 0;
  2367. overflow-y: auto;
  2368. overscroll-behavior: contain;
  2369. border: 1px solid color-mix(in srgb, var(--toolbar-border) 78%, transparent);
  2370. border-radius: 0.55rem;
  2371. background: color-mix(in srgb, var(--panel) 54%, transparent);
  2372. scroll-padding-block: 0.25rem;
  2373. scrollbar-width: thin;
  2374. scrollbar-color: color-mix(in srgb, var(--panel-border) 90%, transparent) transparent;
  2375. }
  2376. /* Slim overlay-style thumb instead of the chunky platform default. */
  2377. .node-finder-results::-webkit-scrollbar { width: 10px; }
  2378. .node-finder-results::-webkit-scrollbar-track { background: transparent; }
  2379. .node-finder-results::-webkit-scrollbar-thumb {
  2380. background: color-mix(in srgb, var(--panel-border) 85%, transparent);
  2381. border: 3px solid transparent;
  2382. border-radius: 999px;
  2383. background-clip: padding-box;
  2384. }
  2385. .node-finder-results::-webkit-scrollbar-thumb:hover {
  2386. background: color-mix(in srgb, var(--text-muted) 65%, transparent);
  2387. border: 3px solid transparent;
  2388. background-clip: padding-box;
  2389. }
  2390. html[data-preset="blueprint"] .node-finder-results { border-radius: 0.18rem; }
  2391. .node-finder-result {
  2392. display: grid;
  2393. grid-template-columns: minmax(0, 1fr) auto;
  2394. gap: 0.2rem 0.75rem;
  2395. width: 100%;
  2396. min-height: 3rem;
  2397. padding: 0.52rem 0.65rem;
  2398. border: 0;
  2399. border-radius: 0;
  2400. background: transparent;
  2401. color: var(--text);
  2402. font: inherit;
  2403. text-align: left;
  2404. cursor: pointer;
  2405. transition: background-color 160ms ease-out;
  2406. }
  2407. .node-finder-result:not(:last-child) {
  2408. border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 62%, transparent);
  2409. }
  2410. .node-finder-result:hover,
  2411. .node-finder-result:focus-visible {
  2412. position: relative;
  2413. z-index: 1;
  2414. background: color-mix(in srgb, var(--frontend-fill) 48%, var(--toolbar-hover));
  2415. }
  2416. .node-finder-result strong {
  2417. overflow: hidden;
  2418. font-size: 0.75rem;
  2419. line-height: 1.25;
  2420. text-overflow: ellipsis;
  2421. white-space: nowrap;
  2422. }
  2423. .node-finder-result small {
  2424. grid-column: 1 / -1;
  2425. overflow: hidden;
  2426. color: var(--text-faint);
  2427. font-size: 0.5625rem;
  2428. letter-spacing: 0.015em;
  2429. text-overflow: ellipsis;
  2430. white-space: nowrap;
  2431. }
  2432. .node-finder-result em {
  2433. align-self: center;
  2434. color: var(--frontend-stroke);
  2435. font-size: 0.625rem;
  2436. font-style: normal;
  2437. }
  2438. /* A zero count is absence, not information — let it recede. */
  2439. .node-finder-result em[data-zero] { color: var(--text-faint); }
  2440. .node-finder[data-context^="route-"] .node-finder-result em {
  2441. padding: 0.1rem 0.3rem;
  2442. border: 1px solid color-mix(in srgb, currentColor 52%, transparent);
  2443. border-radius: 999px;
  2444. font-size: 0.5rem;
  2445. font-weight: 800;
  2446. letter-spacing: 0.05em;
  2447. text-transform: uppercase;
  2448. }
  2449. .node-finder[data-context="route-target"] .node-finder-result em { color: var(--security-stroke); }
  2450. .node-finder-empty {
  2451. padding: 1.1rem 0.75rem 1.25rem;
  2452. color: var(--text-faint);
  2453. font-size: 0.6875rem;
  2454. text-align: center;
  2455. }
  2456. .node-finder-status {
  2457. margin: 0;
  2458. padding: 0.1rem 0.8rem 0.65rem;
  2459. color: var(--text-faint);
  2460. font-size: 0.5625rem;
  2461. }
  2462. .cards {
  2463. display: grid;
  2464. grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  2465. gap: 1rem;
  2466. margin-top: 2rem;
  2467. }
  2468. .card {
  2469. background: var(--panel);
  2470. border-radius: 0.75rem;
  2471. border: 1px solid var(--panel-border);
  2472. padding: 1.125rem 1.25rem;
  2473. /* Card notes are authored prose and may carry an unbreakable run such as a
  2474. slash-joined pipeline or a long identifier. Without this, that run sets the
  2475. card's min-content width, spills past its track in every rail placement,
  2476. and pushes the whole page into horizontal overflow at desktop widths.
  2477. `anywhere` rather than `break-word` because only `anywhere` shrinks the
  2478. intrinsic minimum the layout is sized from. */
  2479. overflow-wrap: anywhere;
  2480. }
  2481. html[data-preset="signal-flow"] .card {
  2482. background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
  2483. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  2484. }
  2485. html[data-preset="signal-flow"][data-theme="light"] .card {
  2486. background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
  2487. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
  2488. }
  2489. /* Preserve the one-screen guarantee on ordinary laptop displays. The
  2490. high-screen expansion above must not trade a fuller canvas for page
  2491. scrolling at 900–1080px heights. */
  2492. @media (min-width: 768px) and (max-height: 1100px) {
  2493. .header { margin-bottom: 1rem; }
  2494. .diagram-container {
  2495. padding: 0.875rem;
  2496. padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
  2497. }
  2498. .cards { margin-top: 1rem; }
  2499. .card { padding: 1rem; }
  2500. }
  2501. @media (min-width: 768px) and (max-height: 920px) {
  2502. body { padding-block: 1.25rem; }
  2503. body { --archify-page-top: 1.25rem; }
  2504. .header { margin-bottom: 0.875rem; }
  2505. .cards { margin-top: 0.75rem; }
  2506. html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
  2507. /* Align the fixed toolbar with the compact title row. Reserve its hit area
  2508. above the guide without taking extra height from a fitted diagram. */
  2509. html[data-nav-stage-rail="true"] .toolbar { top: 0.25rem; }
  2510. html[data-nav-stage-rail="true"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }
  2511. html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
  2512. html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
  2513. }
  2514. html[data-preset="blueprint"] .card {
  2515. position: relative;
  2516. border-color: var(--panel-border);
  2517. border-radius: 0.3rem;
  2518. background: var(--panel);
  2519. box-shadow: none;
  2520. }
  2521. html[data-preset="blueprint"] .card::before {
  2522. content: "";
  2523. position: absolute;
  2524. top: -1px;
  2525. left: 1rem;
  2526. width: 2.5rem;
  2527. border-top: 2px solid var(--frontend-stroke);
  2528. }
  2529. html[data-preset="editorial"] .card {
  2530. position: relative;
  2531. border-radius: 0.28rem;
  2532. background: var(--panel);
  2533. box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
  2534. }
  2535. html[data-preset="editorial"] .card::before {
  2536. position: absolute;
  2537. top: -1px;
  2538. left: 1.25rem;
  2539. width: 3.25rem;
  2540. border-top: 3px solid var(--arrow-emphasis);
  2541. content: "";
  2542. }
  2543. html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
  2544. /* Summary rail: the reader measures the viewport and enables it only when the
  2545. diagram keeps its readable width beside the notes. */
  2546. .reader-rail { display: contents; }
  2547. html[data-reader-rail="true"] .container {
  2548. display: grid;
  2549. grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);
  2550. grid-auto-flow: row dense;
  2551. column-gap: var(--archify-rail-gap);
  2552. align-items: start;
  2553. }
  2554. html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
  2555. html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
  2556. /* The rail is at least the diagram's height and may run on to the viewport
  2557. floor (--archify-rail-max, set by the reader); past that, notes scroll and
  2558. the index keeps a usable share instead of collapsing to its header. */
  2559. html[data-reader-rail="true"] .reader-rail {
  2560. display: flex;
  2561. flex-direction: column;
  2562. grid-column: 2;
  2563. align-self: stretch;
  2564. min-height: 0;
  2565. max-height: var(--archify-rail-max, none);
  2566. }
  2567. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
  2568. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
  2569. display: flex;
  2570. flex: 0 1 auto;
  2571. flex-direction: column;
  2572. gap: 0;
  2573. min-height: 0;
  2574. margin-top: 0;
  2575. padding: 0.125rem 0 0;
  2576. overflow-y: auto;
  2577. scrollbar-width: none;
  2578. -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
  2579. mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
  2580. }
  2581. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards::-webkit-scrollbar { display: none; }
  2582. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card { flex: none; }
  2583. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card {
  2584. padding: 0 0.25rem 1.125rem;
  2585. border: 0;
  2586. border-radius: 0;
  2587. background: transparent;
  2588. box-shadow: none;
  2589. }
  2590. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card + .card {
  2591. padding-top: 1.125rem;
  2592. border-top: 1px solid var(--panel-border);
  2593. }
  2594. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card::before { display: none; }
  2595. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }
  2596. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }
  2597. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }
  2598. .node-outline { display: none; }
  2599. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .node-outline:not([hidden]) {
  2600. display: flex;
  2601. flex: 1 0 min(13rem, 55%);
  2602. flex-direction: column;
  2603. min-height: 0;
  2604. margin-top: 0.25rem;
  2605. overflow: hidden;
  2606. border-top: 1px solid var(--panel-border);
  2607. }
  2608. html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }
  2609. /* Collapsed: only the reveal control remains, so the diagram takes the width. */
  2610. html[data-reader-rail="collapsed"] .reader-rail { display: none; }
  2611. /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */
  2612. html[data-reader-rail="overlay"] .reader-rail {
  2613. position: fixed;
  2614. z-index: 150;
  2615. top: 1rem;
  2616. right: 1rem;
  2617. bottom: 1rem;
  2618. display: flex;
  2619. flex-direction: column;
  2620. width: var(--archify-rail-width);
  2621. padding: 0.75rem 1rem 0.5rem;
  2622. border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
  2623. border-radius: 1rem;
  2624. background: var(--toolbar-menu-bg);
  2625. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);
  2626. animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  2627. }
  2628. @keyframes rail-drawer-in {
  2629. from { opacity: 0; transform: translateX(0.75rem); }
  2630. to { opacity: 1; transform: translateX(0); }
  2631. }
  2632. /* Bottom (default): the notes keep their full-width card row and the index
  2633. follows as one panel whose groups flow into columns, so nothing scrolls
  2634. inside it. The placement toggle sits in the index header. */
  2635. html[data-reader-rail="bottom"] .reader-rail {
  2636. display: grid;
  2637. grid-template-areas: "cards" "index";
  2638. grid-template-columns: minmax(0, 1fr);
  2639. row-gap: 1rem;
  2640. margin-top: 1rem;
  2641. }
  2642. html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
  2643. html[data-reader-rail="bottom"] .cards:empty { display: none; }
  2644. html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
  2645. display: block;
  2646. grid-area: index;
  2647. padding: 0 1.25rem 0.75rem;
  2648. border: 1px solid var(--panel-border);
  2649. border-radius: 0.75rem;
  2650. background: var(--panel);
  2651. }
  2652. html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
  2653. z-index: 1;
  2654. grid-area: index;
  2655. align-self: start;
  2656. justify-self: end;
  2657. margin: 0.625rem 0.625rem 0 0;
  2658. }
  2659. html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
  2660. html[data-reader-rail="bottom"] .node-outline-list {
  2661. display: grid;
  2662. gap: 0.5rem;
  2663. padding: 0;
  2664. overflow: visible;
  2665. -webkit-mask-image: none;
  2666. mask-image: none;
  2667. }
  2668. html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
  2669. html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { padding-bottom: 0.25rem; }
  2670. html[data-reader-rail="bottom"] .node-outline-group > ul {
  2671. display: flex;
  2672. flex-wrap: wrap;
  2673. gap: 0.25rem 0.5rem;
  2674. }
  2675. html[data-reader-rail="bottom"] .node-outline-group > ul::before { display: none; }
  2676. html[data-reader-rail="bottom"] .node-outline-group li {
  2677. flex: 0 1 auto;
  2678. min-width: min(100%, 12rem);
  2679. max-width: min(100%, 32rem);
  2680. }
  2681. html[data-reader-rail="bottom"] .node-outline-heading {
  2682. justify-content: flex-start;
  2683. gap: 0.5rem;
  2684. }
  2685. html[data-reader-rail="bottom"] .node-outline-heading > span { overflow-wrap: anywhere; }
  2686. .rail-controls { display: none; }
  2687. html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
  2688. display: flex;
  2689. flex: none;
  2690. justify-content: flex-end;
  2691. gap: 0.125rem;
  2692. margin: -0.25rem -0.25rem 0.25rem 0;
  2693. }
  2694. .rail-control {
  2695. display: inline-grid;
  2696. place-items: center;
  2697. width: 1.875rem;
  2698. height: 1.875rem;
  2699. border: 0;
  2700. border-radius: 0.5rem;
  2701. background: transparent;
  2702. color: var(--text-faint);
  2703. cursor: pointer;
  2704. transition: background 0.14s ease, color 0.14s ease;
  2705. }
  2706. .rail-control[hidden] { display: none; }
  2707. .rail-control:hover,
  2708. .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
  2709. .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }
  2710. .rail-control-icon,
  2711. .rail-reveal-icon {
  2712. width: 1rem;
  2713. height: 1rem;
  2714. background: currentColor;
  2715. -webkit-mask: var(--rail-glyph) center / contain no-repeat;
  2716. mask: var(--rail-glyph) center / contain no-repeat;
  2717. }
  2718. /* Panel glyphs: a frame with the panel drawn on the side it moves to. */
  2719. .rail-control-icon.placement,
  2720. #rail-placement[data-placement="right"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E"); }
  2721. #rail-placement[data-placement="bottom"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E"); }
  2722. .rail-control-icon.collapse { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  2723. .rail-reveal-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E"); }
  2724. .rail-reveal[hidden] { display: none; }
  2725. /* The collapsed rail leaves one quiet pill in the canvas corner. */
  2726. .rail-reveal {
  2727. position: absolute;
  2728. z-index: 13;
  2729. top: 0.75rem;
  2730. right: 0.75rem;
  2731. display: inline-flex;
  2732. align-items: center;
  2733. gap: 0.45rem;
  2734. min-height: 2rem;
  2735. padding: 0 0.75rem 0 0.625rem;
  2736. border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
  2737. border-radius: 999px;
  2738. background: color-mix(in srgb, var(--panel) 86%, transparent);
  2739. color: var(--text-muted);
  2740. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);
  2741. backdrop-filter: blur(12px);
  2742. font: inherit;
  2743. font-size: 0.75rem;
  2744. font-weight: 500;
  2745. cursor: pointer;
  2746. transition: color 0.14s ease, background 0.14s ease;
  2747. }
  2748. .rail-reveal:hover,
  2749. .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }
  2750. .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }
  2751. html[data-motion="still"] .reader-rail { animation: none !important; }
  2752. .node-outline-head {
  2753. display: flex;
  2754. align-items: center;
  2755. gap: 0.5rem;
  2756. padding: 1.125rem 0.25rem 0.375rem;
  2757. }
  2758. .node-outline-head strong {
  2759. color: var(--text);
  2760. font-size: 0.875rem;
  2761. font-weight: 600;
  2762. letter-spacing: -0.005em;
  2763. }
  2764. .node-outline-count {
  2765. min-width: 1.35rem;
  2766. padding: 0.1rem 0.4rem;
  2767. border-radius: 999px;
  2768. background: color-mix(in srgb, var(--text) 6%, transparent);
  2769. color: var(--text-muted);
  2770. font-size: 0.6875rem;
  2771. font-weight: 600;
  2772. line-height: 1.3;
  2773. text-align: center;
  2774. font-variant-numeric: tabular-nums;
  2775. }
  2776. .node-outline-list {
  2777. flex: 1 1 auto;
  2778. min-height: 0;
  2779. margin: 0 -0.375rem;
  2780. padding: 0 0 1.25rem;
  2781. overflow-y: auto;
  2782. list-style: none;
  2783. scrollbar-width: none;
  2784. -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
  2785. mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
  2786. }
  2787. .node-outline-list::-webkit-scrollbar { display: none; }
  2788. .node-outline-group + .node-outline-group { margin-top: 0.25rem; }
  2789. .node-outline-group > ul {
  2790. position: relative;
  2791. list-style: none;
  2792. }
  2793. /* A quiet spine ties each group's swatches together like a lane. */
  2794. .node-outline-group > ul::before {
  2795. position: absolute;
  2796. top: 0.95rem;
  2797. bottom: 0.95rem;
  2798. left: calc(0.625rem + 0.3125rem - 0.5px);
  2799. width: 1px;
  2800. background: var(--panel-border);
  2801. content: "";
  2802. }
  2803. .node-outline-heading {
  2804. display: flex;
  2805. align-items: baseline;
  2806. justify-content: space-between;
  2807. padding: 0.7rem 0.625rem 0.25rem;
  2808. color: var(--text-faint);
  2809. font-size: 0.6875rem;
  2810. font-weight: 600;
  2811. letter-spacing: 0.02em;
  2812. }
  2813. .node-outline-heading small {
  2814. color: var(--text-dim);
  2815. font-size: 0.6875rem;
  2816. font-weight: 500;
  2817. font-variant-numeric: tabular-nums;
  2818. }
  2819. /* The rail frees the vertical budget, so compact viewports keep the normal
  2820. title spacing instead of the stacked layout's tight stage rail. */
  2821. html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
  2822. html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
  2823. html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
  2824. .node-outline-item {
  2825. position: relative;
  2826. display: grid;
  2827. grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;
  2828. align-items: center;
  2829. column-gap: 0.625rem;
  2830. width: 100%;
  2831. min-height: 1.95rem;
  2832. padding: 0.28rem 0.5rem 0.28rem 0.625rem;
  2833. border: 0;
  2834. border-radius: 0.5rem;
  2835. background: transparent;
  2836. color: var(--text);
  2837. font: inherit;
  2838. text-align: left;
  2839. cursor: pointer;
  2840. transition: background 0.16s ease;
  2841. }
  2842. /* Trailing chevron hints that a click focuses the node. */
  2843. .node-outline-item::after {
  2844. grid-column: 4;
  2845. width: 0.75rem;
  2846. height: 0.75rem;
  2847. background: currentColor;
  2848. color: var(--text-muted);
  2849. content: "";
  2850. opacity: 0;
  2851. transform: translateX(-3px);
  2852. transition: opacity 0.16s ease, transform 0.16s ease;
  2853. -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  2854. mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  2855. }
  2856. .node-outline-item:hover,
  2857. .node-outline-item:focus-visible,
  2858. .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
  2859. .node-outline-item:hover::after,
  2860. .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }
  2861. .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }
  2862. .node-outline-item[aria-current="true"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }
  2863. .node-outline-item[aria-current="true"]::after { opacity: 0; }
  2864. /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */
  2865. .node-outline-dot {
  2866. width: 0.625rem;
  2867. height: 0.5rem;
  2868. border: 1.25px solid var(--outline-tone);
  2869. border-radius: 0.15rem;
  2870. background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));
  2871. transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  2872. }
  2873. .node-outline-item:hover .node-outline-dot,
  2874. .node-outline-item:focus-visible .node-outline-dot,
  2875. .node-outline-item[data-previewing] .node-outline-dot,
  2876. .node-outline-item[aria-current="true"] .node-outline-dot {
  2877. background: var(--outline-tone);
  2878. box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);
  2879. transform: scale(1.08);
  2880. }
  2881. .node-outline-item strong {
  2882. overflow: hidden;
  2883. font-size: 0.8125rem;
  2884. font-weight: 500;
  2885. text-overflow: ellipsis;
  2886. white-space: nowrap;
  2887. }
  2888. .node-outline-item[aria-current="true"] strong { font-weight: 600; }
  2889. .node-outline-item small {
  2890. overflow: hidden;
  2891. color: var(--text-faint);
  2892. font-size: 0.6875rem;
  2893. text-align: right;
  2894. text-overflow: ellipsis;
  2895. white-space: nowrap;
  2896. transition: color 0.16s ease;
  2897. }
  2898. .node-outline-item:hover small,
  2899. .node-outline-item[data-previewing] small,
  2900. .node-outline-item[aria-current="true"] small { color: var(--text-muted); }
  2901. /* The desktop bottom rail is an index: compact rows keep related nodes
  2902. together while allowing full names and descriptions to wrap naturally. */
  2903. html[data-reader-rail="bottom"] .node-outline-item {
  2904. grid-template-columns: 0.625rem minmax(0, 1fr) 0.75rem;
  2905. align-items: first baseline;
  2906. column-gap: 0.375rem;
  2907. min-height: 0;
  2908. padding-block: 0.375rem;
  2909. }
  2910. html[data-reader-rail="bottom"] .node-outline-item strong,
  2911. html[data-reader-rail="bottom"] .node-outline-item small {
  2912. overflow: visible;
  2913. text-overflow: clip;
  2914. white-space: normal;
  2915. overflow-wrap: anywhere;
  2916. }
  2917. html[data-reader-rail="bottom"] .node-outline-item strong {
  2918. grid-column: 2;
  2919. grid-row: 1;
  2920. }
  2921. html[data-reader-rail="bottom"] .node-outline-item small {
  2922. grid-column: 2;
  2923. grid-row: 2;
  2924. text-align: left;
  2925. }
  2926. html[data-reader-rail="bottom"] .node-outline-item::after {
  2927. grid-column: 3;
  2928. grid-row: 1;
  2929. align-self: center;
  2930. }
  2931. .card-header {
  2932. display: flex;
  2933. align-items: center;
  2934. gap: 0.5rem;
  2935. margin-bottom: 0.625rem;
  2936. }
  2937. .card-dot {
  2938. flex: none;
  2939. width: 8px;
  2940. height: 8px;
  2941. border-radius: 50%;
  2942. }
  2943. .card-dot.cyan { background: var(--frontend-stroke); }
  2944. .card-dot.emerald { background: var(--backend-stroke); }
  2945. .card-dot.violet { background: var(--database-stroke); }
  2946. .card-dot.amber { background: var(--cloud-stroke); }
  2947. .card-dot.rose { background: var(--security-stroke); }
  2948. .card-dot.orange { background: var(--messagebus-stroke); }
  2949. .card-dot.slate { background: var(--external-stroke); }
  2950. .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }
  2951. .card ul {
  2952. list-style: none;
  2953. color: var(--text-muted);
  2954. font-size: 0.8125rem;
  2955. line-height: 1.6;
  2956. }
  2957. .card li {
  2958. position: relative;
  2959. margin-bottom: 0.3rem;
  2960. padding-left: 0.9rem;
  2961. }
  2962. .card li:last-child { margin-bottom: 0; }
  2963. /* Hanging markers take the card's tone so wrapped lines align under text. */
  2964. .card li::before {
  2965. position: absolute;
  2966. top: calc(0.8em - 2px);
  2967. left: 0.2rem;
  2968. width: 4px;
  2969. height: 4px;
  2970. border-radius: 50%;
  2971. background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);
  2972. content: "";
  2973. }
  2974. .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }
  2975. .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }
  2976. .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }
  2977. .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }
  2978. .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }
  2979. .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }
  2980. .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }
  2981. .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }
  2982. /* ==========================================================
  2983. Print stylesheet — hide interactive controls, force light,
  2984. drop the grid so the diagram doesn't waste ink, use landscape
  2985. so wide diagrams fit, pack summary cards into 2 columns to
  2986. avoid an orphan card on a trailing page.
  2987. ========================================================== */
  2988. @page { size: landscape; margin: 1.5cm; }
  2989. @media print {
  2990. /* Force the FULL light palette — including component fills/strokes and
  2991. lane/arrow colors — so printing from dark theme doesn't put neon
  2992. strokes and translucent dark fills on white paper. */
  2993. :root, [data-theme="dark"], [data-theme="light"] {
  2994. --bg: #ffffff;
  2995. --grid: transparent;
  2996. --panel: #ffffff;
  2997. --panel-border: #e2e8f0;
  2998. --text: #0f172a;
  2999. --text-muted: #475569;
  3000. --text-dim: #94a3b8;
  3001. --text-faint: #64748b;
  3002. --mask: #ffffff;
  3003. --lane-fill: rgba(248, 250, 252, 0.65);
  3004. --lane-stroke: #cbd5e1;
  3005. --arrow: #94a3b8;
  3006. --arrow-emphasis: #059669;
  3007. --frontend-fill: rgba(34, 211, 238, 0.15);
  3008. --frontend-stroke: #0891b2;
  3009. --backend-fill: rgba(52, 211, 153, 0.18);
  3010. --backend-stroke: #059669;
  3011. --database-fill: rgba(167, 139, 250, 0.2);
  3012. --database-stroke: #7c3aed;
  3013. --cloud-fill: rgba(251, 191, 36, 0.18);
  3014. --cloud-stroke: #d97706;
  3015. --security-fill: rgba(251, 113, 133, 0.15);
  3016. --security-stroke: #e11d48;
  3017. --messagebus-fill: rgba(251, 146, 60, 0.15);
  3018. --messagebus-stroke:#ea580c;
  3019. --external-fill: rgba(148, 163, 184, 0.18);
  3020. --external-stroke: #64748b;
  3021. }
  3022. body { background: #ffffff !important; padding: 0; }
  3023. .container { max-width: none; }
  3024. .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }
  3025. .diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }
  3026. .diagram-container { --archify-nav-reserve: 0px !important; }
  3027. html[data-preset="signal-flow"] .diagram-container,
  3028. html[data-preset="signal-flow"] .card { background: #ffffff; }
  3029. .cards { grid-template-columns: 1fr 1fr; }
  3030. /* Ensure elements break sensibly across pages */
  3031. .card { break-inside: avoid; page-break-inside: avoid; }
  3032. .diagram-container { break-inside: avoid; page-break-inside: avoid; }
  3033. .diagram-container svg [data-detail] {
  3034. opacity: 1 !important;
  3035. pointer-events: auto !important;
  3036. }
  3037. .diagram-container svg [data-detail-anchor] { transform: none !important; }
  3038. .diagram-container svg[data-lens-active] [data-node-id],
  3039. .diagram-container svg[data-lens-active] [data-edge-from],
  3040. .diagram-container svg[data-legend-preview-active] [data-node-id],
  3041. .diagram-container svg[data-legend-preview-active] [data-edge-from] {
  3042. opacity: 1 !important;
  3043. filter: none !important;
  3044. }
  3045. [data-legend-bridge-runtime] { display: none !important; }
  3046. .semantic-lens-overlay { display: none !important; }
  3047. .relationship-hit-overlay { display: none !important; }
  3048. .relationship-pulse-overlay { display: none !important; }
  3049. .route-probe-overlay, .route-journey-overlay { display: none !important; }
  3050. .diagram-container svg[data-focus-active] [data-node-id],
  3051. .diagram-container svg[data-focus-active] [data-edge-from],
  3052. .diagram-container svg[data-focus-active] [data-graph-role="automatic-crossover-underlay"],
  3053. .diagram-container svg[data-reach-active] [data-node-id],
  3054. .diagram-container svg[data-reach-active] [data-edge-from],
  3055. .diagram-container svg[data-reach-active] [data-graph-role="automatic-crossover-underlay"],
  3056. .diagram-container svg[data-route-active] [data-node-id],
  3057. .diagram-container svg[data-route-active] [data-edge-from],
  3058. .diagram-container svg[data-route-active] [data-graph-role="automatic-crossover-underlay"] {
  3059. opacity: 1 !important;
  3060. filter: none !important;
  3061. animation: none !important;
  3062. }
  3063. h1, .subtitle { color: #0f172a; }
  3064. }
  3065. /* ==========================================================
  3066. TOOLBAR (theme toggle + export menu)
  3067. ========================================================== */
  3068. /* The toolbar tracks the centered reader column and the title row, so
  3069. an adaptive narrow reader does not leave its controls stranded at the
  3070. viewport edge. */
  3071. .toolbar {
  3072. position: absolute;
  3073. top: var(--archify-page-top);
  3074. right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));
  3075. display: flex;
  3076. align-items: center;
  3077. gap: 0.125rem;
  3078. padding: 0;
  3079. border: 0;
  3080. background: transparent;
  3081. box-shadow: none;
  3082. z-index: 100;
  3083. }
  3084. /* Ghost controls keep a 44px hit area while the visible pill stays compact;
  3085. Export is the one primary action. */
  3086. .toolbar button {
  3087. position: relative;
  3088. isolation: isolate;
  3089. background: transparent;
  3090. color: var(--text-muted);
  3091. border: 0;
  3092. padding: 0.5rem 0.75rem;
  3093. border-radius: 0.5625rem;
  3094. font-family: inherit;
  3095. font-size: 0.8125rem;
  3096. font-weight: 500;
  3097. cursor: pointer;
  3098. white-space: nowrap;
  3099. box-shadow: none;
  3100. transition: color 0.15s;
  3101. display: inline-flex;
  3102. align-items: center;
  3103. gap: 0.4rem;
  3104. min-height: 2.75rem;
  3105. }
  3106. .toolbar button::before {
  3107. position: absolute;
  3108. z-index: -1;
  3109. inset: 0.375rem 0;
  3110. border-radius: 0.5rem;
  3111. background: transparent;
  3112. content: "";
  3113. transition: background 0.15s, box-shadow 0.15s;
  3114. }
  3115. .toolbar button:hover { color: var(--text); }
  3116. .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }
  3117. .toolbar button[aria-expanded="true"],
  3118. .toolbar button[aria-pressed="true"]:not(#btn-theme) { color: var(--text); }
  3119. .toolbar button[aria-expanded="true"]::before,
  3120. .toolbar button[aria-pressed="true"]:not(#btn-theme)::before {
  3121. background: color-mix(in srgb, var(--text) 8%, transparent);
  3122. }
  3123. .toolbar #btn-export {
  3124. margin-left: 0.375rem;
  3125. padding-right: 0.95rem;
  3126. padding-left: 1rem;
  3127. color: var(--bg);
  3128. font-weight: 550;
  3129. }
  3130. .toolbar #btn-export::before {
  3131. background: var(--text);
  3132. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);
  3133. }
  3134. .toolbar #btn-export:hover,
  3135. .toolbar #btn-export[aria-expanded="true"] { color: var(--bg); }
  3136. .toolbar #btn-export:hover::before,
  3137. .toolbar #btn-export[aria-expanded="true"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
  3138. .toolbar button:focus-visible {
  3139. outline: 2px solid var(--frontend-stroke);
  3140. outline-offset: -4px;
  3141. }
  3142. .toolbar { gap: 0.5rem; }
  3143. .toolbar #btn-export { margin-left: 0; }
  3144. .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }
  3145. /* Tools share one quiet capsule; the capsule is drawn inside the 44px row
  3146. so the controls keep their hit area without a tall visible box. */
  3147. .toolbar-group {
  3148. position: relative;
  3149. isolation: isolate;
  3150. display: flex;
  3151. align-items: center;
  3152. gap: 0.0625rem;
  3153. padding: 0 0.25rem;
  3154. }
  3155. .toolbar-group::before {
  3156. position: absolute;
  3157. z-index: -1;
  3158. inset: 0.25rem 0;
  3159. border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
  3160. border-radius: 0.6875rem;
  3161. background: color-mix(in srgb, var(--panel) 78%, transparent);
  3162. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);
  3163. backdrop-filter: blur(12px);
  3164. content: "";
  3165. }
  3166. .toolbar-group button { padding-inline: 0.625rem; }
  3167. .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }
  3168. /* Theme becomes a sliding switch; its label stays for assistive tech. */
  3169. .toolbar #theme-label,
  3170. .toolbar #present-label {
  3171. position: absolute;
  3172. width: 1px;
  3173. height: 1px;
  3174. overflow: hidden;
  3175. clip: rect(0 0 0 0);
  3176. white-space: nowrap;
  3177. }
  3178. .toolbar #btn-theme {
  3179. width: 3.5rem;
  3180. padding: 0;
  3181. justify-content: center;
  3182. }
  3183. .toolbar #btn-theme::before {
  3184. inset: 0.75rem 0.4375rem;
  3185. border-radius: 999px;
  3186. background: color-mix(in srgb, var(--text) 9%, transparent);
  3187. box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  3188. }
  3189. .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }
  3190. .toolbar #btn-theme::after {
  3191. position: absolute;
  3192. z-index: 0;
  3193. top: 50%;
  3194. left: 0.5625rem;
  3195. width: 1.125rem;
  3196. height: 1.125rem;
  3197. border-radius: 50%;
  3198. background: var(--panel);
  3199. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);
  3200. content: "";
  3201. transform: translateY(-50%);
  3202. transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  3203. }
  3204. .toolbar #theme-icon {
  3205. position: absolute;
  3206. z-index: 1;
  3207. top: 50%;
  3208. left: calc(0.5625rem + 0.1875rem);
  3209. width: 0.75rem;
  3210. height: 0.75rem;
  3211. color: var(--cloud-stroke);
  3212. transform: translateY(-50%);
  3213. transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  3214. }
  3215. [data-theme="dark"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }
  3216. [data-theme="dark"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
  3217. [data-theme="dark"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }
  3218. .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }
  3219. .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }
  3220. html[data-motion="still"] .toolbar #btn-theme::after,
  3221. html[data-motion="still"] .toolbar #theme-icon { transition: none; }
  3222. html[data-present="true"]:not([data-embed="true"]) .toolbar { right: 1rem; }
  3223. html[data-preset="editorial"] .toolbar { border-radius: 0.45rem; }
  3224. .toolbar #btn-motion[hidden] { display: none !important; }
  3225. .toolbar #btn-motion { min-width: 4.4rem; }
  3226. .toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }
  3227. .toolbar .preset-wrap,
  3228. .toolbar .export-wrap {
  3229. position: relative;
  3230. }
  3231. .toolbar-icon {
  3232. display: inline-block;
  3233. width: 0.95rem;
  3234. height: 0.95rem;
  3235. flex: 0 0 auto;
  3236. background: currentColor;
  3237. -webkit-mask-position: center;
  3238. -webkit-mask-repeat: no-repeat;
  3239. -webkit-mask-size: contain;
  3240. mask-position: center;
  3241. mask-repeat: no-repeat;
  3242. mask-size: contain;
  3243. }
  3244. .toolbar-chevron {
  3245. width: 0.65rem;
  3246. height: 0.65rem;
  3247. transition: transform 0.15s ease;
  3248. }
  3249. [aria-expanded="true"] > .toolbar-chevron { transform: rotate(180deg); }
  3250. [data-theme="light"] #theme-icon {
  3251. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E");
  3252. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.1'/%3E%3Cpath d='M10 2.2v1.4M10 16.4v1.4M2.2 10h1.4M16.4 10h1.4M4.5 4.5l1 1M14.5 14.5l1 1M15.5 4.5l-1 1M5.5 14.5l-1 1'/%3E%3C/g%3E%3C/svg%3E");
  3253. }
  3254. [data-theme="dark"] #theme-icon {
  3255. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E");
  3256. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.2 12.7A6.3 6.3 0 017.3 4.8a6.3 6.3 0 107.9 7.9Z' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E");
  3257. }
  3258. #btn-present[aria-pressed="false"] #present-icon {
  3259. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  3260. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 3.2h-4v4M12.8 3.2h4v4M7.2 16.8h-4v-4M12.8 16.8h4v-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  3261. }
  3262. #btn-present[aria-pressed="true"] #present-icon {
  3263. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  3264. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7.2 7.2h-4v-4M12.8 7.2h4v-4M7.2 12.8h-4v4M12.8 12.8h4v4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  3265. }
  3266. .toolbar-chevron {
  3267. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  3268. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  3269. }
  3270. .toolbar #btn-preset { min-width: 5.4rem; }
  3271. .preset-control-mark {
  3272. width: 0.58rem;
  3273. height: 0.58rem;
  3274. flex: 0 0 auto;
  3275. border: 1px solid var(--frontend-stroke);
  3276. border-radius: 0.2rem;
  3277. background: color-mix(in srgb, var(--frontend-stroke) 28%, transparent);
  3278. transition: border-radius 0.15s, box-shadow 0.15s, transform 0.15s;
  3279. }
  3280. #btn-preset[data-preset-option="signal-flow"] .preset-control-mark {
  3281. border-radius: 50%;
  3282. box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 78%, transparent);
  3283. }
  3284. #btn-preset[data-preset-option="blueprint"] .preset-control-mark {
  3285. border-radius: 0.06rem;
  3286. background: transparent;
  3287. box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--frontend-stroke) 32%, transparent);
  3288. transform: rotate(45deg) scale(0.84);
  3289. }
  3290. #btn-preset[data-preset-option="editorial"] .preset-control-mark {
  3291. border-color: var(--arrow-emphasis);
  3292. border-radius: 0;
  3293. background: var(--arrow-emphasis);
  3294. box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);
  3295. transform: rotate(45deg) scale(0.72);
  3296. }
  3297. /* Menus anchor to the tools capsule so they open flush under it. */
  3298. .toolbar-group .preset-wrap { position: static; }
  3299. .toolbar .preset-menu {
  3300. position: absolute;
  3301. top: calc(100% + 0.125rem);
  3302. right: 0;
  3303. display: none;
  3304. width: 17.5rem;
  3305. max-width: calc(100vw - 2rem);
  3306. padding: 0.375rem;
  3307. border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
  3308. border-radius: 0.875rem;
  3309. background: var(--toolbar-menu-bg);
  3310. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
  3311. }
  3312. [data-theme="dark"] .toolbar .preset-menu,
  3313. [data-theme="dark"] .toolbar .export-menu {
  3314. border-color: rgba(148, 163, 184, 0.16);
  3315. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);
  3316. }
  3317. /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */
  3318. .toolbar .preset-menu button,
  3319. .toolbar .export-menu button { isolation: auto; min-height: 0; }
  3320. .toolbar .preset-menu button::before { display: none; }
  3321. .toolbar .preset-menu.open { display: block; }
  3322. .toolbar .preset-menu.open,
  3323. .toolbar .export-menu.open {
  3324. animation: toolbar-menu-in 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  3325. transform-origin: top right;
  3326. }
  3327. @keyframes toolbar-menu-in {
  3328. from { opacity: 0; transform: translateY(-0.25rem) scale(0.985); }
  3329. to { opacity: 1; transform: translateY(0) scale(1); }
  3330. }
  3331. .preset-menu-heading {
  3332. display: flex;
  3333. align-items: center;
  3334. justify-content: space-between;
  3335. gap: 1rem;
  3336. padding: 0.45rem 0.55rem 0.4rem;
  3337. color: var(--text-faint);
  3338. font-size: 0.6875rem;
  3339. font-weight: 600;
  3340. letter-spacing: 0.01em;
  3341. }
  3342. .preset-menu-shortcut {
  3343. display: inline-flex;
  3344. align-items: center;
  3345. gap: 0.35rem;
  3346. font-weight: 500;
  3347. }
  3348. .preset-menu-shortcut kbd {
  3349. min-width: 1.125rem;
  3350. padding: 0.05rem 0.3rem;
  3351. border: 1px solid var(--panel-border);
  3352. border-bottom-width: 2px;
  3353. border-radius: 0.3rem;
  3354. background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
  3355. color: var(--text-muted);
  3356. font-family: inherit;
  3357. font-size: 0.625rem;
  3358. font-weight: 600;
  3359. line-height: 1.3;
  3360. text-align: center;
  3361. }
  3362. .toolbar .preset-option {
  3363. display: grid;
  3364. grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;
  3365. align-items: center;
  3366. gap: 0.75rem;
  3367. width: 100%;
  3368. min-height: 3.125rem;
  3369. margin-top: 0.125rem;
  3370. padding: 0.45rem 0.6rem 0.45rem 0.5rem;
  3371. border: 0;
  3372. border-radius: 0.625rem;
  3373. background: transparent;
  3374. color: var(--text);
  3375. box-shadow: none;
  3376. backdrop-filter: none;
  3377. text-align: left;
  3378. transition: background 0.14s ease;
  3379. }
  3380. .toolbar .preset-option:hover,
  3381. .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
  3382. .toolbar .preset-option[aria-checked="true"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }
  3383. .toolbar .preset-option:focus-visible {
  3384. outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
  3385. outline-offset: -1.5px;
  3386. }
  3387. .preset-option-swatch {
  3388. position: relative;
  3389. width: 2.375rem;
  3390. height: 1.75rem;
  3391. overflow: hidden;
  3392. border: 0;
  3393. border-radius: 0.4375rem;
  3394. background: #0f172a;
  3395. box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);
  3396. transition: box-shadow 0.14s ease, transform 0.14s ease;
  3397. }
  3398. .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }
  3399. .toolbar .preset-option[aria-checked="true"] .preset-option-swatch {
  3400. box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);
  3401. }
  3402. .preset-option-swatch::before,
  3403. .preset-option-swatch::after { position: absolute; content: ""; }
  3404. .preset-option-swatch.classic::before {
  3405. top: 0.42rem;
  3406. right: 0.35rem;
  3407. bottom: 0.42rem;
  3408. left: 0.35rem;
  3409. border: 1px solid #22d3ee;
  3410. border-radius: 0.16rem;
  3411. background: rgba(34, 211, 238, 0.14);
  3412. }
  3413. /* Classic previews the canvas it will actually produce in this theme. */
  3414. [data-theme="light"] .preset-option-swatch.classic {
  3415. background:
  3416. radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,
  3417. #ffffff;
  3418. }
  3419. [data-theme="light"] .preset-option-swatch.classic::before {
  3420. border-color: #1b87a3;
  3421. background: rgba(14, 116, 144, 0.08);
  3422. box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);
  3423. }
  3424. .preset-option-swatch.signal-flow {
  3425. border-color: #29415f;
  3426. background: linear-gradient(135deg, #07101e 10%, #10243c 100%);
  3427. }
  3428. .preset-option-swatch.signal-flow::before {
  3429. top: 50%;
  3430. right: 0.2rem;
  3431. left: 0.2rem;
  3432. height: 1px;
  3433. background: linear-gradient(90deg, #67e8f9, #c4b5fd);
  3434. box-shadow: 0 0 8px #67e8f9;
  3435. }
  3436. .preset-option-swatch.signal-flow::after {
  3437. top: calc(50% - 0.13rem);
  3438. right: 0.28rem;
  3439. width: 0.26rem;
  3440. height: 0.26rem;
  3441. border-radius: 50%;
  3442. background: #67e8f9;
  3443. box-shadow: 0 0 7px #67e8f9;
  3444. }
  3445. .preset-option-swatch.blueprint {
  3446. border-color: #34799a;
  3447. border-radius: 0.08rem;
  3448. background-color: #0a2031;
  3449. background-image:
  3450. linear-gradient(rgba(102, 217, 239, 0.18) 1px, transparent 1px),
  3451. linear-gradient(90deg, rgba(102, 217, 239, 0.18) 1px, transparent 1px);
  3452. background-size: 0.42rem 0.42rem;
  3453. }
  3454. .preset-option-swatch.blueprint::before {
  3455. top: 0.34rem;
  3456. right: 0.38rem;
  3457. bottom: 0.34rem;
  3458. left: 0.38rem;
  3459. border: 1px solid #66d9ef;
  3460. }
  3461. .preset-option-swatch.editorial {
  3462. border-color: #b8aa94;
  3463. border-radius: 0.08rem;
  3464. background: repeating-linear-gradient(0deg, #f2eee5 0 0.34rem, #d8d0c2 0.36rem, #f2eee5 0.38rem);
  3465. }
  3466. .preset-option-swatch.editorial::before {
  3467. top: 0;
  3468. bottom: 0;
  3469. left: 0.42rem;
  3470. width: 1px;
  3471. background: #c9502d;
  3472. opacity: 0.72;
  3473. }
  3474. .preset-option-swatch.editorial::after {
  3475. top: 0.52rem;
  3476. right: 0.45rem;
  3477. width: 0.38rem;
  3478. height: 0.38rem;
  3479. background: #c9502d;
  3480. transform: rotate(45deg);
  3481. }
  3482. .preset-option-copy { min-width: 0; }
  3483. .preset-option-copy strong,
  3484. .preset-option-copy small { display: block; }
  3485. .preset-option-copy strong {
  3486. color: var(--text);
  3487. font-size: 0.8125rem;
  3488. font-weight: 550;
  3489. letter-spacing: -0.005em;
  3490. }
  3491. .toolbar .preset-option[aria-checked="true"] .preset-option-copy strong { font-weight: 650; }
  3492. .preset-option-copy small {
  3493. margin-top: 0.125rem;
  3494. overflow: hidden;
  3495. color: var(--text-faint);
  3496. font-size: 0.6875rem;
  3497. font-weight: 400;
  3498. white-space: nowrap;
  3499. text-overflow: ellipsis;
  3500. }
  3501. .preset-option-check {
  3502. display: inline-block;
  3503. width: 0.9rem;
  3504. height: 0.9rem;
  3505. color: var(--frontend-stroke);
  3506. background: currentColor;
  3507. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  3508. -webkit-mask-position: center;
  3509. -webkit-mask-repeat: no-repeat;
  3510. -webkit-mask-size: contain;
  3511. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3 3 7-7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  3512. mask-position: center;
  3513. mask-repeat: no-repeat;
  3514. mask-size: contain;
  3515. opacity: 0;
  3516. }
  3517. .preset-option[aria-checked="true"] .preset-option-check { opacity: 1; }
  3518. html[data-preset="editorial"] .toolbar button,
  3519. html[data-preset="editorial"] .preset-menu,
  3520. html[data-preset="editorial"] .export-menu,
  3521. html[data-preset="editorial"] .overview-map,
  3522. html[data-preset="editorial"] .semantic-lens,
  3523. html[data-preset="editorial"] .route-probe,
  3524. html[data-preset="editorial"] .focus-chip,
  3525. html[data-preset="editorial"] .diagram-guide,
  3526. html[data-preset="editorial"] .node-finder {
  3527. border-radius: 0.3rem;
  3528. }
  3529. .motion-control-dot {
  3530. width: 0.46rem;
  3531. height: 0.46rem;
  3532. flex: 0 0 auto;
  3533. border: 1px solid var(--frontend-stroke);
  3534. border-radius: 50%;
  3535. background: var(--frontend-stroke);
  3536. box-shadow: 0 0 9px color-mix(in srgb, var(--frontend-stroke) 72%, transparent);
  3537. }
  3538. #btn-motion[aria-pressed="false"] .motion-control-dot {
  3539. background: transparent;
  3540. box-shadow: none;
  3541. }
  3542. /* The motion button breathes on the relay cycle, so the chrome keeps time
  3543. with the wave it controls. Motion Governor mirrors the planned cycle from
  3544. the diagram SVG onto the document. */
  3545. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden]) #btn-motion .motion-control-dot {
  3546. animation: archify-motion-dot-breathe var(--flow-cycle-chrome, 6.4s) ease-in-out infinite;
  3547. }
  3548. @keyframes archify-motion-dot-breathe {
  3549. 0%, 100% { opacity: 1; transform: scale(1); }
  3550. 46% { opacity: 0.55; transform: scale(0.72); }
  3551. }
  3552. .toolbar .export-menu {
  3553. position: absolute;
  3554. top: calc(100% + 0.125rem);
  3555. right: 0;
  3556. background: var(--toolbar-menu-bg);
  3557. border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
  3558. width: 19rem;
  3559. max-width: calc(100vw - 2rem);
  3560. max-height: calc(100vh - 5.5rem);
  3561. overflow-y: auto;
  3562. border-radius: 0.875rem;
  3563. padding: 0.375rem;
  3564. display: none;
  3565. flex-direction: column;
  3566. box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
  3567. scrollbar-width: thin;
  3568. }
  3569. .toolbar .export-menu.open { display: flex; }
  3570. .export-menu-header {
  3571. display: flex;
  3572. align-items: flex-start;
  3573. justify-content: space-between;
  3574. gap: 1rem;
  3575. padding: 0.55rem 0.6rem 0.6rem;
  3576. }
  3577. .export-menu-header strong,
  3578. .export-menu-header span { display: block; }
  3579. .export-menu-header strong {
  3580. color: var(--text);
  3581. font-size: 0.875rem;
  3582. font-weight: 600;
  3583. letter-spacing: -0.005em;
  3584. }
  3585. .export-menu-header span {
  3586. margin-top: 0.15rem;
  3587. color: var(--text-faint);
  3588. font-size: 0.75rem;
  3589. }
  3590. .export-menu-header kbd {
  3591. min-width: 1.125rem;
  3592. padding: 0.05rem 0.3rem;
  3593. border: 1px solid var(--panel-border);
  3594. border-bottom-width: 2px;
  3595. border-radius: 0.3rem;
  3596. background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
  3597. color: var(--text-muted);
  3598. font-family: inherit;
  3599. font-size: 0.625rem;
  3600. font-weight: 600;
  3601. line-height: 1.3;
  3602. text-align: center;
  3603. }
  3604. .export-menu-section {
  3605. display: grid;
  3606. grid-template-columns: minmax(0, 1fr);
  3607. gap: 0.0625rem;
  3608. }
  3609. .export-menu-section + .export-menu-section {
  3610. margin-top: 0.3rem;
  3611. padding-top: 0.3rem;
  3612. border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
  3613. }
  3614. .export-menu-heading {
  3615. grid-column: 1 / -1;
  3616. display: block;
  3617. padding: 0.4rem 0.6rem 0.25rem;
  3618. color: var(--text-faint);
  3619. font-size: 0.6875rem;
  3620. font-weight: 600;
  3621. letter-spacing: 0.01em;
  3622. }
  3623. .toolbar .export-menu button {
  3624. display: grid;
  3625. grid-template-columns: 1rem minmax(0, 1fr);
  3626. align-items: center;
  3627. column-gap: 0.7rem;
  3628. background: transparent;
  3629. border: 0;
  3630. box-shadow: none;
  3631. backdrop-filter: none;
  3632. width: 100%;
  3633. min-height: 2.5rem;
  3634. text-align: left;
  3635. padding: 0.4rem 0.6rem;
  3636. border-radius: 0.5625rem;
  3637. color: var(--text);
  3638. white-space: nowrap;
  3639. transition: background 0.14s ease;
  3640. }
  3641. .toolbar .export-menu button:hover,
  3642. .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
  3643. .toolbar .export-menu button:focus-visible {
  3644. outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
  3645. outline-offset: -1.5px;
  3646. }
  3647. /* Name and format hint share one line, so each row stays compact. */
  3648. .export-item-copy {
  3649. display: flex;
  3650. align-items: baseline;
  3651. justify-content: space-between;
  3652. gap: 0.75rem;
  3653. min-width: 0;
  3654. }
  3655. .export-item-copy strong {
  3656. overflow: hidden;
  3657. color: inherit;
  3658. font-size: 0.8125rem;
  3659. font-weight: 500;
  3660. text-overflow: ellipsis;
  3661. }
  3662. .export-item-copy small {
  3663. flex: none;
  3664. color: var(--text-faint);
  3665. font-size: 0.6875rem;
  3666. font-weight: 450;
  3667. }
  3668. .toolbar .export-menu button::before {
  3669. position: static;
  3670. z-index: auto;
  3671. inset: auto;
  3672. border-radius: 0;
  3673. display: block;
  3674. width: 1rem;
  3675. height: 1rem;
  3676. background: currentColor;
  3677. color: var(--text-muted);
  3678. content: "";
  3679. opacity: 0.8;
  3680. -webkit-mask-position: center;
  3681. -webkit-mask-repeat: no-repeat;
  3682. -webkit-mask-size: contain;
  3683. mask-position: center;
  3684. mask-repeat: no-repeat;
  3685. mask-size: contain;
  3686. }
  3687. .toolbar .export-menu button[data-action="route-share-card"]::before,
  3688. .toolbar .export-menu button[data-action="reach-share-card"]::before {
  3689. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");
  3690. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");
  3691. }
  3692. .toolbar .export-menu button[data-action^="copy"]::before {
  3693. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3694. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='6' y='6' width='10' height='10' rx='1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M4 13H3.5A1.5 1.5 0 012 11.5v-8A1.5 1.5 0 013.5 2h8A1.5 1.5 0 0113 3.5V4' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3695. }
  3696. .toolbar .export-menu button[data-format="png"]::before,
  3697. .toolbar .export-menu button[data-format="jpeg"]::before,
  3698. .toolbar .export-menu button[data-format="webp"]::before {
  3699. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3700. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3701. }
  3702. .toolbar .export-menu button[data-format^="svg"]::before,
  3703. .toolbar .export-menu button[data-format="webm"]::before {
  3704. -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3705. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
  3706. }
  3707. .toolbar .export-menu button[data-action="route-share-card"],
  3708. .toolbar .export-menu button[data-action="reach-share-card"] {
  3709. color: var(--text);
  3710. background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);
  3711. }
  3712. .toolbar .export-menu button[data-action="route-share-card"]::before,
  3713. .toolbar .export-menu button[data-action="reach-share-card"]::before { color: var(--frontend-stroke); opacity: 1; }
  3714. .toolbar .export-menu button[hidden] { display: none; }
  3715. .toolbar .export-menu button[data-action="route-share-card"]:hover,
  3716. .toolbar .export-menu button[data-action="reach-share-card"]:hover {
  3717. background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);
  3718. }
  3719. .toolbar .export-menu button:disabled {
  3720. color: var(--text-faint);
  3721. background: transparent;
  3722. opacity: 0.55;
  3723. cursor: not-allowed;
  3724. }
  3725. .toolbar .export-menu .hint {
  3726. color: var(--text-faint);
  3727. font-size: 0.6875rem;
  3728. }
  3729. /* Toast — brief feedback for actions like "copied" */
  3730. .archify-toast {
  3731. position: fixed;
  3732. top: 1rem;
  3733. left: 50%;
  3734. transform: translateX(-50%) translateY(-8px);
  3735. background: var(--toolbar-menu-bg);
  3736. color: var(--text);
  3737. border: 1px solid var(--toolbar-border);
  3738. padding: 0.5rem 1rem;
  3739. border-radius: 0.5rem;
  3740. font-family: inherit;
  3741. font-size: 0.75rem;
  3742. opacity: 0;
  3743. transition: opacity 0.2s, transform 0.2s;
  3744. z-index: 200;
  3745. pointer-events: none;
  3746. box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  3747. }
  3748. .archify-toast.show {
  3749. opacity: 1;
  3750. transform: translateX(-50%) translateY(0);
  3751. }
  3752. @media (max-width: 720px) {
  3753. body { padding: 1rem; }
  3754. .toolbar .preset-menu,
  3755. .toolbar .export-menu {
  3756. position: fixed;
  3757. top: 4.5rem;
  3758. right: 1rem;
  3759. left: 1rem;
  3760. width: auto;
  3761. max-width: none;
  3762. }
  3763. .toolbar {
  3764. position: relative;
  3765. top: auto;
  3766. right: auto;
  3767. justify-content: flex-end;
  3768. width: max-content;
  3769. max-width: 100%;
  3770. margin-left: auto;
  3771. margin-bottom: 1rem;
  3772. }
  3773. .header { margin-bottom: 1.25rem; padding-right: 0; }
  3774. html[data-preset="signal-flow"] .header,
  3775. html[data-preset="blueprint"] .header,
  3776. html[data-preset="editorial"] .header { padding-right: 0; }
  3777. .header-row {
  3778. gap: 0.75rem;
  3779. align-items: flex-start;
  3780. }
  3781. html[data-preset="signal-flow"] .header-row,
  3782. html[data-preset="blueprint"] .header-row,
  3783. html[data-preset="editorial"] .header-row { flex-wrap: wrap; }
  3784. html[data-preset="signal-flow"] .header-row::after {
  3785. margin-left: 0;
  3786. order: 3;
  3787. }
  3788. html[data-preset="blueprint"] .header-row::after {
  3789. margin-left: 0;
  3790. order: 3;
  3791. }
  3792. html[data-preset="editorial"] .header-row::after {
  3793. margin-left: 0;
  3794. order: 3;
  3795. }
  3796. h1 {
  3797. font-size: 1.25rem;
  3798. line-height: 1.25;
  3799. }
  3800. .subtitle {
  3801. margin-left: 0;
  3802. font-size: 0.8125rem;
  3803. line-height: 1.55;
  3804. }
  3805. .diagram-container {
  3806. padding: 0.75rem;
  3807. border-radius: 0.75rem;
  3808. }
  3809. html:not([data-embed="true"]) .diagram-container {
  3810. padding: 0.75rem 0.75rem 4.25rem;
  3811. }
  3812. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] {
  3813. overflow-x: auto;
  3814. overflow-y: hidden;
  3815. overscroll-behavior-x: contain;
  3816. scrollbar-width: thin;
  3817. scroll-behavior: smooth;
  3818. }
  3819. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {
  3820. min-width: 720px;
  3821. }
  3822. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-nav,
  3823. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .overview-map,
  3824. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .focus-chip,
  3825. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .route-probe,
  3826. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .semantic-lens,
  3827. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .diagram-guide,
  3828. html:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] .node-finder {
  3829. transform: translateX(var(--archify-scroll-x, 0px));
  3830. }
  3831. .diagram-nav { right: 0.5rem; bottom: 0.5rem; }
  3832. .diagram-nav button {
  3833. min-width: 2.75rem;
  3834. height: 2.75rem;
  3835. }
  3836. .diagram-nav [data-view="reset"] { min-width: 3.75rem; }
  3837. .diagram-nav [data-view="reset"][data-detail-visible] { min-width: 4.35rem; }
  3838. .overview-map {
  3839. right: 0.5rem;
  3840. bottom: 3.7rem;
  3841. width: min(10.25rem, calc(100% - 1rem));
  3842. }
  3843. .overview-map[data-docked="true"] {
  3844. right: var(--archify-radar-right, 0.5rem);
  3845. top: var(--archify-radar-top, 0.5rem);
  3846. bottom: auto;
  3847. transform: none !important;
  3848. }
  3849. .overview-map[data-docked="true"][data-dock-side="left"] {
  3850. right: auto;
  3851. left: var(--archify-radar-left, 0.5rem);
  3852. }
  3853. .overview-map-surface { height: 4rem; }
  3854. .overview-map-feedback { right: 0.5rem; bottom: 3.7rem; }
  3855. .semantic-lens {
  3856. right: 0.5rem;
  3857. bottom: 3.7rem;
  3858. width: calc(100% - 1rem);
  3859. max-height: calc(100% - 4.2rem);
  3860. }
  3861. .semantic-lens[data-dock-side] { left: auto; right: 0.5rem; }
  3862. .semantic-lens-kinds { max-height: min(12rem, 34vh); }
  3863. .focus-chip {
  3864. left: 0.5rem;
  3865. top: 0.5rem;
  3866. width: calc(100% - 1rem);
  3867. max-width: none;
  3868. }
  3869. .relationship-lens-head { padding-top: 0.7rem; }
  3870. .relationship-lens-drag-handle { display: none; }
  3871. .relationship-lens-list { max-height: min(12rem, 38vh); }
  3872. .relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }
  3873. .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }
  3874. .focus-chip:not([data-relations-expanded="true"]) .relationship-lens-list { display: none; }
  3875. /* While a mobile reader previews one relationship, turn the full Lens
  3876. into a compact peek card. This keeps the exact source and target on
  3877. canvas instead of covering them with a long, scrollable list. */
  3878. .focus-chip[data-relationship-previewing="true"] .relationship-lens-list {
  3879. max-height: none;
  3880. padding: 0.35rem;
  3881. overflow: hidden;
  3882. }
  3883. .focus-chip[data-relationship-previewing="true"] .relationship-lens-group { margin: 0; }
  3884. .focus-chip[data-relationship-previewing="true"] .relationship-lens-group-title,
  3885. .focus-chip[data-relationship-previewing="true"] .relationship-lens-row:not([data-preview-active="true"]) {
  3886. display: none;
  3887. }
  3888. .node-finder {
  3889. top: 0.5rem;
  3890. left: 0.5rem;
  3891. width: min(22rem, calc(100% - 1rem));
  3892. max-height: calc(100% - 1rem);
  3893. }
  3894. .diagram-guide {
  3895. top: 0.5rem;
  3896. right: 0.5rem;
  3897. left: 0.5rem;
  3898. width: auto;
  3899. max-height: calc(100% - 1rem);
  3900. }
  3901. .diagram-guide-head { padding: 0.62rem 0.7rem 0.52rem; }
  3902. .diagram-guide-stats { padding: 0.42rem 0.7rem; }
  3903. .diagram-guide-actions {
  3904. grid-template-columns: 1fr;
  3905. gap: 0.28rem;
  3906. padding: 0.42rem;
  3907. }
  3908. .diagram-guide-action {
  3909. min-height: 3.1rem;
  3910. padding: 0.42rem 0.48rem;
  3911. }
  3912. .diagram-guide-action small {
  3913. display: block;
  3914. overflow: hidden;
  3915. text-overflow: ellipsis;
  3916. white-space: nowrap;
  3917. }
  3918. .diagram-guide-index {
  3919. width: 1.5rem;
  3920. height: 1.5rem;
  3921. }
  3922. .diagram-guide-shortcuts { padding: 0.46rem 0.7rem 0.52rem; }
  3923. .diagram-guide-action[data-guide-action="present"] { grid-column: auto; }
  3924. .route-probe[data-guide-open="true"] {
  3925. visibility: hidden;
  3926. pointer-events: none;
  3927. }
  3928. .node-finder-results { max-height: min(16rem, 38vh); }
  3929. .route-probe {
  3930. left: 0.5rem;
  3931. bottom: 3.7rem;
  3932. width: calc(100% - 1rem);
  3933. min-width: 0;
  3934. }
  3935. .route-probe[data-route-dock="top"] {
  3936. top: 0.5rem;
  3937. bottom: auto;
  3938. }
  3939. .route-probe[data-finder-open="true"] {
  3940. visibility: hidden;
  3941. pointer-events: none;
  3942. }
  3943. .route-probe-head { padding: 0.45rem 0.48rem 0.38rem; }
  3944. .route-probe-path { padding: 0.35rem 0.48rem 0.2rem; }
  3945. .route-probe-node { min-height: 2.75rem !important; }
  3946. .route-journey-controls {
  3947. grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem minmax(0, 1fr);
  3948. padding: 0.08rem 0.48rem 0.32rem;
  3949. }
  3950. .route-journey-controls button { min-height: 2.75rem; }
  3951. .route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }
  3952. .route-probe-node { max-width: 7.5rem; }
  3953. html[data-embed="true"][data-share-playback="true"] .diagram-container {
  3954. padding-top: 4.25rem;
  3955. }
  3956. html[data-embed="true"][data-share-moment="true"] .diagram-container {
  3957. padding-top: 4.25rem;
  3958. }
  3959. .cards {
  3960. grid-template-columns: 1fr;
  3961. margin-top: 1rem;
  3962. }
  3963. html[data-present="true"]:not([data-embed="true"]) body { padding: 0.5rem; }
  3964. html[data-present="true"]:not([data-embed="true"]) .container {
  3965. gap: 0.5rem;
  3966. height: calc(100dvh - 1rem);
  3967. }
  3968. html[data-present="true"]:not([data-embed="true"]) .toolbar {
  3969. position: fixed;
  3970. top: 0.5rem;
  3971. right: 0.5rem;
  3972. margin: 0;
  3973. gap: 0.25rem;
  3974. }
  3975. html[data-present="true"]:not([data-embed="true"]) .toolbar button {
  3976. min-height: 2.75rem;
  3977. padding: 0.42rem 0.58rem;
  3978. }
  3979. html[data-present="true"]:not([data-embed="true"]) .header {
  3980. min-height: 2.25rem;
  3981. padding: 3.5rem 0 0;
  3982. }
  3983. html[data-present="true"]:not([data-embed="true"]) .header-row {
  3984. min-height: 2.25rem;
  3985. margin: 0;
  3986. align-items: center;
  3987. flex-wrap: nowrap;
  3988. }
  3989. html[data-present="true"]:not([data-embed="true"]) .header-row::after,
  3990. html[data-present="true"]:not([data-embed="true"]) .pulse-dot,
  3991. html[data-present="true"]:not([data-embed="true"]) .subtitle { display: none; }
  3992. html[data-present="true"]:not([data-embed="true"]) h1 {
  3993. flex: 1 1 auto;
  3994. min-width: 0;
  3995. max-width: 100%;
  3996. overflow: hidden;
  3997. font-size: 0.875rem;
  3998. text-overflow: ellipsis;
  3999. white-space: nowrap;
  4000. }
  4001. html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }
  4002. html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {
  4003. width: 720px;
  4004. height: auto;
  4005. min-width: 720px;
  4006. }
  4007. }
  4008. @media (max-width: 420px) {
  4009. .export-menu-section { grid-template-columns: 1fr; }
  4010. .export-menu-heading,
  4011. .toolbar .export-menu button[data-action="route-share-card"],
  4012. .toolbar .export-menu button[data-action="reach-share-card"] { grid-column: 1; }
  4013. }
  4014. @media (prefers-reduced-motion: reduce) {
  4015. .toolbar .preset-menu.open,
  4016. .toolbar .export-menu.open { animation: none; }
  4017. .toolbar-chevron { transition: none; }
  4018. }
  4019. @media (max-width: 360px) {
  4020. .toolbar { gap: 0.25rem; }
  4021. .toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }
  4022. .toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }
  4023. #theme-label, #preset-label, #present-label { display: none; }
  4024. }
  4025. /* ==========================================================
  4026. SVG SEMANTIC CLASSES — use these instead of inline fill/stroke
  4027. ========================================================== */
  4028. .c-grid { stroke: var(--grid); fill: none; }
  4029. .c-mask { fill: var(--mask); stroke: none; }
  4030. .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }
  4031. .c-lane-wash { fill: var(--lane-fill); stroke: none; }
  4032. .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }
  4033. .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }
  4034. .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }
  4035. .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }
  4036. .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }
  4037. .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }
  4038. .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }
  4039. /* Text helpers */
  4040. .t-primary { fill: var(--text); }
  4041. .t-muted { fill: var(--text-muted); }
  4042. .t-dim { fill: var(--text-dim); }
  4043. .t-frontend { fill: var(--frontend-stroke); }
  4044. .t-backend { fill: var(--backend-stroke); }
  4045. .t-database { fill: var(--database-stroke); }
  4046. .t-cloud { fill: var(--cloud-stroke); }
  4047. .t-security { fill: var(--security-stroke); }
  4048. .t-messagebus { fill: var(--messagebus-stroke); }
  4049. .t-external { fill: var(--external-stroke); }
  4050. /* Relationship labels share the exact color token used by their path. */
  4051. .t-edge-default { fill: var(--arrow); }
  4052. .t-edge-emphasis { fill: var(--arrow-emphasis); }
  4053. .t-edge-security { fill: var(--security-stroke); }
  4054. .t-edge-dashed { fill: var(--database-stroke); }
  4055. /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes
  4056. read as lifted cards with hairline strokes. Paint only; authored geometry,
  4057. hit areas and exports keep their canonical shapes. */
  4058. html[data-preset="classic"] .diagram-container {
  4059. background:
  4060. radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,
  4061. var(--panel);
  4062. }
  4063. html[data-preset="classic"] .diagram-container > svg .c-grid { stroke: transparent; }
  4064. html[data-preset="classic"][data-theme="light"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
  4065. --ambient-node-base-filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));
  4066. filter: var(--ambient-node-base-filter);
  4067. }
  4068. html[data-preset="classic"][data-theme="dark"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
  4069. --ambient-node-base-filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
  4070. filter: var(--ambient-node-base-filter);
  4071. }
  4072. html[data-preset="classic"] .diagram-container > svg [data-edge-from] {
  4073. stroke-linecap: round;
  4074. stroke-linejoin: round;
  4075. }
  4076. html[data-preset="classic"] .diagram-container > svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }
  4077. html[data-preset="classic"] .diagram-container > svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }
  4078. html[data-preset="classic"][data-theme="dark"] .diagram-container > svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }
  4079. html[data-preset="classic"] .diagram-container > svg [data-node-id] {
  4080. transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  4081. }
  4082. html[data-preset="classic"]:not([data-motion="still"]) .diagram-container > svg [data-node-id]:hover {
  4083. transform: translateY(-1.5px);
  4084. }
  4085. /* Semantic Sigils are small authored role stamps, not icons from a brand
  4086. pack and not viewer controls. Prefix selectors with svg so the canonical
  4087. export's SVG-only stylesheet collector keeps them automatically. */
  4088. svg .semantic-sigil {
  4089. fill: none;
  4090. stroke: currentColor;
  4091. stroke-width: 1.35;
  4092. stroke-linecap: round;
  4093. stroke-linejoin: round;
  4094. opacity: 0.76;
  4095. pointer-events: none;
  4096. }
  4097. svg .semantic-sigil > * { vector-effect: non-scaling-stroke; }
  4098. svg .semantic-sigil .sigil-fill { fill: currentColor; stroke: none; }
  4099. svg .s-frontend { color: var(--frontend-stroke); }
  4100. svg .s-backend { color: var(--backend-stroke); }
  4101. svg .s-database { color: var(--database-stroke); }
  4102. svg .s-cloud { color: var(--cloud-stroke); }
  4103. svg .s-security { color: var(--security-stroke); }
  4104. svg .s-messagebus { color: var(--messagebus-stroke); }
  4105. svg .s-external { color: var(--external-stroke); }
  4106. /* Brand Marks are authored identity badges. Their color is contained
  4107. inside one neutral plate so vendor color never replaces Archify's
  4108. semantic node and relationship vocabulary. */
  4109. svg .brand-mark { pointer-events: none; }
  4110. svg .brand-mark-badge { fill: #fff; stroke: none; }
  4111. svg .brand-mark-frame {
  4112. fill: none;
  4113. stroke: #cbd5e1;
  4114. stroke-width: 0.8;
  4115. vector-effect: non-scaling-stroke;
  4116. }
  4117. svg .brand-mark-fallback {
  4118. fill: none;
  4119. stroke: #475569;
  4120. stroke-width: 1.15;
  4121. stroke-linecap: round;
  4122. stroke-linejoin: round;
  4123. }
  4124. svg[data-preset="blueprint"] .brand-mark-badge,
  4125. svg[data-preset="blueprint"] .brand-mark-frame { rx: 1px; }
  4126. /* Reading Depth is a viewer-only level-of-detail layer. MAP preserves the
  4127. authored structure and primary labels, READ restores relationship labels
  4128. and node context, and FULL restores tags and fine annotations. Semantic
  4129. intent can reveal the relevant detail without moving any geometry. */
  4130. svg [data-detail] { transition: opacity 160ms ease; }
  4131. svg [data-detail-anchor] {
  4132. transform-box: fill-box;
  4133. transform-origin: center;
  4134. transition: transform 160ms ease;
  4135. }
  4136. .diagram-container[data-detail-level="map"] svg [data-detail="context"],
  4137. .diagram-container[data-detail-level="map"] svg [data-detail="fine"],
  4138. .diagram-container[data-detail-level="read"] svg [data-detail="fine"] {
  4139. opacity: 0;
  4140. pointer-events: none;
  4141. }
  4142. .diagram-container[data-detail-level="map"] svg [data-detail-anchor] {
  4143. transform: translateY(8px);
  4144. }
  4145. /* Focus, lens, preview, route, and story states are stronger reader intent than
  4146. the global zoom level. Reveal only their exact semantic matches. */
  4147. svg[data-focus-active] [data-focus-match][data-detail],
  4148. svg[data-focus-active] [data-focus-match] [data-detail],
  4149. svg[data-reach-active] [data-reach-match][data-detail],
  4150. svg[data-reach-active] [data-reach-match] [data-detail],
  4151. svg[data-lens-active] [data-lens-match][data-detail],
  4152. svg[data-lens-active] [data-lens-match] [data-detail],
  4153. svg[data-legend-preview-active] [data-legend-preview-match][data-detail],
  4154. svg[data-legend-preview-active] [data-legend-preview-match] [data-detail],
  4155. svg[data-intent-trace-active] [data-intent-trace-match][data-detail],
  4156. svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],
  4157. svg[data-route-active] [data-route-match][data-detail],
  4158. svg[data-route-active] [data-route-match] [data-detail],
  4159. svg[data-relationship-preview-active] [data-relationship-preview][data-detail],
  4160. svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],
  4161. svg [data-node-id]:hover [data-detail],
  4162. svg [data-node-id]:focus-visible [data-detail] {
  4163. opacity: 1;
  4164. pointer-events: auto;
  4165. }
  4166. svg[data-focus-active] [data-focus-match] [data-detail-anchor],
  4167. svg[data-reach-active] [data-reach-match] [data-detail-anchor],
  4168. svg[data-lens-active] [data-lens-match] [data-detail-anchor],
  4169. svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],
  4170. svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],
  4171. svg[data-route-active] [data-route-match] [data-detail-anchor],
  4172. svg [data-node-id]:hover [data-detail-anchor],
  4173. svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }
  4174. /* Arrows */
  4175. .a-default { stroke: var(--arrow); fill: none; }
  4176. .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }
  4177. .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }
  4178. .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }
  4179. /* Arrowhead markers reference these */
  4180. .m-default { fill: var(--arrow); }
  4181. .m-emphasis { fill: var(--arrow-emphasis); }
  4182. .m-security { fill: var(--security-stroke); }
  4183. .m-dashed { fill: var(--database-stroke); }
  4184. /* Stable semantic exploration hooks emitted by every renderer. */
  4185. svg [data-node-id] {
  4186. cursor: pointer;
  4187. transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;
  4188. }
  4189. svg [data-edge-from],
  4190. svg [data-graph-role="automatic-crossover-underlay"] { transition: opacity 0.18s ease, filter 0.18s ease; }
  4191. svg [data-node-id]:hover,
  4192. svg [data-node-id]:focus-visible {
  4193. filter: drop-shadow(0 0 7px var(--frontend-stroke));
  4194. outline: none;
  4195. }
  4196. svg [data-legend-kind][role="button"] { cursor: pointer; }
  4197. svg [data-legend-kind]:focus { outline: none; }
  4198. svg [data-legend-hit] {
  4199. fill: transparent;
  4200. stroke: transparent;
  4201. stroke-width: 1.4;
  4202. pointer-events: all;
  4203. vector-effect: non-scaling-stroke;
  4204. transition: stroke 150ms ease, stroke-width 150ms ease, filter 150ms ease;
  4205. }
  4206. svg [data-legend-count-badge] { pointer-events: none; }
  4207. svg [data-legend-count-badge] rect {
  4208. fill: var(--mask);
  4209. stroke: var(--panel-border);
  4210. stroke-width: 1;
  4211. vector-effect: non-scaling-stroke;
  4212. }
  4213. svg [data-legend-count-badge] text {
  4214. fill: var(--text-muted);
  4215. font-size: 8px;
  4216. font-weight: 700;
  4217. text-anchor: middle;
  4218. }
  4219. svg [data-legend-kind][role="button"]:hover [data-legend-hit] {
  4220. stroke: color-mix(in srgb, var(--database-stroke) 58%, transparent);
  4221. }
  4222. svg [data-legend-kind][role="button"]:focus-visible [data-legend-hit] {
  4223. stroke: var(--frontend-stroke);
  4224. stroke-width: 1.8;
  4225. filter: drop-shadow(0 0 3px var(--frontend-stroke));
  4226. }
  4227. svg [data-legend-kind][data-legend-selected] [data-legend-hit] {
  4228. stroke: var(--database-stroke);
  4229. stroke-width: 2.2;
  4230. stroke-dasharray: 3 2;
  4231. }
  4232. svg [data-legend-kind][data-legend-selected] [data-legend-count-badge] rect {
  4233. stroke: var(--database-stroke);
  4234. stroke-width: 1.8;
  4235. }
  4236. svg [data-legend-kind][data-legend-zero] { opacity: 0.44; }
  4237. svg[data-preset="signal-flow"] [data-legend-kind][data-legend-selected] [data-legend-hit] {
  4238. filter: drop-shadow(0 0 4px var(--database-stroke));
  4239. }
  4240. svg[data-preset="blueprint"] [data-legend-hit],
  4241. svg[data-preset="blueprint"] [data-legend-count-badge] rect { rx: 0; filter: none; }
  4242. svg[data-legend-preview-active] [data-node-id],
  4243. svg[data-legend-preview-active] [data-edge-from] { opacity: 0.11; }
  4244. svg[data-legend-preview-active] [data-legend-preview-match] { opacity: 1; }
  4245. svg[data-legend-preview-active] [data-legend-preview-peer] { opacity: 0.62; }
  4246. svg[data-legend-preview-active] [data-legend-preview-selected] {
  4247. filter: drop-shadow(0 0 8px var(--database-stroke));
  4248. }
  4249. svg[data-lens-active] [data-node-id],
  4250. svg[data-lens-active] [data-edge-from] { opacity: 0.11; }
  4251. svg[data-lens-active] [data-lens-match] { opacity: 1; }
  4252. svg[data-lens-active] [data-lens-peer] { opacity: 0.62; }
  4253. svg[data-lens-active] [data-lens-selected] {
  4254. filter: drop-shadow(0 0 10px var(--database-stroke));
  4255. }
  4256. .semantic-lens-overlay { pointer-events: none; }
  4257. .semantic-lens-flow {
  4258. fill: none;
  4259. stroke-width: 3.05;
  4260. stroke-linecap: round;
  4261. stroke-dasharray: 0.075 0.925;
  4262. stroke-dashoffset: 0;
  4263. vector-effect: non-scaling-stroke;
  4264. opacity: 0.9;
  4265. animation: archify-semantic-lens-flow 1.35s linear 1 both;
  4266. animation-delay: var(--lens-flow-delay, 0s);
  4267. }
  4268. .semantic-lens-flow[data-direction="out"],
  4269. .semantic-lens-flow[data-direction="forward"] {
  4270. stroke: var(--frontend-stroke);
  4271. filter: drop-shadow(0 0 3px var(--frontend-stroke));
  4272. }
  4273. .semantic-lens-flow[data-direction="in"],
  4274. .semantic-lens-flow[data-direction="reverse"] {
  4275. stroke: var(--database-stroke);
  4276. filter: drop-shadow(0 0 3px var(--database-stroke));
  4277. }
  4278. .semantic-lens-flow[data-direction="within"] {
  4279. stroke: var(--messagebus-stroke);
  4280. filter: drop-shadow(0 0 3px var(--messagebus-stroke));
  4281. }
  4282. svg[data-preset="signal-flow"] .semantic-lens-flow {
  4283. stroke-width: 3.7;
  4284. opacity: 1;
  4285. }
  4286. svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="out"],
  4287. svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="forward"] {
  4288. filter: drop-shadow(0 0 6px var(--frontend-stroke));
  4289. }
  4290. svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="in"],
  4291. svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="reverse"] {
  4292. filter: drop-shadow(0 0 6px var(--database-stroke));
  4293. }
  4294. svg[data-preset="signal-flow"] .semantic-lens-flow[data-direction="within"] {
  4295. filter: drop-shadow(0 0 6px var(--messagebus-stroke));
  4296. }
  4297. svg[data-preset="blueprint"] .semantic-lens-flow {
  4298. stroke-width: 2.45;
  4299. stroke-linecap: square;
  4300. filter: none;
  4301. opacity: 0.78;
  4302. }
  4303. html[data-embed="true"] .semantic-lens-overlay { display: none; }
  4304. /* Automatic crossover masks are visual companions of their one semantic
  4305. edge. Keep the mask free of data-edge-* identity so graph traversal and
  4306. export still observe exactly one edge, then mirror reader emphasis from
  4307. the paired foreground path in this presentation-only wrapper. */
  4308. svg[data-legend-preview-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"],
  4309. svg[data-lens-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
  4310. svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-match]) > [data-graph-role="automatic-crossover-underlay"],
  4311. svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4312. svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-peer]) > [data-graph-role="automatic-crossover-underlay"],
  4313. svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-peer]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
  4314. svg[data-focus-active] [data-node-id],
  4315. svg[data-focus-active] [data-edge-from] { opacity: 0.13; }
  4316. svg[data-focus-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.13; }
  4317. svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }
  4318. svg[data-focus-active] [data-focus-match] { opacity: 1; }
  4319. svg[data-focus-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4320. svg[data-focus-active] [data-focus-selected] {
  4321. filter: drop-shadow(0 0 10px var(--frontend-stroke));
  4322. }
  4323. /* Authored Reachability is a bounded graph query over the relationships
  4324. already present in the artifact. Upstream walks incoming edges;
  4325. downstream walks outgoing edges. It never claims runtime causality and
  4326. changes only viewer emphasis, not canonical geometry or export bytes. */
  4327. svg[data-reach-active] [data-node-id],
  4328. svg[data-reach-active] [data-edge-from] { opacity: 0.09; }
  4329. svg[data-reach-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.09; }
  4330. svg[data-reach-active] [data-reach-match] { opacity: 1; }
  4331. svg[data-reach-active] [data-graph-role="automatic-crossover"]:has(> [data-reach-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4332. svg[data-reach-active="upstream"] [data-reach-origin] {
  4333. filter: drop-shadow(0 0 11px var(--database-stroke));
  4334. }
  4335. svg[data-reach-active="downstream"] [data-reach-origin] {
  4336. filter: drop-shadow(0 0 11px var(--backend-stroke));
  4337. }
  4338. svg[data-reach-active="upstream"] [data-edge-from][data-reach-match] {
  4339. filter: drop-shadow(0 0 4px color-mix(in srgb, var(--database-stroke) 72%, transparent));
  4340. }
  4341. svg[data-reach-active="downstream"] [data-edge-from][data-reach-match] {
  4342. filter: drop-shadow(0 0 4px color-mix(in srgb, var(--backend-stroke) 72%, transparent));
  4343. }
  4344. svg[data-preset="blueprint"][data-reach-active] [data-reach-origin],
  4345. svg[data-preset="blueprint"][data-reach-active] [data-edge-from][data-reach-match] {
  4346. filter: none;
  4347. }
  4348. /* Direct Relationship Explorer makes authored paths a real input surface
  4349. without changing their visible stroke or canonical SVG. A transparent
  4350. runtime rail supplies forgiving pointer geometry; the exact authored
  4351. path and endpoints continue to carry every visible state. */
  4352. .relationship-hit-overlay { pointer-events: none; }
  4353. .relationship-hit-target { outline: none; }
  4354. .relationship-hit-rail {
  4355. fill: none;
  4356. stroke: transparent;
  4357. stroke-width: 24;
  4358. stroke-linecap: round;
  4359. stroke-linejoin: round;
  4360. vector-effect: non-scaling-stroke;
  4361. pointer-events: stroke;
  4362. cursor: pointer;
  4363. }
  4364. .relationship-focus-rail {
  4365. fill: none;
  4366. stroke: color-mix(in srgb, var(--frontend-stroke) 34%, transparent);
  4367. stroke-width: 6;
  4368. stroke-dasharray: 2 4;
  4369. stroke-linecap: round;
  4370. stroke-linejoin: round;
  4371. vector-effect: non-scaling-stroke;
  4372. pointer-events: none;
  4373. opacity: 0;
  4374. }
  4375. .relationship-hit-target:focus-visible .relationship-focus-rail {
  4376. opacity: 1;
  4377. }
  4378. svg[data-preset="blueprint"] .relationship-hit-target:focus-visible .relationship-focus-rail {
  4379. stroke-linecap: square;
  4380. filter: none;
  4381. }
  4382. svg[data-relationship-direct-active] [data-node-id],
  4383. svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }
  4384. svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.16; }
  4385. svg[data-relationship-direct-active] [data-relationship-preview],
  4386. svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }
  4387. svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4388. svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,
  4389. svg[data-route-picking] .relationship-hit-rail,
  4390. svg[data-route-active] .relationship-hit-rail,
  4391. svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }
  4392. html[data-embed="true"] .relationship-hit-overlay { display: none; }
  4393. @media (hover: none), (pointer: coarse) {
  4394. .relationship-hit-rail { stroke-width: 24; }
  4395. }
  4396. /* Relationship Preview is temporary exploration state layered on top of
  4397. neighborhood focus. It changes emphasis only; exported geometry and the
  4398. relationship's original solid/dashed visual language stay untouched. */
  4399. svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }
  4400. svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.18; }
  4401. svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }
  4402. svg[data-relationship-preview-active] [data-relationship-preview],
  4403. svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }
  4404. svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4405. svg[data-relationship-preview-active] [data-relationship-preview] {
  4406. filter: drop-shadow(0 0 5px var(--arrow-emphasis));
  4407. }
  4408. svg[data-relationship-preview-active] [data-relationship-preview] path,
  4409. svg[data-relationship-preview-active] path[data-relationship-preview],
  4410. svg[data-relationship-preview-active] [data-relationship-preview] line,
  4411. svg[data-relationship-preview-active] line[data-relationship-preview],
  4412. svg[data-relationship-preview-active] [data-relationship-preview] polyline,
  4413. svg[data-relationship-preview-active] polyline[data-relationship-preview] {
  4414. stroke-width: 2.75;
  4415. }
  4416. svg[data-relationship-preview-active] [data-relationship-preview-source] {
  4417. filter: drop-shadow(0 0 7px var(--frontend-stroke));
  4418. }
  4419. svg[data-relationship-preview-active] [data-relationship-preview-target] {
  4420. filter: drop-shadow(0 0 7px var(--database-stroke));
  4421. }
  4422. .relationship-pulse-overlay { pointer-events: none; }
  4423. .relationship-flow-pulse {
  4424. fill: none;
  4425. stroke: var(--arrow-emphasis);
  4426. stroke-width: 3.35;
  4427. stroke-linecap: round;
  4428. stroke-dasharray: 0.085 0.915;
  4429. stroke-dashoffset: 0;
  4430. vector-effect: non-scaling-stroke;
  4431. opacity: 0;
  4432. filter: drop-shadow(0 0 4px var(--arrow-emphasis));
  4433. animation: archify-relationship-pulse 1.2s linear 1 both;
  4434. }
  4435. svg[data-preset="signal-flow"] .relationship-flow-pulse {
  4436. stroke: var(--frontend-stroke);
  4437. stroke-width: 3.85;
  4438. filter: drop-shadow(0 0 7px var(--frontend-stroke));
  4439. }
  4440. svg[data-preset="blueprint"] .relationship-flow-pulse {
  4441. stroke-width: 2.5;
  4442. stroke-linecap: square;
  4443. filter: none;
  4444. }
  4445. svg[data-preset="editorial"] .relationship-flow-pulse {
  4446. stroke: var(--arrow-emphasis);
  4447. stroke-width: 2.75;
  4448. filter: none;
  4449. }
  4450. .semantic-flow-token {
  4451. color: var(--frontend-stroke);
  4452. opacity: 0;
  4453. pointer-events: none;
  4454. }
  4455. .relationship-flow-token {
  4456. animation: archify-relationship-token-life 1.2s linear 1 both;
  4457. }
  4458. .semantic-flow-token-halo {
  4459. fill: var(--mask);
  4460. stroke: currentColor;
  4461. stroke-width: 1.1;
  4462. vector-effect: non-scaling-stroke;
  4463. opacity: 0.96;
  4464. }
  4465. .relationship-flow-token-shape {
  4466. fill: var(--mask);
  4467. stroke: currentColor;
  4468. stroke-width: 1.35;
  4469. stroke-linecap: round;
  4470. stroke-linejoin: round;
  4471. vector-effect: non-scaling-stroke;
  4472. }
  4473. .relationship-flow-token-ink {
  4474. fill: none;
  4475. stroke: currentColor;
  4476. stroke-width: 1.05;
  4477. stroke-linecap: round;
  4478. vector-effect: non-scaling-stroke;
  4479. }
  4480. .relationship-flow-token-dot { fill: currentColor; stroke: none; }
  4481. .semantic-flow-token[data-token-kind="data"] { color: var(--database-stroke); }
  4482. .semantic-flow-token[data-token-kind="event"] { color: var(--messagebus-stroke); }
  4483. .semantic-flow-token[data-token-kind="security"] { color: var(--security-stroke); }
  4484. .semantic-flow-token[data-token-kind="state"] { color: var(--cloud-stroke); }
  4485. svg[data-preset="signal-flow"] .semantic-flow-token {
  4486. filter: drop-shadow(0 0 5px currentColor);
  4487. }
  4488. svg[data-preset="blueprint"] .semantic-flow-token { filter: none; }
  4489. svg[data-preset="editorial"] .semantic-flow-token { filter: none; }
  4490. html[data-embed="true"] .relationship-pulse-overlay { display: none; }
  4491. /* Intent Trace is a temporary, pre-click exploration layer. Related
  4492. topology stays readable while a short viewer-only signal runs over
  4493. cloned edge geometry; the authored edge remains untouched underneath. */
  4494. /* Keep the node's opaque backing mask intact while its visible ink dims.
  4495. Fading the whole group also fades that mask and briefly exposes arrows
  4496. routed underneath the node when the pointer leaves. */
  4497. svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }
  4498. svg [data-node-id] > .c-mask { fill-opacity: 1; }
  4499. svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }
  4500. svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }
  4501. svg[data-intent-trace-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.2; }
  4502. svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }
  4503. svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }
  4504. svg[data-intent-trace-active] [data-graph-role="automatic-crossover"]:has(> [data-intent-trace-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4505. svg[data-intent-trace-active] [data-intent-trace-selected] {
  4506. filter: drop-shadow(0 0 10px var(--frontend-stroke));
  4507. }
  4508. .intent-trace-overlay { pointer-events: none; }
  4509. .intent-trace-flow {
  4510. fill: none;
  4511. stroke-width: 3.1;
  4512. stroke-linecap: round;
  4513. stroke-dasharray: 0.1 0.9;
  4514. stroke-dashoffset: 0;
  4515. vector-effect: non-scaling-stroke;
  4516. opacity: 0.94;
  4517. animation: archify-intent-trace-flow 1.15s linear 1 both;
  4518. }
  4519. /* Direction names describe each edge relative to the focused node only.
  4520. The cloned geometry already runs from the authored source to target, so
  4521. incoming and outgoing signals must share the same playback direction. */
  4522. .intent-trace-flow[data-direction="out"] {
  4523. stroke: var(--frontend-stroke);
  4524. filter: drop-shadow(0 0 4px var(--frontend-stroke));
  4525. }
  4526. .intent-trace-flow[data-direction="in"] {
  4527. stroke: var(--database-stroke);
  4528. filter: drop-shadow(0 0 4px var(--database-stroke));
  4529. animation-direction: normal;
  4530. }
  4531. .intent-trace-flow[data-direction="loop"] {
  4532. stroke: var(--security-stroke);
  4533. filter: drop-shadow(0 0 4px var(--security-stroke));
  4534. }
  4535. svg[data-preset="blueprint"] [data-intent-trace-selected],
  4536. svg[data-preset="blueprint"] .intent-trace-flow {
  4537. filter: none;
  4538. stroke-linecap: square;
  4539. }
  4540. svg[data-preset="editorial"] [data-intent-trace-selected],
  4541. svg[data-preset="editorial"] .intent-trace-flow { filter: none; }
  4542. .intent-trace-status {
  4543. position: absolute;
  4544. width: 1px;
  4545. height: 1px;
  4546. padding: 0;
  4547. margin: -1px;
  4548. overflow: hidden;
  4549. clip: rect(0, 0, 0, 0);
  4550. clip-path: inset(50%);
  4551. white-space: nowrap;
  4552. border: 0;
  4553. }
  4554. /* Route Probe separates a durable two-point query from selection and
  4555. one-hop hover. Only the chosen shortest directed path stays prominent;
  4556. the traveling signal is cloned viewer geometry and never authored SVG. */
  4557. svg[data-route-picking="target"] [data-node-id] { opacity: 0.24; }
  4558. svg[data-route-picking="target"] [data-route-candidate],
  4559. svg[data-route-picking="target"] [data-route-start] { opacity: 1; }
  4560. svg[data-route-picking] [data-node-id] { cursor: crosshair; }
  4561. svg[data-route-picking] [data-route-start] {
  4562. filter: drop-shadow(0 0 10px var(--frontend-stroke));
  4563. }
  4564. svg[data-route-active] [data-node-id],
  4565. svg[data-route-active] [data-edge-from] { opacity: 0.11; }
  4566. svg[data-route-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
  4567. svg[data-route-active] [data-route-match] { opacity: 1; }
  4568. svg[data-route-active] [data-graph-role="automatic-crossover"]:has(> [data-route-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4569. svg[data-route-active] [data-route-start] {
  4570. filter: drop-shadow(0 0 11px var(--frontend-stroke));
  4571. }
  4572. svg[data-route-active] [data-route-end] {
  4573. filter: drop-shadow(0 0 11px var(--security-stroke));
  4574. }
  4575. svg[data-route-active] [data-route-step]:not([data-route-start]):not([data-route-end]) {
  4576. filter: drop-shadow(0 0 7px var(--backend-stroke));
  4577. }
  4578. svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }
  4579. svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }
  4580. svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }
  4581. svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="past"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
  4582. svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="future"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.34; }
  4583. svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="current"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
  4584. svg[data-route-journey] [data-node-id][data-route-journey-current] {
  4585. filter: drop-shadow(0 0 10px var(--backend-stroke));
  4586. }
  4587. svg[data-route-journey] [data-edge-from][data-route-journey-current] {
  4588. opacity: 1;
  4589. filter: drop-shadow(0 0 6px var(--backend-stroke));
  4590. }
  4591. .route-probe-overlay { pointer-events: none; }
  4592. .route-journey-overlay { pointer-events: none; }
  4593. .route-probe-flow {
  4594. fill: none;
  4595. stroke: var(--backend-stroke);
  4596. stroke-width: 3.25;
  4597. stroke-linecap: round;
  4598. stroke-dasharray: 0.085 0.915;
  4599. stroke-dashoffset: 0;
  4600. vector-effect: non-scaling-stroke;
  4601. opacity: 0.96;
  4602. filter: drop-shadow(0 0 5px var(--backend-stroke));
  4603. animation: archify-route-probe-flow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 1 both;
  4604. animation-delay: calc(var(--route-step, 0) * 0.16s);
  4605. }
  4606. .route-journey-flow {
  4607. fill: none;
  4608. stroke: var(--backend-stroke);
  4609. stroke-width: 3.5;
  4610. stroke-linecap: round;
  4611. stroke-dasharray: 0.1 0.9;
  4612. stroke-dashoffset: 0;
  4613. vector-effect: non-scaling-stroke;
  4614. opacity: 0;
  4615. filter: drop-shadow(0 0 6px var(--backend-stroke));
  4616. animation: archify-route-journey-flow 780ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;
  4617. }
  4618. svg[data-preset="blueprint"] [data-route-start],
  4619. svg[data-preset="blueprint"] [data-route-end],
  4620. svg[data-preset="blueprint"] [data-route-step],
  4621. svg[data-preset="blueprint"] .route-probe-flow {
  4622. filter: none;
  4623. stroke-linecap: square;
  4624. }
  4625. svg[data-preset="blueprint"] .route-journey-flow {
  4626. filter: none;
  4627. stroke-linecap: square;
  4628. }
  4629. svg[data-preset="editorial"] [data-route-start],
  4630. svg[data-preset="editorial"] [data-route-end],
  4631. svg[data-preset="editorial"] [data-route-step],
  4632. svg[data-preset="editorial"] .route-probe-flow,
  4633. svg[data-preset="editorial"] .route-journey-flow { filter: none; }
  4634. svg[data-preset="editorial"] .c-grid {
  4635. stroke-dasharray: 1 4;
  4636. opacity: 0.48;
  4637. }
  4638. svg[data-preset="editorial"] .c-region {
  4639. fill: color-mix(in srgb, var(--cloud-fill) 48%, transparent);
  4640. stroke-dasharray: 9 4;
  4641. }
  4642. svg[data-preset="editorial"] [data-node-id]:hover,
  4643. svg[data-preset="editorial"] [data-node-id]:focus-visible,
  4644. svg[data-preset="editorial"][data-focus-active] [data-focus-selected] {
  4645. filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent));
  4646. }
  4647. svg[data-preset="blueprint"] .c-grid {
  4648. stroke-dasharray: 1 3;
  4649. opacity: 0.78;
  4650. }
  4651. svg[data-preset="blueprint"] .c-region {
  4652. fill: color-mix(in srgb, var(--cloud-fill) 58%, transparent);
  4653. stroke-dasharray: 12 4 2 4;
  4654. }
  4655. svg[data-preset="blueprint"] .c-security-group,
  4656. svg[data-preset="blueprint"] .c-lane { stroke-dasharray: 7 3; }
  4657. svg[data-preset="blueprint"] [data-node-id]:hover,
  4658. svg[data-preset="blueprint"] [data-node-id]:focus-visible {
  4659. filter: drop-shadow(0 0 3px var(--frontend-stroke));
  4660. }
  4661. svg[data-preset="blueprint"][data-focus-active] [data-focus-selected] {
  4662. filter: drop-shadow(0 0 3px var(--frontend-stroke));
  4663. }
  4664. svg[data-preset="blueprint"][data-focus-active][data-reach-active] [data-focus-selected][data-reach-origin] {
  4665. filter: none;
  4666. }
  4667. svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview],
  4668. svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-source],
  4669. svg[data-preset="blueprint"][data-relationship-preview-active] [data-relationship-preview-target] {
  4670. filter: drop-shadow(0 0 3px var(--frontend-stroke));
  4671. }
  4672. /* Dashed boundary variants */
  4673. .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }
  4674. .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }
  4675. .c-lane { fill: var(--lane-fill); stroke: var(--lane-stroke); stroke-dasharray: 6,6; }
  4676. /* Live plays one relay per cycle: a comet (halo, tail, head) leaves each
  4677. source when the signal reaches it, travels at one shared speed, leaves a
  4678. soft wake, and lands as a ripple while its target glows. Downstream edges
  4679. depart only after their source is reached, so the reader sees the path the
  4680. diagram describes rather than every edge shimmering at once. Sequence
  4681. messages relay in authored chronological order. Motion Governor plans the
  4682. timeline and its per-edge keyframes; this stylesheet owns appearance.
  4683. Original line language and markers remain static. Node entry is bounded to
  4684. one pass per document. */
  4685. svg[data-animation="trace"] {
  4686. --flow-cycle: 6.4s;
  4687. --flow-halo-peak: 0.17;
  4688. --flow-glow-peak: 0.5;
  4689. --flow-tail-peak: 0.42;
  4690. --flow-head-peak: 0.95;
  4691. --flow-wake-peak: 0.3;
  4692. --flow-ripple-peak: 0.65;
  4693. }
  4694. .ambient-edge-flow {
  4695. fill: none;
  4696. stroke: var(--arrow-emphasis);
  4697. stroke-linecap: round;
  4698. pointer-events: none;
  4699. display: none;
  4700. }
  4701. .ambient-flow-wake {
  4702. --flow-peak: var(--flow-wake-peak, 0.3);
  4703. stroke-width: 3.2;
  4704. stroke-dasharray: var(--flow-dasharray, none);
  4705. }
  4706. .ambient-flow-halo {
  4707. --flow-peak: var(--flow-halo-peak, 0.17);
  4708. stroke-width: 6;
  4709. stroke-dasharray: var(--flow-dash, 12px) calc(var(--flow-len, 0px) - var(--flow-dash, 12px));
  4710. }
  4711. /* A wide blurred streak centered on the head: this is the bloom that makes
  4712. the comet read as a traveling orb of light rather than a bright dash. */
  4713. .ambient-flow-glow {
  4714. --flow-peak: var(--flow-glow-peak, 0.5);
  4715. stroke-width: 9;
  4716. stroke-dasharray: var(--flow-dash, 12px) calc(var(--flow-len, 0px) - var(--flow-dash, 12px));
  4717. filter: blur(2.5px);
  4718. }
  4719. .ambient-flow-tail {
  4720. --flow-peak: var(--flow-tail-peak, 0.42);
  4721. stroke-width: 2.4;
  4722. stroke-dasharray: var(--flow-dasharray, var(--flow-dash, 20px) calc(var(--flow-len, 0px) - var(--flow-dash, 20px)));
  4723. }
  4724. .ambient-flow-head {
  4725. --flow-peak: var(--flow-head-peak, 0.95);
  4726. stroke: color-mix(in srgb, var(--arrow-emphasis) 40%, white);
  4727. stroke-width: 2.6;
  4728. stroke-dasharray: var(--flow-dash, 6px) calc(var(--flow-len, 0px) - var(--flow-dash, 6px));
  4729. }
  4730. .ambient-flow-ripple {
  4731. --flow-peak: var(--flow-ripple-peak, 0.65);
  4732. stroke: color-mix(in srgb, var(--arrow-emphasis) 55%, white);
  4733. stroke-width: 2;
  4734. }
  4735. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden]) .ambient-edge-flow {
  4736. display: inline;
  4737. animation-name: var(--flow-name, none);
  4738. animation-duration: var(--flow-cycle, 6.4s);
  4739. animation-timing-function: linear;
  4740. animation-iteration-count: infinite;
  4741. animation-delay: var(--flow-delay, 0s);
  4742. /* Without backwards fill a delayed layer would sit at its natural opacity
  4743. (fully lit) until its departure arrives. */
  4744. animation-fill-mode: backwards;
  4745. }
  4746. /* Stream packets trail the comet head as smaller, dimmer beads. */
  4747. .ambient-flow-head.packet {
  4748. --flow-peak: calc(var(--flow-head-peak, 0.95) * 0.62);
  4749. stroke-width: 3.4;
  4750. }
  4751. /* Timeline and waterfall playhead: a crisp rule over a soft bloom. */
  4752. .ambient-flow-playhead {
  4753. --flow-peak: 0.9;
  4754. stroke: color-mix(in srgb, var(--arrow-emphasis) 55%, white);
  4755. stroke-width: 1.6;
  4756. }
  4757. .ambient-flow-playhead-glow {
  4758. --flow-peak: 0.32;
  4759. stroke-width: 10;
  4760. filter: blur(4px);
  4761. }
  4762. /* Waterfall spans fill in proportion to their measured time, then settle. */
  4763. .ambient-flow-fill {
  4764. --flow-peak: 0.5;
  4765. fill: color-mix(in srgb, var(--flow-fill, var(--arrow-emphasis)) 55%, white);
  4766. stroke: none;
  4767. transform-box: fill-box;
  4768. transform-origin: left center;
  4769. }
  4770. .ambient-flow-fill-failed { fill: var(--security-stroke); --flow-peak: 0.5; }
  4771. html[data-theme="light"] .ambient-flow-playhead { stroke: color-mix(in srgb, var(--arrow-emphasis) 70%, black); }
  4772. html[data-theme="light"] .ambient-flow-fill { --flow-peak: 0.42; fill: color-mix(in srgb, var(--flow-fill, var(--arrow-emphasis)) 70%, black); }
  4773. svg[data-preset="editorial"] .ambient-flow-fill { --flow-peak: 0.2; }
  4774. svg[data-preset="editorial"] .ambient-flow-playhead-glow { --flow-peak: 0.14; }
  4775. /* Each decorative flow follows its owning edge through tree visibility. */
  4776. .ambient-edge-flow[data-tree-hidden] { display: none !important; animation: none !important; }
  4777. svg[data-preset="blueprint"] .ambient-edge-flow { stroke-linecap: square; }
  4778. svg[data-preset="editorial"] { --flow-halo-peak: 0.07; --flow-glow-peak: 0.28; --flow-tail-peak: 0.2; --flow-head-peak: 0.7; --flow-wake-peak: 0.14; --flow-ripple-peak: 0.3; }
  4779. /* On light canvases the relay reads by saturation instead of bloom: the head
  4780. and ripple mix toward ink instead of white, and every layer's peak rises so
  4781. the wave survives the bright background. */
  4782. html[data-theme="light"] svg[data-animation="trace"] {
  4783. --flow-halo-peak: 0.22;
  4784. --flow-glow-peak: 0.4;
  4785. --flow-tail-peak: 0.5;
  4786. --flow-wake-peak: 0.34;
  4787. }
  4788. html[data-theme="light"] .ambient-flow-head {
  4789. stroke: color-mix(in srgb, var(--arrow-emphasis) 55%, black);
  4790. stroke-width: 2.8;
  4791. }
  4792. html[data-theme="light"] .ambient-flow-ripple {
  4793. stroke: color-mix(in srgb, var(--arrow-emphasis) 65%, black);
  4794. }
  4795. html[data-ambient-entry="running"] svg[data-animation="trace"] [data-animate="node"] {
  4796. transform-box: fill-box;
  4797. transform-origin: center;
  4798. animation: archify-node-pulse 3.6s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4799. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4800. }
  4801. html[data-ambient-entry="running"] svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {
  4802. animation: archify-node-pulse 3.1s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4803. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4804. }
  4805. html[data-ambient-entry="running"] svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {
  4806. animation: archify-blueprint-node-pulse 3.8s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4807. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4808. }
  4809. html[data-ambient-entry="running"] svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {
  4810. animation: archify-editorial-node-pulse 3.5s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4811. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4812. }
  4813. /* Each node glows in its planned windows: when the relay reaches it, while a
  4814. walk token rests on it, as a message lands, or as the playhead passes.
  4815. During the bounded entrance all three animations run; the entrance pulse is
  4816. listed after the repeating glow and wins on filter until it completes. */
  4817. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden]) svg[data-animation="trace"] [data-animate="node"] {
  4818. animation: var(--flow-node-name, none) var(--flow-cycle, 6.4s) linear infinite;
  4819. }
  4820. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden])[data-ambient-entry="running"] svg[data-animation="trace"] [data-animate="node"] {
  4821. animation: var(--flow-node-name, none) var(--flow-cycle, 6.4s) linear infinite,
  4822. archify-node-pulse 3.6s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4823. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4824. }
  4825. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden])[data-ambient-entry="running"] svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {
  4826. animation: var(--flow-node-name, none) var(--flow-cycle, 6.4s) linear infinite,
  4827. archify-node-pulse 3.1s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4828. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4829. }
  4830. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden])[data-ambient-entry="running"] svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {
  4831. animation: var(--flow-node-name, none) var(--flow-cycle, 6.4s) linear infinite,
  4832. archify-blueprint-node-pulse 3.8s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4833. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4834. }
  4835. html[data-ambient-motion="running"][data-motion="live"]:not([data-motion-owner]):not([data-embed]):not([data-share-playback]):not([data-document-hidden])[data-ambient-entry="running"] svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {
  4836. animation: var(--flow-node-name, none) var(--flow-cycle, 6.4s) linear infinite,
  4837. archify-editorial-node-pulse 3.5s ease-in-out 1 calc(var(--step, 0) * 160ms),
  4838. archify-node-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards calc(var(--step, 0) * 160ms);
  4839. }
  4840. @keyframes archify-node-enter {
  4841. from { opacity: 0; }
  4842. to { opacity: 1; }
  4843. }
  4844. @media print {
  4845. .ambient-edge-flow { display: none !important; animation: none !important; }
  4846. svg[data-animation="trace"] [data-animate="node"] { animation: none !important; }
  4847. }
  4848. @keyframes archify-node-pulse {
  4849. 0%, 72%, 100% { filter: none; stroke-width: 1.5; }
  4850. 18%, 36% {
  4851. filter: drop-shadow(0 0 8px var(--arrow-emphasis));
  4852. stroke-width: 2.4;
  4853. }
  4854. }
  4855. @keyframes archify-blueprint-node-pulse {
  4856. 0%, 72%, 100% { opacity: 1; filter: none; }
  4857. 18%, 36% { opacity: 0.72; filter: drop-shadow(0 0 2px var(--frontend-stroke)); }
  4858. }
  4859. @keyframes archify-editorial-node-pulse {
  4860. 0%, 72%, 100% { opacity: 1; filter: none; }
  4861. 18%, 36% { opacity: 0.78; filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 18%, transparent)); }
  4862. }
  4863. @keyframes archify-signal-scan {
  4864. 0%, 18% { opacity: 1; transform: translateX(-70%); }
  4865. 70% { opacity: 1; transform: translateX(70%); }
  4866. 100% { opacity: 0; transform: translateX(70%); }
  4867. }
  4868. @keyframes archify-radar-live {
  4869. 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }
  4870. 55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }
  4871. }
  4872. @keyframes archify-intent-trace-flow {
  4873. 0% { opacity: 0.28; stroke-dashoffset: 0; }
  4874. 12%, 78% { opacity: 0.94; }
  4875. 100% { opacity: 0; stroke-dashoffset: -1; }
  4876. }
  4877. @keyframes archify-route-probe-flow {
  4878. 0% { stroke-dashoffset: 0; opacity: 0.96; }
  4879. 78% { stroke-dashoffset: -1; opacity: 0.96; }
  4880. 100% { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.58; }
  4881. }
  4882. @keyframes archify-route-journey-flow {
  4883. 0% { opacity: 0.16; stroke-dashoffset: 0; }
  4884. 14%, 76% { opacity: 1; }
  4885. 100% { opacity: 0; stroke-dashoffset: -1; }
  4886. }
  4887. @keyframes archify-semantic-lens-flow {
  4888. 0% { opacity: 0.2; stroke-dashoffset: 0; }
  4889. 12%, 78% { opacity: 0.9; }
  4890. 100% { opacity: 0; stroke-dashoffset: -1; }
  4891. }
  4892. @keyframes archify-relationship-pulse {
  4893. 0% { opacity: 0.18; stroke-dashoffset: 0; }
  4894. 10%, 76% { opacity: 0.98; }
  4895. 100% { opacity: 0; stroke-dashoffset: -1; }
  4896. }
  4897. @keyframes archify-relationship-token-life {
  4898. 0%, 7% { opacity: 0; }
  4899. 13%, 82% { opacity: 1; }
  4900. 100% { opacity: 0; }
  4901. }
  4902. @keyframes archify-share-cue-enter {
  4903. from { opacity: 0; transform: translate(-50%, -0.45rem); }
  4904. to { opacity: 1; transform: translate(-50%, 0); }
  4905. }
  4906. @keyframes archify-share-cue-pulse {
  4907. 0%, 100% { opacity: 1; transform: scale(1); }
  4908. 50% { opacity: 0.48; transform: scale(0.78); }
  4909. }
  4910. @media (prefers-reduced-motion: reduce) {
  4911. .ambient-edge-flow { display: none !important; animation: none !important; }
  4912. html[data-preset="signal-flow"] .diagram-container::before {
  4913. animation: none !important;
  4914. }
  4915. .pulse-dot { animation: none !important; }
  4916. .motion-control-dot { animation: none !important; }
  4917. svg[data-animation="trace"] [data-animate] {
  4918. animation: none !important;
  4919. stroke-dashoffset: 0;
  4920. }
  4921. svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
  4922. animation: none !important;
  4923. stroke-dashoffset: 0;
  4924. }
  4925. .intent-trace-flow,
  4926. .route-probe-flow,
  4927. .semantic-lens,
  4928. .diagram-guide,
  4929. .overview-map-live { animation: none !important; }
  4930. .intent-trace-flow {
  4931. animation: none !important;
  4932. stroke-dasharray: none;
  4933. stroke-dashoffset: 0;
  4934. opacity: 0.72;
  4935. }
  4936. .route-probe-flow {
  4937. animation: none !important;
  4938. stroke-dasharray: none;
  4939. stroke-dashoffset: 0;
  4940. opacity: 0.78;
  4941. }
  4942. .route-journey-overlay { display: none !important; }
  4943. .semantic-lens-flow {
  4944. animation: none !important;
  4945. stroke-dasharray: none;
  4946. stroke-width: 2.2;
  4947. opacity: 0.34;
  4948. filter: none;
  4949. }
  4950. .relationship-pulse-overlay { display: none !important; }
  4951. svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }
  4952. }
  4953. </style>
  4954. <script type="application/json" id="archify-software-notices">"NOTICE\nArchify\nCopyright (c) 2026 tt-a1i (Archify)\nCopyright (c) 2025 Cocoon AI\n\nArchify is distributed under the Apache License, Version 2.0 (LICENSE),\nexcept where a file, package manifest, or third-party notice specifies otherwise.\nThe separately versioned DeepSeek Harness adapter remains MIT; its bundled\nSkill retains the license of the immutable source selected in release.json.\n\nCode and contributions received under the MIT License through pre-transition\ncommit 25cf37080fc8b1dbe758a4efc3935b55f3327083 remain available under their\noriginal terms. Previously published releases keep their existing licenses. The complete historical MIT\ncopyright and permission notice is preserved in LICENSE-MIT. This transition\ndoes not revoke existing MIT grants or assert a new patent grant on behalf\nof historical contributors.\n\nArchify originated from Cocoon-AI/architecture-diagram-generator:\nhttps://github.com/Cocoon-AI/architecture-diagram-generator\n\nThird-party components retain their own licenses; see THIRD_PARTY_NOTICES.md\nand the license files beside those components. Names and logos do not imply\nofficial endorsement, and the software license grants no general trademark\npermission.\n\nThese software licenses cover Archify's embedded runtime and templates, not\nownership of a user's authored content, business data, or source repository.\n\nLICENSE\n\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\nLICENSE-MIT\nMIT License\n\nCopyright (c) 2026 tt-a1i (Archify)\nCopyright (c) 2025 Cocoon AI\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nTHIRD_PARTY_NOTICES.md\n# Third-party notices\n\nArchify includes optional vector data for third-party brand marks. These marks\nare provided only to identify technologies and services in user-authored\ndiagrams. Their inclusion does not imply sponsorship, endorsement, partnership,\nor affiliation with Archify.\n\nArchify's license and historical MIT grants are described in LICENSE, NOTICE,\nand LICENSE-MIT. The software license does not\nreplace the copyright licenses, trademark policies, or brand guidelines that\napply to third-party marks. Users are responsible for confirming that their\nparticular use is permitted.\n\n## Simple Icons\n\nMost of the built-in vector paths and their metadata were generated from\n[Simple Icons 16.28.0](https://github.com/simple-icons/simple-icons/tree/16.28.0).\nSimple Icons makes its collection work available under\n[CC0 1.0 Universal](https://github.com/simple-icons/simple-icons/blob/16.28.0/LICENSE.md).\n\nAs Simple Icons explains in its\n[disclaimer](https://github.com/simple-icons/simple-icons/blob/16.28.0/DISCLAIMER.md),\nCC0 for the collection does not mean that every underlying icon is CC0. License\nand brand-guideline metadata may be incomplete or change over time. The absence\nof an individual license entry is not a grant of permission.\n\nArchify embeds the selected icons as vector-path data and may render them in a\nuser-selected color. The following individual licenses were recorded in the\npinned Simple Icons 16.28.0 metadata:\n\n| Mark | Recorded source | Recorded license | Archify treatment |\n|---|---|---|---|\n| Angular | [Angular press kit](https://angular.dev/press-kit) | [`CC-BY-4.0`](https://creativecommons.org/licenses/by/4.0/) | Embedded as vector-path data; color may be changed by the authored diagram. |\n| Apache Airflow | [Apache logos](https://apache.org/logos) | [`Apache-2.0`](https://www.apache.org/licenses/LICENSE-2.0) | Embedded as vector-path data; Apache trademarks remain subject to the [ASF trademark policy](https://www.apache.org/foundation/marks/). |\n| Apache Kafka | [Apache logos](https://apache.org/logos) | [`Apache-2.0`](https://www.apache.org/licenses/LICENSE-2.0) | Embedded as vector-path data; Apache trademarks remain subject to the [ASF trademark policy](https://www.apache.org/foundation/marks/). |\n| .NET | [.NET brand repository](https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/logo/dotnet-logo.svg) | [`CC0-1.0`](https://creativecommons.org/publicdomain/zero/1.0/) | Embedded as vector-path data; color may be changed by the authored diagram. |\n| JavaScript | [JS community logo](https://github.com/voodootikigod/logo.js/blob/1544bdeed6d618a6cfe4f0650d04ab8d9cfa76d9/js.svg) | [`MIT`](https://github.com/voodootikigod/logo.js/blob/1544bdeed6d618a6cfe4f0650d04ab8d9cfa76d9/LICENSE) | Embedded as vector-path data; color may be changed by the authored diagram. |\n| Jenkins | [Jenkins artwork source](https://get.jenkins.io/art/) | [`CC-BY-SA-3.0`](https://creativecommons.org/licenses/by-sa/3.0/) | Embedded as vector-path data; color may be changed by the authored diagram. Jenkins retains its trademark rights. |\n| Rust | [Rust project](https://www.rust-lang.org) | [`CC-BY-SA-4.0`](https://creativecommons.org/licenses/by-sa/4.0/) | Embedded as vector-path data; color may be changed by the authored diagram. See the [Rust media guide](https://www.rust-lang.org/policies/media-guide). |\n| Vue.js | [Vue logo source](https://github.com/vuejs/art/blob/a1c78b74569b70a25300925b4eacfefcc143b8f6/logo.svg) | [`CC-BY-NC-SA-4.0`](https://creativecommons.org/licenses/by-nc-sa/4.0/) | Embedded as vector-path data; color may be changed by the authored diagram. The non-commercial and share-alike conditions remain applicable; see the [Vue artwork terms](https://github.com/vuejs/art/blob/a1c78b74569b70a25300925b4eacfefcc143b8f6/README.md). |\n\nThe source, guideline, and known license fields for every packaged mark are\npreserved in `renderers/shared/generated-brand-marks.mjs`.\n\n## OpenAI mark\n\nThe OpenAI vector path is recorded from the\n[OpenAI brand guidelines](https://openai.com/brand/), not from Simple Icons.\nUse remains subject to those current guidelines and any applicable trademark\nrights. Its inclusion does not state or imply endorsement by OpenAI.\n\n## JetBrains Mono\n\nDelivered Archify viewer artifacts embed the JetBrains Mono variable font\nsubsets served by Google Fonts. For characters covered by these subsets, font\nselection does not depend on a network request or a locally installed copy.\nUncovered characters (including CJK) still use the system fallback stack;\nbrowser and operating-system rasterization can differ.\nJetBrains Mono is maintained at\n[github.com/JetBrains/JetBrainsMono](https://github.com/JetBrains/JetBrainsMono)\nand is distributed under the SIL Open Font License 1.1. The complete license\ntext is preserved in `assets/JetBrainsMono-OFL.txt` in the packaged Skill and\nin the font CSS carried by standalone HTML and SVG exports.\n\n## Pele\n\nThe explainer renders Mermaid chart fences with an unmodified subset of\n[Pele 1.3.0](https://github.com/obsidianmd/pele), copyright (c) 2026 kepano,\ndistributed under the MIT License. The subset and its license text are in\n`explainer/vendor/pele/` in the packaged Skill. Charts are rendered to static\nSVG when a page is built; delivered pages contain no Pele code.\n\n## No additional rights granted\n\nBrand names, logos, and trademarks remain the property of their respective\nowners. This notice records provenance and known terms; it does not grant rights\nthat Archify does not hold, and it does not state that every packaged mark has\nbeen cleared for every commercial, promotional, or redistributive use."</script>
  4955. </head>
  4956. <body>
  4957. <!-- Toolbar: theme, live visual style, trace motion, presentation stage, and export.
  4958. Motion appears only for trace-enabled artifacts and has no shortcut;
  4959. Keyboard: T toggles theme, S cycles style, F toggles the stage, E opens export. -->
  4960. <div class="toolbar" role="toolbar" aria-label="图表操作">
  4961. <div class="toolbar-group">
  4962. <button id="btn-theme" type="button"
  4963. title="切换主题(T)"
  4964. aria-label="切换颜色主题"
  4965. aria-pressed="false">
  4966. <span id="theme-icon" class="toolbar-icon" aria-hidden="true"></span>
  4967. <span id="theme-label">深色</span>
  4968. </button>
  4969. <div class="preset-wrap">
  4970. <button id="btn-preset" type="button"
  4971. title="选择视觉风格(S 循环切换)"
  4972. aria-label="选择视觉风格"
  4973. aria-haspopup="menu"
  4974. aria-expanded="false"
  4975. aria-controls="preset-menu"
  4976. aria-keyshortcuts="S">
  4977. <span class="preset-control-mark" aria-hidden="true"></span>
  4978. <span id="preset-label">风格</span>
  4979. <span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>
  4980. </button>
  4981. <div class="preset-menu" id="preset-menu" role="menu" aria-label="视觉风格">
  4982. <div class="preset-menu-heading" role="presentation"><span>视觉表达</span><span class="preset-menu-shortcut"><kbd>S</kbd>循环切换</span></div>
  4983. <button class="preset-option" data-preset-value="classic" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
  4984. <span class="preset-option-swatch classic" aria-hidden="true"></span>
  4985. <span class="preset-option-copy"><strong>经典</strong><small>稳定的技术默认风格</small></span>
  4986. <span class="preset-option-check" aria-hidden="true"></span>
  4987. </button>
  4988. <button class="preset-option" data-preset-value="signal-flow" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
  4989. <span class="preset-option-swatch signal-flow" aria-hidden="true"></span>
  4990. <span class="preset-option-copy"><strong>信号流</strong><small>突出动态流向</small></span>
  4991. <span class="preset-option-check" aria-hidden="true"></span>
  4992. </button>
  4993. <button class="preset-option" data-preset-value="blueprint" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
  4994. <span class="preset-option-swatch blueprint" aria-hidden="true"></span>
  4995. <span class="preset-option-copy"><strong>蓝图</strong><small>工程评审</small></span>
  4996. <span class="preset-option-check" aria-hidden="true"></span>
  4997. </button>
  4998. <button class="preset-option" data-preset-value="editorial" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
  4999. <span class="preset-option-swatch editorial" aria-hidden="true"></span>
  5000. <span class="preset-option-copy"><strong>编辑风格</strong><small>适合发布与上线说明</small></span>
  5001. <span class="preset-option-check" aria-hidden="true"></span>
  5002. </button>
  5003. </div>
  5004. </div>
  5005. <button id="btn-motion" type="button" hidden
  5006. title="暂停动效"
  5007. aria-label="暂停动效"
  5008. aria-pressed="true">
  5009. <span class="motion-control-dot" aria-hidden="true"></span>
  5010. <span id="motion-label">动态</span>
  5011. </button>
  5012. <button id="btn-present" type="button"
  5013. title="演示模式(F)"
  5014. aria-label="进入演示模式"
  5015. aria-pressed="false">
  5016. <span id="present-icon" class="toolbar-icon" aria-hidden="true"></span>
  5017. <span id="present-label">演示</span>
  5018. </button>
  5019. </div>
  5020. <div class="export-wrap">
  5021. <button id="btn-export" type="button"
  5022. title="导出图表(E)"
  5023. aria-label="导出图表"
  5024. aria-haspopup="menu"
  5025. aria-expanded="false"
  5026. aria-controls="export-menu">
  5027. 导出 <span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>
  5028. </button>
  5029. <div class="export-menu" id="export-menu" role="menu" aria-label="导出">
  5030. <div class="export-menu-header" role="presentation">
  5031. <div><strong>导出图表</strong><span>便携、整洁的输出</span></div>
  5032. <kbd>E</kbd>
  5033. </div>
  5034. <div class="export-menu-section" role="group" aria-label="分享">
  5035. <span class="export-menu-heading" aria-hidden="true">分享</span>
  5036. <button data-action="route-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>路径分享卡片</strong><small class="hint">1200&times;630 PNG</small></span></button>
  5037. <button data-action="reach-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>可达范围分享卡片</strong><small class="hint">1200&times;630 PNG</small></span></button>
  5038. <button data-action="copy" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>复制图表</strong><small class="hint">复制 PNG 到剪贴板</small></span></button>
  5039. </div>
  5040. <div class="export-menu-section" role="group" aria-label="位图">
  5041. <span class="export-menu-heading" aria-hidden="true">图像</span>
  5042. <button data-format="png" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>PNG</strong><small class="hint">无损图像</small></span></button>
  5043. <button data-format="jpeg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>JPEG</strong><small class="hint">紧凑图像</small></span></button>
  5044. <button data-format="webp" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebP</strong><small class="hint">现代图像格式</small></span></button>
  5045. </div>
  5046. <div class="export-menu-section" role="group" aria-label="矢量与动效">
  5047. <span class="export-menu-heading" aria-hidden="true">矢量与动效</span>
  5048. <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · 自动</strong><small class="hint">匹配宿主主题</small></span></button>
  5049. <button data-format="svg-light" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · 浅色</strong><small class="hint">始终浅色</small></span></button>
  5050. <button data-format="svg-dark" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · 深色</strong><small class="hint">始终深色</small></span></button>
  5051. <button data-format="webm" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebM</strong><small class="hint">6 秒动效</small></span></button>
  5052. </div>
  5053. </div>
  5054. </div>
  5055. </div>
  5056. <div class="container">
  5057. <!-- Header -->
  5058. <div class="header">
  5059. <div class="header-row"
  5060. data-preset-badge-signal-flow="信号流"
  5061. data-preset-badge-blueprint="蓝图 / 修订 01"
  5062. data-preset-badge-editorial="编辑风格 / 现场笔记">
  5063. <div class="pulse-dot"></div>
  5064. <h1>恪澜通 · 运营支撑系统端到端业务流程(业务口径)</h1>
  5065. </div>
  5066. </div>
  5067. <script id="archify-source-evidence-data" type="application/json">{"schemaVersion":1,"verified":true,"repository":{"url":"http://112.124.19.38:8080/klt-bos/klt-bos-service.git","revision":"9d6284f26f575959f81c97e9cbd303b13770c540","shortRevision":"9d6284f","label":"112.124.19.38:8080/klt-bos/klt-bos-service.git","linkMode":"local-only"},"referenceCount":15,"nodes":{"request":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/03-工单生成与分派.md","line":77,"endLine":85}],"auth":[{"path":"docs/详细设计说明书/00-总则与全局约定/04-模块划分与请求链路.md","line":46,"endLine":56}],"create":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/03-工单生成与分派.md","line":56,"endLine":72}],"assign":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":33,"endLine":35}],"carrier":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/05-回填竣工与回执.md","line":5,"endLine":7}],"backfill":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/05-回填竣工与回执.md","line":13,"endLine":28},{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/05-回填竣工与回执.md","line":121,"endLine":130}],"completion":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":38,"endLine":38}],"settled":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":38,"endLine":39}],"billing_start":[{"path":"docs/详细设计说明书/06-第6册-计费与对账出账/03-计费起点与不满月折算.md","line":18,"endLine":40}],"billing":[{"path":"docs/详细设计说明书/06-第6册-计费与对账出账/04-应收生成与出账批次.md","line":10,"endLine":18}],"terminate":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":40,"endLine":40}],"partial":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":217,"endLine":218}],"reject":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":48,"endLine":50}],"revert":[{"path":"docs/详细设计说明书/05-第5册-工单与开停交付/04-状态机与开停交付.md","line":176,"endLine":189}]}}</script>
  5068. <script id="archify-i18n-data" type="application/json">{"locale":"zh-CN","messages":{"viewer.kind.frontend":"前端","viewer.kind.backend":"后端","viewer.kind.database":"数据库","viewer.kind.cloud":"云服务","viewer.kind.security":"安全","viewer.kind.messagebus":"消息总线","viewer.kind.external":"外部系统","viewer.kind.neutral":"中性","viewer.kind.node":"节点","viewer.kind.start":"开始","viewer.kind.active":"活动","viewer.kind.waiting":"等待","viewer.kind.decision":"决策","viewer.kind.success":"成功","viewer.kind.failure":"失败","viewer.toolbar.actions":"图表操作","viewer.theme.toggle.title":"切换主题(T)","viewer.theme.toggle":"切换颜色主题","viewer.theme.dark":"深色","viewer.theme.light":"浅色","viewer.preset.choose.title":"选择视觉风格(S 循环切换)","viewer.preset.choose":"选择视觉风格","viewer.preset.style":"风格","viewer.preset.menu":"视觉风格","viewer.preset.identity":"视觉表达","viewer.preset.cycles":"循环切换","viewer.preset.classic":"经典","viewer.preset.classic.short":"经典","viewer.preset.classic.hint":"稳定的技术默认风格","viewer.preset.flow":"信号流","viewer.preset.flow.short":"流动","viewer.preset.flow.hint":"突出动态流向","viewer.preset.blueprint":"蓝图","viewer.preset.blueprint.hint":"工程评审","viewer.preset.editorial":"编辑风格","viewer.preset.editorial.hint":"适合发布与上线说明","viewer.preset.badge.signalFlow":"信号流","viewer.preset.badge.blueprint":"蓝图 / 修订 01","viewer.preset.badge.editorial":"编辑风格 / 现场笔记","viewer.preset.badge.editorialPlate":"ARCHIFY / 图版 04","viewer.preset.current":"当前视觉风格:{style}。选择视觉风格","viewer.motion.live":"动态","viewer.motion.still":"静态","viewer.motion.pause":"暂停动效","viewer.motion.resume":"恢复动效","viewer.motion.reduced":"已根据减少动态效果偏好暂停动效","viewer.motion.hidden":"页面不可见时已暂停动效","viewer.motion.yielding":"暂停动效;当前让位于{owner}","viewer.motion.yielding.title":"动态预览已启用 · 正在让位于{owner}","viewer.owner.route":"路径探测","viewer.owner.lens":"语义透镜","viewer.owner.relationship":"关系预览","viewer.owner.intent":"意图追踪","viewer.owner.focus":"语义聚焦","viewer.owner.legend":"图例预览","viewer.owner.reader":"读者交互","viewer.present.enter":"进入演示模式","viewer.present.enter.title":"演示模式(F)","viewer.present.exit":"退出演示模式","viewer.present.exit.title":"退出演示模式(F 或 Escape)","viewer.present.present":"演示","viewer.present.exit.label":"退出","viewer.export.button":"导出","viewer.export.button.title":"导出图表(E)","viewer.export.diagram":"导出图表","viewer.export.menu":"导出","viewer.export.subtitle":"便携、整洁的输出","viewer.export.share":"分享","viewer.export.shareCard":"分享卡片","viewer.export.routeShareCard":"路径分享卡片","viewer.export.reachShareCard":"可达范围分享卡片","viewer.export.copyDiagram":"复制图表","viewer.export.clipboardPng":"复制 PNG 到剪贴板","viewer.export.raster":"位图","viewer.export.image":"图像","viewer.export.lossless":"无损图像","viewer.export.compact":"紧凑图像","viewer.export.modern":"现代图像格式","viewer.export.vectorMotion":"矢量与动效","viewer.export.vectorMotion.heading":"矢量与动效","viewer.export.editable":"可编辑矢量图","viewer.export.svg.auto":"SVG · 自动","viewer.export.svg.auto.hint":"匹配宿主主题","viewer.export.svg.light":"SVG · 浅色","viewer.export.svg.light.hint":"始终浅色","viewer.export.svg.dark":"SVG · 深色","viewer.export.svg.dark.hint":"始终深色","viewer.export.motion6s":"6 秒动效","viewer.export.unsupported":"当前浏览器不支持","viewer.export.clipboardUnsupported":"当前浏览器不支持写入图片剪贴板","viewer.export.clipboardUnsupported.short":"此浏览器不支持写入图片剪贴板。","viewer.export.motionUnavailable":"当前浏览器无法录制动效","viewer.export.webmUnavailable":"当前浏览器不支持 WebM","viewer.export.failed":"导出失败:{message}","viewer.export.unknownVariant":"未知的分享卡片类型:{variant}","viewer.export.routeRequired":"请先追踪路径,再导出路径分享卡片","viewer.export.reachRequired":"请先追踪编写可达范围,再导出可达范围分享卡片","viewer.export.unknown":"未知错误","viewer.export.routeFailed":"路径分享卡片导出失败:{message}","viewer.export.reachFailed":"可达范围分享卡片导出失败:{message}","viewer.export.copyFailed":"复制失败:{message}","viewer.export.copiedPng":"已将 PNG 复制到剪贴板","viewer.export.downloadedRoute":"已下载路径分享卡片","viewer.export.downloadedReach":"已下载可达范围分享卡片","viewer.export.downloadedWebm":"已下载 WebM","viewer.export.recording":"正在录制 6 秒动效…","viewer.export.card.routeSummary.one":"路径:{source} → {target} · {count} 步","viewer.export.card.routeSummary.other":"路径:{source} → {target} · {count} 步","viewer.export.card.reachSummary":"从{origin}开始的编写{direction} · {nodes} · {links} · 最深 {hops}","viewer.export.card.node.one":"{count} 个节点","viewer.export.card.node.other":"{count} 个节点","viewer.export.card.link.one":"{count} 条连接","viewer.export.card.link.other":"{count} 条连接","viewer.export.card.hop.one":"{count} 跳","viewer.export.card.hop.other":"{count} 跳","viewer.export.card.routeBadge":"ARCHIFY · 路径 · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction}可达范围","viewer.export.direction.upstream":"上游","viewer.export.direction.downstream":"下游","viewer.export.error.canvasUnavailable":"无法为{label}使用画布","viewer.export.error.contextUnavailable":"无法为{label}创建二维画布上下文","viewer.export.error.toBlobUnavailable":"{label}无法使用 canvas.toBlob","viewer.export.error.toBlobNull":"{label}的 canvas.toBlob 未返回数据","viewer.export.error.variantsCombined":"无法同时组合多种分享卡片类型","viewer.export.error.viewerState":"分享卡片导出无法移除临时 Viewer 状态","viewer.export.error.routeState":"路径卡片导出无法安全保留已解析路径","viewer.export.error.reachState":"可达范围卡片导出无法安全保留编写的可达范围","viewer.export.error.webmRequirements":"WebM 动效导出需要追踪动画及浏览器 MediaRecorder 支持","viewer.export.error.mediaRecorder":"MediaRecorder 录制失败","viewer.export.error.emptyWebm":"MediaRecorder 生成了空的 WebM","viewer.export.error.webmBackground":"无法为 WebM 导出加载 SVG 背景","viewer.guide.title":"探索此系统","viewer.focus.selectedNodes":"已选择 {count} 个节点","viewer.guide.eyebrow":"图表指南","viewer.guide.close":"关闭图表指南","viewer.guide.inspecting":"正在检查已编译语义","viewer.guide.actions":"图表探索操作","viewer.guide.find":"查找任意节点","viewer.guide.find.hint":"搜索标签、职责、类型和稳定 ID。","viewer.guide.route":"追踪路径","viewer.guide.route.aria":"追踪有向路径","viewer.guide.route.hint":"查看两个语义节点如何按编写方向连接。","viewer.guide.map":"查看完整系统","viewer.guide.map.hint":"打开带实时视口和稳定节点的语义雷达。","viewer.guide.lens":"比较语义类型","viewer.guide.lens.hint":"统计角色、显示流量并比较直接编写的连接。","viewer.guide.present":"进入演示模式","viewer.guide.present.hint":"让实时图表占满视口,同时不改变导出。","viewer.guide.shortcuts":"其他键盘快捷键","viewer.guide.shortcut.export":"导出","viewer.guide.shortcut.theme":"主题","viewer.guide.shortcut.style":"风格","viewer.guide.shortcut.reset":"重置","viewer.guide.shortcut.zoomIn":"放大","viewer.guide.shortcut.zoomOut":"缩小","viewer.guide.shortcut.close":"关闭","viewer.guide.credit":"觉得好用?在 GitHub 给 Archify 点个 Star","viewer.guide.star":"Star","viewer.guide.facts":"{nodes} · {relationships}","viewer.guide.fact.node.one":"{count} 个语义节点","viewer.guide.fact.node.other":"{count} 个语义节点","viewer.guide.fact.relationship.one":"{count} 条关系","viewer.guide.fact.relationship.other":"{count} 条关系","viewer.guide.open":"打开图表指南","viewer.finder.title":"查找节点","viewer.finder.close":"关闭节点查找器","viewer.finder.placeholder":"搜索标签或 ID","viewer.finder.search":"搜索图表节点","viewer.finder.results":"图表节点","viewer.finder.empty":"没有匹配的节点","viewer.finder.result.focus":"聚焦{label}","viewer.finder.result.routeStart":"选择{label}作为路径起点","viewer.finder.result.routeTarget":"选择{label}作为路径终点,{links}","viewer.finder.status.empty":"没有匹配的节点","viewer.finder.status.count.one":"{count} 个匹配节点","viewer.finder.status.count.other":"{count} 个匹配节点","viewer.finder.noun.nodes":"个节点","viewer.finder.link.one":"{count} 条连接","viewer.finder.link.other":"{count} 条连接","viewer.finder.result.focus.one":"聚焦{label},{count} 条相关连接","viewer.finder.result.focus.other":"聚焦{label},{count} 条相关连接","viewer.finder.status.filtered":"{visible}/{available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"语义护照","viewer.passport.metadata":"节点元数据","viewer.passport.evidence":"已验证的源代码证据","viewer.passport.verified":"已验证来源","viewer.passport.verificationScope":"已按固定修订版本验证本地 Git 证据,未检查远程访问权限。","viewer.passport.reach":"编写可达范围","viewer.passport.reach.trace":"追踪编写的可达性","viewer.passport.upstream":"上游","viewer.passport.downstream":"下游","viewer.passport.upstream.trace":"追踪上游编写可达性","viewer.passport.downstream.trace":"追踪下游编写可达性","viewer.passport.close":"关闭语义护照","viewer.passport.move":"移动语义护照。可拖动、使用方向键移动,或按 Home 恢复自动位置。","viewer.passport.copy":"复制链接","viewer.passport.copy.focus":"复制聚焦节点的链接","viewer.passport.relations":"关系","viewer.passport.relations.show":"显示关联关系","viewer.passport.relations.hide":"隐藏关联关系","viewer.passport.relations.list":"关联关系","viewer.passport.copyRelation":"复制关系","viewer.passport.copyNode":"复制节点","viewer.passport.copyPinned":"复制固定关系的链接","viewer.passport.copySource":"复制来源节点的链接","viewer.passport.copy.focused.success":"已复制聚焦节点链接","viewer.passport.copy.pinned.success":"已复制固定关系链接","viewer.passport.copy.focused.failed":"无法复制聚焦节点链接","viewer.passport.copy.pinned.failed":"无法复制固定关系链接","viewer.passport.relationship.none":"没有关联关系","viewer.passport.relationship.count.one":"{count} 条关系","viewer.passport.relationship.count.other":"{count} 条关系","viewer.passport.relationship.show.one":"显示 {count} 条关联关系","viewer.passport.relationship.show.other":"显示 {count} 条关联关系","viewer.passport.relationship.summary":"{out} 条出向 · {in} 条入向{loops}","viewer.passport.relationship.loops":" · {count} 条自环","viewer.passport.relationship.explorer":"直接关系浏览器","viewer.passport.relationship.help":"使用方向键浏览关系。按 Enter 或空格键固定详情;按 Escape 清除。","viewer.passport.relationship.loopsBack":"回环","viewer.passport.relationship.connectsTo":"连接到","viewer.passport.relationship.connectsFrom":"连接自","viewer.passport.relationship.pinned":"已固定关系 · {from} → {to} · {label}","viewer.passport.relationship.inspect":"检查第 {index}/{total} 条关系:{from} 到 {to},{label}。按 Enter 查看详情。","viewer.passport.relationship.group.out":"出向","viewer.passport.relationship.group.in":"入向","viewer.passport.relationship.group.loop":"自环","viewer.passport.relationship.row":"{group}:{relationship},{neighbor}","viewer.passport.relationship.direction.out":"出 →","viewer.passport.relationship.direction.in":"← 入","viewer.passport.relationship.direction.loop":"自环","viewer.passport.sourceCount.one":"{count} 个已验证来源引用","viewer.passport.sourceCount.other":"{count} 个已验证来源引用","viewer.passport.repository.open":"打开已验证的仓库修订版本 {revision}","viewer.passport.source.open":"打开修订版本 {revision} 中已验证的来源 {path}","viewer.passport.source.openLink":"打开 ↗","viewer.passport.reach.upstream.one":"追踪 {count} 个上游编写节点","viewer.passport.reach.upstream.other":"追踪 {count} 个上游编写节点","viewer.passport.reach.downstream.one":"追踪 {count} 个下游编写节点","viewer.passport.reach.downstream.other":"追踪 {count} 个下游编写节点","viewer.passport.reach.noUpstream":"没有上游编写节点","viewer.passport.reach.noDownstream":"没有下游编写节点","viewer.passport.reach.status":"{direction} · {nodes} 个节点 · {links} 条连接 · 最深 {hops} 跳","viewer.route.eyebrow":"路径","viewer.route.start":"点击路径的起点","viewer.route.start.find":"查找起点","viewer.route.start.find.aria":"查找路径起点","viewer.route.copy":"复制链接","viewer.route.copy.aria":"复制已追踪路径的链接","viewer.route.clear":"清除","viewer.route.clear.aria":"清除路径探测","viewer.route.traced":"路径","viewer.route.pickTwo":"在图上点两个节点","viewer.route.pickOne":"在图上点一个节点","viewer.route.controls":"路径旅程控制","viewer.route.previous":"上一个路径位置","viewer.route.play":"播放路径旅程","viewer.route.pause":"暂停路径旅程","viewer.route.replay":"重播路径旅程","viewer.route.next":"下一个路径位置","viewer.route.journey":"旅程","viewer.route.pause.label":"暂停","viewer.route.replay.label":"重播","viewer.route.overview":"总览","viewer.route.overview.aria":"显示完整路径总览","viewer.route.instructions":"先点起点,再点终点,沿箭头方向找路。","viewer.route.destination":"从{label}出发,走到哪里?","viewer.route.destination.find":"查找目标","viewer.route.destination.find.aria":"查找可达的路径目标","viewer.route.differentDestination":"选择其他目标","viewer.route.distinct":"请选两个不同的节点。","viewer.route.unreachable":"走不到{label}","viewer.route.unreachable.detail":"沿箭头方向,从{source}走不到{target}。请选一个高亮节点。","viewer.route.start.instructions":"接着选终点,能走到的节点会亮起。","viewer.route.copy.success":"已复制路径链接","viewer.route.copy.failed":"无法复制路径链接","viewer.route.position":"路径位置 {index}/{total}:{label}","viewer.route.step":"第 {index}/{total} 步 · {phase} · {label}","viewer.route.motionRequired":"自动旅程需要动态模式","viewer.route.trigger.clear":"清除已追踪路径","viewer.route.overview.status":"{nodes} · {hops} · 最短路径","viewer.route.overview.node.one":"{count} 个节点","viewer.route.overview.node.other":"{count} 个节点","viewer.route.overview.hop.one":"{count} 步","viewer.route.overview.hop.other":"{count} 步","viewer.route.phase.playing":"播放中","viewer.route.phase.complete":"已完成","viewer.route.phase.inspecting":"检查中","viewer.route.destination.count.one":"有 {count} 个能走到的节点已高亮,点一下。","viewer.route.destination.count.other":"有 {count} 个能走到的节点已高亮,点一个。","viewer.route.noOutgoing":"这个节点没有向外的箭头。清除后换一个起点。","viewer.route.result.title":"{source} 到 {target}","viewer.route.finder.source.title":"选择路径起点","viewer.route.finder.source.placeholder":"搜索路径来源","viewer.route.finder.source.empty":"没有匹配的路径来源","viewer.route.finder.source.results":"可作为路径起点的节点","viewer.route.finder.source.noun":"个路径来源","viewer.route.finder.source.badge":"起点","viewer.route.finder.target.title":"从{label}出发的目标","viewer.route.finder.target.placeholder":"搜索可达目标","viewer.route.finder.target.empty":"没有匹配的可达目标","viewer.route.finder.target.results":"可达路径目标","viewer.route.finder.target.noun":"个可达目标","viewer.route.hop.one":"{count} 跳","viewer.route.hop.other":"{count} 跳","viewer.lens.eyebrow":"语义透镜","viewer.lens.title":"比较系统角色","viewer.lens.close":"关闭语义透镜","viewer.lens.instruction":"最多选择两种语义类型。选择一种可显示其真实流量;选择两种只比较直接编写的关系。","viewer.lens.kinds":"语义类型","viewer.lens.choose":"选择一种类型以检查其节点和相连关系。","viewer.lens.copy":"复制语义透镜链接","viewer.lens.clear":"清除语义透镜","viewer.lens.open":"打开语义透镜","viewer.lens.openActive":"打开当前语义透镜","viewer.lens.legend":"语义图例","viewer.lens.legend.inspect.one":"检查{label},{count} 个节点","viewer.lens.legend.inspect.other":"检查{label},{count} 个节点","viewer.lens.kind.count.one":"{label},{count} 个节点","viewer.lens.kind.count.other":"{label},{count} 个节点","viewer.lens.compare.one":"{first} → {second}:{forward} · {second} → {first}:{reverse} · 共 {count} 条直接关系","viewer.lens.compare.other":"{first} → {second}:{forward} · {second} → {first}:{reverse} · 共 {count} 条直接关系","viewer.lens.single":"{nodes} · {relationships} · 已连接节点保持可见","viewer.lens.node.one":"{count} 个{label}节点","viewer.lens.node.other":"{count} 个{label}节点","viewer.lens.relationship.one":"{count} 条相连关系","viewer.lens.relationship.other":"{count} 条相连关系","viewer.radar.title":"语义雷达","viewer.radar.building":"正在构建总览","viewer.radar.openFull":"打开完整语义雷达","viewer.radar.open":"打开雷达","viewer.radar.close":"关闭语义雷达","viewer.radar.surface":"图表总览。点击节点进行聚焦,或使用方向键平移。","viewer.radar.click":"点击节点","viewer.radar.drag":"拖动平移","viewer.radar.space":"语义雷达需要更多地图可见空间。","viewer.radar.nodes":"语义图表雷达节点","viewer.radar.focus":"从语义雷达聚焦{label}","viewer.radar.status":"{count} 个节点 · {viewport}","viewer.radar.fullMap":"{count} 个节点 · 完整地图","viewer.radar.compacted":"已收紧雷达,避免遮挡语义护照或地图控件。","viewer.radar.cancelWaiting":"取消等待更多地图空间的语义雷达","viewer.radar.needsSpace":"语义雷达需要更多可见地图空间","viewer.radar.viewport.full":"完整地图","viewer.radar.viewport.width":"宽度 {percent}%","viewer.radar.viewport.scale":"视口 {percent}%","viewer.nav.controls":"图表视图控制","viewer.nav.route":"追踪有向路径","viewer.nav.route.title":"追踪路径(R)","viewer.nav.route.short":"路径","viewer.nav.radar":"打开语义雷达","viewer.nav.radar.title":"语义雷达(M)","viewer.nav.radar.short":"地图","viewer.nav.lens":"打开语义透镜","viewer.nav.lens.title":"语义透镜(L)","viewer.nav.lens.short":"透镜","viewer.nav.find":"查找节点","viewer.nav.find.title":"查找节点(/)","viewer.outline.title":"节点索引","viewer.rail.show":"要点与索引","viewer.rail.controls":"侧栏","viewer.rail.collapse":"收起侧栏","viewer.rail.bottom":"移到图下方","viewer.rail.right":"移到图右侧","viewer.nav.guide":"打开图表指南","viewer.nav.guide.title":"图表指南(?)","viewer.nav.zoomOut":"缩小","viewer.nav.zoomOut.title":"缩小(-)","viewer.nav.reset":"重置图表视图","viewer.nav.reset.title":"重置视图(0)","viewer.nav.read":"阅读","viewer.nav.zoomIn":"放大","viewer.nav.zoomIn.title":"放大(+)","viewer.nav.camera":"{hint}。重置图表视图","viewer.nav.camera.title":"{semantic}{hint} · 重置视图(0)","viewer.nav.camera.semantic":"语义相机已启用 · ","viewer.nav.level.map":"概览","viewer.nav.level.read":"阅读","viewer.nav.level.full":"完整","viewer.nav.level.auto":"自动","viewer.nav.detail.map":"放大以显示关系标签和节点上下文","viewer.nav.detail.read":"再次放大以显示标签和注释","viewer.nav.detail.full":"完整图表详情","viewer.intent.summary":"{label}。{out} 条出向,{in} 条入向{loops}。共 {total} 条连接。按 Enter 查看详情。","viewer.intent.loops":",{count} 条自环","viewer.common.copied":"已复制","viewer.common.copyFailed":"复制失败","viewer.common.copyLink":"复制链接","viewer.common.clear":"清除","viewer.common.close":"关闭"}}</script>
  5069. <!-- Main Diagram -->
  5070. <div class="diagram-container" data-detail-level="read"
  5071. data-preset-badge-editorial-plate="ARCHIFY / 图版 04">
  5072. <svg viewBox="0 0 1152 1038" data-reader-fit="width-first" data-layout-contract="readable-v2" role="img" lang="zh-CN" aria-labelledby="archify-diagram-title archify-diagram-description" data-animation="trace" data-preset="classic" data-quality-profile="showcase" data-node-ui="">
  5073. <title id="archify-diagram-title">恪澜通 · 运营支撑系统端到端业务流程(业务口径)</title>
  5074. <desc id="archify-diagram-description">由 Archify 生成的工作流图。</desc>
  5075. <!-- Definitions -->
  5076. <defs>
  5077. <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
  5078. <polygon points="0 0, 10 3.5, 0 7" class="m-default" />
  5079. </marker>
  5080. <marker id="arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
  5081. <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />
  5082. </marker>
  5083. <marker id="arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
  5084. <polygon points="0 0, 10 3.5, 0 7" class="m-security" />
  5085. </marker>
  5086. <marker id="arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
  5087. <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />
  5088. </marker>
  5089. <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
  5090. <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>
  5091. </pattern>
  5092. </defs>
  5093. <style>
  5094. svg[data-node-ui] [data-node-id] > rect:not(.c-mask) { stroke-width: 1.25px; }
  5095. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-frontend { fill: color-mix(in srgb, var(--frontend-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--frontend-stroke) 72%, var(--mask)); }
  5096. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-backend { fill: color-mix(in srgb, var(--backend-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--backend-stroke) 72%, var(--mask)); }
  5097. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-database { fill: color-mix(in srgb, var(--database-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--database-stroke) 72%, var(--mask)); }
  5098. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-cloud { fill: color-mix(in srgb, var(--cloud-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--cloud-stroke) 72%, var(--mask)); }
  5099. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-security { fill: color-mix(in srgb, var(--security-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--security-stroke) 72%, var(--mask)); }
  5100. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-messagebus { fill: color-mix(in srgb, var(--messagebus-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--messagebus-stroke) 72%, var(--mask)); }
  5101. :is([data-theme="dark"] svg[data-node-ui], svg[data-node-ui][data-theme="dark"]) [data-node-id] > rect:not(.c-mask).c-external { fill: color-mix(in srgb, var(--external-stroke) 13%, var(--mask)); stroke: color-mix(in srgb, var(--external-stroke) 72%, var(--mask)); }
  5102. svg[data-node-ui]:is([data-preset="classic"], [data-preset="signal-flow"], [data-preset="editorial"]) .c-region { fill: color-mix(in srgb, var(--cloud-stroke) 3%, transparent); stroke: color-mix(in srgb, var(--cloud-stroke) 42%, var(--lane-stroke)); stroke-dasharray: none; }
  5103. svg[data-node-ui] .c-security-group { stroke: color-mix(in srgb, var(--security-stroke) 58%, var(--lane-stroke)); }
  5104. svg[data-node-ui]:is([data-preset="classic"], [data-preset="signal-flow"], [data-preset="editorial"]) .c-security-group { stroke-dasharray: 4 3; }
  5105. svg[data-node-ui]:is([data-preset="classic"], [data-preset="signal-flow"], [data-preset="editorial"]) .c-lane { stroke: var(--lane-stroke); stroke-dasharray: none; }
  5106. svg[data-node-ui] [data-graph-role="structural-frame-label-mask"] { rx: 5px; fill: color-mix(in srgb, var(--cloud-stroke) 10%, var(--mask)); stroke: color-mix(in srgb, var(--cloud-stroke) 38%, var(--mask)); stroke-width: .8px; }
  5107. svg[data-node-ui] [data-composition-frame-kind="security-group"] > [data-graph-role="structural-frame-label-mask"] { fill: color-mix(in srgb, var(--security-stroke) 9%, var(--mask)); stroke: color-mix(in srgb, var(--security-stroke) 36%, var(--mask)); }
  5108. svg[data-node-ui] .phase-rule { opacity: .5; stroke-dasharray: none; }
  5109. svg[data-node-ui] .phase-chip { stroke: var(--lane-stroke); stroke-width: .75px; }
  5110. svg[data-node-ui] g[data-edge-from] > rect.c-mask { rx: 7px; stroke: var(--lane-stroke); stroke-width: .75px; }
  5111. svg[data-node-ui][data-preset="blueprint"] :is([data-graph-role="structural-frame-label-mask"], g[data-edge-from] > rect.c-mask, .phase-chip) { rx: 2px; }
  5112. svg[data-node-ui][data-preset="editorial"] :is([data-graph-role="structural-frame-label-mask"], g[data-edge-from] > rect.c-mask, .phase-chip) { rx: 3px; }
  5113. </style>
  5114. <!-- Background Grid -->
  5115. <rect width="100%" height="100%" fill="url(#grid)" />
  5116. <!-- Swimlanes -->
  5117. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-0" x="40" y="52" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5118. <text x="54" y="74" class="t-muted" font-size="10" font-weight="600">01 / 客户 / 报障人</text>
  5119. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-1" x="40" y="178" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5120. <text x="54" y="200" class="t-muted" font-size="10" font-weight="600">02 / SEOH 平台 · 判权与中台</text>
  5121. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-2" x="40" y="304" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5122. <text x="54" y="326" class="t-muted" font-size="10" font-weight="600">03 / 运营 · 客服与派单</text>
  5123. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-3" x="40" y="430" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5124. <text x="54" y="452" class="t-muted" font-size="10" font-weight="600">04 / 运维 · 接单与回填</text>
  5125. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-4" x="40" y="556" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5126. <text x="54" y="578" class="t-muted" font-size="10" font-weight="600">05 / 运营商 · 外部执行</text>
  5127. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-5" x="40" y="682" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5128. <text x="54" y="704" class="t-muted" font-size="10" font-weight="600">06 / 计费 · 对账出账</text>
  5129. <rect data-graph-role="structural-frame" data-composition-frame-kind="lane" data-composition-frame-id="lane-6" x="40" y="808" width="851" height="106" rx="10" class="c-lane" stroke-width="1"/>
  5130. <rect data-graph-role="structural-frame" data-composition-frame-kind="exception-lane" data-composition-frame-id="lane-6-exception" x="46" y="814" width="839" height="94" rx="8" class="c-security-group" stroke-width="1"/>
  5131. <text x="54" y="830" class="t-security" font-size="10" font-weight="600">EX / 异常与回退</text>
  5132. <!-- Phase headers -->
  5133. <path d="M 66 35 H 262" class="a-default phase-rule" stroke-width="1" stroke-linecap="round" fill="none"/>
  5134. <rect x="134.8" y="27" width="58.4" height="16" rx="8" class="c-mask phase-chip"/>
  5135. <text x="164" y="38.5" class="t-muted" font-size="8" font-weight="600" text-anchor="middle" letter-spacing=".04em">受理建单</text>
  5136. <path d="M 334.4 35 H 546.4" class="a-emphasis phase-rule" stroke-width="1" stroke-linecap="round" fill="none"/>
  5137. <rect x="406.4" y="27" width="68" height="16" rx="8" class="c-mask phase-chip"/>
  5138. <text x="440.4" y="38.5" class="t-backend" font-size="8" font-weight="600" text-anchor="middle" letter-spacing=".04em">派单与执行</text>
  5139. <path d="M 610.4 35 H 686.4" class="a-default phase-rule" stroke-width="1" stroke-linecap="round" fill="none"/>
  5140. <rect x="619.1999999999999" y="27" width="58.4" height="16" rx="8" class="c-mask phase-chip"/>
  5141. <text x="648.4" y="38.5" class="t-muted" font-size="8" font-weight="600" text-anchor="middle" letter-spacing=".04em">竣工闭环</text>
  5142. <path d="M 784.8 35 H 860.8" class="a-dashed phase-rule" stroke-width="1" stroke-linecap="round" fill="none"/>
  5143. <rect x="793.5999999999999" y="27" width="58.4" height="16" rx="8" class="c-mask phase-chip"/>
  5144. <text x="822.8" y="38.5" class="t-messagebus" font-size="8" font-weight="600" text-anchor="middle" letter-spacing=".04em">计费出账</text>
  5145. <!-- Workflow groups -->
  5146. <rect data-graph-role="structural-frame" data-composition-frame-kind="group" data-composition-frame-id="group-0" x="44" y="216" width="120" height="64" rx="9" class="c-lane" stroke-width="1"/>
  5147. <text x="54" y="214" class="t-backend" font-size="7" font-weight="600">网关判权门</text>
  5148. <rect data-graph-role="structural-frame" data-composition-frame-kind="group" data-composition-frame-id="group-1" x="320.4" y="846" width="562.4" height="64" rx="9" class="c-security-group" stroke-width="1"/>
  5149. <text x="330.4" y="844" class="t-security" font-size="7" font-weight="600">异常 · 驳回 · 回退</text>
  5150. <!-- Edge paths -->
  5151. <path data-edge-from="assign" data-edge-to="backfill" data-edge-label="进入可处理态" data-edge-key="0" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="372.4,406;372.4,498;456.4,498" d="M 372.4 406 L 372.4 490 Q 372.4 498 380.4 498 L 456.4 498" class="a-default" data-animate="edge" style="--step:2" stroke-width="1.4" marker-end="url(#arrowhead)"/>
  5152. <path data-edge-from="assign" data-edge-to="terminate" data-edge-label="撤回" data-edge-key="1" data-composition-routing="workflow-v2-auto" data-edge-role="error" data-composition-points="348.4,406;348.4,609;436.4,609;436.4,876;420.4,876" d="M 348.4 406 L 348.4 601 Q 348.4 609 356.4 609 L 428.4 609 Q 436.4 609 436.4 617 L 436.4 868 Q 436.4 876 428.4 876 L 420.4 876" class="a-security" data-animate="edge" style="--step:9" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>
  5153. <path data-edge-from="auth" data-edge-to="create" data-edge-label="判权通过" data-edge-key="2" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="160,246;224,246;224,338" d="M 160 246 L 216 246 Q 224 246 224 254 L 224 338" class="a-security" data-animate="edge" style="--step:10" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>
  5154. <path data-edge-from="backfill" data-edge-to="completion" data-edge-label="success + 必填齐" data-edge-key="3" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="508.4,464;508.4,372;596.4,372" d="M 508.4 464 L 508.4 380 Q 508.4 372 516.4 372 L 596.4 372" class="a-emphasis" data-animate="edge" style="--step:3" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
  5155. <path data-edge-from="backfill" data-edge-to="partial" data-edge-label="partial / fail" data-edge-key="4" data-composition-routing="workflow-v2-auto" data-edge-role="error" data-composition-points="560.4,498;576.4,498;576.4,672;508.4,672;508.4,850" d="M 560.4 498 L 568.4 498 Q 576.4 498 576.4 506 L 576.4 664 Q 576.4 672 568.4 672 L 516.4 672 Q 508.4 672 508.4 680 L 508.4 850" class="a-security" data-animate="edge" style="--step:12" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>
  5156. <path data-edge-from="billing_start" data-edge-to="billing" data-edge-label="次月出账" data-edge-key="5" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="718.4,750;774.8,750" d="M 718.4 750 L 774.8 750" class="a-emphasis" data-animate="edge" style="--step:6" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
  5157. <path data-edge-from="carrier" data-edge-to="backfill" data-edge-label="执行结论" data-edge-key="6" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="508.4,598;508.4,532" d="M 508.4 598 L 508.4 532" class="a-dashed" data-animate="edge" style="--step:12" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>
  5158. <path data-edge-from="completion" data-edge-to="reject" data-edge-label="判废" data-edge-key="7" data-composition-routing="workflow-v2-auto" data-edge-role="error" data-composition-points="700.4,372;1135.2,372;1135.2,918;648.4,918;648.4,902" d="M 700.4 372 L 1127.2 372 Q 1135.2 372 1135.2 380 L 1135.2 910 Q 1135.2 918 1127.2 918 L 656.4 918 Q 648.4 918 648.4 910 L 648.4 902" class="a-security" data-animate="edge" style="--step:12" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>
  5159. <path data-edge-from="completion" data-edge-to="settled" data-edge-label="闭环" data-edge-key="8" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="648.4,398;648.4,464" d="M 648.4 398 L 648.4 464" class="a-emphasis" data-animate="edge" style="--step:4" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
  5160. <path data-edge-from="create" data-edge-to="assign" data-edge-label="团队分派" data-edge-key="9" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="270,372;326.4,372" d="M 270 372 L 326.4 372" class="a-emphasis" data-animate="edge" style="--step:1" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
  5161. <path data-edge-from="request" data-edge-to="create" data-edge-label="提交" data-edge-key="10" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="150,120;248,120;248,338" d="M 150 120 L 240 120 Q 248 120 248 128 L 248 338" class="a-emphasis" data-animate="edge" style="--step:0" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
  5162. <path data-edge-from="settled" data-edge-to="billing_start" data-edge-label="改写开通日" data-edge-key="11" data-composition-routing="workflow-v2-auto" data-edge-role="" data-composition-points="648.4,532;648.4,724" d="M 648.4 532 L 648.4 724" class="a-dashed" data-animate="edge" style="--step:5" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>
  5163. <path data-edge-from="settled" data-edge-to="revert" data-edge-label="纠错回退" data-edge-key="12" data-composition-routing="workflow-v2-auto" data-edge-role="error" data-composition-points="698.4,498;903,498;903,876;878.8,876" d="M 698.4 498 L 895 498 Q 903 498 903 506 L 903 868 Q 903 876 895 876 L 878.8 876" class="a-security" data-animate="edge" style="--step:12" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>
  5164. <!-- Nodes -->
  5165. <g id="node-request" data-node-id="request" data-node-label="提交 · 报障" tabindex="0" role="button" aria-label="聚焦提交 · 报障,下单/报障/停用申请, 客户 / 报障人 › 受理建单" aria-pressed="false" data-node-kind="frontend" data-node-sublabel="下单/报障/停用申请" data-node-context="客户 / 报障人 › 受理建单">
  5166. <title>提交 · 报障 · 下单/报障/停用申请 · 客户 / 报障人 › 受理建单</title>
  5167. <rect x="58" y="94" width="92" height="52" rx="8" class="c-mask"/>
  5168. <rect x="58" y="94" width="92" height="52" rx="8" class="c-frontend" data-animate="node" style="--step:0" stroke-width="1.5"/>
  5169. <g aria-hidden="true" data-semantic-sigil="frontend" class="semantic-sigil s-frontend" transform="translate(64 100) scale(0.6875)">
  5170. <rect x="2" y="3" width="12" height="10" rx="2"/>
  5171. <path d="M2 6.5h12"/>
  5172. <circle cx="4.1" cy="4.8" r=".7" class="sigil-fill"/>
  5173. <circle cx="6.3" cy="4.8" r=".7" class="sigil-fill"/>
  5174. </g>
  5175. <text data-node-label="" data-detail-anchor="" x="104" y="126" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">提交 · 报障</text>
  5176. <text data-detail="context" x="104" y="138" class="t-muted" font-size="7.7" text-anchor="middle">下单/报障/停用申请</text>
  5177. </g>
  5178. <g id="node-auth" data-node-id="auth" data-node-label="网关判权" tabindex="0" role="button" aria-label="聚焦网关判权,拼权限键 · 注入实例上界, SEOH 平台 · 判权与中台 › 网关判权门 › 受理建单" aria-pressed="false" data-node-kind="security" data-node-sublabel="拼权限键 · 注入实例上界" data-node-context="SEOH 平台 · 判权与中台 › 网关判权门 › 受理建单">
  5179. <title>网关判权 · 拼权限键 · 注入实例上界 · SEOH 平台 · 判权与中台 › 网关判权门 › 受理建单</title>
  5180. <rect x="48" y="220" width="112" height="52" rx="8" class="c-mask"/>
  5181. <rect x="48" y="220" width="112" height="52" rx="8" class="c-security" data-animate="node" style="--step:9" stroke-width="1.5"/>
  5182. <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(54 226) scale(0.6875)">
  5183. <path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
  5184. <path d="m5.8 8 1.5 1.5 3-3"/>
  5185. </g>
  5186. <text data-node-label="" data-detail-anchor="" x="104" y="252" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">网关判权</text>
  5187. <text data-detail="context" x="104" y="263.8" class="t-muted" font-size="7.5" text-anchor="middle">拼权限键 · 注入实例上界</text>
  5188. </g>
  5189. <g id="node-create" data-node-id="create" data-node-label="建单 · 待派单" tabindex="0" role="button" aria-label="聚焦建单 · 待派单,六时点同事务生成, 运营 · 客服与派单 › 受理建单" aria-pressed="false" data-node-kind="backend" data-node-sublabel="六时点同事务生成" data-node-tag="unassigned" data-node-context="运营 · 客服与派单 › 受理建单">
  5190. <title>建单 · 待派单 · 六时点同事务生成 · 运营 · 客服与派单 › 受理建单 · unassigned</title>
  5191. <rect x="178" y="338" width="92" height="68" rx="8" class="c-mask"/>
  5192. <rect x="178" y="338" width="92" height="68" rx="8" class="c-backend" data-animate="node" style="--step:1" stroke-width="1.5"/>
  5193. <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(184 344) scale(0.6875)">
  5194. <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
  5195. </g>
  5196. <text data-node-label="" data-detail-anchor="" x="224" y="371.9" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">建单 · 待派单</text>
  5197. <text data-detail="context" x="224" y="386.8" class="t-muted" font-size="8" text-anchor="middle">六时点同事务生成</text>
  5198. <text data-detail="fine" x="224" y="399.6" class="t-backend" font-size="7" text-anchor="middle">unassigned</text>
  5199. </g>
  5200. <g id="node-assign" data-node-id="assign" data-node-label="分派 · 处理中" tabindex="0" role="button" aria-label="聚焦分派 · 处理中,责任人阅读自动推进, 运营 · 客服与派单 › 派单与执行" aria-pressed="false" data-node-kind="backend" data-node-sublabel="责任人阅读自动推进" data-node-tag="pending→processing" data-node-context="运营 · 客服与派单 › 派单与执行">
  5201. <title>分派 · 处理中 · 责任人阅读自动推进 · 运营 · 客服与派单 › 派单与执行 · pending→processing</title>
  5202. <rect x="326.4" y="338" width="92" height="68" rx="8" class="c-mask"/>
  5203. <rect x="326.4" y="338" width="92" height="68" rx="8" class="c-backend" data-animate="node" style="--step:2" stroke-width="1.5"/>
  5204. <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(332.4 344) scale(0.6875)">
  5205. <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
  5206. </g>
  5207. <text data-node-label="" data-detail-anchor="" x="372.4" y="371.9" class="t-primary" font-size="10.7" font-weight="600" text-anchor="middle">分派 · 处理中</text>
  5208. <text data-detail="context" x="372.4" y="386.4" class="t-muted" font-size="7.7" text-anchor="middle">责任人阅读自动推进</text>
  5209. <text data-detail="fine" x="372.4" y="399.2" class="t-backend" font-size="7" text-anchor="middle">pending→processing</text>
  5210. </g>
  5211. <g id="node-completion" data-node-id="completion" data-node-label="竣工 · 回执" tabindex="0" role="button" aria-label="聚焦竣工 · 回执,回传竣工 + 运营商回执, 运营 · 客服与派单 › 竣工闭环" aria-pressed="false" data-node-kind="cloud" data-node-sublabel="回传竣工 + 运营商回执" data-node-context="运营 · 客服与派单 › 竣工闭环">
  5212. <title>竣工 · 回执 · 回传竣工 + 运营商回执 · 运营 · 客服与派单 › 竣工闭环</title>
  5213. <rect x="596.4" y="346" width="104" height="52" rx="8" class="c-mask"/>
  5214. <rect x="596.4" y="346" width="104" height="52" rx="8" class="c-cloud" data-animate="node" style="--step:4" stroke-width="1.5"/>
  5215. <g aria-hidden="true" data-semantic-sigil="cloud" class="semantic-sigil s-cloud" transform="translate(602.4 352) scale(0.6875)">
  5216. <path d="M4.3 12.5h7.3a2.4 2.4 0 0 0 .2-4.8 4 4 0 0 0-7.5-1.3A3.1 3.1 0 0 0 4.3 12.5Z"/>
  5217. </g>
  5218. <text data-node-label="" data-detail-anchor="" x="648.4" y="378" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">竣工 · 回执</text>
  5219. <text data-detail="context" x="648.4" y="389.9" class="t-muted" font-size="7.6" text-anchor="middle">回传竣工 + 运营商回执</text>
  5220. </g>
  5221. <g id="node-backfill" data-node-id="backfill" data-node-label="开停回填" tabindex="0" role="button" aria-label="聚焦开停回填,两层判定 · 三写同事务, 运维 · 接单与回填 › 派单与执行" aria-pressed="false" data-node-kind="security" data-node-sublabel="两层判定 · 三写同事务" data-node-tag="决策门" data-node-context="运维 · 接单与回填 › 派单与执行">
  5222. <title>开停回填 · 两层判定 · 三写同事务 · 运维 · 接单与回填 › 派单与执行 · 决策门</title>
  5223. <rect x="456.4" y="464" width="104" height="68" rx="8" class="c-mask"/>
  5224. <rect x="456.4" y="464" width="104" height="68" rx="8" class="c-security" data-animate="node" style="--step:3" stroke-width="1.5"/>
  5225. <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(462.4 470) scale(0.6875)">
  5226. <path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
  5227. <path d="m5.8 8 1.5 1.5 3-3"/>
  5228. </g>
  5229. <text data-node-label="" data-detail-anchor="" x="508.4" y="498.2" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">开停回填</text>
  5230. <text data-detail="context" x="508.4" y="512.7" class="t-muted" font-size="7.6" text-anchor="middle">两层判定 · 三写同事务</text>
  5231. <text data-detail="fine" x="508.4" y="525.4" class="t-security" font-size="7" text-anchor="middle">决策门</text>
  5232. </g>
  5233. <g id="node-settled" data-node-id="settled" data-node-label="工单闭环" tabindex="0" role="button" aria-label="聚焦工单闭环,settled · 只读不可逆, 运维 · 接单与回填 › 竣工闭环" aria-pressed="false" data-node-kind="database" data-node-sublabel="settled · 只读不可逆" data-node-tag="终态" data-node-context="运维 · 接单与回填 › 竣工闭环">
  5234. <title>工单闭环 · settled · 只读不可逆 · 运维 · 接单与回填 › 竣工闭环 · 终态</title>
  5235. <rect x="598.4" y="464" width="100" height="68" rx="8" class="c-mask"/>
  5236. <rect x="598.4" y="464" width="100" height="68" rx="8" class="c-database" data-animate="node" style="--step:5" stroke-width="1.5"/>
  5237. <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(604.4 470) scale(0.6875)">
  5238. <ellipse cx="8" cy="4" rx="5" ry="2"/>
  5239. <path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
  5240. </g>
  5241. <text data-node-label="" data-detail-anchor="" x="648.4" y="498.2" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">工单闭环</text>
  5242. <text data-detail="context" x="648.4" y="512.7" class="t-muted" font-size="7.6" text-anchor="middle">settled · 只读不可逆</text>
  5243. <text data-detail="fine" x="648.4" y="525.4" class="t-database" font-size="7" text-anchor="middle">终态</text>
  5244. </g>
  5245. <g id="node-carrier" data-node-id="carrier" data-node-label="网络侧开停" tabindex="0" role="button" aria-label="聚焦网络侧开停,执行 + 反馈报文, 运营商 · 外部执行 › 派单与执行" aria-pressed="false" data-node-kind="external" data-node-sublabel="执行 + 反馈报文" data-node-context="运营商 · 外部执行 › 派单与执行">
  5246. <title>网络侧开停 · 执行 + 反馈报文 · 运营商 · 外部执行 › 派单与执行</title>
  5247. <rect x="462.4" y="598" width="92" height="52" rx="8" class="c-mask"/>
  5248. <rect x="462.4" y="598" width="92" height="52" rx="8" class="c-external" data-animate="node" style="--step:12" stroke-width="1.5"/>
  5249. <g aria-hidden="true" data-semantic-sigil="external" class="semantic-sigil s-external" transform="translate(468.4 604) scale(0.6875)">
  5250. <rect x="2.5" y="5" width="8.5" height="8" rx="1.5"/>
  5251. <path d="M8 2.5h5.5V8M13.5 2.5 7.5 8.5"/>
  5252. </g>
  5253. <text data-node-label="" data-detail-anchor="" x="508.4" y="630" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">网络侧开停</text>
  5254. <text data-detail="context" x="508.4" y="642.3" class="t-muted" font-size="8" text-anchor="middle">执行 + 反馈报文</text>
  5255. </g>
  5256. <g id="node-billing_start" data-node-id="billing_start" data-node-label="计费起点" tabindex="0" role="button" aria-label="聚焦计费起点,max(实际开通日, 订单生效日), 计费 · 对账出账 › 竣工闭环" aria-pressed="false" data-node-kind="backend" data-node-sublabel="max(实际开通日, 订单生效日)" data-node-context="计费 · 对账出账 › 竣工闭环">
  5257. <title>计费起点 · max(实际开通日, 订单生效日) · 计费 · 对账出账 › 竣工闭环</title>
  5258. <rect x="578.4" y="724" width="140" height="52" rx="8" class="c-mask"/>
  5259. <rect x="578.4" y="724" width="140" height="52" rx="8" class="c-backend" data-animate="node" style="--step:6" stroke-width="1.5"/>
  5260. <g aria-hidden="true" data-semantic-sigil="backend" class="semantic-sigil s-backend" transform="translate(584.4 730) scale(0.6875)">
  5261. <path d="M6 3 3 8l3 5M10 3l3 5-3 5"/>
  5262. </g>
  5263. <text data-node-label="" data-detail-anchor="" x="648.4" y="745" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">计费起点</text>
  5264. <text data-detail="context" x="648.4" y="762" class="t-muted" font-size="8" text-anchor="middle">max(实际开通日, 订单生效日)</text>
  5265. </g>
  5266. <g id="node-billing" data-node-id="billing" data-node-label="应收生成 · 出账" tabindex="0" role="button" aria-label="聚焦应收生成 · 出账,次月两阶段对账, 计费 · 对账出账 › 计费出账" aria-pressed="false" data-node-kind="database" data-node-sublabel="次月两阶段对账" data-node-context="计费 · 对账出账 › 计费出账">
  5267. <title>应收生成 · 出账 · 次月两阶段对账 · 计费 · 对账出账 › 计费出账</title>
  5268. <rect x="774.8" y="724" width="96" height="52" rx="8" class="c-mask"/>
  5269. <rect x="774.8" y="724" width="96" height="52" rx="8" class="c-database" data-animate="node" style="--step:7" stroke-width="1.5"/>
  5270. <g aria-hidden="true" data-semantic-sigil="database" class="semantic-sigil s-database" transform="translate(780.8 730) scale(0.6875)">
  5271. <ellipse cx="8" cy="4" rx="5" ry="2"/>
  5272. <path d="M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2"/>
  5273. </g>
  5274. <text data-node-label="" data-detail-anchor="" x="822.8" y="756.7" class="t-primary" font-size="9.7" font-weight="600" text-anchor="middle">应收生成 · 出账</text>
  5275. <text data-detail="context" x="822.8" y="771.3" class="t-muted" font-size="8" text-anchor="middle">次月两阶段对账</text>
  5276. </g>
  5277. <g id="node-terminate" data-node-id="terminate" data-node-label="撤回 · 终止" tabindex="0" role="button" aria-label="聚焦撤回 · 终止,报障人撤回/必填原因, 异常与回退 › 异常 · 驳回 · 回退 › 派单与执行" aria-pressed="false" data-node-kind="security" data-node-sublabel="报障人撤回/必填原因" data-node-context="异常与回退 › 异常 · 驳回 · 回退 › 派单与执行">
  5278. <title>撤回 · 终止 · 报障人撤回/必填原因 · 异常与回退 › 异常 · 驳回 · 回退 › 派单与执行</title>
  5279. <rect x="324.4" y="850" width="96" height="52" rx="8" class="c-mask"/>
  5280. <rect x="324.4" y="850" width="96" height="52" rx="8" class="c-security" data-animate="node" style="--step:12" stroke-width="1.5"/>
  5281. <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(330.4 856) scale(0.6875)">
  5282. <path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
  5283. <path d="m5.8 8 1.5 1.5 3-3"/>
  5284. </g>
  5285. <text data-node-label="" data-detail-anchor="" x="372.4" y="882" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">撤回 · 终止</text>
  5286. <text data-detail="context" x="372.4" y="894" class="t-muted" font-size="7.7" text-anchor="middle">报障人撤回/必填原因</text>
  5287. </g>
  5288. <g id="node-partial" data-node-id="partial" data-node-label="部分成功 / 失败" tabindex="0" role="button" aria-label="聚焦部分成功 / 失败,不生效 · 补齐后整体重填, 异常与回退 › 异常 · 驳回 · 回退 › 派单与执行" aria-pressed="false" data-node-kind="security" data-node-sublabel="不生效 · 补齐后整体重填" data-node-context="异常与回退 › 异常 · 驳回 · 回退 › 派单与执行">
  5289. <title>部分成功 / 失败 · 不生效 · 补齐后整体重填 · 异常与回退 › 异常 · 驳回 · 回退 › 派单与执行</title>
  5290. <rect x="452.4" y="850" width="112" height="52" rx="8" class="c-mask"/>
  5291. <rect x="452.4" y="850" width="112" height="52" rx="8" class="c-security" data-animate="node" style="--step:12" stroke-width="1.5"/>
  5292. <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(458.4 856) scale(0.6875)">
  5293. <path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
  5294. <path d="m5.8 8 1.5 1.5 3-3"/>
  5295. </g>
  5296. <text data-node-label="" data-detail-anchor="" x="508.4" y="882" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">部分成功 / 失败</text>
  5297. <text data-detail="context" x="508.4" y="893.8" class="t-muted" font-size="7.5" text-anchor="middle">不生效 · 补齐后整体重填</text>
  5298. </g>
  5299. <g id="node-reject" data-node-id="reject" data-node-label="竣工驳回" tabindex="0" role="button" aria-label="聚焦竣工驳回,运营商判废 · 同号重推, 异常与回退 › 异常 · 驳回 · 回退 › 竣工闭环" aria-pressed="false" data-node-kind="security" data-node-sublabel="运营商判废 · 同号重推" data-node-context="异常与回退 › 异常 · 驳回 · 回退 › 竣工闭环">
  5300. <title>竣工驳回 · 运营商判废 · 同号重推 · 异常与回退 › 异常 · 驳回 · 回退 › 竣工闭环</title>
  5301. <rect x="596.4" y="850" width="104" height="52" rx="8" class="c-mask"/>
  5302. <rect x="596.4" y="850" width="104" height="52" rx="8" class="c-security" data-animate="node" style="--step:12" stroke-width="1.5"/>
  5303. <g aria-hidden="true" data-semantic-sigil="security" class="semantic-sigil s-security" transform="translate(602.4 856) scale(0.6875)">
  5304. <path d="M8 2.2 13 4v3.5c0 3.1-1.8 5.4-5 6.5-3.2-1.1-5-3.4-5-6.5V4Z"/>
  5305. <path d="m5.8 8 1.5 1.5 3-3"/>
  5306. </g>
  5307. <text data-node-label="" data-detail-anchor="" x="648.4" y="882" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">竣工驳回</text>
  5308. <text data-detail="context" x="648.4" y="893.9" class="t-muted" font-size="7.6" text-anchor="middle">运营商判废 · 同号重推</text>
  5309. </g>
  5310. <g id="node-revert" data-node-id="revert" data-node-label="受控回退" tabindex="0" role="button" aria-label="聚焦受控回退,仅总运营 · 回退至处理中, 异常与回退 › 异常 · 驳回 · 回退 › 计费出账" aria-pressed="false" data-node-kind="messagebus" data-node-sublabel="仅总运营 · 回退至处理中" data-node-context="异常与回退 › 异常 · 驳回 · 回退 › 计费出账">
  5311. <title>受控回退 · 仅总运营 · 回退至处理中 · 异常与回退 › 异常 · 驳回 · 回退 › 计费出账</title>
  5312. <rect x="766.8" y="850" width="112" height="52" rx="8" class="c-mask"/>
  5313. <rect x="766.8" y="850" width="112" height="52" rx="8" class="c-messagebus" data-animate="node" style="--step:12" stroke-width="1.5"/>
  5314. <g aria-hidden="true" data-semantic-sigil="messagebus" class="semantic-sigil s-messagebus" transform="translate(772.8 856) scale(0.6875)">
  5315. <path d="M2.5 4.5h11M2.5 8h11M2.5 11.5h11"/>
  5316. <circle cx="5" cy="4.5" r="1" class="sigil-fill"/>
  5317. <circle cx="10.5" cy="8" r="1" class="sigil-fill"/>
  5318. <circle cx="7" cy="11.5" r="1" class="sigil-fill"/>
  5319. </g>
  5320. <text data-node-label="" data-detail-anchor="" x="822.8" y="882" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">受控回退</text>
  5321. <text data-detail="context" x="822.8" y="893.8" class="t-muted" font-size="7.5" text-anchor="middle">仅总运营 · 回退至处理中</text>
  5322. </g>
  5323. <!-- Edge labels -->
  5324. <g data-detail="context" data-edge-from="assign" data-edge-to="backfill" data-edge-label="进入可处理态" data-edge-key="0">
  5325. <rect x="380.59999999999997" y="478" width="67.6" height="14" rx="3" class="c-mask"/>
  5326. <text x="414.4" y="488" class="t-muted" font-size="8" text-anchor="middle">进入可处理态</text>
  5327. </g>
  5328. <g data-detail="context" data-edge-from="assign" data-edge-to="terminate" data-edge-label="撤回" data-edge-key="1">
  5329. <rect x="377.4" y="589" width="30" height="14" rx="3" class="c-mask"/>
  5330. <text x="392.4" y="599" class="t-edge-security" font-size="8" text-anchor="middle">撤回</text>
  5331. </g>
  5332. <g data-detail="context" data-edge-from="auth" data-edge-to="create" data-edge-label="判权通过" data-edge-key="2">
  5333. <rect x="167.8" y="226" width="48.4" height="14" rx="3" class="c-mask"/>
  5334. <text x="192" y="236" class="t-edge-security" font-size="8" text-anchor="middle">判权通过</text>
  5335. </g>
  5336. <g data-detail="context" data-edge-from="backfill" data-edge-to="completion" data-edge-label="success + 必填齐" data-edge-key="3">
  5337. <rect x="509" y="352" width="86.8" height="14" rx="3" class="c-mask"/>
  5338. <text x="552.4" y="362" class="t-edge-emphasis" font-size="8" text-anchor="middle">success + 必填齐</text>
  5339. </g>
  5340. <g data-detail="context" data-edge-from="backfill" data-edge-to="partial" data-edge-label="partial / fail" data-edge-key="4">
  5341. <rect x="503.79999999999995" y="652" width="77.2" height="14" rx="3" class="c-mask"/>
  5342. <text x="542.4" y="662" class="t-edge-security" font-size="8" text-anchor="middle">partial / fail</text>
  5343. </g>
  5344. <g data-detail="context" data-edge-from="billing_start" data-edge-to="billing" data-edge-label="次月出账" data-edge-key="5">
  5345. <rect x="722.3999999999999" y="730" width="48.4" height="14" rx="3" class="c-mask"/>
  5346. <text x="746.5999999999999" y="740" class="t-edge-emphasis" font-size="8" text-anchor="middle">次月出账</text>
  5347. </g>
  5348. <g data-detail="context" data-edge-from="carrier" data-edge-to="backfill" data-edge-label="执行结论" data-edge-key="6">
  5349. <rect x="516.4" y="555" width="48.4" height="14" rx="3" class="c-mask"/>
  5350. <text x="540.6" y="565" class="t-edge-dashed" font-size="8" text-anchor="middle">执行结论</text>
  5351. </g>
  5352. <g data-detail="context" data-edge-from="completion" data-edge-to="reject" data-edge-label="判废" data-edge-key="7">
  5353. <rect x="876.8" y="898" width="30" height="14" rx="3" class="c-mask"/>
  5354. <text x="891.8" y="908" class="t-edge-security" font-size="8" text-anchor="middle">判废</text>
  5355. </g>
  5356. <g data-detail="context" data-edge-from="completion" data-edge-to="settled" data-edge-label="闭环" data-edge-key="8">
  5357. <rect x="633.4" y="421" width="30" height="14" rx="3" class="c-mask"/>
  5358. <text x="648.4" y="431" class="t-edge-emphasis" font-size="8" text-anchor="middle">闭环</text>
  5359. </g>
  5360. <g data-detail="context" data-edge-from="create" data-edge-to="assign" data-edge-label="团队分派" data-edge-key="9">
  5361. <rect x="274" y="352" width="48.4" height="14" rx="3" class="c-mask"/>
  5362. <text x="298.2" y="362" class="t-edge-emphasis" font-size="8" text-anchor="middle">团队分派</text>
  5363. </g>
  5364. <g data-detail="context" data-edge-from="request" data-edge-to="create" data-edge-label="提交" data-edge-key="10">
  5365. <rect x="184" y="100" width="30" height="14" rx="3" class="c-mask"/>
  5366. <text x="199" y="110" class="t-edge-emphasis" font-size="8" text-anchor="middle">提交</text>
  5367. </g>
  5368. <g data-detail="context" data-edge-from="settled" data-edge-to="billing_start" data-edge-label="改写开通日" data-edge-key="11">
  5369. <rect x="619.4" y="618" width="58" height="14" rx="3" class="c-mask"/>
  5370. <text x="648.4" y="628" class="t-edge-dashed" font-size="8" text-anchor="middle">改写开通日</text>
  5371. </g>
  5372. <g data-detail="context" data-edge-from="settled" data-edge-to="revert" data-edge-label="纠错回退" data-edge-key="12">
  5373. <rect x="776.5" y="478" width="48.4" height="14" rx="3" class="c-mask"/>
  5374. <text x="800.7" y="488" class="t-edge-security" font-size="8" text-anchor="middle">纠错回退</text>
  5375. </g>
  5376. <!-- Legend -->
  5377. <g data-legend="" data-legend-bridge="">
  5378. <text x="20" y="938" class="t-primary" font-size="12" font-weight="650">图例</text>
  5379. <g data-legend-semantic-kind="frontend" data-legend-kind="frontend" data-legend-label="用户界面" data-legend-x="20" data-legend-baseline="958" data-legend-width="81">
  5380. <rect x="20" y="950" width="14" height="9" rx="2" class="c-frontend" stroke-width="1"/>
  5381. <text x="42" y="958" class="t-muted" font-size="7.5" font-weight="500">用户界面</text>
  5382. </g>
  5383. <g data-legend-semantic-kind="backend" data-legend-kind="backend" data-legend-label="Agent 逻辑" data-legend-x="108" data-legend-baseline="958" data-legend-width="90">
  5384. <rect x="108" y="950" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>
  5385. <text x="130" y="958" class="t-muted" font-size="7.5" font-weight="500">Agent 逻辑</text>
  5386. </g>
  5387. <g data-legend-semantic-kind="security" data-legend-kind="security" data-legend-label="策略" data-legend-x="205" data-legend-baseline="958" data-legend-width="62">
  5388. <rect x="205" y="950" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>
  5389. <text x="227" y="958" class="t-muted" font-size="7.5" font-weight="500">策略</text>
  5390. </g>
  5391. <g data-legend-semantic-kind="messagebus" data-legend-kind="messagebus" data-legend-label="工具操作" data-legend-x="274" data-legend-baseline="958" data-legend-width="81">
  5392. <rect x="274" y="950" width="14" height="9" rx="2" class="c-messagebus" stroke-width="1"/>
  5393. <text x="296" y="958" class="t-muted" font-size="7.5" font-weight="500">工具操作</text>
  5394. </g>
  5395. <g data-legend-semantic-kind="database" data-legend-kind="database" data-legend-label="上下文 / 追踪" data-legend-x="362" data-legend-baseline="958" data-legend-width="104">
  5396. <rect x="362" y="950" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>
  5397. <text x="384" y="958" class="t-muted" font-size="7.5" font-weight="500">上下文 / 追踪</text>
  5398. </g>
  5399. <g data-legend-semantic-kind="cloud" data-legend-kind="cloud" data-legend-label="云服务" data-legend-x="473" data-legend-baseline="958" data-legend-width="71">
  5400. <rect x="473" y="950" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>
  5401. <text x="495" y="958" class="t-muted" font-size="7.5" font-weight="500">云服务</text>
  5402. </g>
  5403. <g data-legend-semantic-kind="external" data-legend-kind="external" data-legend-label="外部系统" data-legend-x="551" data-legend-baseline="958" data-legend-width="81">
  5404. <rect x="551" y="950" width="14" height="9" rx="2" class="c-external" stroke-width="1"/>
  5405. <text x="573" y="958" class="t-muted" font-size="7.5" font-weight="500">外部系统</text>
  5406. </g>
  5407. </g>
  5408. </svg>
  5409. <p class="intent-trace-status no-print" id="intent-trace-status" role="status" aria-live="polite" aria-atomic="true"></p>
  5410. <div class="diagram-guide no-print" id="diagram-guide" hidden role="dialog" aria-modal="false" aria-labelledby="diagram-guide-title">
  5411. <div class="diagram-guide-head">
  5412. <span>
  5413. <span class="diagram-guide-eyebrow">图表指南</span>
  5414. <strong class="diagram-guide-title" id="diagram-guide-title">探索此系统</strong>
  5415. </span>
  5416. <button class="diagram-guide-close" id="diagram-guide-close" type="button" aria-label="关闭图表指南">&#215;</button>
  5417. </div>
  5418. <p class="diagram-guide-stats" id="diagram-guide-stats">正在检查已编译语义</p>
  5419. <div class="diagram-guide-actions" id="diagram-guide-actions" role="group" aria-label="图表探索操作">
  5420. <button class="diagram-guide-action" type="button" data-guide-action="find" aria-label="查找任意节点">
  5421. <span class="diagram-guide-index" aria-hidden="true">01</span>
  5422. <span class="diagram-guide-action-copy"><strong>查找任意节点</strong><small>搜索标签、职责、类型和稳定 ID。</small></span>
  5423. <kbd aria-hidden="true">/</kbd>
  5424. </button>
  5425. <button class="diagram-guide-action" type="button" data-guide-action="route" aria-label="追踪有向路径">
  5426. <span class="diagram-guide-index" aria-hidden="true">02</span>
  5427. <span class="diagram-guide-action-copy"><strong>追踪路径</strong><small>查看两个语义节点如何按编写方向连接。</small></span>
  5428. <kbd aria-hidden="true">R</kbd>
  5429. </button>
  5430. <button class="diagram-guide-action" type="button" data-guide-action="map" aria-label="查看完整系统">
  5431. <span class="diagram-guide-index" aria-hidden="true">03</span>
  5432. <span class="diagram-guide-action-copy"><strong>查看完整系统</strong><small>打开带实时视口和稳定节点的语义雷达。</small></span>
  5433. <kbd aria-hidden="true">M</kbd>
  5434. </button>
  5435. <button class="diagram-guide-action" type="button" data-guide-action="lens" aria-label="比较语义类型">
  5436. <span class="diagram-guide-index" aria-hidden="true">04</span>
  5437. <span class="diagram-guide-action-copy"><strong>比较语义类型</strong><small>统计角色、显示流量并比较直接编写的连接。</small></span>
  5438. <kbd aria-hidden="true">L</kbd>
  5439. </button>
  5440. <button class="diagram-guide-action" type="button" data-guide-action="present" aria-label="进入演示模式">
  5441. <span class="diagram-guide-index" aria-hidden="true">05</span>
  5442. <span class="diagram-guide-action-copy"><strong>进入演示模式</strong><small>让实时图表占满视口,同时不改变导出。</small></span>
  5443. <kbd aria-hidden="true">F</kbd>
  5444. </button>
  5445. </div>
  5446. <div class="diagram-guide-shortcuts" aria-label="其他键盘快捷键">
  5447. <span><kbd>E</kbd> 导出</span><span><kbd>T</kbd> 主题</span><span><kbd>S</kbd> 风格</span><span><kbd>0</kbd> 重置</span><span><kbd>+</kbd> 放大</span><span><kbd>-</kbd> 缩小</span><span><kbd>Esc</kbd> 关闭</span>
  5448. </div>
  5449. <p class="diagram-guide-feedback" id="diagram-guide-feedback" aria-live="polite"></p>
  5450. <a class="diagram-guide-credit" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener noreferrer"><span>觉得好用?在 GitHub 给 Archify 点个 Star</span><span class="diagram-guide-credit-link"><span class="diagram-guide-star" aria-hidden="true"></span>Star <span aria-hidden="true">&#8599;</span></span></a>
  5451. </div>
  5452. <div class="node-finder no-print" id="node-finder" hidden role="dialog" aria-modal="false" aria-labelledby="node-finder-title">
  5453. <div class="node-finder-head">
  5454. <strong id="node-finder-title">查找节点</strong>
  5455. <button class="node-finder-close" id="node-finder-close" type="button" aria-label="关闭节点查找器">&#215;</button>
  5456. </div>
  5457. <div class="node-finder-search">
  5458. <span aria-hidden="true">&#8981;</span>
  5459. <input class="node-finder-input" id="node-finder-input" type="search" autocomplete="off" spellcheck="false" placeholder="搜索标签或 ID" aria-label="搜索图表节点" aria-describedby="node-finder-status">
  5460. <kbd aria-hidden="true">/</kbd>
  5461. </div>
  5462. <div class="node-finder-results" id="node-finder-results" role="group" aria-label="图表节点"></div>
  5463. <p class="node-finder-empty" id="node-finder-empty" hidden>没有匹配的节点</p>
  5464. <p class="node-finder-status" id="node-finder-status" aria-live="polite"></p>
  5465. </div>
  5466. <div class="focus-chip relationship-lens no-print" id="focus-chip" hidden role="region" aria-labelledby="relationship-lens-title">
  5467. <div class="relationship-lens-head">
  5468. <button class="relationship-lens-drag-handle" id="btn-focus-move" type="button" data-focus-drag-handle aria-label="移动语义护照。可拖动、使用方向键移动,或按 Home 恢复自动位置。" title="移动语义护照。可拖动、使用方向键移动,或按 Home 恢复自动位置。"></button>
  5469. <div class="relationship-lens-copy">
  5470. <span class="relationship-lens-eyebrow">语义护照</span>
  5471. <strong class="relationship-lens-title" id="relationship-lens-title"><span id="focus-label"></span></strong>
  5472. <span class="semantic-passport-detail" id="focus-detail" hidden></span>
  5473. <div class="semantic-passport-meta" id="focus-passport-meta" aria-label="节点元数据">
  5474. <span id="focus-kind" data-passport="kind"></span>
  5475. <span id="focus-context" data-passport="context" hidden></span>
  5476. <span id="focus-tag" data-passport="tag" hidden></span>
  5477. <span id="focus-brand" data-passport="brand" hidden></span>
  5478. <code id="focus-id" data-passport="id"></code>
  5479. </div>
  5480. <div class="semantic-passport-evidence" id="focus-evidence" hidden aria-label="已验证的源代码证据">
  5481. <div class="semantic-passport-evidence-head">
  5482. <span class="semantic-passport-evidence-status">已验证来源</span>
  5483. <a class="semantic-passport-repository" id="focus-repository" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer"></a>
  5484. </div>
  5485. <div class="semantic-passport-evidence-links" id="focus-evidence-links"></div>
  5486. </div>
  5487. <span class="relationship-lens-summary" id="focus-summary" aria-live="polite"></span>
  5488. <div class="semantic-passport-reach" id="focus-reach" hidden>
  5489. <span class="semantic-passport-reach-label">编写可达范围</span>
  5490. <div class="semantic-passport-reach-actions" role="group" aria-label="追踪编写的可达性">
  5491. <button id="btn-reach-upstream" type="button" aria-label="追踪上游编写可达性" aria-pressed="false">
  5492. <span>上游</span><strong id="focus-reach-upstream-count">0</strong>
  5493. </button>
  5494. <button id="btn-reach-downstream" type="button" aria-label="追踪下游编写可达性" aria-pressed="false">
  5495. <span>下游</span><strong id="focus-reach-downstream-count">0</strong>
  5496. </button>
  5497. </div>
  5498. <small class="semantic-passport-reach-status" id="focus-reach-status" hidden aria-live="polite"></small>
  5499. </div>
  5500. </div>
  5501. <div class="relationship-lens-actions">
  5502. <button id="btn-focus-clear" type="button" aria-label="关闭语义护照" title="关闭">&#215;</button>
  5503. <button id="btn-focus-copy" type="button" aria-label="复制聚焦节点的链接">复制链接</button>
  5504. <button id="btn-focus-relations" type="button" aria-label="显示关联关系" aria-expanded="false" aria-controls="relationship-lens-list">关系</button>
  5505. </div>
  5506. </div>
  5507. <div class="relationship-lens-list" id="relationship-lens-list" aria-label="关联关系"></div>
  5508. </div>
  5509. <div class="route-probe no-print" id="route-probe" hidden role="region" aria-labelledby="route-probe-title" data-state="idle">
  5510. <div class="route-probe-head">
  5511. <span class="route-probe-copy">
  5512. <span class="route-probe-eyebrow">路径</span>
  5513. <strong class="route-probe-title" id="route-probe-title">点击路径的起点</strong>
  5514. </span>
  5515. <span class="route-probe-actions">
  5516. <button class="route-probe-find" id="route-probe-find" type="button" aria-label="查找路径起点" data-node-finder-trigger>查找起点</button>
  5517. <button class="route-probe-copy-link" id="route-probe-copy" type="button" aria-label="复制已追踪路径的链接" hidden>复制链接</button>
  5518. <button id="route-probe-clear" type="button" aria-label="清除路径探测">清除</button>
  5519. </span>
  5520. </div>
  5521. <div class="route-probe-path" id="route-probe-path" aria-label="路径">
  5522. <span class="route-probe-placeholder">在图上点两个节点</span>
  5523. </div>
  5524. <div class="route-journey-controls" id="route-journey-controls" hidden role="group" aria-label="路径旅程控制" data-playing="false">
  5525. <button id="route-journey-prev" type="button" aria-label="上一个路径位置" title="上一个路径位置">&#8592;</button>
  5526. <button class="route-journey-play" id="route-journey-play" type="button" aria-label="播放路径旅程" aria-pressed="false" title="播放路径旅程">
  5527. <span id="route-journey-play-icon" aria-hidden="true">&#9654;</span>
  5528. <span id="route-journey-play-label">旅程</span>
  5529. </button>
  5530. <button id="route-journey-next" type="button" aria-label="下一个路径位置" title="下一个路径位置">&#8594;</button>
  5531. <button class="route-journey-overview" id="route-journey-overview" type="button" aria-label="显示完整路径总览" title="显示完整路径总览">总览</button>
  5532. </div>
  5533. <small class="route-probe-status" id="route-probe-status" aria-live="polite">先点起点,再点终点,沿箭头方向找路。</small>
  5534. </div>
  5535. <div class="semantic-lens no-print" id="semantic-lens" hidden role="dialog" aria-modal="false" aria-labelledby="semantic-lens-title">
  5536. <div class="semantic-lens-head">
  5537. <span>
  5538. <span class="semantic-lens-eyebrow">语义透镜</span>
  5539. <strong class="semantic-lens-title" id="semantic-lens-title">比较系统角色</strong>
  5540. </span>
  5541. <button class="semantic-lens-close" id="semantic-lens-close" type="button" aria-label="关闭语义透镜">&#215;</button>
  5542. </div>
  5543. <p class="semantic-lens-instruction">最多选择两种语义类型。选择一种可显示其真实流量;选择两种只比较直接编写的关系。</p>
  5544. <div class="semantic-lens-kinds" id="semantic-lens-kinds" role="group" aria-label="语义类型"></div>
  5545. <p class="semantic-lens-status" id="semantic-lens-status" aria-live="polite">选择一种类型以检查其节点和相连关系。</p>
  5546. <div class="semantic-lens-actions">
  5547. <button id="semantic-lens-copy" type="button" aria-label="复制语义透镜链接" hidden>复制链接</button>
  5548. <button id="semantic-lens-clear" type="button" aria-label="清除语义透镜">清除</button>
  5549. </div>
  5550. </div>
  5551. <div class="overview-map no-print" id="overview-map" hidden role="region" aria-labelledby="overview-map-title">
  5552. <div class="overview-map-head">
  5553. <span class="overview-map-live" aria-hidden="true"></span>
  5554. <span class="overview-map-copy">
  5555. <strong id="overview-map-title">语义雷达</strong>
  5556. <small id="overview-map-status" aria-live="polite">正在构建总览</small>
  5557. </span>
  5558. <button class="overview-map-expand" id="overview-map-expand" type="button" aria-label="打开完整语义雷达">打开雷达</button>
  5559. <button class="overview-map-close" id="overview-map-close" type="button" aria-label="关闭语义雷达">&#215;</button>
  5560. </div>
  5561. <div class="overview-map-surface" id="overview-map-surface" tabindex="0" role="group" aria-label="图表总览。点击节点进行聚焦,或使用方向键平移。"></div>
  5562. <div class="overview-map-hint" aria-hidden="true"><span>点击节点</span><span>拖动平移</span></div>
  5563. </div>
  5564. <p class="overview-map-feedback no-print" id="overview-map-feedback" role="status" aria-live="polite" hidden>语义雷达需要更多地图可见空间。</p>
  5565. <button class="rail-reveal no-print" id="rail-reveal" type="button" hidden aria-controls="reader-rail" aria-expanded="false"><span class="rail-reveal-icon" aria-hidden="true"></span><span>要点与索引</span></button>
  5566. <div class="diagram-nav no-print" role="toolbar" aria-label="图表视图控制">
  5567. <button id="btn-route-probe" type="button" aria-label="追踪有向路径" aria-pressed="false" aria-controls="route-probe" title="追踪路径(R)">路径</button>
  5568. <button id="btn-overview-map" type="button" aria-label="打开语义雷达" aria-expanded="false" aria-controls="overview-map" title="语义雷达(M)">地图</button>
  5569. <button id="btn-semantic-lens" type="button" aria-label="打开语义透镜" aria-haspopup="dialog" aria-expanded="false" aria-pressed="false" aria-controls="semantic-lens" title="语义透镜(L)">透镜</button>
  5570. <button id="btn-node-finder" type="button" aria-label="查找节点" aria-haspopup="dialog" aria-expanded="false" aria-controls="node-finder" title="查找节点(/)" data-node-finder-trigger><span class="diagram-nav-icon find" aria-hidden="true"></span></button>
  5571. <button id="btn-diagram-guide" type="button" aria-label="打开图表指南" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="图表指南(?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
  5572. <button data-view="out" type="button" aria-label="缩小" title="缩小(-)"><span class="diagram-nav-icon minus" aria-hidden="true"></span></button>
  5573. <button data-view="reset" type="button" aria-label="重置图表视图" title="重置视图(0)"><span class="diagram-nav-detail" data-view-detail hidden>阅读</span><span class="diagram-nav-percent" data-view-percent>100%</span></button>
  5574. <button data-view="in" type="button" aria-label="放大" title="放大(+)"><span class="diagram-nav-icon plus" aria-hidden="true"></span></button>
  5575. </div>
  5576. </div>
  5577. <aside class="reader-rail" id="reader-rail">
  5578. <div class="rail-controls no-print" role="toolbar" aria-label="侧栏">
  5579. <button class="rail-control" id="rail-placement" type="button" hidden aria-label="移到图下方" title="移到图下方" data-placement="right"><span class="rail-control-icon placement" aria-hidden="true"></span></button>
  5580. <button class="rail-control" id="rail-collapse" type="button" hidden aria-controls="reader-rail" aria-expanded="true" aria-label="收起侧栏" title="收起侧栏"><span class="rail-control-icon collapse" aria-hidden="true"></span></button>
  5581. </div>
  5582. <!-- Info Cards -->
  5583. <div class="cards">
  5584. <div class="card">
  5585. <div class="card-header">
  5586. <div class="card-dot emerald"></div>
  5587. <h3>主线五步 + 计费</h3>
  5588. </div>
  5589. <ul>
  5590. <li>建单(unassigned)→ 分派(pending)→ 阅读推进(processing)→ 回填(completed)→ 闭环(settled)</li>
  5591. <li>工单没有「新建」按钮:六个建单时点里四个由订单事务同事务触发,其余来自到期停机作业与人工发起</li>
  5592. <li>回填 success 改写服务开通状态与实际开通日,计费起点 = max(实际开通日, 订单生效日),不开通不计费</li>
  5593. </ul>
  5594. </div>
  5595. <div class="card">
  5596. <div class="card-header">
  5597. <div class="card-dot cyan"></div>
  5598. <h3>判权与职责边界</h3>
  5599. </div>
  5600. <ul>
  5601. <li>网关按权限键判权并注入实例上界;服务侧另做业务角色判定,非授权角色直连写接口一律拒绝</li>
  5602. <li>平台只答「有无接口能力 + 哪片实例」,业务角色判定(谁能建市级、谁能改挂)必须在服务侧</li>
  5603. <li>运维人员档案勾选的工单类型决定其能接哪些单,录入人员不被分派、不能回填</li>
  5604. </ul>
  5605. </div>
  5606. <div class="card">
  5607. <div class="card-header">
  5608. <div class="card-dot violet"></div>
  5609. <h3>回填是决策门</h3>
  5610. </div>
  5611. <ul>
  5612. <li>两层判定:执行结论(success/partial/fail)决定服务状态与计费;必填组决定能否进 completed 与出竣工</li>
  5613. <li>success 触发三写同事务:开停记录 + 服务开通状态 + 计费起点,不得降级为最终一致或补偿</li>
  5614. <li>竣工默认需回传 + 运营商回执才闭环;简化路径下「完成即竣工」,completed 不落库停留</li>
  5615. </ul>
  5616. </div>
  5617. <div class="card">
  5618. <div class="card-header">
  5619. <div class="card-dot rose"></div>
  5620. <h3>异常与不可逆</h3>
  5621. </div>
  5622. <ul>
  5623. <li>partial/fail 只留存不生效,补齐后整体覆盖重填;停机类只录二态结论、竣工缺口恒为空</li>
  5624. <li>竣工被运营商判废进 rejected,同号覆盖重推或总运营受控回退到 processing,此期间不计超期</li>
  5625. <li>已闭环只读、终止不可回退;服务开通状态不因工单关闭回滚,已出账期次不冲销</li>
  5626. </ul>
  5627. </div>
  5628. </div>
  5629. <nav class="node-outline no-print" id="node-outline" hidden aria-labelledby="node-outline-title">
  5630. <div class="node-outline-head">
  5631. <strong id="node-outline-title">节点索引</strong>
  5632. <span class="node-outline-count" id="node-outline-count"></span>
  5633. </div>
  5634. <ol class="node-outline-list" id="node-outline-list"></ol>
  5635. </nav>
  5636. </aside>
  5637. </div>
  5638. <script>
  5639. var Archify = {};
  5640. var archifyI18nData = (function () {
  5641. var node = document.getElementById('archify-i18n-data');
  5642. try { return JSON.parse(node ? node.textContent : '{}'); }
  5643. catch (_) { return { locale: 'en', messages: {} }; }
  5644. })();
  5645. Archify.locale = archifyI18nData.locale || 'en';
  5646. function viewerText(key, values) {
  5647. var messages = archifyI18nData.messages || {};
  5648. var template = Object.prototype.hasOwnProperty.call(messages, key) ? messages[key] : key;
  5649. return String(template).replace(/\{([a-zA-Z0-9_]+)\}/g, function (match, name) {
  5650. return values && Object.prototype.hasOwnProperty.call(values, name) ? String(values[name]) : match;
  5651. });
  5652. }
  5653. function viewerCount(key, count, values) {
  5654. var suffix = Number(count) === 1 ? '.one' : '.other';
  5655. var payload = Object.assign({}, values || {}, { count: count });
  5656. return viewerText(key + suffix, payload);
  5657. }
  5658. function viewerKindLabel(value) {
  5659. var normalized = String(value || 'node').toLowerCase();
  5660. var knownKey = 'viewer.kind.' + normalized;
  5661. var known = viewerText(knownKey);
  5662. if (known !== knownKey) return known;
  5663. return normalized
  5664. .replace(/messagebus/gi, 'message bus')
  5665. .replace(/[-_]+/g, ' ')
  5666. .replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
  5667. }
  5668. function readerLink(state) {
  5669. var template = document.documentElement.getAttribute('data-reading-link-template');
  5670. if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
  5671. if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
  5672. try {
  5673. var url = new URL(template.replace('{state}', encodeURIComponent(state)));
  5674. if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
  5675. return url.href;
  5676. } catch (_) { return null; }
  5677. }
  5678. function copyReaderText(value) {
  5679. function fallbackCopy() {
  5680. var field = document.createElement('textarea');
  5681. field.value = value;
  5682. field.setAttribute('readonly', '');
  5683. field.style.position = 'fixed';
  5684. field.style.opacity = '0';
  5685. document.body.appendChild(field);
  5686. field.select();
  5687. var copied = false;
  5688. try { copied = document.execCommand('copy'); } catch (_) {}
  5689. field.remove();
  5690. return copied;
  5691. }
  5692. var policy = document.permissionsPolicy || document.featurePolicy;
  5693. var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
  5694. if (allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
  5695. try { return Promise.resolve(navigator.clipboard.writeText(value)).then(function () { return true; }).catch(fallbackCopy); }
  5696. catch (_) {}
  5697. }
  5698. return Promise.resolve(fallbackCopy());
  5699. }
  5700. function hasDrawableGeometry(element) {
  5701. if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
  5702. var geometries = /^(path|line|polyline)$/i.test(element.tagName)
  5703. ? [element]
  5704. : Array.prototype.slice.call(element.querySelectorAll('path, line, polyline'));
  5705. return geometries.some(function (geometry) {
  5706. if (geometry.hasAttribute('data-ambient-flow-overlay')) return false;
  5707. var source = geometry.tagName.toLowerCase() === 'path'
  5708. ? geometry.getAttribute('d')
  5709. : geometry.tagName.toLowerCase() === 'polyline'
  5710. ? geometry.getAttribute('points')
  5711. : [geometry.getAttribute('x1'), geometry.getAttribute('y1'), geometry.getAttribute('x2'), geometry.getAttribute('y2')].join(' ');
  5712. if (!source || /(?:^|[^a-z])(?:nan|infinity)(?:[^a-z]|$)/i.test(source) || typeof geometry.getTotalLength !== 'function') return false;
  5713. try {
  5714. var length = Number(geometry.getTotalLength());
  5715. return Number.isFinite(length) && length > 0;
  5716. } catch (_) {
  5717. return false;
  5718. }
  5719. });
  5720. }
  5721. /* ============================================================
  5722. Visual style try-on — one topology, four bundled presets.
  5723. The reader's choice is intentionally session-only: it updates the
  5724. live page and canonical SVG together, but never rewrites the source,
  5725. URL, or a later diagram's authored default.
  5726. ============================================================ */
  5727. Archify.preset = (function () {
  5728. var PRESETS = ['classic', 'signal-flow', 'blueprint', 'editorial'];
  5729. var LABELS = {
  5730. classic: viewerText('viewer.preset.classic.short'),
  5731. 'signal-flow': viewerText('viewer.preset.flow.short'),
  5732. blueprint: viewerText('viewer.preset.blueprint'),
  5733. editorial: viewerText('viewer.preset.editorial')
  5734. };
  5735. var html = document.documentElement;
  5736. var svg = document.querySelector('.diagram-container svg');
  5737. var btn = document.getElementById('btn-preset');
  5738. var label = document.getElementById('preset-label');
  5739. var menu = document.getElementById('preset-menu');
  5740. var options = function () {
  5741. return Array.prototype.slice.call(menu.querySelectorAll('[data-preset-value]'));
  5742. };
  5743. var authored = PRESETS.indexOf(html.getAttribute('data-preset')) >= 0
  5744. ? html.getAttribute('data-preset')
  5745. : 'classic';
  5746. function current() {
  5747. var value = html.getAttribute('data-preset');
  5748. return PRESETS.indexOf(value) >= 0 ? value : authored;
  5749. }
  5750. function nextAfter(preset) {
  5751. return PRESETS[(PRESETS.indexOf(preset) + 1) % PRESETS.length];
  5752. }
  5753. function apply(preset) {
  5754. if (html.getAttribute('data-embed') === 'true') return false;
  5755. if (PRESETS.indexOf(preset) < 0) return false;
  5756. html.setAttribute('data-preset', preset);
  5757. svg.setAttribute('data-preset', preset);
  5758. btn.setAttribute('data-preset-option', preset);
  5759. label.textContent = LABELS[preset];
  5760. btn.setAttribute('aria-label', viewerText('viewer.preset.current', { style: LABELS[preset] }));
  5761. btn.title = viewerText('viewer.preset.choose.title');
  5762. options().forEach(function (option) {
  5763. var selected = option.getAttribute('data-preset-value') === preset;
  5764. option.setAttribute('aria-checked', String(selected));
  5765. });
  5766. return true;
  5767. }
  5768. function cycle() { return apply(nextAfter(current())); }
  5769. function isOpen() { return menu.classList.contains('open'); }
  5770. function open(focusLast) {
  5771. if (html.getAttribute('data-embed') === 'true') return false;
  5772. if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);
  5773. menu.classList.add('open');
  5774. btn.setAttribute('aria-expanded', 'true');
  5775. var available = options();
  5776. var selected = available.find(function (option) { return option.getAttribute('aria-checked') === 'true'; });
  5777. var target = focusLast ? available[available.length - 1] : (selected || available[0]);
  5778. if (target) target.focus();
  5779. return true;
  5780. }
  5781. function close(focusTrigger) {
  5782. menu.classList.remove('open');
  5783. btn.setAttribute('aria-expanded', 'false');
  5784. if (focusTrigger) btn.focus();
  5785. return false;
  5786. }
  5787. apply(authored);
  5788. btn.addEventListener('click', function (e) {
  5789. e.stopPropagation();
  5790. if (isOpen()) close(false);
  5791. else open(false);
  5792. });
  5793. btn.addEventListener('keydown', function (e) {
  5794. if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
  5795. if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
  5796. e.preventDefault();
  5797. if (!isOpen()) open(e.key === 'ArrowUp');
  5798. }
  5799. });
  5800. document.addEventListener('click', function (e) {
  5801. if (!menu.contains(e.target) && e.target !== btn) close(false);
  5802. });
  5803. menu.addEventListener('click', function (e) {
  5804. var option = e.target.closest('[data-preset-value]');
  5805. if (!option || !menu.contains(option)) return;
  5806. if (apply(option.getAttribute('data-preset-value'))) close(true);
  5807. });
  5808. menu.addEventListener('keydown', function (e) {
  5809. if (e.key === 'Escape') { e.preventDefault(); close(true); return; }
  5810. if (e.key === 'Tab') { close(false); return; }
  5811. if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
  5812. var available = options();
  5813. var active = available.indexOf(document.activeElement);
  5814. switch (e.key) {
  5815. case 'ArrowDown':
  5816. e.preventDefault();
  5817. if (available.length) available[(active + 1 + available.length) % available.length].focus();
  5818. break;
  5819. case 'ArrowUp':
  5820. e.preventDefault();
  5821. if (available.length) available[(active - 1 + available.length) % available.length].focus();
  5822. break;
  5823. case 'Home':
  5824. e.preventDefault();
  5825. if (available[0]) available[0].focus();
  5826. break;
  5827. case 'End':
  5828. e.preventDefault();
  5829. if (available.length) available[available.length - 1].focus();
  5830. break;
  5831. }
  5832. });
  5833. return { cycle: cycle, apply: apply, current: current, authored: authored, open: open, close: close, isOpen: isOpen };
  5834. })();
  5835. /* ============================================================
  5836. Theme toggle — persists to localStorage, respects system pref
  5837. ============================================================ */
  5838. Archify.theme = (function () {
  5839. var STORAGE_KEY = 'archify-theme';
  5840. var html = document.documentElement;
  5841. var btn = document.getElementById('btn-theme');
  5842. var label = document.getElementById('theme-label');
  5843. // localStorage can throw (blocked cookies, sandboxed iframes); the whole
  5844. // script element dies on an uncaught error, so guard every access.
  5845. function readStored() {
  5846. try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }
  5847. }
  5848. function writeStored(value) {
  5849. try { localStorage.setItem(STORAGE_KEY, value); } catch (_) {}
  5850. }
  5851. function urlOverride() {
  5852. // URL param wins (useful for deterministic screenshots / share links)
  5853. try {
  5854. var param = new URLSearchParams(window.location.search).get('theme');
  5855. if (param === 'light' || param === 'dark') return param;
  5856. } catch (_) {}
  5857. return null;
  5858. }
  5859. function resolveInitial() {
  5860. var fromUrl = urlOverride();
  5861. if (fromUrl) return fromUrl;
  5862. var saved = readStored();
  5863. if (saved === 'light' || saved === 'dark') return saved;
  5864. return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
  5865. }
  5866. function apply(theme) {
  5867. html.setAttribute('data-theme', theme);
  5868. label.textContent = viewerText(theme === 'dark' ? 'viewer.theme.dark' : 'viewer.theme.light');
  5869. btn.setAttribute('aria-pressed', theme === 'light' ? 'true' : 'false');
  5870. }
  5871. function toggle() {
  5872. var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
  5873. apply(next);
  5874. writeStored(next);
  5875. }
  5876. apply(resolveInitial());
  5877. btn.addEventListener('click', toggle);
  5878. // Follow live OS theme changes while the user has no explicit preference.
  5879. try {
  5880. var media = window.matchMedia('(prefers-color-scheme: light)');
  5881. var onChange = function (e) {
  5882. var saved = readStored();
  5883. if (urlOverride() || saved === 'light' || saved === 'dark') return;
  5884. apply(e.matches ? 'light' : 'dark');
  5885. };
  5886. if (media.addEventListener) media.addEventListener('change', onChange);
  5887. else if (media.addListener) media.addListener(onChange);
  5888. } catch (_) {}
  5889. return { toggle: toggle };
  5890. })();
  5891. /* ============================================================
  5892. Export — Share Card / PNG / JPEG / WebP / SVG / WebM and clipboard
  5893. Raster exports are always rendered at 4x source resolution for
  5894. maximum sharpness. The trick: we set the serialized SVG's
  5895. `width`/`height` to viewBox * 4 so the browser rasterizes the
  5896. vectors at that resolution natively. drawImage then draws at
  5897. the image's natural size (no upscaling = no blur).
  5898. JPEG/WebP paint the current theme's background explicitly since
  5899. those formats have no alpha channel.
  5900. ============================================================ */
  5901. (function () {
  5902. var RASTER_SCALE = 4;
  5903. var MOTION_DURATION = 6000;
  5904. var MOTION_FPS = 30;
  5905. var SHARE_CARD_WIDTH = 1200;
  5906. var SHARE_CARD_HEIGHT = 630;
  5907. var SHARE_CARD_PADDING = 40;
  5908. var SHARE_CARD_HEADER = 124;
  5909. function exportError(key, values) {
  5910. var error = new Error(viewerText(key, values));
  5911. error.archifyViewerMessage = true;
  5912. return error;
  5913. }
  5914. function exportMessage(error) {
  5915. return error && error.archifyViewerMessage
  5916. ? error.message
  5917. : viewerText('viewer.export.unknown');
  5918. }
  5919. function diagramFilename() {
  5920. var title = (document.title || 'diagram')
  5921. .replace(/\s+Architecture(\s+Diagram)?$/i, '')
  5922. .replace(/\s+Diagram$/i, '')
  5923. .trim();
  5924. return title.replace(/[^a-z0-9_\-]+/gi, '-')
  5925. .toLowerCase()
  5926. .replace(/^-+|-+$/g, '') || 'diagram';
  5927. }
  5928. function currentBg() {
  5929. return getComputedStyle(document.body).backgroundColor || '#ffffff';
  5930. }
  5931. function cleanExportClone(clone) {
  5932. Array.prototype.forEach.call(clone.querySelectorAll('[data-ambient-flow-overlay]'), function (el) {
  5933. el.remove();
  5934. });
  5935. // Route interaction rewrites CSS declarations through CSSOM. Normalize
  5936. // authored motion delays on the clone so exported bytes do not depend
  5937. // on whether the reader traced a route before downloading.
  5938. Array.prototype.forEach.call(clone.querySelectorAll('[data-animate]'), function (el) {
  5939. var step = el.style.getPropertyValue('--step');
  5940. if (step) el.setAttribute('style', el.style.cssText);
  5941. });
  5942. // View transforms and neighborhood focus are HTML exploration state,
  5943. // never part of a downloaded full-diagram artifact.
  5944. clone.style.removeProperty('transform');
  5945. clone.style.removeProperty('clip-path');
  5946. clone.removeAttribute('data-view-scale');
  5947. clone.removeAttribute('data-focus-active');
  5948. clone.removeAttribute('data-reach-active');
  5949. clone.removeAttribute('data-lens-active');
  5950. clone.removeAttribute('data-lens-flow-count');
  5951. clone.removeAttribute('data-lens-flow-density');
  5952. clone.removeAttribute('data-legend-preview-active');
  5953. clone.removeAttribute('data-relationship-preview-active');
  5954. clone.removeAttribute('data-relationship-direct-active');
  5955. clone.removeAttribute('data-relationship-pin-active');
  5956. clone.removeAttribute('data-intent-trace-active');
  5957. clone.removeAttribute('data-route-picking');
  5958. clone.removeAttribute('data-route-active');
  5959. clone.removeAttribute('data-route-journey');
  5960. clone.removeAttribute('data-share-route');
  5961. clone.removeAttribute('data-share-reach');
  5962. Array.prototype.forEach.call(clone.querySelectorAll('[data-reader-legend-corner]'), function (el) {
  5963. el.removeAttribute('data-reader-legend-corner');
  5964. el.style.removeProperty('--archify-reader-legend-transform');
  5965. });
  5966. Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
  5967. el.remove();
  5968. });
  5969. Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
  5970. el.remove();
  5971. });
  5972. Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
  5973. el.remove();
  5974. });
  5975. Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
  5976. el.remove();
  5977. });
  5978. Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
  5979. el.remove();
  5980. });
  5981. Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
  5982. el.removeAttribute('data-legend-kind');
  5983. el.removeAttribute('data-legend-label');
  5984. el.removeAttribute('data-legend-count');
  5985. el.removeAttribute('data-legend-zero');
  5986. el.removeAttribute('data-legend-selected');
  5987. el.removeAttribute('role');
  5988. el.removeAttribute('tabindex');
  5989. el.removeAttribute('aria-label');
  5990. el.removeAttribute('aria-pressed');
  5991. el.removeAttribute('aria-haspopup');
  5992. el.removeAttribute('aria-controls');
  5993. el.removeAttribute('aria-expanded');
  5994. });
  5995. Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
  5996. el.removeAttribute('data-legend-bridge');
  5997. el.removeAttribute('role');
  5998. el.removeAttribute('aria-label');
  5999. });
  6000. Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
  6001. el.remove();
  6002. });
  6003. Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
  6004. el.remove();
  6005. });
  6006. Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
  6007. el.remove();
  6008. });
  6009. Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
  6010. var originalLabel = el.getAttribute('data-source-evidence-original-label');
  6011. if (originalLabel == null) el.removeAttribute('aria-label');
  6012. else el.setAttribute('aria-label', originalLabel);
  6013. el.removeAttribute('data-source-evidence-count');
  6014. el.removeAttribute('data-source-evidence-original-label');
  6015. });
  6016. Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
  6017. el.removeAttribute('data-focus-match');
  6018. el.removeAttribute('data-focus-selected');
  6019. });
  6020. Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
  6021. el.removeAttribute('data-reach-match');
  6022. el.removeAttribute('data-reach-origin');
  6023. el.removeAttribute('data-reach-depth');
  6024. });
  6025. Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
  6026. el.removeAttribute('data-lens-match');
  6027. el.removeAttribute('data-lens-selected');
  6028. el.removeAttribute('data-lens-peer');
  6029. });
  6030. Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
  6031. el.removeAttribute('data-legend-preview-match');
  6032. el.removeAttribute('data-legend-preview-selected');
  6033. el.removeAttribute('data-legend-preview-peer');
  6034. });
  6035. Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
  6036. el.removeAttribute('data-relationship-preview');
  6037. el.removeAttribute('data-relationship-preview-node');
  6038. el.removeAttribute('data-relationship-preview-source');
  6039. el.removeAttribute('data-relationship-preview-target');
  6040. });
  6041. Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
  6042. el.removeAttribute('data-intent-trace-match');
  6043. el.removeAttribute('data-intent-trace-selected');
  6044. });
  6045. Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
  6046. el.removeAttribute('data-route-match');
  6047. el.removeAttribute('data-route-start');
  6048. el.removeAttribute('data-route-end');
  6049. el.removeAttribute('data-route-step');
  6050. el.removeAttribute('data-route-candidate');
  6051. el.removeAttribute('data-route-journey-state');
  6052. el.removeAttribute('data-route-journey-current');
  6053. el.style.removeProperty('--route-step');
  6054. });
  6055. Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
  6056. el.removeAttribute('data-share-route-match');
  6057. el.removeAttribute('data-share-route-step');
  6058. el.removeAttribute('data-share-route-start');
  6059. el.removeAttribute('data-share-route-end');
  6060. el.removeAttribute('data-share-route-middle');
  6061. });
  6062. Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
  6063. el.removeAttribute('data-share-reach-match');
  6064. el.removeAttribute('data-share-reach-origin');
  6065. el.removeAttribute('data-share-reach-depth');
  6066. });
  6067. Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
  6068. el.removeAttribute('data-detail');
  6069. el.removeAttribute('data-detail-anchor');
  6070. });
  6071. Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
  6072. el.setAttribute('aria-pressed', 'false');
  6073. });
  6074. // A downloaded tree is always the complete hierarchy: collapsing is a
  6075. // reading aid, never a silent change to what the artifact contains.
  6076. clone.removeAttribute('data-tree-any-collapsed');
  6077. Array.prototype.forEach.call(clone.querySelectorAll('[data-tree-hidden], [data-tree-collapsed]'), function (el) {
  6078. el.removeAttribute('data-tree-hidden');
  6079. el.removeAttribute('data-tree-collapsed');
  6080. });
  6081. Array.prototype.forEach.call(clone.querySelectorAll('[data-tree-toggle]'), function (el) {
  6082. el.setAttribute('aria-expanded', 'true');
  6083. el.setAttribute('aria-label', el.getAttribute('data-tree-label-collapse') || '');
  6084. });
  6085. return !clone.hasAttribute('data-view-scale') &&
  6086. !clone.hasAttribute('data-focus-active') &&
  6087. !clone.hasAttribute('data-reach-active') &&
  6088. !clone.hasAttribute('data-lens-active') &&
  6089. !clone.hasAttribute('data-lens-flow-count') &&
  6090. !clone.hasAttribute('data-lens-flow-density') &&
  6091. !clone.hasAttribute('data-legend-preview-active') &&
  6092. !clone.hasAttribute('data-relationship-preview-active') &&
  6093. !clone.hasAttribute('data-relationship-direct-active') &&
  6094. !clone.hasAttribute('data-intent-trace-active') &&
  6095. !clone.hasAttribute('data-route-picking') &&
  6096. !clone.hasAttribute('data-route-active') &&
  6097. !clone.hasAttribute('data-route-journey') &&
  6098. !clone.hasAttribute('data-share-route') &&
  6099. !clone.hasAttribute('data-share-reach') &&
  6100. !clone.hasAttribute('data-tree-any-collapsed') &&
  6101. !clone.style.getPropertyValue('transform') &&
  6102. !clone.style.getPropertyValue('clip-path') &&
  6103. clone.querySelectorAll('[data-ambient-flow-overlay], [data-reader-legend-corner], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor], [data-tree-hidden], [data-tree-collapsed]').length === 0;
  6104. }
  6105. /**
  6106. * Serialize the main SVG into a standalone document.
  6107. *
  6108. * Two modes:
  6109. * - Default (opts.autoTheme=false) — locks the serialized SVG to the
  6110. * viewer's current theme. Used by the raster pipeline
  6111. * (PNG/JPEG/WebP/clipboard) because canvas rasterization needs
  6112. * deterministic colors; a raster cannot react to
  6113. * prefers-color-scheme after encoding.
  6114. * - theme=auto — emits BOTH dark and light variable sets plus a
  6115. * `@media (prefers-color-scheme)` rule so the resulting SVG
  6116. * self-themes when embedded in GitHub READMEs or other hosts that
  6117. * expose a color scheme. Used for the default "Download SVG".
  6118. * - theme=light|dark — locks the standalone SVG to the requested
  6119. * theme, independently of its source Viewer and host OS themes.
  6120. */
  6121. function applyRouteSnapshot(clone, snapshot) {
  6122. if (!snapshot || !Array.isArray(snapshot.nodeIds) || !Array.isArray(snapshot.edges) ||
  6123. snapshot.nodeIds.length < 2 || snapshot.edges.length !== snapshot.nodeIds.length - 1 ||
  6124. snapshot.hops !== snapshot.edges.length ||
  6125. !snapshot.source || !snapshot.target ||
  6126. snapshot.source.id !== snapshot.nodeIds[0] ||
  6127. snapshot.target.id !== snapshot.nodeIds[snapshot.nodeIds.length - 1]) return false;
  6128. clone.removeAttribute('data-animation');
  6129. Array.prototype.forEach.call(clone.querySelectorAll('[data-animate]'), function (element) {
  6130. element.removeAttribute('data-animate');
  6131. element.style.removeProperty('--step');
  6132. });
  6133. var cloneNodes = Array.prototype.slice.call(clone.querySelectorAll('[data-node-id]'));
  6134. var cloneEdges = Array.prototype.slice.call(clone.querySelectorAll('[data-edge-key]'));
  6135. var nodeIds = Object.create(null);
  6136. var edgeKeys = Object.create(null);
  6137. var nodeMatches = [];
  6138. var edgeMatches = [];
  6139. for (var nodeIndex = 0; nodeIndex < snapshot.nodeIds.length; nodeIndex++) {
  6140. var nodeId = snapshot.nodeIds[nodeIndex];
  6141. if (typeof nodeId !== 'string' || !nodeId || nodeIds[nodeId]) return false;
  6142. var matchedNodes = cloneNodes.filter(function (candidate) {
  6143. return candidate.getAttribute('data-node-id') === nodeId;
  6144. });
  6145. if (matchedNodes.length !== 1) return false;
  6146. nodeIds[nodeId] = true;
  6147. nodeMatches.push(matchedNodes);
  6148. }
  6149. for (var edgeIndex = 0; edgeIndex < snapshot.edges.length; edgeIndex++) {
  6150. var edge = snapshot.edges[edgeIndex];
  6151. var fromId = snapshot.nodeIds[edgeIndex];
  6152. var toId = snapshot.nodeIds[edgeIndex + 1];
  6153. if (!edge || typeof edge.key !== 'string' || !edge.key || edgeKeys[edge.key] ||
  6154. edge.from !== fromId || edge.to !== toId) return false;
  6155. var matchedEdges = cloneEdges.filter(function (candidate) {
  6156. return candidate.getAttribute('data-edge-key') === edge.key;
  6157. });
  6158. var drawableMatches = matchedEdges.filter(hasDrawableGeometry);
  6159. if (!matchedEdges.length || drawableMatches.length !== 1 || !matchedEdges.every(function (candidate) {
  6160. return candidate.getAttribute('data-edge-from') === edge.from &&
  6161. candidate.getAttribute('data-edge-to') === edge.to &&
  6162. (candidate.getAttribute('data-edge-id') || '') === (edge.id || '');
  6163. })) return false;
  6164. edgeKeys[edge.key] = true;
  6165. edgeMatches.push(matchedEdges);
  6166. }
  6167. clone.setAttribute('data-share-route', '');
  6168. nodeMatches.forEach(function (matches, step) {
  6169. matches.forEach(function (element) {
  6170. element.setAttribute('data-share-route-match', '');
  6171. element.setAttribute('data-share-route-step', String(step));
  6172. if (step === 0) element.setAttribute('data-share-route-start', '');
  6173. else if (step === snapshot.nodeIds.length - 1) element.setAttribute('data-share-route-end', '');
  6174. else element.setAttribute('data-share-route-middle', '');
  6175. });
  6176. });
  6177. edgeMatches.forEach(function (matches, step) {
  6178. matches.forEach(function (element) {
  6179. element.setAttribute('data-share-route-match', '');
  6180. element.setAttribute('data-share-route-step', String(step));
  6181. });
  6182. });
  6183. return clone.hasAttribute('data-share-route') &&
  6184. !clone.hasAttribute('data-animation') &&
  6185. !clone.hasAttribute('data-route-active') &&
  6186. !clone.hasAttribute('data-route-journey') &&
  6187. clone.querySelectorAll('[data-animate], [data-route-match], [data-route-step], [data-route-start], [data-route-end], [data-route-journey-state], [data-route-journey-current], [data-route-journey-overlay]').length === 0 &&
  6188. clone.querySelectorAll('[data-share-route-match]').length ===
  6189. nodeMatches.reduce(function (count, matches) { return count + matches.length; }, 0) +
  6190. edgeMatches.reduce(function (count, matches) { return count + matches.length; }, 0);
  6191. }
  6192. function applyReachSnapshot(clone, snapshot) {
  6193. if (!snapshot || (snapshot.direction !== 'upstream' && snapshot.direction !== 'downstream') ||
  6194. !snapshot.origin || typeof snapshot.origin.id !== 'string' || !snapshot.origin.id ||
  6195. typeof snapshot.origin.label !== 'string' || !snapshot.origin.label.trim() ||
  6196. !Array.isArray(snapshot.nodeIds) || snapshot.nodeIds.length < 2 ||
  6197. !Array.isArray(snapshot.edges) || !snapshot.edges.length ||
  6198. !snapshot.depths || typeof snapshot.depths !== 'object' ||
  6199. !Number.isInteger(snapshot.maxDepth) || snapshot.maxDepth < 1 ||
  6200. snapshot.nodeIds[0] !== snapshot.origin.id) return false;
  6201. clone.removeAttribute('data-animation');
  6202. Array.prototype.forEach.call(clone.querySelectorAll('[data-animate]'), function (element) {
  6203. element.removeAttribute('data-animate');
  6204. element.style.removeProperty('--step');
  6205. });
  6206. var cloneNodes = Array.prototype.slice.call(clone.querySelectorAll('[data-node-id]'));
  6207. var cloneEdges = Array.prototype.slice.call(clone.querySelectorAll('[data-edge-key]'));
  6208. var nodeIds = Object.create(null);
  6209. var edgeKeys = Object.create(null);
  6210. var nodeMatches = [];
  6211. var edgeMatches = [];
  6212. var measuredMaxDepth = 0;
  6213. for (var nodeIndex = 0; nodeIndex < snapshot.nodeIds.length; nodeIndex++) {
  6214. var nodeId = snapshot.nodeIds[nodeIndex];
  6215. var depth = snapshot.depths[nodeId];
  6216. if (typeof nodeId !== 'string' || !nodeId || nodeIds[nodeId] ||
  6217. !Number.isInteger(depth) || depth < 0 || depth > snapshot.maxDepth ||
  6218. (nodeId === snapshot.origin.id ? depth !== 0 : depth < 1)) return false;
  6219. var matchedNodes = cloneNodes.filter(function (candidate) {
  6220. return candidate.getAttribute('data-node-id') === nodeId;
  6221. });
  6222. if (matchedNodes.length !== 1) return false;
  6223. nodeIds[nodeId] = true;
  6224. measuredMaxDepth = Math.max(measuredMaxDepth, depth);
  6225. nodeMatches.push({ elements: matchedNodes, id: nodeId, depth: depth });
  6226. }
  6227. if (measuredMaxDepth !== snapshot.maxDepth) return false;
  6228. for (var edgeIndex = 0; edgeIndex < snapshot.edges.length; edgeIndex++) {
  6229. var edge = snapshot.edges[edgeIndex];
  6230. if (!edge || typeof edge.key !== 'string' || !edge.key || edgeKeys[edge.key] ||
  6231. !nodeIds[edge.from] || !nodeIds[edge.to] ||
  6232. !Number.isInteger(edge.depth) || edge.depth < 1 || edge.depth > snapshot.maxDepth ||
  6233. edge.depth !== Math.max(snapshot.depths[edge.from], snapshot.depths[edge.to])) return false;
  6234. var matchedEdges = cloneEdges.filter(function (candidate) {
  6235. return candidate.getAttribute('data-edge-key') === edge.key;
  6236. });
  6237. var drawableMatches = matchedEdges.filter(hasDrawableGeometry);
  6238. if (!matchedEdges.length || drawableMatches.length !== 1 || !matchedEdges.every(function (candidate) {
  6239. return candidate.getAttribute('data-edge-from') === edge.from &&
  6240. candidate.getAttribute('data-edge-to') === edge.to &&
  6241. (candidate.getAttribute('data-edge-id') || '') === (edge.id || '');
  6242. })) return false;
  6243. edgeKeys[edge.key] = true;
  6244. edgeMatches.push({ elements: matchedEdges, depth: edge.depth });
  6245. }
  6246. clone.setAttribute('data-share-reach', snapshot.direction);
  6247. nodeMatches.forEach(function (match) {
  6248. match.elements.forEach(function (element) {
  6249. element.setAttribute('data-share-reach-match', '');
  6250. element.setAttribute('data-share-reach-depth', String(match.depth));
  6251. if (match.id === snapshot.origin.id) element.setAttribute('data-share-reach-origin', '');
  6252. });
  6253. });
  6254. edgeMatches.forEach(function (match) {
  6255. match.elements.forEach(function (element) {
  6256. element.setAttribute('data-share-reach-match', '');
  6257. element.setAttribute('data-share-reach-depth', String(match.depth));
  6258. });
  6259. });
  6260. return clone.getAttribute('data-share-reach') === snapshot.direction &&
  6261. !clone.hasAttribute('data-animation') &&
  6262. !clone.hasAttribute('data-reach-active') &&
  6263. clone.querySelectorAll('[data-animate], [data-reach-match], [data-reach-origin], [data-reach-depth]').length === 0 &&
  6264. clone.querySelectorAll('[data-share-reach-origin]').length === 1 &&
  6265. clone.querySelectorAll('[data-share-reach-match]').length ===
  6266. nodeMatches.reduce(function (count, match) { return count + match.elements.length; }, 0) +
  6267. edgeMatches.reduce(function (count, match) { return count + match.elements.length; }, 0);
  6268. }
  6269. function serializeSvg(scale, opts) {
  6270. // scale: multiplier (integer unless the figure is oversized) for intrinsic SVG pixel dimensions used by
  6271. // the raster path. Defaults to 1 (natural size) for SVG download.
  6272. scale = scale || 1;
  6273. opts = opts || {};
  6274. var requestedTheme = opts.theme || (opts.autoTheme === true ? 'auto' : null);
  6275. if (requestedTheme && requestedTheme !== 'auto' && requestedTheme !== 'light' && requestedTheme !== 'dark') {
  6276. throw new Error('Unsupported SVG theme: ' + requestedTheme);
  6277. }
  6278. var autoTheme = requestedTheme === 'auto';
  6279. var svg = document.querySelector('.diagram-container svg');
  6280. var clone = svg.cloneNode(true);
  6281. var softwareNotices = document.getElementById('archify-software-notices');
  6282. if (softwareNotices) {
  6283. var softwareMetadata = document.createElementNS('http://www.w3.org/2000/svg', 'metadata');
  6284. softwareMetadata.setAttribute('id', 'archify-software-notices');
  6285. softwareMetadata.textContent = JSON.parse(softwareNotices.textContent);
  6286. clone.insertBefore(softwareMetadata, clone.firstChild);
  6287. }
  6288. var canonicalStateClean = cleanExportClone(clone);
  6289. var vb = svg.viewBox.baseVal;
  6290. var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&
  6291. Number.isFinite(vb.width) && Number.isFinite(vb.height) && vb.width > 0 && vb.height > 0;
  6292. var routeStateClean = opts.routeSnapshot
  6293. ? canonicalStateClean && finiteSvgDimensions && applyRouteSnapshot(clone, opts.routeSnapshot)
  6294. : null;
  6295. var reachStateClean = opts.reachSnapshot
  6296. ? canonicalStateClean && finiteSvgDimensions && !opts.routeSnapshot && applyReachSnapshot(clone, opts.reachSnapshot)
  6297. : null;
  6298. // Scale width/height so the browser rasterizes the vectors at target
  6299. // resolution directly. viewBox stays unchanged so coordinates don't
  6300. // shift. This is the key to sharp rasters — do NOT scale later via
  6301. // canvas upscaling.
  6302. clone.setAttribute('width', vb.width * scale);
  6303. clone.setAttribute('height', vb.height * scale);
  6304. // Keep copied Viewer layout rules from overriding the export's size.
  6305. clone.style.width = vb.width * scale + 'px';
  6306. clone.style.height = vb.height * scale + 'px';
  6307. clone.style.minWidth = '0';
  6308. clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
  6309. // Only the SVG-relevant rules: semantic classes, markers, and the
  6310. // theme variable blocks. Toolbar/cards/print CSS can never apply
  6311. // inside a standalone SVG and would only bloat the export.
  6312. var hostStyle = (function () {
  6313. var out = [];
  6314. Array.prototype.forEach.call(document.styleSheets, function (sheet) {
  6315. var rules;
  6316. try { rules = sheet.cssRules; } catch (_) { return; } // cross-origin
  6317. if (!rules) return;
  6318. Array.prototype.forEach.call(rules, function (rule) {
  6319. if (rule.type === 7 && /^archify-/.test(rule.name || '')) {
  6320. out.push(rule.cssText);
  6321. return;
  6322. }
  6323. if (rule.type !== 1) return; // plain style rules only
  6324. var sel = rule.selectorText || '';
  6325. if (/(^|,)\s*(svg|:root|\[data-theme|\[data-preset|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {
  6326. out.push(rule.cssText);
  6327. } else if (opts.figure && sel.indexOf('.diagram-container > svg') !== -1) {
  6328. // Figures look like the Viewer canvas: keep its preset/theme paint
  6329. // (quiet grid, lifted nodes) by rescoping matching rules to svg.
  6330. var scoped = sel.split(',').map(function (part) {
  6331. var at = part.indexOf('.diagram-container > svg');
  6332. if (at === -1) return null;
  6333. var prefix = part.slice(0, at).trim();
  6334. try { if (prefix && !document.documentElement.matches(prefix)) return null; } catch (_) { return null; }
  6335. return 'svg' + part.slice(at + '.diagram-container > svg'.length);
  6336. }).filter(Boolean);
  6337. if (scoped.length) out.push(scoped.join(', ') + ' { ' + rule.style.cssText + ' }');
  6338. }
  6339. });
  6340. });
  6341. return out.join('\n');
  6342. })();
  6343. // Derive the variable list from the stylesheet so newly added theme
  6344. // variables can never be missed by the export pipeline again
  6345. // (--lane-fill/--lane-stroke once were).
  6346. var varNames = (function () {
  6347. var seen = {};
  6348. var names = [];
  6349. (hostStyle.match(/--[a-zA-Z0-9-]+(?=\s*:)/g) || []).forEach(function (n) {
  6350. if (!seen[n]) { seen[n] = true; names.push(n); }
  6351. });
  6352. return names;
  6353. })();
  6354. // Resolve the full variable set for a given data-theme via an
  6355. // off-DOM probe, independent of what the viewer is currently set to.
  6356. function resolveVars(themeAttr) {
  6357. var probe = document.createElement('div');
  6358. probe.setAttribute('data-theme', themeAttr);
  6359. probe.setAttribute('data-preset', document.documentElement.getAttribute('data-preset') || 'classic');
  6360. probe.style.cssText = 'position:absolute;width:0;height:0;visibility:hidden;';
  6361. document.body.appendChild(probe);
  6362. try {
  6363. var c = getComputedStyle(probe);
  6364. return {
  6365. background: c.getPropertyValue('--bg').trim(),
  6366. vars: varNames.map(function (n) {
  6367. return n + ': ' + c.getPropertyValue(n).trim() + ';';
  6368. }).join(' ')
  6369. };
  6370. } finally {
  6371. document.body.removeChild(probe);
  6372. }
  6373. }
  6374. // Keep the same font bytes, character coverage, and attribution in
  6375. // standalone SVGs and the SVG images used by every raster export.
  6376. var fontCss = document.getElementById('archify-fonts').textContent;
  6377. var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');
  6378. var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
  6379. // Cover the real viewBox: auto-cropped canvases start below y=0, and a
  6380. // 100% rect anchored at the origin left an unpainted band at the bottom.
  6381. bgRect.setAttribute('x', vb.x);
  6382. bgRect.setAttribute('y', vb.y);
  6383. bgRect.setAttribute('width', vb.width);
  6384. bgRect.setAttribute('height', vb.height);
  6385. if (autoTheme) {
  6386. // Dual-theme SVG. Dark is the default (so hosts without
  6387. // prefers-color-scheme still render), light swaps in via media
  6388. // query, and svg[data-theme="..."] still lets downstream
  6389. // consumers force a specific theme.
  6390. var darkTheme = resolveVars('dark');
  6391. var lightTheme = resolveVars('light');
  6392. style.textContent =
  6393. fontCss + "\n" +
  6394. "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
  6395. hostStyle + "\n" +
  6396. ":root, svg { " + darkTheme.vars + " }\n" +
  6397. "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
  6398. "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
  6399. "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
  6400. "rect.c-bg-rect { fill: var(--bg); }\n";
  6401. // Don't lock the serialized SVG to the viewer's current theme.
  6402. clone.removeAttribute('data-theme');
  6403. // Background follows the CSS variable, not a fixed color, so it
  6404. // swaps with the media query.
  6405. bgRect.setAttribute('class', 'c-bg-rect');
  6406. } else {
  6407. // Raster exports keep the viewer's current theme. Explicit SVG
  6408. // exports instead select their own stable light/dark source.
  6409. var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
  6410. var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
  6411. var computed = getComputedStyle(document.documentElement);
  6412. var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
  6413. return n + ': ' + computed.getPropertyValue(n).trim() + ';';
  6414. }).join(' ');
  6415. // IMPORTANT: inject the resolved variables AFTER hostStyle,
  6416. // otherwise hostStyle's ":root, [data-theme=\"dark\"] { ... }" rule
  6417. // overrides our chosen theme via later-in-cascade equal-specificity.
  6418. // Keep this order.
  6419. style.textContent =
  6420. fontCss + "\n" +
  6421. "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
  6422. hostStyle + "\n" +
  6423. ":root, svg { " + vars + " }\n";
  6424. if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
  6425. bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
  6426. }
  6427. if (opts.routeSnapshot) {
  6428. style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from], svg[data-share-route] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n" +
  6429. "svg[data-share-route] [data-share-route-match], svg[data-share-route] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-route-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
  6430. "svg[data-share-route] [data-share-route-start] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3; stroke-dasharray: 5 3; }\n" +
  6431. "svg[data-share-route] [data-share-route-middle] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 2.2; }\n" +
  6432. "svg[data-share-route] [data-share-route-end] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3.4; stroke-dasharray: 1 0; }\n";
  6433. }
  6434. if (opts.reachSnapshot) {
  6435. style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from], svg[data-share-reach] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.14; }\n" +
  6436. "svg[data-share-reach] [data-share-reach-match], svg[data-share-reach] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-reach-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
  6437. "svg[data-share-reach] [data-edge-from][data-share-reach-match] { stroke-width: 1.55; }\n" +
  6438. "svg[data-share-reach=\"upstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--database-stroke); stroke-width: 3.4; stroke-dasharray: 5 3; }\n" +
  6439. "svg[data-share-reach=\"downstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--backend-stroke); stroke-width: 3.4; stroke-dasharray: 1 0; }\n" +
  6440. "svg[data-preset=\"blueprint\"][data-share-reach] [data-share-reach-origin], svg[data-preset=\"blueprint\"][data-share-reach] [data-edge-from][data-share-reach-match] { filter: none; }\n";
  6441. }
  6442. // Figures draw the diagram on a painted canvas card, like the Viewer.
  6443. if (opts.figure) bgRect.setAttribute('fill', 'none');
  6444. clone.insertBefore(style, clone.firstChild);
  6445. clone.insertBefore(bgRect, style.nextSibling);
  6446. // The XML declaration pins UTF-8: without it, consumers that guess an
  6447. // encoding instead of defaulting to UTF-8 mangle non-ASCII text.
  6448. return {
  6449. svgString: '<?xml version="1.0" encoding="UTF-8"?>\n' +
  6450. new XMLSerializer().serializeToString(clone),
  6451. width: vb.width * scale,
  6452. height: vb.height * scale,
  6453. canonicalStateClean: canonicalStateClean,
  6454. routeStateClean: routeStateClean,
  6455. reachStateClean: reachStateClean
  6456. };
  6457. }
  6458. function download(blob, filename) {
  6459. var url = URL.createObjectURL(blob);
  6460. var a = document.createElement('a');
  6461. a.href = url;
  6462. a.download = filename;
  6463. // Keep the export-owned activation inside its existing control boundary.
  6464. // The synthetic download click must not dismiss the reader selection.
  6465. menu.appendChild(a);
  6466. a.click();
  6467. a.remove();
  6468. setTimeout(function () { URL.revokeObjectURL(url); }, 1000);
  6469. }
  6470. // Conservative upper bound on total canvas pixels. Older Safari on iOS
  6471. // silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /
  6472. // desktop Safari are far higher but start failing on memory-constrained
  6473. // devices. We pick the largest integer scale in {4,3,2,1} whose target
  6474. // pixel count fits under this cap; a figure too large even at 1x is
  6475. // downscaled to fit rather than allocating an oversized canvas.
  6476. var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;
  6477. function pickSafeScale(vbW, vbH) {
  6478. for (var s = RASTER_SCALE; s >= 1; s--) {
  6479. if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;
  6480. }
  6481. return Math.sqrt(MAX_CANVAS_PIXELS / (vbW * vbH)) * 0.999;
  6482. }
  6483. // Raster exports reproduce the Viewer page without its controls: the
  6484. // title row with its accent dot, then the diagram on the same rounded
  6485. // canvas card (fill, hairline, shadow, dot field). CSS pixels.
  6486. var FIGURE_MARGIN = 28;
  6487. var FIGURE_CARD_PADDING = 24;
  6488. var FIGURE_TITLE_SIZE = 24;
  6489. var FIGURE_SUBTITLE_SIZE = 14;
  6490. function figureLayout(vb) {
  6491. var titleNode = document.querySelector('.header h1');
  6492. var subtitleNode = document.querySelector('.header .subtitle');
  6493. var container = document.querySelector('.diagram-container');
  6494. var root = getComputedStyle(document.documentElement);
  6495. var card = container ? getComputedStyle(container) : null;
  6496. var title = titleNode ? titleNode.textContent.trim() : '';
  6497. var subtitle = subtitleNode ? subtitleNode.textContent.trim() : '';
  6498. var header = title ? 32 + (subtitle ? 24 : 0) + 18 : 0;
  6499. var cardWidth = vb.width + FIGURE_CARD_PADDING * 2;
  6500. var cardHeight = vb.height + FIGURE_CARD_PADDING * 2;
  6501. var cardFill = card && card.backgroundColor && !/rgba\(0, 0, 0, 0\)|transparent/.test(card.backgroundColor)
  6502. ? card.backgroundColor : (root.getPropertyValue('--panel').trim() || 'transparent');
  6503. return {
  6504. title: title,
  6505. subtitle: subtitle,
  6506. family: titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif',
  6507. text: root.getPropertyValue('--text').trim() || '#111827',
  6508. muted: root.getPropertyValue('--text-muted').trim() || '#64748b',
  6509. accent: root.getPropertyValue('--frontend-stroke').trim() || '#0891b2',
  6510. bg: root.getPropertyValue('--bg').trim() || currentBg(),
  6511. cardFill: cardFill,
  6512. cardBorder: root.getPropertyValue('--panel-border').trim() || 'transparent',
  6513. dot: card && /radial-gradient/.test(card.backgroundImage) ? (root.getPropertyValue('--canvas-dot').trim() || '') : '',
  6514. light: (document.documentElement.getAttribute('data-theme') || 'dark') === 'light',
  6515. header: header,
  6516. cardWidth: cardWidth,
  6517. cardHeight: cardHeight,
  6518. width: cardWidth + FIGURE_MARGIN * 2,
  6519. height: cardHeight + FIGURE_MARGIN * 2 + header
  6520. };
  6521. }
  6522. function paintFigure(ctx, layout) {
  6523. var m = FIGURE_MARGIN;
  6524. ctx.fillStyle = layout.bg;
  6525. ctx.fillRect(0, 0, layout.width, layout.height);
  6526. if (layout.title) {
  6527. var titleMid = m + 16;
  6528. ctx.fillStyle = layout.accent;
  6529. ctx.globalAlpha = 0.16;
  6530. ctx.beginPath(); ctx.arc(m + 5, titleMid, 9, 0, Math.PI * 2); ctx.fill();
  6531. ctx.globalAlpha = 1;
  6532. ctx.beginPath(); ctx.arc(m + 5, titleMid, 5, 0, Math.PI * 2); ctx.fill();
  6533. ctx.textBaseline = 'middle';
  6534. ctx.fillStyle = layout.text;
  6535. ctx.fillText(fitCanvasText(ctx, layout.title, layout.width - m * 2 - 22, FIGURE_TITLE_SIZE, 14, '650', layout.family), m + 22, titleMid + 1);
  6536. if (layout.subtitle) {
  6537. ctx.fillStyle = layout.muted;
  6538. ctx.fillText(fitCanvasText(ctx, layout.subtitle, layout.width - m * 2, FIGURE_SUBTITLE_SIZE, 11, '400', layout.family), m, titleMid + 30);
  6539. }
  6540. ctx.textBaseline = 'alphabetic';
  6541. }
  6542. var x = m, y = m + layout.header, w = layout.cardWidth, h = layout.cardHeight, r = 16;
  6543. function cardPath() {
  6544. ctx.beginPath();
  6545. if (typeof ctx.roundRect === 'function') ctx.roundRect(x, y, w, h, r);
  6546. else ctx.rect(x, y, w, h);
  6547. }
  6548. ctx.save();
  6549. if (layout.light) {
  6550. ctx.shadowColor = 'rgba(15, 23, 42, 0.08)';
  6551. ctx.shadowBlur = 28;
  6552. ctx.shadowOffsetY = 10;
  6553. }
  6554. cardPath();
  6555. ctx.fillStyle = layout.bg;
  6556. ctx.fill();
  6557. ctx.restore();
  6558. cardPath();
  6559. ctx.fillStyle = layout.cardFill;
  6560. ctx.fill();
  6561. if (layout.dot) {
  6562. ctx.save();
  6563. cardPath();
  6564. ctx.clip();
  6565. ctx.fillStyle = layout.dot;
  6566. for (var dy = y + 1; dy < y + h; dy += 20) {
  6567. for (var dx = x + 1; dx < x + w; dx += 20) {
  6568. ctx.beginPath(); ctx.arc(dx, dy, 1, 0, Math.PI * 2); ctx.fill();
  6569. }
  6570. }
  6571. ctx.restore();
  6572. }
  6573. cardPath();
  6574. ctx.strokeStyle = layout.cardBorder;
  6575. ctx.lineWidth = 1;
  6576. ctx.stroke();
  6577. return { x: x + FIGURE_CARD_PADDING, y: y + FIGURE_CARD_PADDING };
  6578. }
  6579. function rasterize(format) {
  6580. // Serialize at a safe scale (RASTER_SCALE=4 by default, reduced if the
  6581. // resulting canvas would exceed MAX_CANVAS_PIXELS). The SVG itself is
  6582. // rasterized at target resolution natively; drawImage draws at natural
  6583. // size — no upsampling blur.
  6584. var svg = document.querySelector('.diagram-container svg');
  6585. var vb = svg.viewBox.baseVal;
  6586. var layout = figureLayout(vb);
  6587. var scale = pickSafeScale(layout.width, layout.height);
  6588. var data = serializeSvg(scale, { figure: true });
  6589. var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });
  6590. var svgUrl = URL.createObjectURL(svgBlob);
  6591. return new Promise(function (resolve, reject) {
  6592. var img = new Image();
  6593. img.onload = function () {
  6594. try {
  6595. var canvas = document.createElement('canvas');
  6596. canvas.width = Math.round(layout.width * scale);
  6597. canvas.height = Math.round(layout.height * scale);
  6598. var ctx = canvas2dOrThrow(canvas, format);
  6599. // Paint in CSS pixels; the SVG image is already rendered at scale,
  6600. // so drawing it at CSS size under this transform stays 1:1.
  6601. ctx.setTransform(scale, 0, 0, scale, 0, 0);
  6602. var origin = paintFigure(ctx, layout);
  6603. ctx.drawImage(img, origin.x, origin.y, vb.width, vb.height);
  6604. ctx.setTransform(1, 0, 0, 1, 0, 0);
  6605. URL.revokeObjectURL(svgUrl);
  6606. var mime = format === 'jpeg' ? 'image/jpeg' :
  6607. format === 'webp' ? 'image/webp' : 'image/png';
  6608. var quality = format === 'png' ? undefined : 0.95;
  6609. canvas.toBlob(function (blob) {
  6610. if (!blob) reject(exportError('viewer.export.error.toBlobNull', { label: format }));
  6611. else resolve(blob);
  6612. }, mime, quality);
  6613. } catch (error) {
  6614. URL.revokeObjectURL(svgUrl);
  6615. reject(error);
  6616. }
  6617. };
  6618. img.onerror = function (e) {
  6619. URL.revokeObjectURL(svgUrl);
  6620. reject(e);
  6621. };
  6622. img.src = svgUrl;
  6623. });
  6624. }
  6625. function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight, fontFamily) {
  6626. var value = String(text || '').trim();
  6627. var size = startSize;
  6628. var family = fontFamily || "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
  6629. while (size > minSize) {
  6630. ctx.font = (weight || '600') + ' ' + size + 'px ' + family;
  6631. if (ctx.measureText(value).width <= maxWidth) return value;
  6632. size -= 1;
  6633. }
  6634. ctx.font = (weight || '600') + ' ' + minSize + 'px ' + family;
  6635. if (ctx.measureText(value).width <= maxWidth) return value;
  6636. var suffix = '\u2026';
  6637. while (value.length > 1 && ctx.measureText(value + suffix).width > maxWidth) {
  6638. value = value.slice(0, -1);
  6639. }
  6640. return value + suffix;
  6641. }
  6642. function canvas2dOrThrow(canvas, label) {
  6643. if (!canvas || typeof canvas.getContext !== 'function') {
  6644. throw exportError('viewer.export.error.canvasUnavailable', { label: label });
  6645. }
  6646. var ctx = canvas.getContext('2d');
  6647. if (!ctx) throw exportError('viewer.export.error.contextUnavailable', { label: label });
  6648. if (typeof canvas.toBlob !== 'function') throw exportError('viewer.export.error.toBlobUnavailable', { label: label });
  6649. return ctx;
  6650. }
  6651. function renderShareCard(options) {
  6652. var routeSnapshot = options.routeSnapshot || null;
  6653. var reachSnapshot = options.reachSnapshot || null;
  6654. if (routeSnapshot && reachSnapshot) return Promise.reject(exportError('viewer.export.error.variantsCombined'));
  6655. var svg = document.querySelector('.diagram-container svg');
  6656. var vb = svg.viewBox.baseVal;
  6657. var sourceScale = Math.min(2, pickSafeScale(vb.width, vb.height));
  6658. var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot, figure: true });
  6659. if (!data.canonicalStateClean) return Promise.reject(exportError('viewer.export.error.viewerState'));
  6660. if (routeSnapshot && !data.routeStateClean) return Promise.reject(exportError('viewer.export.error.routeState'));
  6661. if (reachSnapshot && !data.reachStateClean) return Promise.reject(exportError('viewer.export.error.reachState'));
  6662. var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });
  6663. var svgUrl = URL.createObjectURL(svgBlob);
  6664. return new Promise(function (resolve, reject) {
  6665. var img = new Image();
  6666. img.onload = function () {
  6667. try {
  6668. var canvas = document.createElement('canvas');
  6669. canvas.width = SHARE_CARD_WIDTH;
  6670. canvas.height = SHARE_CARD_HEIGHT;
  6671. var ctx = canvas2dOrThrow(canvas, viewerText('viewer.export.shareCard'));
  6672. var computed = getComputedStyle(document.documentElement);
  6673. var bg = computed.getPropertyValue('--bg').trim() || currentBg();
  6674. var text = computed.getPropertyValue('--text').trim() || '#ffffff';
  6675. var muted = computed.getPropertyValue('--text-muted').trim() || '#94a3b8';
  6676. var border = computed.getPropertyValue('--panel-border').trim() || '#334155';
  6677. var accentProperty = reachSnapshot
  6678. ? (reachSnapshot.direction === 'upstream' ? '--database-stroke' : '--backend-stroke')
  6679. : '--frontend-stroke';
  6680. var accent = computed.getPropertyValue(accentProperty).trim() || '#22d3ee';
  6681. var titleNode = document.querySelector('.header h1');
  6682. var title = titleNode ? titleNode.textContent : document.title;
  6683. var directionLabel = reachSnapshot
  6684. ? viewerText('viewer.export.direction.' + reachSnapshot.direction)
  6685. : '';
  6686. var subtitle = routeSnapshot
  6687. ? viewerCount('viewer.export.card.routeSummary', routeSnapshot.hops, {
  6688. source: routeSnapshot.source.label,
  6689. target: routeSnapshot.target.label
  6690. })
  6691. : viewerText('viewer.export.card.reachSummary', {
  6692. direction: directionLabel,
  6693. origin: reachSnapshot.origin.label,
  6694. nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
  6695. links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
  6696. hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
  6697. });
  6698. var cardLabel = routeSnapshot
  6699. ? viewerText('viewer.export.card.routeBadge', {
  6700. hops: viewerCount('viewer.export.card.hop', routeSnapshot.hops).toUpperCase()
  6701. })
  6702. : viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() });
  6703. var family = titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif';
  6704. var panelFill = bg;
  6705. ctx.fillStyle = bg;
  6706. ctx.fillRect(0, 0, SHARE_CARD_WIDTH, SHARE_CARD_HEIGHT);
  6707. // Header: a short accent rule and badge over the title and summary.
  6708. ctx.fillStyle = accent;
  6709. ctx.fillRect(SHARE_CARD_PADDING, 34, 28, 3);
  6710. ctx.textBaseline = 'alphabetic';
  6711. ctx.font = '600 12px ' + family;
  6712. ctx.textAlign = 'right';
  6713. ctx.fillStyle = muted;
  6714. ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 40);
  6715. ctx.textAlign = 'left';
  6716. ctx.fillStyle = text;
  6717. var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 260, 30, 18, '650', family);
  6718. ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 74);
  6719. ctx.fillStyle = muted;
  6720. var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2, 15, 12, '400', family);
  6721. ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 99);
  6722. // The diagram sits on one soft rounded panel with an even inset.
  6723. var panelX = SHARE_CARD_PADDING;
  6724. var panelY = SHARE_CARD_HEADER;
  6725. var panelWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
  6726. var panelHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
  6727. var inset = 18;
  6728. ctx.beginPath();
  6729. if (typeof ctx.roundRect === 'function') ctx.roundRect(panelX, panelY, panelWidth, panelHeight, 14);
  6730. else ctx.rect(panelX, panelY, panelWidth, panelHeight);
  6731. ctx.fillStyle = panelFill;
  6732. ctx.fill();
  6733. ctx.strokeStyle = border;
  6734. ctx.lineWidth = 1;
  6735. ctx.stroke();
  6736. var availableWidth = panelWidth - inset * 2;
  6737. var availableHeight = panelHeight - inset * 2;
  6738. var fit = Math.min(availableWidth / data.width, availableHeight / data.height);
  6739. var drawWidth = data.width * fit;
  6740. var drawHeight = data.height * fit;
  6741. var drawX = panelX + inset + (availableWidth - drawWidth) / 2;
  6742. var drawY = panelY + inset + (availableHeight - drawHeight) / 2;
  6743. ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
  6744. URL.revokeObjectURL(svgUrl);
  6745. canvas.toBlob(function (blob) {
  6746. if (!blob) reject(exportError('viewer.export.error.toBlobNull', { label: viewerText('viewer.export.shareCard') }));
  6747. else resolve(blob);
  6748. }, 'image/png');
  6749. } catch (error) {
  6750. URL.revokeObjectURL(svgUrl);
  6751. reject(error);
  6752. }
  6753. };
  6754. img.onerror = function (e) {
  6755. URL.revokeObjectURL(svgUrl);
  6756. reject(e);
  6757. };
  6758. img.src = svgUrl;
  6759. });
  6760. }
  6761. function rasterizeShareCard(options) {
  6762. options = options || {};
  6763. if (options.variant !== 'route' && options.variant !== 'reach') {
  6764. return Promise.reject(exportError('viewer.export.unknownVariant', { variant: options.variant }));
  6765. }
  6766. if (options.variant === 'route') {
  6767. var routeSnapshot = Archify.routeProbe && Archify.routeProbe.exportSnapshot();
  6768. if (!routeSnapshot) return Promise.reject(exportError('viewer.export.routeRequired'));
  6769. return renderShareCard({ routeSnapshot: routeSnapshot });
  6770. }
  6771. var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'
  6772. ? Archify.focus.reachabilitySnapshot()
  6773. : null;
  6774. if (!snapshot) return Promise.reject(exportError('viewer.export.reachRequired'));
  6775. return renderShareCard({ reachSnapshot: snapshot });
  6776. }
  6777. function motionMimeType() {
  6778. if (typeof MediaRecorder === 'undefined') return '';
  6779. var candidates = [
  6780. 'video/webm;codecs=vp9',
  6781. 'video/webm;codecs=vp8',
  6782. 'video/webm'
  6783. ];
  6784. for (var i = 0; i < candidates.length; i++) {
  6785. if (!MediaRecorder.isTypeSupported || MediaRecorder.isTypeSupported(candidates[i])) return candidates[i];
  6786. }
  6787. return '';
  6788. }
  6789. function canRecordMotion() {
  6790. var svg = document.querySelector('.diagram-container svg');
  6791. return !!(svg && svg.getAttribute('data-animation') === 'trace' &&
  6792. typeof MediaRecorder !== 'undefined' && motionMimeType() &&
  6793. typeof HTMLCanvasElement !== 'undefined' &&
  6794. typeof HTMLCanvasElement.prototype.captureStream === 'function');
  6795. }
  6796. // Record the live CSS animation without Puppeteer, ffmpeg, or a network
  6797. // dependency. SVG files loaded through Image are commonly rasterized as
  6798. // one cached bitmap, so repeatedly drawing that Image does not reliably
  6799. // advance its CSS animation. Keep one crisp static SVG background, then
  6800. // render an explicit time-varying signal scene over the real authored
  6801. // relationship geometry on every captured canvas frame.
  6802. function recordWebm(options) {
  6803. options = options || {};
  6804. if (!canRecordMotion()) {
  6805. return Promise.reject(exportError('viewer.export.error.webmRequirements'));
  6806. }
  6807. var duration = Math.max(250, Number(options.duration) || MOTION_DURATION);
  6808. var fps = Math.max(1, Number(options.fps) || MOTION_FPS);
  6809. var svg = document.querySelector('.diagram-container svg');
  6810. var vb = svg.viewBox.baseVal;
  6811. var scale = Math.min(1, 1280 / vb.width);
  6812. var data = serializeSvg(scale);
  6813. function createMotionScene(root) {
  6814. var rootMatrix = root.getCTM ? root.getCTM() : null;
  6815. function pointInRoot(element, point) {
  6816. if (!rootMatrix || !element.getCTM || !point.matrixTransform) return { x: point.x, y: point.y };
  6817. try {
  6818. var elementMatrix = element.getCTM();
  6819. if (!elementMatrix) return { x: point.x, y: point.y };
  6820. var mapped = point.matrixTransform(rootMatrix.inverse().multiply(elementMatrix));
  6821. return { x: mapped.x, y: mapped.y };
  6822. } catch (_) {
  6823. return { x: point.x, y: point.y };
  6824. }
  6825. }
  6826. function samplesFor(element) {
  6827. if (typeof element.getTotalLength !== 'function' || typeof element.getPointAtLength !== 'function') return [];
  6828. var geometry = element;
  6829. if (element.getAttribute('data-motion-path')) {
  6830. geometry = element.cloneNode(false);
  6831. geometry.setAttribute('d', element.getAttribute('data-motion-path'));
  6832. }
  6833. var length;
  6834. try { length = geometry.getTotalLength(); } catch (_) { return []; }
  6835. if (!Number.isFinite(length) || length <= 0) return [];
  6836. var count = Math.max(12, Math.min(72, Math.ceil(length / 12)));
  6837. var points = [];
  6838. for (var i = 0; i <= count; i++) {
  6839. points.push(pointInRoot(element, geometry.getPointAtLength(length * i / count)));
  6840. }
  6841. return points;
  6842. }
  6843. function authoredStep(element, fallback) {
  6844. var raw = element.style.getPropertyValue('--step') || getComputedStyle(element).getPropertyValue('--step');
  6845. var value = Number(raw);
  6846. return Number.isFinite(value) ? value : fallback;
  6847. }
  6848. var edges = Array.prototype.slice.call(root.querySelectorAll('[data-animate="edge"]')).map(function (element, index) {
  6849. var computed = getComputedStyle(element);
  6850. return {
  6851. points: samplesFor(element),
  6852. color: computed.stroke && computed.stroke !== 'none' ? computed.stroke : '#22d3ee',
  6853. width: Math.max(1.5, parseFloat(computed.strokeWidth) || 1.5),
  6854. delay: Math.min(12, authoredStep(element, index)) * 0.16
  6855. };
  6856. }).filter(function (edge) { return edge.points.length > 1; });
  6857. var nodes = Array.prototype.slice.call(root.querySelectorAll('[data-node-id][data-animate="node"]')).map(function (element, index) {
  6858. var box;
  6859. try { box = element.getBBox(); } catch (_) { return null; }
  6860. var painted = element.querySelector('[class*="c-"]') || element;
  6861. var computed = getComputedStyle(painted);
  6862. return {
  6863. x: box.x,
  6864. y: box.y,
  6865. width: box.width,
  6866. height: box.height,
  6867. color: computed.stroke && computed.stroke !== 'none' ? computed.stroke : '#22d3ee',
  6868. delay: Math.min(12, authoredStep(element, index)) * 0.16
  6869. };
  6870. }).filter(Boolean);
  6871. return { edges: edges, nodes: nodes, x: vb.x, y: vb.y, width: vb.width, height: vb.height };
  6872. }
  6873. function pointAlong(points, progress) {
  6874. var scaled = Math.max(0, Math.min(1, progress)) * (points.length - 1);
  6875. var index = Math.min(points.length - 2, Math.floor(scaled));
  6876. var mix = scaled - index;
  6877. return {
  6878. x: points[index].x + (points[index + 1].x - points[index].x) * mix,
  6879. y: points[index].y + (points[index + 1].y - points[index].y) * mix
  6880. };
  6881. }
  6882. function roundedRectPath(ctx, x, y, width, height, radius) {
  6883. var r = Math.max(0, Math.min(radius, width / 2, height / 2));
  6884. ctx.beginPath();
  6885. ctx.moveTo(x + r, y);
  6886. ctx.lineTo(x + width - r, y);
  6887. ctx.quadraticCurveTo(x + width, y, x + width, y + r);
  6888. ctx.lineTo(x + width, y + height - r);
  6889. ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
  6890. ctx.lineTo(x + r, y + height);
  6891. ctx.quadraticCurveTo(x, y + height, x, y + height - r);
  6892. ctx.lineTo(x, y + r);
  6893. ctx.quadraticCurveTo(x, y, x + r, y);
  6894. ctx.closePath();
  6895. }
  6896. function drawMotionFrame(ctx, backgroundImage, motionScene, elapsed) {
  6897. ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
  6898. ctx.drawImage(backgroundImage, 0, 0, ctx.canvas.width, ctx.canvas.height);
  6899. ctx.save();
  6900. ctx.scale(ctx.canvas.width / motionScene.width, ctx.canvas.height / motionScene.height);
  6901. ctx.translate(-motionScene.x, -motionScene.y);
  6902. motionScene.edges.forEach(function (edge) {
  6903. var duration = 1.75;
  6904. var progress = (elapsed - edge.delay) / duration;
  6905. if (progress < 0 || progress > 1) return;
  6906. var head = Math.max(0, Math.min(1, progress));
  6907. var tail = Math.max(0, head - 0.24);
  6908. var opacity = Math.sin(Math.PI * Math.min(1, progress));
  6909. ctx.save();
  6910. ctx.strokeStyle = edge.color;
  6911. ctx.fillStyle = edge.color;
  6912. ctx.lineCap = 'round';
  6913. ctx.lineJoin = 'round';
  6914. ctx.lineWidth = Math.max(3.2, edge.width * 2.2);
  6915. ctx.globalAlpha = 0.42 + opacity * 0.5;
  6916. ctx.shadowColor = edge.color;
  6917. ctx.shadowBlur = 10;
  6918. ctx.beginPath();
  6919. for (var i = 0; i <= 14; i++) {
  6920. var trailPoint = pointAlong(edge.points, tail + (head - tail) * i / 14);
  6921. if (i === 0) ctx.moveTo(trailPoint.x, trailPoint.y);
  6922. else ctx.lineTo(trailPoint.x, trailPoint.y);
  6923. }
  6924. ctx.stroke();
  6925. var point = pointAlong(edge.points, head);
  6926. ctx.globalAlpha = 0.95;
  6927. ctx.beginPath();
  6928. ctx.arc(point.x, point.y, 4.8, 0, Math.PI * 2);
  6929. ctx.fill();
  6930. ctx.restore();
  6931. });
  6932. motionScene.nodes.forEach(function (node) {
  6933. var progress = (elapsed - node.delay) / 2.6;
  6934. if (progress < 0 || progress > 1) return;
  6935. var pulse = Math.sin(Math.PI * progress);
  6936. if (pulse <= 0.02) return;
  6937. ctx.save();
  6938. ctx.strokeStyle = node.color;
  6939. ctx.lineWidth = 1.4 + pulse * 1.8;
  6940. ctx.globalAlpha = pulse * 0.5;
  6941. ctx.shadowColor = node.color;
  6942. ctx.shadowBlur = 12 * pulse;
  6943. var inset = 2 + pulse * 3;
  6944. roundedRectPath(ctx, node.x - inset, node.y - inset, node.width + inset * 2, node.height + inset * 2, 8);
  6945. ctx.stroke();
  6946. ctx.restore();
  6947. });
  6948. ctx.restore();
  6949. }
  6950. var motionScene = createMotionScene(svg);
  6951. return new Promise(function (resolve, reject) {
  6952. var sourceUrl = null;
  6953. var backgroundImage = null;
  6954. var stream = null;
  6955. var recorder = null;
  6956. var raf = 0;
  6957. var durationTimer = 0;
  6958. var flushTimer = 0;
  6959. var settled = false;
  6960. function finish(error, blob) {
  6961. if (settled) return;
  6962. // 先锁定终态:停止录制和释放流可能产生晚到的编码事件。
  6963. settled = true;
  6964. cancelAnimationFrame(raf);
  6965. clearTimeout(durationTimer);
  6966. clearTimeout(flushTimer);
  6967. if (backgroundImage) {
  6968. backgroundImage.onload = null;
  6969. backgroundImage.onerror = null;
  6970. }
  6971. if (recorder) {
  6972. recorder.ondataavailable = null;
  6973. recorder.onerror = null;
  6974. recorder.onstop = null;
  6975. try { if (recorder.state !== 'inactive') recorder.stop(); } catch (_) {}
  6976. }
  6977. if (stream) stream.getTracks().forEach(function (track) { track.stop(); });
  6978. if (sourceUrl) URL.revokeObjectURL(sourceUrl);
  6979. if (blob) resolve(blob);
  6980. else reject(error);
  6981. }
  6982. try {
  6983. sourceUrl = URL.createObjectURL(new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' }));
  6984. backgroundImage = new Image();
  6985. backgroundImage.onload = function () {
  6986. if (settled) return;
  6987. try {
  6988. var canvas = document.createElement('canvas');
  6989. canvas.width = Math.max(2, Math.round(data.width / 2) * 2);
  6990. canvas.height = Math.max(2, Math.round(data.height / 2) * 2);
  6991. var ctx = canvas.getContext('2d');
  6992. if (!ctx) throw exportError('viewer.export.error.contextUnavailable', { label: 'WebM' });
  6993. stream = canvas.captureStream(fps);
  6994. var mime = motionMimeType();
  6995. recorder = new MediaRecorder(stream, { mimeType: mime, videoBitsPerSecond: 6000000 });
  6996. var chunks = [];
  6997. var startedAt = performance.now();
  6998. function draw(now) {
  6999. if (settled) return;
  7000. try {
  7001. var elapsed = Math.max(0, ((Number(now) || performance.now()) - startedAt) / 1000);
  7002. drawMotionFrame(ctx, backgroundImage, motionScene, elapsed);
  7003. raf = requestAnimationFrame(draw);
  7004. } catch (error) { finish(error); }
  7005. }
  7006. recorder.ondataavailable = function (event) {
  7007. if (!settled && event.data && event.data.size) chunks.push(event.data);
  7008. };
  7009. recorder.onerror = function (event) {
  7010. finish(event.error || exportError('viewer.export.error.mediaRecorder'));
  7011. };
  7012. recorder.onstop = function () {
  7013. if (settled) return;
  7014. try {
  7015. var blob = new Blob(chunks, { type: recorder.mimeType || mime });
  7016. if (!blob.size) throw exportError('viewer.export.error.emptyWebm');
  7017. finish(null, blob);
  7018. } catch (error) { finish(error); }
  7019. };
  7020. drawMotionFrame(ctx, backgroundImage, motionScene, 0);
  7021. recorder.start(250);
  7022. if (settled) return;
  7023. startedAt = performance.now();
  7024. raf = requestAnimationFrame(draw);
  7025. durationTimer = setTimeout(function () {
  7026. if (settled || recorder.state === 'inactive') return;
  7027. // 保留最佳努力的编码器 flush;失败后仍通过 stop 收集最后的片段。
  7028. try { recorder.requestData(); } catch (_) {}
  7029. if (settled) return;
  7030. flushTimer = setTimeout(function () {
  7031. if (settled) return;
  7032. try { if (recorder.state !== 'inactive') recorder.stop(); }
  7033. catch (error) { finish(error); }
  7034. }, 120);
  7035. }, duration);
  7036. } catch (error) { finish(error); }
  7037. };
  7038. backgroundImage.onerror = function () {
  7039. finish(exportError('viewer.export.error.webmBackground'));
  7040. };
  7041. backgroundImage.src = sourceUrl;
  7042. } catch (error) { finish(error); }
  7043. });
  7044. }
  7045. var menu = document.getElementById('export-menu');
  7046. var btn = document.getElementById('btn-export');
  7047. var routeShareItem = menu.querySelector('button[data-action="route-share-card"]');
  7048. var reachShareItem = menu.querySelector('button[data-action="reach-share-card"]');
  7049. var items = function () {
  7050. return Array.prototype.slice.call(menu.querySelectorAll('button[role="menuitem"]'));
  7051. };
  7052. function syncRouteShareItem() {
  7053. var snapshot = Archify.routeProbe && typeof Archify.routeProbe.exportSnapshot === 'function'
  7054. ? Archify.routeProbe.exportSnapshot()
  7055. : null;
  7056. routeShareItem.hidden = !snapshot;
  7057. routeShareItem.disabled = !snapshot;
  7058. return snapshot;
  7059. }
  7060. function syncReachShareItem() {
  7061. var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'
  7062. ? Archify.focus.reachabilitySnapshot()
  7063. : null;
  7064. reachShareItem.hidden = !snapshot;
  7065. reachShareItem.disabled = !snapshot;
  7066. return snapshot;
  7067. }
  7068. // ---- Clipboard support ----------------------------------------------
  7069. function canCopyImage() {
  7070. return typeof ClipboardItem !== 'undefined' &&
  7071. navigator.clipboard &&
  7072. typeof navigator.clipboard.write === 'function';
  7073. }
  7074. // ---- Raster format detection ----------------------------------------
  7075. // canvas.toBlob('image/webp') silently returns a PNG on browsers without
  7076. // WebP encoding (older Safari), so detect explicitly.
  7077. function supports(format) {
  7078. if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
  7079. if (format === 'webm') return canRecordMotion();
  7080. var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
  7081. try {
  7082. var c = document.createElement('canvas');
  7083. c.width = c.height = 2;
  7084. return c.toDataURL(mime).indexOf('data:' + mime) === 0;
  7085. } catch (_) { return false; }
  7086. }
  7087. // Gray out unsupported items.
  7088. items().forEach(function (it) {
  7089. if (it.dataset.format && !supports(it.dataset.format)) {
  7090. it.disabled = true;
  7091. it.title = viewerText('viewer.export.unsupported');
  7092. }
  7093. if (it.dataset.action === 'copy' && !canCopyImage()) {
  7094. it.disabled = true;
  7095. it.title = viewerText('viewer.export.clipboardUnsupported');
  7096. }
  7097. });
  7098. // ---- Toast ----------------------------------------------------------
  7099. // A live region only announces CHANGES to an existing node, so the toast
  7100. // element is created once up front and updated in place.
  7101. var toastEl = document.createElement('div');
  7102. toastEl.className = 'archify-toast';
  7103. toastEl.setAttribute('role', 'status');
  7104. document.body.appendChild(toastEl);
  7105. var toastTimer = null;
  7106. function toast(msg) {
  7107. toastEl.textContent = '';
  7108. requestAnimationFrame(function () {
  7109. toastEl.textContent = msg;
  7110. toastEl.classList.add('show');
  7111. });
  7112. clearTimeout(toastTimer);
  7113. toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 1500);
  7114. }
  7115. function open(focusLast) {
  7116. if (Archify.preset && Archify.preset.isOpen()) Archify.preset.close(false);
  7117. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  7118. if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
  7119. syncRouteShareItem();
  7120. syncReachShareItem();
  7121. menu.classList.add('open');
  7122. btn.setAttribute('aria-expanded', 'true');
  7123. var available = items().filter(function (i) { return !i.hidden && !i.disabled; });
  7124. var target = focusLast ? available[available.length - 1] : available[0];
  7125. if (target) target.focus();
  7126. }
  7127. function close(focusTrigger) {
  7128. menu.classList.remove('open');
  7129. btn.setAttribute('aria-expanded', 'false');
  7130. if (focusTrigger) btn.focus();
  7131. }
  7132. function isOpen() { return menu.classList.contains('open'); }
  7133. btn.addEventListener('click', function (e) {
  7134. e.stopPropagation();
  7135. if (isOpen()) close(false);
  7136. else open();
  7137. });
  7138. // APG menu-button pattern: ArrowDown/ArrowUp on the trigger opens the menu.
  7139. btn.addEventListener('keydown', function (e) {
  7140. if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
  7141. if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
  7142. e.preventDefault();
  7143. if (!isOpen()) open(e.key === 'ArrowUp');
  7144. }
  7145. });
  7146. document.addEventListener('click', function (e) {
  7147. if (!menu.contains(e.target) && e.target !== btn) close(false);
  7148. });
  7149. // Keyboard navigation inside the menu.
  7150. // Menu items: Up/Down, Home/End.
  7151. // Esc closes + returns focus to trigger; Tab closes.
  7152. menu.addEventListener('keydown', function (e) {
  7153. if (e.key === 'Escape') { e.preventDefault(); close(true); return; }
  7154. if (e.key === 'Tab') { close(false); return; }
  7155. if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
  7156. var available = items().filter(function (i) { return !i.hidden && !i.disabled; });
  7157. var current = available.indexOf(document.activeElement);
  7158. switch (e.key) {
  7159. case 'ArrowDown':
  7160. e.preventDefault();
  7161. if (available.length) available[(current + 1 + available.length) % available.length].focus();
  7162. break;
  7163. case 'ArrowUp':
  7164. e.preventDefault();
  7165. if (available.length) available[(current - 1 + available.length) % available.length].focus();
  7166. break;
  7167. case 'Home':
  7168. e.preventDefault();
  7169. if (available[0]) available[0].focus();
  7170. break;
  7171. case 'End':
  7172. e.preventDefault();
  7173. if (available.length) available[available.length - 1].focus();
  7174. break;
  7175. }
  7176. });
  7177. function runExport(format) {
  7178. if (['svg', 'svg-light', 'svg-dark', 'png', 'jpeg', 'webp', 'webm'].indexOf(format) === -1) {
  7179. return Promise.reject(exportError('viewer.export.unsupported'));
  7180. }
  7181. var base = diagramFilename();
  7182. var svgTheme = format === 'svg' ? 'auto' :
  7183. format === 'svg-light' ? 'light' :
  7184. format === 'svg-dark' ? 'dark' : null;
  7185. close(true);
  7186. clearExportReceipt();
  7187. if (format === 'webm') toast(viewerText('viewer.export.recording'));
  7188. return (svgTheme
  7189. ? Promise.resolve(serializeSvg(1, { theme: svgTheme })).then(function (d) {
  7190. var blob = new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' });
  7191. recordExportReceipt('svg', blob, d.canonicalStateClean);
  7192. download(blob, base + (svgTheme === 'auto' ? '' : '-' + svgTheme) + '.svg');
  7193. })
  7194. : format === 'webm'
  7195. ? recordWebm().then(function (blob) {
  7196. document.documentElement.setAttribute('data-last-motion-bytes', String(blob.size));
  7197. recordExportReceipt('webm', blob, true);
  7198. download(blob, base + '.webm');
  7199. toast(viewerText('viewer.export.downloadedWebm'));
  7200. })
  7201. : rasterize(format).then(function (blob) {
  7202. recordExportReceipt(format, blob, true);
  7203. download(blob, base + '.' + format);
  7204. })
  7205. ).catch(function (err) {
  7206. console.error(err);
  7207. var technicalMessage = err && err.message ? err.message : format;
  7208. var message = exportMessage(err);
  7209. document.documentElement.setAttribute('data-last-export-error-format', format);
  7210. document.documentElement.setAttribute('data-last-export-error', technicalMessage);
  7211. if (format === 'webm') {
  7212. var motionItem = menu.querySelector('button[data-format="webm"]');
  7213. if (motionItem) {
  7214. motionItem.disabled = true;
  7215. motionItem.title = viewerText('viewer.export.motionUnavailable');
  7216. motionItem.style.opacity = '0.5';
  7217. }
  7218. toast(viewerText('viewer.export.webmUnavailable'));
  7219. return;
  7220. }
  7221. alert(viewerText('viewer.export.failed', { message: message }));
  7222. });
  7223. }
  7224. function runRouteShareCard() {
  7225. close(false);
  7226. clearExportReceipt();
  7227. var snapshot = Archify.routeProbe && Archify.routeProbe.exportSnapshot();
  7228. var blobPromise = snapshot
  7229. ? renderShareCard({ routeSnapshot: snapshot })
  7230. : Promise.reject(exportError('viewer.export.routeRequired'));
  7231. return blobPromise.then(function (blob) {
  7232. recordExportReceipt('share-card', blob, false, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT }, 'route', true);
  7233. download(blob, diagramFilename() + '-route-share-card.png');
  7234. toast(viewerText('viewer.export.downloadedRoute'));
  7235. return blob;
  7236. }).catch(function (err) {
  7237. console.error(err);
  7238. var technicalMessage = err && err.message ? err.message : 'share-card';
  7239. var message = exportMessage(err);
  7240. document.documentElement.setAttribute('data-last-export-error-format', 'share-card');
  7241. document.documentElement.setAttribute('data-last-export-error', technicalMessage);
  7242. alert(viewerText('viewer.export.routeFailed', { message: message }));
  7243. });
  7244. }
  7245. function runReachShareCard() {
  7246. close(false);
  7247. clearExportReceipt();
  7248. var snapshot = Archify.focus && typeof Archify.focus.reachabilitySnapshot === 'function'
  7249. ? Archify.focus.reachabilitySnapshot()
  7250. : null;
  7251. var blobPromise = snapshot
  7252. ? renderShareCard({ reachSnapshot: snapshot })
  7253. : Promise.reject(exportError('viewer.export.reachRequired'));
  7254. return blobPromise.then(function (blob) {
  7255. recordExportReceipt('share-card', blob, false, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT }, 'reach', false, true);
  7256. download(blob, diagramFilename() + '-' + snapshot.direction + '-reach-share-card.png');
  7257. toast(viewerText('viewer.export.downloadedReach'));
  7258. return blob;
  7259. }).catch(function (err) {
  7260. console.error(err);
  7261. var technicalMessage = err && err.message ? err.message : 'share-card';
  7262. var message = exportMessage(err);
  7263. document.documentElement.setAttribute('data-last-export-error-format', 'share-card');
  7264. document.documentElement.setAttribute('data-last-export-error', technicalMessage);
  7265. alert(viewerText('viewer.export.reachFailed', { message: message }));
  7266. });
  7267. }
  7268. // A compact, machine-readable receipt for local QA and generated proof
  7269. // galleries. It exposes no diagram contents, only the completed format,
  7270. // byte count, and whether temporary viewer state was excluded.
  7271. function recordExportReceipt(format, blob, canonical, dimensions, variant, routeStateClean, reachStateClean) {
  7272. document.documentElement.setAttribute('data-last-export-format', format);
  7273. document.documentElement.setAttribute('data-last-export-bytes', String(blob.size));
  7274. document.documentElement.setAttribute('data-last-export-canonical', canonical ? 'true' : 'false');
  7275. if (variant) {
  7276. document.documentElement.setAttribute('data-last-export-variant', variant);
  7277. } else {
  7278. document.documentElement.removeAttribute('data-last-export-variant');
  7279. }
  7280. if (routeStateClean === true) {
  7281. document.documentElement.setAttribute('data-last-export-route-state-clean', 'true');
  7282. } else {
  7283. document.documentElement.removeAttribute('data-last-export-route-state-clean');
  7284. }
  7285. if (reachStateClean === true) {
  7286. document.documentElement.setAttribute('data-last-export-reach-state-clean', 'true');
  7287. } else {
  7288. document.documentElement.removeAttribute('data-last-export-reach-state-clean');
  7289. }
  7290. if (dimensions) {
  7291. document.documentElement.setAttribute('data-last-export-width', String(dimensions.width));
  7292. document.documentElement.setAttribute('data-last-export-height', String(dimensions.height));
  7293. } else {
  7294. document.documentElement.removeAttribute('data-last-export-width');
  7295. document.documentElement.removeAttribute('data-last-export-height');
  7296. }
  7297. }
  7298. function clearExportReceipt() {
  7299. document.documentElement.removeAttribute('data-last-export-format');
  7300. document.documentElement.removeAttribute('data-last-export-bytes');
  7301. document.documentElement.removeAttribute('data-last-export-canonical');
  7302. document.documentElement.removeAttribute('data-last-export-width');
  7303. document.documentElement.removeAttribute('data-last-export-height');
  7304. document.documentElement.removeAttribute('data-last-export-variant');
  7305. document.documentElement.removeAttribute('data-last-export-route-state-clean');
  7306. document.documentElement.removeAttribute('data-last-export-reach-state-clean');
  7307. document.documentElement.removeAttribute('data-last-export-error-format');
  7308. document.documentElement.removeAttribute('data-last-export-error');
  7309. }
  7310. function writePngToClipboard(blobPromise) {
  7311. // WebKit requires ClipboardItem to be constructed synchronously inside
  7312. // the user gesture. Chromium accepts the same pending Promise<Blob>;
  7313. // engines that reject promise values fall back to an awaited Blob.
  7314. try {
  7315. return navigator.clipboard.write([new ClipboardItem({ 'image/png': blobPromise })]);
  7316. } catch (_) {
  7317. return blobPromise.then(function (blob) {
  7318. return navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);
  7319. });
  7320. }
  7321. }
  7322. function runCopy() {
  7323. close(true);
  7324. clearExportReceipt();
  7325. if (!canCopyImage()) {
  7326. alert(viewerText('viewer.export.clipboardUnsupported.short'));
  7327. return;
  7328. }
  7329. var blobPromise = rasterize('png');
  7330. return writePngToClipboard(blobPromise).then(function () {
  7331. toast(viewerText('viewer.export.copiedPng'));
  7332. }).catch(function (err) {
  7333. console.error(err);
  7334. alert(viewerText('viewer.export.copyFailed', {
  7335. message: exportMessage(err)
  7336. }));
  7337. });
  7338. }
  7339. menu.addEventListener('click', function (e) {
  7340. var routeShareCardBtn = e.target.closest('button[data-action="route-share-card"]');
  7341. if (routeShareCardBtn && !routeShareCardBtn.disabled && !routeShareCardBtn.hidden) { runRouteShareCard(); return; }
  7342. var reachShareCardBtn = e.target.closest('button[data-action="reach-share-card"]');
  7343. if (reachShareCardBtn && !reachShareCardBtn.disabled && !reachShareCardBtn.hidden) { runReachShareCard(); return; }
  7344. var copyBtn = e.target.closest('button[data-action="copy"]');
  7345. if (copyBtn && !copyBtn.disabled) { runCopy(); return; }
  7346. var formatBtn = e.target.closest('button[data-format]');
  7347. if (formatBtn && !formatBtn.disabled) { runExport(formatBtn.dataset.format); }
  7348. });
  7349. Archify.motion = { canRecord: canRecordMotion, recordWebm: recordWebm };
  7350. Archify.exportMenu = {
  7351. open: open,
  7352. close: close,
  7353. isOpen: isOpen,
  7354. run: runExport,
  7355. shareCard: rasterizeShareCard,
  7356. downloadRouteShareCard: runRouteShareCard,
  7357. downloadReachShareCard: runReachShareCard,
  7358. syncRouteShare: syncRouteShareItem,
  7359. syncReachShare: syncReachShareItem
  7360. };
  7361. // Auto-open on page load for demo/screenshot purposes: ?openExport=1
  7362. // Wait for fonts (so the menu doesn't flash before typography lands)
  7363. // and paint before opening. Fallback timeout for browsers without the
  7364. // Font Loading API.
  7365. try {
  7366. if (new URLSearchParams(window.location.search).get('openExport') === '1') {
  7367. var openWhenReady = function () {
  7368. requestAnimationFrame(function () { requestAnimationFrame(open); });
  7369. };
  7370. if (document.fonts && document.fonts.ready) {
  7371. document.fonts.ready.then(openWhenReady);
  7372. } else {
  7373. setTimeout(openWhenReady, 200);
  7374. }
  7375. }
  7376. } catch (_) {}
  7377. })();
  7378. /* ============================================================
  7379. Motion Governor — one reader switch and one motion budget. Ambient
  7380. trace yields to the strongest semantic owner; Still also parks bounded
  7381. viewer signals without discarding their static meaning.
  7382. ============================================================ */
  7383. Archify.motionGovernor = (function () {
  7384. var STORAGE_KEY = 'archify-motion';
  7385. var html = document.documentElement;
  7386. var svg = document.querySelector('.diagram-container svg');
  7387. var btn = document.getElementById('btn-motion');
  7388. var label = document.getElementById('motion-label');
  7389. var motionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;
  7390. var capable = !!(svg && svg.getAttribute('data-animation') === 'trace');
  7391. var readerPaused = false;
  7392. var suspensions = Object.create(null);
  7393. var explicitOwner = '';
  7394. var owner = '';
  7395. var ownerToken = 0;
  7396. var ownerCleanup = null;
  7397. var lastEffectivePaused = null;
  7398. var entryStarted = false;
  7399. var entryPending = new Set();
  7400. var flowCount = 0;
  7401. // Runtime decoration carries geometry and tree visibility only. Keep each
  7402. // flow beside its authored edge so transforms, clipping and crossover
  7403. // paint order apply.
  7404. // Each renderer may declare a choreography that matches what its diagram
  7405. // means. Relay (the default) sends a comet from each source when the
  7406. // signal reaches it; stream adds a packet train for continuous data; walk
  7407. // moves one token along the main state path; sequence plays messages in
  7408. // authored order; sweep runs a playhead along a timeline; replay fills
  7409. // waterfall spans in proportion to their measured time. Motion Governor
  7410. // plans the timeline and per-element keyframes; viewer.css owns looks.
  7411. var SVG_NS = 'http://www.w3.org/2000/svg';
  7412. var choreography = svg ? (svg.getAttribute('data-motion-choreography') || 'relay') : 'relay';
  7413. var RELAY = {
  7414. speed: 280,
  7415. minTravel: 0.42,
  7416. maxTravel: 1.5,
  7417. handoff: 0.1,
  7418. dwell: 0.55,
  7419. maxSpan: 9,
  7420. land: 0.9,
  7421. rest: 1.4,
  7422. minCycle: 3.6
  7423. };
  7424. function stepOf(element, fallback) {
  7425. var step = parseFloat(element && element.style ? element.style.getPropertyValue('--step') : '');
  7426. return Number.isFinite(step) ? step : fallback;
  7427. }
  7428. function byStep(a, b) { return a.step - b.step || a.index - b.index; }
  7429. function addWindow(windows, id, start, end, strong) {
  7430. if (!id) return;
  7431. (windows[id] = windows[id] || []).push({ start: start, end: end, strong: !!strong });
  7432. }
  7433. function planRelay(records, windows) {
  7434. var arrive = Object.create(null);
  7435. var seeded = Object.create(null);
  7436. var targets = Object.create(null);
  7437. records.forEach(function (record) { if (record.from !== record.to) targets[record.to] = true; });
  7438. function seed(id) {
  7439. if (arrive[id] !== undefined) return;
  7440. arrive[id] = 0;
  7441. seeded[id] = true;
  7442. }
  7443. function relax() {
  7444. // Earliest arrival over a few dozen edges; a scan per settle keeps
  7445. // cycles and fan-in deterministic without a priority queue.
  7446. var settled = Object.create(null);
  7447. for (;;) {
  7448. var next = null;
  7449. Object.keys(arrive).forEach(function (id) {
  7450. if (!settled[id] && (next === null || arrive[id] < arrive[next])) next = id;
  7451. });
  7452. if (next === null) return;
  7453. settled[next] = true;
  7454. var depart = arrive[next] + (seeded[next] ? 0 : RELAY.handoff);
  7455. records.forEach(function (record) {
  7456. if (record.from !== next) return;
  7457. var at = depart + record.travel;
  7458. if (arrive[record.to] === undefined || at < arrive[record.to]) arrive[record.to] = at;
  7459. });
  7460. }
  7461. }
  7462. records.forEach(function (record) { if (!targets[record.from]) seed(record.from); });
  7463. relax();
  7464. for (;;) {
  7465. // A closed cycle has no entry; start it at its earliest authored edge.
  7466. var orphan = records.filter(function (record) { return arrive[record.from] === undefined; }).sort(byStep)[0];
  7467. if (!orphan) break;
  7468. seed(orphan.from);
  7469. relax();
  7470. }
  7471. records.forEach(function (record) {
  7472. record.depart = arrive[record.from] + (seeded[record.from] ? 0 : RELAY.handoff);
  7473. record.active = true;
  7474. });
  7475. Object.keys(arrive).forEach(function (id) { addWindow(windows, id, arrive[id], arrive[id]); });
  7476. }
  7477. function planWalk(records, windows) {
  7478. // A state machine is in one state at a time: follow the first authored
  7479. // transition to an unvisited state and let the current state stay lit.
  7480. var targets = Object.create(null);
  7481. records.forEach(function (record) { if (record.from !== record.to) targets[record.to] = true; });
  7482. var ordered = records.slice().sort(byStep);
  7483. var start = (ordered.find(function (record) { return !targets[record.from]; }) || ordered[0]).from;
  7484. var visited = Object.create(null);
  7485. var current = start;
  7486. var clock = 0;
  7487. var enteredAt = 0;
  7488. visited[start] = true;
  7489. for (var hops = 0; hops < 16; hops += 1) {
  7490. var next = ordered.find(function (record) { return record.from === current && !visited[record.to]; });
  7491. if (!next) break;
  7492. next.active = true;
  7493. next.depart = clock + RELAY.dwell;
  7494. addWindow(windows, current, enteredAt, next.depart, true);
  7495. clock = next.depart + next.travel;
  7496. enteredAt = clock;
  7497. current = next.to;
  7498. visited[current] = true;
  7499. }
  7500. addWindow(windows, current, enteredAt, enteredAt + 1.2, true);
  7501. }
  7502. function planSequence(records, windows) {
  7503. var clock = 0;
  7504. records.slice().sort(byStep).forEach(function (record) {
  7505. record.active = true;
  7506. record.depart = clock;
  7507. clock += record.travel + RELAY.handoff;
  7508. addWindow(windows, record.from, record.depart, record.depart);
  7509. addWindow(windows, record.to, record.depart + record.travel, record.depart + record.travel);
  7510. });
  7511. }
  7512. function scalePlan(records, windows, span) {
  7513. var scale = span > RELAY.maxSpan ? RELAY.maxSpan / span : 1;
  7514. if (scale === 1) return span;
  7515. records.forEach(function (record) {
  7516. if (!record.active) return;
  7517. record.depart *= scale;
  7518. record.travel *= scale;
  7519. });
  7520. Object.keys(windows).forEach(function (id) {
  7521. windows[id].forEach(function (window) { window.start *= scale; window.end *= scale; });
  7522. });
  7523. return span * scale;
  7524. }
  7525. function nodeShapes() {
  7526. var shapes = Object.create(null);
  7527. Array.prototype.forEach.call(svg.querySelectorAll('[data-animate="node"]'), function (shape) {
  7528. var wrapper = shape.closest('[data-node-id]');
  7529. var id = wrapper ? wrapper.getAttribute('data-node-id') : '';
  7530. if (id) (shapes[id] = shapes[id] || []).push(shape);
  7531. });
  7532. return shapes;
  7533. }
  7534. function sceneBounds(elements) {
  7535. var box = null;
  7536. elements.forEach(function (element) {
  7537. var b = null;
  7538. try { b = element.getBBox(); } catch (_) {}
  7539. if (!b || !(b.width || b.height)) return;
  7540. if (!box) box = { x: b.x, y: b.y, right: b.x + b.width, bottom: b.y + b.height };
  7541. else {
  7542. box.x = Math.min(box.x, b.x); box.y = Math.min(box.y, b.y);
  7543. box.right = Math.max(box.right, b.x + b.width); box.bottom = Math.max(box.bottom, b.y + b.height);
  7544. }
  7545. });
  7546. return box;
  7547. }
  7548. function overlay(tag, cls, attrs, parent, before) {
  7549. var element = document.createElementNS(SVG_NS, tag);
  7550. Object.keys(attrs).forEach(function (name) { element.setAttribute(name, attrs[name]); });
  7551. element.setAttribute('class', 'ambient-edge-flow ' + cls);
  7552. element.setAttribute('data-ambient-flow-overlay', 'true');
  7553. element.setAttribute('aria-hidden', 'true');
  7554. parent.insertBefore(element, before || null);
  7555. return element;
  7556. }
  7557. // Timeline and waterfall share a playhead: a lit vertical rule and its
  7558. // bloom travel the time axis linearly, because time is the subject.
  7559. function addPlayhead(box, x0, x1, lead, sweep, extras) {
  7560. var anchor = svg.querySelector('[data-node-id]');
  7561. var parent = anchor ? anchor.parentNode : svg;
  7562. var attrs = { x1: x0.toFixed(1), x2: x0.toFixed(1), y1: (box.y - 10).toFixed(1), y2: (box.bottom + 10).toFixed(1) };
  7563. ['playhead-glow', 'playhead'].forEach(function (kind) {
  7564. var line = overlay('line', 'ambient-flow-' + kind, attrs, parent, anchor);
  7565. line.style.setProperty('--flow-name', 'archify-motion-playhead');
  7566. extras.push(line);
  7567. });
  7568. extras.playhead = { distance: x1 - x0, lead: lead, sweep: sweep };
  7569. }
  7570. function planSweep(windows, extras) {
  7571. var events = Array.prototype.filter.call(svg.querySelectorAll('[data-node-id][data-timeline-x]'), function (node) {
  7572. return Number.isFinite(parseFloat(node.getAttribute('data-timeline-x')));
  7573. });
  7574. if (!events.length) return 0;
  7575. var xs = events.map(function (node) { return parseFloat(node.getAttribute('data-timeline-x')); });
  7576. var x0 = Math.min.apply(null, xs), x1 = Math.max.apply(null, xs);
  7577. var lead = 0.35;
  7578. var sweep = Math.min(7, Math.max(3.2, events.length * 0.6));
  7579. events.forEach(function (node, index) {
  7580. var at = lead + (x1 > x0 ? (xs[index] - x0) / (x1 - x0) : 0) * sweep;
  7581. addWindow(windows, node.getAttribute('data-node-id'), at, at + 0.35, true);
  7582. });
  7583. var box = sceneBounds(Array.prototype.slice.call(svg.querySelectorAll('[data-timeline-lane]')));
  7584. if (box && x1 > x0) addPlayhead(box, x0, x1, lead, sweep, extras);
  7585. return lead + sweep + 0.6;
  7586. }
  7587. function planReplay(windows, extras) {
  7588. var spans = [];
  7589. Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-waterfall-start]'), function (node) {
  7590. var start = parseFloat(node.getAttribute('data-waterfall-start'));
  7591. var end = parseFloat(node.getAttribute('data-waterfall-end'));
  7592. var bar = node.querySelector('[data-animate="node"]');
  7593. if (!bar || !Number.isFinite(start) || !(end >= start)) return;
  7594. var width = parseFloat(bar.getAttribute('width'));
  7595. var x = parseFloat(bar.getAttribute('x'));
  7596. if (!(width > 0) || !Number.isFinite(x)) return;
  7597. spans.push({ node: node, bar: bar, start: start, end: end, x: x, width: width });
  7598. });
  7599. if (!spans.length) return 0;
  7600. var t0 = Math.min.apply(null, spans.map(function (span) { return span.start; }));
  7601. var t1 = Math.max.apply(null, spans.map(function (span) { return span.end; }));
  7602. if (!(t1 > t0)) return 0;
  7603. var ruler = spans.reduce(function (best, span) { return span.end - span.start > best.end - best.start ? span : best; });
  7604. var pxPerUnit = ruler.width / Math.max(ruler.end - ruler.start, 1e-9);
  7605. var x0 = ruler.x - (ruler.start - t0) * pxPerUnit;
  7606. var lead = 0.35;
  7607. var replay = Math.min(6, Math.max(3.4, spans.length * 0.45));
  7608. var at = function (t) { return lead + (t - t0) / (t1 - t0) * replay; };
  7609. var settle = lead + replay + 0.9;
  7610. spans.forEach(function (span) {
  7611. var fill = overlay('rect', 'ambient-flow-fill', {
  7612. x: span.bar.getAttribute('x'), y: span.bar.getAttribute('y'),
  7613. width: span.bar.getAttribute('width'), height: span.bar.getAttribute('height'),
  7614. rx: span.bar.getAttribute('rx') || '0'
  7615. }, span.bar.parentNode, span.bar.nextSibling);
  7616. var tone = /(?:^|\s)c-([a-z]+)(?:\s|$)/.exec(span.bar.getAttribute('class') || '');
  7617. if (tone) fill.style.setProperty('--flow-fill', 'var(--' + tone[1] + '-stroke)');
  7618. if (span.node.getAttribute('data-waterfall-status') && span.node.getAttribute('data-waterfall-status') !== 'ok') {
  7619. fill.classList.add('ambient-flow-fill-failed');
  7620. }
  7621. fill.timing = { start: at(span.start), end: Math.max(at(span.end), at(span.start) + 0.08), settle: settle };
  7622. extras.push(fill);
  7623. addWindow(windows, span.node.getAttribute('data-node-id'), fill.timing.end, fill.timing.end);
  7624. });
  7625. var box = sceneBounds(spans.map(function (span) { return span.bar; }));
  7626. if (box) addPlayhead(box, x0, x0 + (t1 - t0) * pxPerUnit, lead, replay, extras);
  7627. return settle;
  7628. }
  7629. function writeKeyframes(records, windows, extras, cycle) {
  7630. function at(seconds) {
  7631. return (Math.min(100, Math.max(0, seconds / cycle * 100))).toFixed(3) + '%';
  7632. }
  7633. var ease = 'animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1);';
  7634. var rules = [
  7635. '@keyframes archify-relay-ripple {',
  7636. ' 0% { r: 2px; opacity: var(--flow-peak, 0.6); }',
  7637. ' ' + at(0.75) + ', 100% { r: 20px; opacity: 0; }',
  7638. '}'
  7639. ];
  7640. records.forEach(function (record) {
  7641. if (!record.active) return;
  7642. var travel = record.travel;
  7643. rules.push(
  7644. '@keyframes archify-relay-comet-' + record.index + ' {',
  7645. ' 0% { stroke-dashoffset: calc(var(--flow-len, 0px) + var(--flow-shift, 0px)); opacity: 0; ' + ease + ' }',
  7646. ' ' + at(Math.min(0.12, travel * 0.2)) + ' { opacity: var(--flow-peak, 0.9); }',
  7647. ' ' + at(travel) + ' { stroke-dashoffset: var(--flow-shift, 0px); opacity: var(--flow-peak, 0.9); }',
  7648. ' ' + at(travel + 0.16) + ', 100% { stroke-dashoffset: var(--flow-shift, 0px); opacity: 0; }',
  7649. '}',
  7650. // A solid wake draws the travelled path behind the head on the same
  7651. // easing; a dashed wake only brightens its authored segments.
  7652. '@keyframes archify-relay-wake-' + record.index + ' {',
  7653. record.dashed
  7654. ? ' 0%, ' + at(travel * 0.3) + ' { opacity: 0; }'
  7655. : ' 0% { stroke-dashoffset: var(--flow-len, 0px); opacity: var(--flow-peak, 0.3); ' + ease + ' }',
  7656. record.dashed
  7657. ? ' ' + at(travel) + ' { opacity: var(--flow-peak, 0.3); }'
  7658. : ' ' + at(travel) + ' { stroke-dashoffset: 0px; opacity: var(--flow-peak, 0.3); }',
  7659. ' ' + at(travel + 0.9) + ', 100% { stroke-dashoffset: 0px; opacity: 0; }',
  7660. '}'
  7661. );
  7662. });
  7663. var glow = function (strong) {
  7664. return 'filter: var(--ambient-node-base-filter,) drop-shadow(0 0 ' + (strong ? 14 : 10) + 'px var(--arrow-emphasis));';
  7665. };
  7666. var base = 'filter: var(--ambient-node-base-filter, none);';
  7667. Object.keys(windows).forEach(function (id, index) {
  7668. var merged = [];
  7669. windows[id].slice().sort(function (a, b) { return a.start - b.start; }).forEach(function (window) {
  7670. var peakEnd = Math.max(window.end, window.start + 0.42);
  7671. var last = merged[merged.length - 1];
  7672. if (last && window.start <= last.peakEnd + 0.78) {
  7673. last.peakEnd = Math.max(last.peakEnd, peakEnd);
  7674. last.strong = last.strong || window.strong;
  7675. } else merged.push({ start: window.start, peakEnd: peakEnd, strong: window.strong });
  7676. });
  7677. var frames = [' 0%, 100% { ' + base + ' }'];
  7678. merged.forEach(function (window) {
  7679. frames.push(
  7680. ' ' + at(window.start) + ' { ' + base + ' }',
  7681. ' ' + at(window.start + 0.12) + ', ' + at(window.peakEnd) + ' { ' + glow(window.strong) + ' }',
  7682. ' ' + at(window.peakEnd + 0.78) + ' { ' + base + ' }'
  7683. );
  7684. });
  7685. rules.push('@keyframes archify-relay-node-' + index + ' {', frames.join('\n'), '}');
  7686. windows[id].keyframes = 'archify-relay-node-' + index;
  7687. });
  7688. if (extras.playhead) {
  7689. var p = extras.playhead;
  7690. rules.push(
  7691. '@keyframes archify-motion-playhead {',
  7692. ' 0% { transform: translateX(0px); opacity: 0; }',
  7693. ' ' + at(Math.max(0.05, p.lead - 0.2)) + ' { transform: translateX(0px); opacity: 0; }',
  7694. ' ' + at(p.lead) + ' { transform: translateX(0px); opacity: var(--flow-peak, 0.9); }',
  7695. ' ' + at(p.lead + p.sweep) + ' { transform: translateX(' + p.distance.toFixed(1) + 'px); opacity: var(--flow-peak, 0.9); }',
  7696. ' ' + at(p.lead + p.sweep + 0.45) + ', 100% { transform: translateX(' + p.distance.toFixed(1) + 'px); opacity: 0; }',
  7697. '}'
  7698. );
  7699. }
  7700. extras.forEach(function (element, index) {
  7701. if (!element.timing) return;
  7702. var t = element.timing;
  7703. rules.push(
  7704. '@keyframes archify-replay-fill-' + index + ' {',
  7705. ' 0%, ' + at(t.start) + ' { transform: scaleX(0); opacity: var(--flow-peak, 0.4); }',
  7706. ' ' + at(t.end) + ', ' + at(t.settle) + ' { transform: scaleX(1); opacity: var(--flow-peak, 0.4); }',
  7707. ' ' + at(t.settle + 0.7) + ', 100% { transform: scaleX(1); opacity: 0; }',
  7708. '}'
  7709. );
  7710. element.style.setProperty('--flow-name', 'archify-replay-fill-' + index);
  7711. });
  7712. var style = document.createElement('style');
  7713. style.setAttribute('data-ambient-flow-keyframes', 'true');
  7714. style.textContent = rules.join('\n');
  7715. document.head.appendChild(style);
  7716. }
  7717. function createFlows() {
  7718. var records = [];
  7719. Array.prototype.forEach.call(svg.querySelectorAll('path[data-animate="edge"]'), function (shape, index) {
  7720. var d = shape.getAttribute('data-motion-path') || shape.getAttribute('d');
  7721. if (!d) return;
  7722. var anchor = shape;
  7723. // Tree Branches initializes after these overlays and includes their
  7724. // inherited ancestors in its existing collapse/expand lifecycle.
  7725. function tagOverlay(flow) {
  7726. flow.setAttribute('data-ambient-flow-overlay', 'true');
  7727. flow.setAttribute('aria-hidden', 'true');
  7728. if (shape.hasAttribute('data-tree-ancestors')) {
  7729. flow.setAttribute('data-tree-ancestors', shape.getAttribute('data-tree-ancestors'));
  7730. }
  7731. }
  7732. function addPath(cls) {
  7733. var flow = document.createElementNS(SVG_NS, 'path');
  7734. flow.setAttribute('d', d);
  7735. ['transform', 'mask', 'clip-path', 'vector-effect'].forEach(function (name) {
  7736. if (shape.hasAttribute(name)) flow.setAttribute(name, shape.getAttribute(name));
  7737. });
  7738. flow.setAttribute('class', 'ambient-edge-flow ambient-flow-' + cls);
  7739. tagOverlay(flow);
  7740. shape.parentNode.insertBefore(flow, anchor.nextSibling);
  7741. anchor = flow;
  7742. return flow;
  7743. }
  7744. var wake = addPath('wake');
  7745. var len = 0;
  7746. try { len = wake.getTotalLength(); } catch (_) {}
  7747. if (!(len > 0)) {
  7748. wake.remove();
  7749. return;
  7750. }
  7751. var record = {
  7752. index: records.length,
  7753. len: len,
  7754. from: shape.getAttribute('data-edge-from') || shape.getAttribute('data-composition-edge-from') || '',
  7755. to: shape.getAttribute('data-edge-to') || shape.getAttribute('data-composition-edge-to') || '',
  7756. step: stepOf(shape, index),
  7757. travel: Math.min(RELAY.maxTravel, Math.max(RELAY.minTravel, len / RELAY.speed)),
  7758. depart: 0,
  7759. active: false,
  7760. layers: []
  7761. };
  7762. records.push(record);
  7763. // Dashed authored lines keep their dash language through the relay:
  7764. // the wake brightens only the authored segments and never fills the
  7765. // gaps back into a solid line.
  7766. var authoredDash = '';
  7767. try { authoredDash = window.getComputedStyle(shape).strokeDasharray; } catch (_) {}
  7768. record.dashed = !!(authoredDash && authoredDash !== 'none');
  7769. wake.style.setProperty('--flow-dasharray', record.dashed ? authoredDash : len.toFixed(1) + ' ' + len.toFixed(1));
  7770. // Absolute caps keep the comet a slim streak on long edges instead
  7771. // of growing into a bright slab; the tail disintegrates into a
  7772. // sparkle of fragments behind the head, and --flow-shift trails
  7773. // each layer behind the head tip by its own length.
  7774. var headLen = Math.min(14, Math.max(7, len * 0.03));
  7775. var haloLen = Math.min(22, Math.max(12, len * 0.07));
  7776. var trail = len >= 120
  7777. ? { pattern: '2.5 2 4 3 5.5 4.5 8 ' + (len - 30).toFixed(1), length: 30 }
  7778. : (len >= 60
  7779. ? { pattern: '3 3 7 ' + (len - 13).toFixed(1), length: 13 }
  7780. : { pattern: '5 ' + Math.max(4, len - 5).toFixed(1), length: 5 });
  7781. record.layers.push(
  7782. { flow: wake, kind: 'wake', dash: len, shift: 0 },
  7783. { flow: addPath('glow'), kind: 'comet', dash: haloLen, shift: (haloLen - headLen) / 2 },
  7784. { flow: addPath('halo'), kind: 'comet', dash: haloLen, shift: (haloLen - headLen) / 2 },
  7785. { flow: addPath('tail'), kind: 'comet', dash: trail.length, shift: trail.length - headLen, dasharray: trail.pattern },
  7786. { flow: addPath('head'), kind: 'comet', dash: headLen, shift: 0 }
  7787. );
  7788. if (choreography === 'stream') {
  7789. // A packet train behind the comet reads as a continuous stream.
  7790. [1, 2, 3].forEach(function (order) {
  7791. record.layers.push({ flow: addPath('head packet'), kind: 'comet', dash: Math.max(4, headLen * 0.55), shift: 0, packet: order });
  7792. });
  7793. }
  7794. // The ripple lands where the comet does; keep it out of the edge's
  7795. // mask so it can bloom over the node boundary.
  7796. var end = null;
  7797. try { end = wake.getPointAtLength(len); } catch (_) {}
  7798. if (end) {
  7799. var ripple = document.createElementNS(SVG_NS, 'circle');
  7800. ripple.setAttribute('cx', end.x.toFixed(1));
  7801. ripple.setAttribute('cy', end.y.toFixed(1));
  7802. ripple.setAttribute('r', '2');
  7803. if (shape.hasAttribute('transform')) ripple.setAttribute('transform', shape.getAttribute('transform'));
  7804. ripple.setAttribute('class', 'ambient-edge-flow ambient-flow-ripple');
  7805. tagOverlay(ripple);
  7806. shape.parentNode.insertBefore(ripple, anchor.nextSibling);
  7807. record.ripple = ripple;
  7808. }
  7809. });
  7810. var windows = Object.create(null);
  7811. var extras = [];
  7812. var span = 0;
  7813. if (choreography === 'sweep') span = planSweep(windows, extras);
  7814. else if (choreography === 'replay') span = planReplay(windows, extras);
  7815. else if (records.length) {
  7816. var linked = records.filter(function (record) { return record.from && record.to; });
  7817. if (choreography === 'sequence' || linked.length < records.length) planSequence(records, windows);
  7818. else if (choreography === 'walk') planWalk(records, windows);
  7819. else planRelay(records, windows);
  7820. span = records.reduce(function (max, record) {
  7821. return record.active ? Math.max(max, record.depart + record.travel) : max;
  7822. }, 0);
  7823. span = scalePlan(records, windows, span);
  7824. }
  7825. records.forEach(function (record) {
  7826. if (record.active) return;
  7827. record.layers.forEach(function (layer) { layer.flow.remove(); });
  7828. if (record.ripple) record.ripple.remove();
  7829. });
  7830. var active = records.filter(function (record) { return record.active; });
  7831. if (!active.length && !extras.length) return;
  7832. var cycle = Math.max(RELAY.minCycle, span + RELAY.land + RELAY.rest);
  7833. writeKeyframes(active, windows, extras, cycle);
  7834. svg.style.setProperty('--flow-cycle', cycle.toFixed(3) + 's');
  7835. html.style.setProperty('--flow-cycle-chrome', cycle.toFixed(3) + 's');
  7836. active.forEach(function (record) {
  7837. var gap = Math.min(0.22, record.travel * 0.28);
  7838. record.layers.forEach(function (layer) {
  7839. var flow = layer.flow;
  7840. flow.style.setProperty('--flow-len', record.len.toFixed(1) + 'px');
  7841. flow.style.setProperty('--flow-delay', (record.depart + (layer.packet || 0) * gap).toFixed(3) + 's');
  7842. flow.style.setProperty('--flow-dash', layer.dash.toFixed(1) + 'px');
  7843. flow.style.setProperty('--flow-shift', layer.shift.toFixed(1) + 'px');
  7844. flow.style.setProperty('--flow-name', 'archify-relay-' + layer.kind + '-' + record.index);
  7845. if (layer.dasharray) flow.style.setProperty('--flow-dasharray', layer.dasharray);
  7846. });
  7847. if (record.ripple) {
  7848. record.ripple.style.setProperty('--flow-delay', (record.depart + record.travel).toFixed(3) + 's');
  7849. record.ripple.style.setProperty('--flow-name', 'archify-relay-ripple');
  7850. }
  7851. });
  7852. var shapes = nodeShapes();
  7853. Object.keys(windows).forEach(function (id) {
  7854. (shapes[id] || []).forEach(function (shape) {
  7855. shape.style.setProperty('--flow-node-name', windows[id].keyframes);
  7856. });
  7857. });
  7858. flowCount = active.length + extras.length;
  7859. }
  7860. function settleEntry() {
  7861. entryPending.clear();
  7862. svg.removeEventListener('animationend', onEntryBoundary, true);
  7863. svg.removeEventListener('animationcancel', onEntryBoundary, true);
  7864. html.setAttribute('data-ambient-entry', 'settled');
  7865. }
  7866. function onEntryBoundary(event) {
  7867. if (!entryPending.has(event.target)) return;
  7868. // The entrance settles only when each node's pulse finishes; the
  7869. // shorter fade-rise enter animation may end first without ending it.
  7870. if (event.animationName && !/node-pulse/.test(event.animationName)) return;
  7871. entryPending.delete(event.target);
  7872. if (!entryPending.size) settleEntry();
  7873. }
  7874. function renderAmbient(suppressed) {
  7875. html.setAttribute('data-ambient-motion', flowCount ? (suppressed ? 'paused' : 'running') : 'empty');
  7876. if (suppressed) {
  7877. entryStarted = true;
  7878. settleEntry();
  7879. } else if (!entryStarted) {
  7880. entryStarted = true;
  7881. entryPending = new Set(Array.prototype.slice.call(svg.querySelectorAll('[data-animate="node"]')));
  7882. if (!entryPending.size) settleEntry();
  7883. else {
  7884. svg.addEventListener('animationend', onEntryBoundary, true);
  7885. svg.addEventListener('animationcancel', onEntryBoundary, true);
  7886. html.setAttribute('data-ambient-entry', 'running');
  7887. }
  7888. }
  7889. }
  7890. function readStored() {
  7891. try { return localStorage.getItem(STORAGE_KEY); } catch (_) { return null; }
  7892. }
  7893. function writeStored() {
  7894. try {
  7895. if (readerPaused) localStorage.removeItem(STORAGE_KEY);
  7896. else localStorage.setItem(STORAGE_KEY, 'live');
  7897. } catch (_) {}
  7898. }
  7899. function reducedMotion() {
  7900. return !!(motionQuery && motionQuery.matches);
  7901. }
  7902. function hasSuspension() {
  7903. return Object.keys(suspensions).length > 0;
  7904. }
  7905. function effectivePaused() {
  7906. return readerPaused || reducedMotion() || hasSuspension();
  7907. }
  7908. function ownerLabel(value) {
  7909. if (value === 'route') return viewerText('viewer.owner.route');
  7910. if (value === 'lens') return viewerText('viewer.owner.lens');
  7911. if (value === 'relationship') return viewerText('viewer.owner.relationship');
  7912. if (value === 'intent') return viewerText('viewer.owner.intent');
  7913. if (value === 'focus') return viewerText('viewer.owner.focus');
  7914. if (value === 'legend') return viewerText('viewer.owner.legend');
  7915. return viewerText('viewer.owner.reader');
  7916. }
  7917. function render() {
  7918. if (!capable) return;
  7919. var systemPaused = reducedMotion();
  7920. var paused = effectivePaused();
  7921. html.setAttribute('data-motion', paused ? 'still' : 'live');
  7922. renderAmbient(paused || owner || html.hasAttribute('data-embed') || html.hasAttribute('data-share-playback') || html.hasAttribute('data-document-hidden'));
  7923. btn.setAttribute('aria-pressed', paused ? 'false' : 'true');
  7924. btn.disabled = systemPaused;
  7925. label.textContent = viewerText(paused ? 'viewer.motion.still' : 'viewer.motion.live');
  7926. if (paused && lastEffectivePaused !== true && Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
  7927. Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still') });
  7928. }
  7929. lastEffectivePaused = paused;
  7930. if (Archify.routeProbe && typeof Archify.routeProbe.syncMotion === 'function') Archify.routeProbe.syncMotion();
  7931. if (systemPaused) {
  7932. btn.setAttribute('aria-label', viewerText('viewer.motion.reduced'));
  7933. btn.title = viewerText('viewer.motion.reduced');
  7934. } else if (hasSuspension()) {
  7935. btn.setAttribute('aria-label', viewerText('viewer.motion.hidden'));
  7936. btn.title = viewerText('viewer.motion.hidden');
  7937. } else if (paused) {
  7938. btn.setAttribute('aria-label', viewerText('viewer.motion.resume'));
  7939. btn.title = viewerText('viewer.motion.resume');
  7940. } else if (owner) {
  7941. btn.setAttribute('aria-label', viewerText('viewer.motion.yielding', { owner: ownerLabel(owner) }));
  7942. btn.title = viewerText('viewer.motion.yielding.title', { owner: ownerLabel(owner) });
  7943. } else {
  7944. btn.setAttribute('aria-label', viewerText('viewer.motion.pause'));
  7945. btn.title = viewerText('viewer.motion.pause');
  7946. }
  7947. }
  7948. function setPaused(next, options) {
  7949. options = options || {};
  7950. readerPaused = !!next;
  7951. if (options.persist !== false) writeStored();
  7952. render();
  7953. return readerPaused;
  7954. }
  7955. function publishOwner() {
  7956. owner = explicitOwner || deriveOwner();
  7957. if (owner) html.setAttribute('data-motion-owner', owner);
  7958. else html.removeAttribute('data-motion-owner');
  7959. render();
  7960. return owner;
  7961. }
  7962. function deriveOwner() {
  7963. if (!svg) return '';
  7964. if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return 'route';
  7965. if (svg.hasAttribute('data-lens-active')) return 'lens';
  7966. if (svg.hasAttribute('data-relationship-preview-active')) return 'relationship';
  7967. if (svg.hasAttribute('data-intent-trace-active')) return 'intent';
  7968. if (svg.hasAttribute('data-focus-active')) return 'focus';
  7969. if (svg.hasAttribute('data-legend-preview-active')) return 'legend';
  7970. return '';
  7971. }
  7972. function clearClaim(preempted) {
  7973. var cleanup = ownerCleanup;
  7974. ownerCleanup = null;
  7975. explicitOwner = '';
  7976. if (preempted && cleanup) {
  7977. try { cleanup(); } catch (_) {}
  7978. }
  7979. }
  7980. function claim(next, cleanup) {
  7981. if (!capable || !next) return 0;
  7982. clearClaim(true);
  7983. ownerToken += 1;
  7984. explicitOwner = next;
  7985. ownerCleanup = typeof cleanup === 'function' ? cleanup : null;
  7986. publishOwner();
  7987. return ownerToken;
  7988. }
  7989. function release(token) {
  7990. if (!capable || token !== ownerToken || !explicitOwner) return false;
  7991. clearClaim(false);
  7992. ownerToken += 1;
  7993. publishOwner();
  7994. return true;
  7995. }
  7996. function suspend(reason) {
  7997. var key = String(reason || 'runtime');
  7998. var active = true;
  7999. suspensions[key] = (suspensions[key] || 0) + 1;
  8000. render();
  8001. return function () {
  8002. if (!active) return false;
  8003. active = false;
  8004. if (suspensions[key] > 1) suspensions[key] -= 1;
  8005. else delete suspensions[key];
  8006. render();
  8007. return true;
  8008. };
  8009. }
  8010. function syncVisibility() {
  8011. if (document.hidden) {
  8012. suspensions.visibility = true;
  8013. html.setAttribute('data-document-hidden', 'true');
  8014. } else {
  8015. delete suspensions.visibility;
  8016. html.removeAttribute('data-document-hidden');
  8017. }
  8018. render();
  8019. }
  8020. if (!capable) {
  8021. btn.hidden = true;
  8022. html.removeAttribute('data-motion-capable');
  8023. html.removeAttribute('data-motion');
  8024. html.removeAttribute('data-motion-owner');
  8025. html.removeAttribute('data-ambient-motion');
  8026. html.removeAttribute('data-ambient-entry');
  8027. return {
  8028. capable: false,
  8029. pause: function () { return false; },
  8030. resume: function () { return false; },
  8031. toggle: function () { return false; },
  8032. setMode: function () { return 'still'; },
  8033. mode: function () { return 'still'; },
  8034. claim: function () { return 0; },
  8035. release: function () { return false; },
  8036. suspend: function () { return function () { return false; }; },
  8037. isPaused: function () { return true; },
  8038. owner: function () { return ''; }
  8039. };
  8040. }
  8041. createFlows();
  8042. html.setAttribute('data-motion-capable', 'true');
  8043. btn.hidden = false;
  8044. readerPaused = readStored() !== 'live';
  8045. btn.addEventListener('click', function () { setPaused(!readerPaused); });
  8046. if (motionQuery) {
  8047. if (typeof motionQuery.addEventListener === 'function') motionQuery.addEventListener('change', render);
  8048. else if (typeof motionQuery.addListener === 'function') motionQuery.addListener(render);
  8049. }
  8050. document.addEventListener('visibilitychange', syncVisibility);
  8051. if (typeof MutationObserver !== 'undefined') {
  8052. var contextObserver = new MutationObserver(render);
  8053. contextObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-share-playback'] });
  8054. }
  8055. if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node) {
  8056. var ownerObserver = new MutationObserver(function () { publishOwner(); });
  8057. ownerObserver.observe(svg, {
  8058. attributes: true,
  8059. attributeFilter: [
  8060. 'data-route-picking', 'data-route-active',
  8061. 'data-lens-active', 'data-relationship-preview-active', 'data-intent-trace-active',
  8062. 'data-focus-active', 'data-legend-preview-active'
  8063. ]
  8064. });
  8065. }
  8066. syncVisibility();
  8067. publishOwner();
  8068. render();
  8069. return {
  8070. capable: true,
  8071. pause: function () { return setPaused(true); },
  8072. resume: function () { return setPaused(false); },
  8073. toggle: function () { return setPaused(!readerPaused); },
  8074. setMode: function (next, options) {
  8075. setPaused(next === 'still', options);
  8076. return effectivePaused() ? 'still' : 'live';
  8077. },
  8078. mode: function () { return effectivePaused() ? 'still' : 'live'; },
  8079. claim: claim,
  8080. release: release,
  8081. suspend: suspend,
  8082. isPaused: effectivePaused,
  8083. owner: function () { return owner; }
  8084. };
  8085. })();
  8086. /* Verified repository evidence is emitted only after the renderer checks
  8087. the authored GitHub revision, source blobs, and optional line ranges
  8088. against the explicit --repo-root. It remains outside the SVG so every
  8089. canonical visual export stays free of repository paths. */
  8090. Archify.sourceEvidence = (function () {
  8091. var element = document.getElementById('archify-source-evidence-data');
  8092. var payload = null;
  8093. if (element) {
  8094. try {
  8095. var parsed = JSON.parse(element.textContent || 'null');
  8096. if (parsed && parsed.verified === true && parsed.repository && parsed.nodes) payload = parsed;
  8097. } catch (_) {}
  8098. }
  8099. // Keep verified evidence discoverable to screen readers without adding
  8100. // visual marks. Restore first so repeated initialization never appends
  8101. // another count or retains one after evidence becomes unavailable.
  8102. var svg = document.querySelector('.diagram-container svg');
  8103. if (svg) Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
  8104. if (node.hasAttribute('data-source-evidence-count')) {
  8105. var savedLabel = node.getAttribute('data-source-evidence-original-label');
  8106. if (savedLabel == null) node.removeAttribute('aria-label');
  8107. else node.setAttribute('aria-label', savedLabel);
  8108. node.removeAttribute('data-source-evidence-count');
  8109. node.removeAttribute('data-source-evidence-original-label');
  8110. }
  8111. var sources = payload && payload.nodes[node.getAttribute('data-node-id')];
  8112. if (!Array.isArray(sources) || !sources.length) return;
  8113. var originalLabel = node.getAttribute('aria-label');
  8114. node.setAttribute('data-source-evidence-count', String(sources.length));
  8115. if (originalLabel != null) node.setAttribute('data-source-evidence-original-label', originalLabel);
  8116. node.setAttribute('aria-label', (originalLabel ? originalLabel + ', ' : '') +
  8117. viewerCount('viewer.passport.sourceCount', sources.length));
  8118. });
  8119. return {
  8120. available: function () { return Boolean(payload); },
  8121. repository: function () { return payload ? payload.repository : null; },
  8122. node: function (id) {
  8123. var sources = payload && payload.nodes ? payload.nodes[id] : null;
  8124. return Array.isArray(sources) ? sources.slice() : [];
  8125. }
  8126. };
  8127. })();
  8128. /* ============================================================
  8129. Tree Branches — expand/collapse for hierarchy diagrams. The renderer
  8130. lays out the complete tree once and tags every node, link, and toggle
  8131. with its ancestors; collapsing only hides descendants, so visible nodes
  8132. never move and the reader keeps their place. Selecting a hidden node
  8133. through Finder, Outline, or a shared link expands its ancestors. Export
  8134. always writes the complete tree (see Export Cleanup).
  8135. ============================================================ */
  8136. Archify.treeBranches = (function () {
  8137. var svg = document.querySelector('.diagram-container > svg[data-tree-ui]');
  8138. if (!svg) return { active: false };
  8139. var collapsed = Object.create(null);
  8140. var toggles = Object.create(null);
  8141. Array.prototype.forEach.call(svg.querySelectorAll('[data-tree-toggle]'), function (toggle) {
  8142. toggles[toggle.getAttribute('data-tree-toggle')] = toggle;
  8143. });
  8144. var tagged = svg.querySelectorAll('[data-tree-ancestors]');
  8145. var expandAll = svg.querySelector('[data-tree-expand-all]');
  8146. function ancestors(el) {
  8147. return (el.getAttribute('data-tree-ancestors') || '').split(' ').filter(Boolean);
  8148. }
  8149. function apply() {
  8150. Array.prototype.forEach.call(tagged, function (el) {
  8151. var hidden = ancestors(el).some(function (id) { return collapsed[id]; });
  8152. if (hidden) el.setAttribute('data-tree-hidden', '');
  8153. else el.removeAttribute('data-tree-hidden');
  8154. });
  8155. var any = false;
  8156. Object.keys(toggles).forEach(function (id) {
  8157. var toggle = toggles[id];
  8158. var isCollapsed = Boolean(collapsed[id]);
  8159. any = any || isCollapsed;
  8160. toggle.setAttribute('aria-expanded', isCollapsed ? 'false' : 'true');
  8161. toggle.setAttribute('aria-label', toggle.getAttribute(isCollapsed ? 'data-tree-label-expand' : 'data-tree-label-collapse') || '');
  8162. var node = svg.querySelector('[data-node-id="' + id + '"]');
  8163. if (node) {
  8164. if (isCollapsed) node.setAttribute('data-tree-collapsed', '');
  8165. else node.removeAttribute('data-tree-collapsed');
  8166. }
  8167. });
  8168. if (any) svg.setAttribute('data-tree-any-collapsed', '');
  8169. else svg.removeAttribute('data-tree-any-collapsed');
  8170. }
  8171. function setCollapsed(id, value) {
  8172. if (!toggles[id]) return false;
  8173. if (value) collapsed[id] = true;
  8174. else delete collapsed[id];
  8175. apply();
  8176. return true;
  8177. }
  8178. function toggle(id) { return setCollapsed(id, !collapsed[id]); }
  8179. // Reveal a node by expanding every collapsed ancestor; nothing else moves.
  8180. function reveal(id) {
  8181. var node = svg.querySelector('[data-node-id="' + id + '"]');
  8182. if (!node) return false;
  8183. var changed = false;
  8184. ancestors(node).forEach(function (ancestor) {
  8185. if (collapsed[ancestor]) { delete collapsed[ancestor]; changed = true; }
  8186. });
  8187. if (changed) apply();
  8188. return changed;
  8189. }
  8190. function restoreAll() {
  8191. collapsed = Object.create(null);
  8192. apply();
  8193. }
  8194. function activate(event) {
  8195. var target = event.target.closest('[data-tree-toggle], [data-tree-expand-all]');
  8196. if (!target || !svg.contains(target)) return false;
  8197. event.preventDefault();
  8198. event.stopPropagation();
  8199. if (target.hasAttribute('data-tree-expand-all')) {
  8200. restoreAll();
  8201. var root = svg.querySelector('[data-tree-toggle]:not([data-tree-ancestors])');
  8202. if (root) root.focus();
  8203. } else {
  8204. toggle(target.getAttribute('data-tree-toggle'));
  8205. target.focus();
  8206. }
  8207. return true;
  8208. }
  8209. // Capture phase so the canvas focus handler never treats a toggle press
  8210. // as a background click that clears the current focus.
  8211. svg.addEventListener('click', activate, true);
  8212. svg.addEventListener('keydown', function (event) {
  8213. if (event.key === 'Enter' || event.key === ' ') { activate(event); return; }
  8214. var node = event.target.closest('[data-node-id]');
  8215. if (!node || !svg.contains(node)) return;
  8216. var id = node.getAttribute('data-node-id');
  8217. // Arrow keys follow the tree convention: left collapses, right expands.
  8218. if (event.key === 'ArrowLeft' && toggles[id] && !collapsed[id]) { event.preventDefault(); setCollapsed(id, true); }
  8219. else if (event.key === 'ArrowRight' && collapsed[id]) { event.preventDefault(); setCollapsed(id, false); }
  8220. }, true);
  8221. // Focus reveals ancestors synchronously before positioning its lens.
  8222. // The observer also covers paths that change pressed state directly.
  8223. new MutationObserver(function (records) {
  8224. records.forEach(function (record) {
  8225. var el = record.target;
  8226. if (el.hasAttribute && el.hasAttribute('data-tree-hidden') && el.getAttribute('aria-pressed') === 'true') {
  8227. reveal(el.getAttribute('data-node-id'));
  8228. }
  8229. });
  8230. }).observe(svg, { subtree: true, attributes: true, attributeFilter: ['aria-pressed'] });
  8231. Object.keys(toggles).forEach(function (id) {
  8232. if (toggles[id].hasAttribute('data-tree-initially-collapsed')) collapsed[id] = true;
  8233. });
  8234. apply();
  8235. return {
  8236. active: true,
  8237. toggle: toggle,
  8238. collapse: function (id) { return setCollapsed(id, true); },
  8239. expand: function (id) { return setCollapsed(id, false); },
  8240. reveal: reveal,
  8241. restoreAll: restoreAll,
  8242. collapsedIds: function () { return Object.keys(collapsed); },
  8243. expandAllControl: expandAll
  8244. };
  8245. })();
  8246. /* ============================================================
  8247. Explore — stable-ID neighborhood focus + dependency-free pan/zoom.
  8248. Renderer IDs become deep-linkable semantic hooks without turning the
  8249. standalone artifact into a canvas editor.
  8250. ============================================================ */
  8251. Archify.focus = (function () {
  8252. var html = document.documentElement;
  8253. var container = document.querySelector('.diagram-container');
  8254. var svg = container.querySelector('svg');
  8255. var chip = document.getElementById('focus-chip');
  8256. var label = document.getElementById('focus-label');
  8257. var detail = document.getElementById('focus-detail');
  8258. var kind = document.getElementById('focus-kind');
  8259. var context = document.getElementById('focus-context');
  8260. var tag = document.getElementById('focus-tag');
  8261. var semanticId = document.getElementById('focus-id');
  8262. var evidence = document.getElementById('focus-evidence');
  8263. var repositoryLink = document.getElementById('focus-repository');
  8264. var evidenceLinks = document.getElementById('focus-evidence-links');
  8265. var summary = document.getElementById('focus-summary');
  8266. var reachSection = document.getElementById('focus-reach');
  8267. var reachStatus = document.getElementById('focus-reach-status');
  8268. var upstreamBtn = document.getElementById('btn-reach-upstream');
  8269. var downstreamBtn = document.getElementById('btn-reach-downstream');
  8270. var upstreamCount = document.getElementById('focus-reach-upstream-count');
  8271. var downstreamCount = document.getElementById('focus-reach-downstream-count');
  8272. var relationshipList = document.getElementById('relationship-lens-list');
  8273. var copyBtn = document.getElementById('btn-focus-copy');
  8274. var relationsBtn = document.getElementById('btn-focus-relations');
  8275. var clearBtn = document.getElementById('btn-focus-clear');
  8276. var moveBtn = document.getElementById('btn-focus-move');
  8277. var activeIds = [];
  8278. var hoveredRelationship = null;
  8279. var focusedRelationship = null;
  8280. var pinnedRelationship = null;
  8281. var pinnedRelationshipKey = null;
  8282. var activeRelationshipPreview = null;
  8283. var relationshipHitOverlay = null;
  8284. var relationshipHitTargets = [];
  8285. var directPreviewTimer = null;
  8286. var lensDrag = null;
  8287. var lensDragClickPointer = null;
  8288. var manualLensPosition = null;
  8289. var reachabilityMode = null;
  8290. var activeReachability = null;
  8291. var svgNamespace = 'http://www.w3.org/2000/svg';
  8292. var reducedMotionQuery = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;
  8293. var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;
  8294. function nodes() {
  8295. return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
  8296. }
  8297. function edges() {
  8298. return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
  8299. }
  8300. function nodeLabel(node, fallback) {
  8301. return node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');
  8302. }
  8303. function reachabilityRelationships() {
  8304. var seen = Object.create(null);
  8305. var relationships = [];
  8306. edges().forEach(function (edge) {
  8307. var from = edge.getAttribute('data-edge-from');
  8308. var to = edge.getAttribute('data-edge-to');
  8309. var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));
  8310. if (!from || !to || seen[key]) return;
  8311. seen[key] = true;
  8312. relationships.push({ key: key, from: from, to: to });
  8313. });
  8314. return relationships;
  8315. }
  8316. function computeReachability(originId, direction, relationships) {
  8317. if (typeof originId !== 'string' || !originId ||
  8318. (direction !== 'upstream' && direction !== 'downstream') ||
  8319. !Array.isArray(relationships)) return null;
  8320. var records = [];
  8321. var seenKeys = Object.create(null);
  8322. relationships.forEach(function (relationship, index) {
  8323. if (!relationship || typeof relationship.from !== 'string' || !relationship.from ||
  8324. typeof relationship.to !== 'string' || !relationship.to) return;
  8325. var key = typeof relationship.key === 'string' && relationship.key
  8326. ? relationship.key : String(index);
  8327. if (seenKeys[key]) return;
  8328. seenKeys[key] = true;
  8329. records.push({ key: key, from: relationship.from, to: relationship.to });
  8330. });
  8331. var depths = Object.create(null);
  8332. var order = [];
  8333. var queue = [originId];
  8334. depths[originId] = 0;
  8335. for (var cursor = 0; cursor < queue.length; cursor += 1) {
  8336. var current = queue[cursor];
  8337. records.forEach(function (relationship) {
  8338. var next = null;
  8339. if (direction === 'downstream' && relationship.from === current) next = relationship.to;
  8340. else if (direction === 'upstream' && relationship.to === current) next = relationship.from;
  8341. if (next == null || Object.prototype.hasOwnProperty.call(depths, next)) return;
  8342. depths[next] = depths[current] + 1;
  8343. queue.push(next);
  8344. });
  8345. }
  8346. queue.forEach(function (id) { order.push(id); });
  8347. var edgeKeys = [];
  8348. records.forEach(function (relationship) {
  8349. if (Object.prototype.hasOwnProperty.call(depths, relationship.from) &&
  8350. Object.prototype.hasOwnProperty.call(depths, relationship.to)) edgeKeys.push(relationship.key);
  8351. });
  8352. var maxDepth = order.reduce(function (maximum, id) {
  8353. return Math.max(maximum, depths[id]);
  8354. }, 0);
  8355. return {
  8356. direction: direction,
  8357. originId: originId,
  8358. nodeIds: order,
  8359. edgeKeys: edgeKeys,
  8360. depths: depths,
  8361. maxDepth: maxDepth
  8362. };
  8363. }
  8364. function reachabilityFor(id, direction) {
  8365. return computeReachability(id, direction, reachabilityRelationships());
  8366. }
  8367. function resetReachabilityButtons() {
  8368. upstreamBtn.setAttribute('aria-pressed', 'false');
  8369. downstreamBtn.setAttribute('aria-pressed', 'false');
  8370. }
  8371. function clearReachability(options) {
  8372. options = options || {};
  8373. reachabilityMode = null;
  8374. activeReachability = null;
  8375. svg.removeAttribute('data-reach-active');
  8376. chip.removeAttribute('data-reach-mode');
  8377. nodes().forEach(function (node) {
  8378. node.removeAttribute('data-reach-match');
  8379. node.removeAttribute('data-reach-origin');
  8380. node.removeAttribute('data-reach-depth');
  8381. });
  8382. edges().forEach(function (edge) {
  8383. edge.removeAttribute('data-reach-match');
  8384. edge.removeAttribute('data-reach-depth');
  8385. });
  8386. resetReachabilityButtons();
  8387. reachStatus.textContent = '';
  8388. reachStatus.hidden = true;
  8389. if (Archify.exportMenu && typeof Archify.exportMenu.syncReachShare === 'function') {
  8390. Archify.exportMenu.syncReachShare();
  8391. }
  8392. if (options.updateUrl === true && activeIds.length === 1) {
  8393. try {
  8394. history.replaceState(null, '', location.pathname + location.search + '#focus=' + encodeURIComponent(activeIds[0]));
  8395. } catch (_) {}
  8396. }
  8397. }
  8398. function renderReachabilityControls(id) {
  8399. var upstream = reachabilityFor(id, 'upstream');
  8400. var downstream = reachabilityFor(id, 'downstream');
  8401. var upstreamReach = upstream ? Math.max(0, upstream.nodeIds.length - 1) : 0;
  8402. var downstreamReach = downstream ? Math.max(0, downstream.nodeIds.length - 1) : 0;
  8403. upstreamCount.textContent = String(upstreamReach);
  8404. downstreamCount.textContent = String(downstreamReach);
  8405. upstreamBtn.disabled = upstreamReach === 0;
  8406. downstreamBtn.disabled = downstreamReach === 0;
  8407. upstreamBtn.setAttribute('aria-label', upstreamReach
  8408. ? viewerCount('viewer.passport.reach.upstream', upstreamReach)
  8409. : viewerText('viewer.passport.reach.noUpstream'));
  8410. downstreamBtn.setAttribute('aria-label', downstreamReach
  8411. ? viewerCount('viewer.passport.reach.downstream', downstreamReach)
  8412. : viewerText('viewer.passport.reach.noDownstream'));
  8413. reachSection.hidden = false;
  8414. }
  8415. function applyReachability(direction, options) {
  8416. options = options || {};
  8417. if (activeIds.length !== 1 || (direction !== 'upstream' && direction !== 'downstream')) return false;
  8418. if (reachabilityMode === direction && options.toggle !== false) {
  8419. clearReachability({ updateUrl: options.updateUrl !== false });
  8420. return true;
  8421. }
  8422. var result = reachabilityFor(activeIds[0], direction);
  8423. if (!result || result.nodeIds.length <= 1) return false;
  8424. clearRelationshipPreview({ clearPin: true });
  8425. clearReachability({ updateUrl: false });
  8426. reachabilityMode = direction;
  8427. activeReachability = result;
  8428. var edgeKeySet = Object.create(null);
  8429. result.edgeKeys.forEach(function (key) { edgeKeySet[key] = true; });
  8430. svg.setAttribute('data-reach-active', direction);
  8431. chip.setAttribute('data-reach-mode', direction);
  8432. nodes().forEach(function (node) {
  8433. var id = node.getAttribute('data-node-id');
  8434. if (!Object.prototype.hasOwnProperty.call(result.depths, id)) return;
  8435. node.setAttribute('data-reach-match', '');
  8436. node.setAttribute('data-reach-depth', String(result.depths[id]));
  8437. if (id === result.originId) node.setAttribute('data-reach-origin', '');
  8438. });
  8439. edges().forEach(function (edge) {
  8440. var key = edge.getAttribute('data-edge-key') || (
  8441. edge.getAttribute('data-edge-from') + '\u0000' +
  8442. edge.getAttribute('data-edge-to') + '\u0000' +
  8443. (edge.getAttribute('data-edge-label') || '')
  8444. );
  8445. if (!edgeKeySet[key]) return;
  8446. edge.setAttribute('data-reach-match', '');
  8447. var fromDepth = result.depths[edge.getAttribute('data-edge-from')];
  8448. var toDepth = result.depths[edge.getAttribute('data-edge-to')];
  8449. edge.setAttribute('data-reach-depth', String(Math.max(fromDepth || 0, toDepth || 0)));
  8450. });
  8451. resetReachabilityButtons();
  8452. var activeButton = direction === 'upstream' ? upstreamBtn : downstreamBtn;
  8453. activeButton.setAttribute('aria-pressed', 'true');
  8454. var reachableCount = result.nodeIds.length - 1;
  8455. var directionLabel = viewerText(direction === 'upstream'
  8456. ? 'viewer.passport.upstream'
  8457. : 'viewer.passport.downstream');
  8458. reachStatus.textContent = viewerText('viewer.passport.reach.status', {
  8459. direction: directionLabel,
  8460. nodes: reachableCount,
  8461. links: result.edgeKeys.length,
  8462. hops: result.maxDepth
  8463. });
  8464. reachStatus.hidden = false;
  8465. if (Archify.exportMenu && typeof Archify.exportMenu.syncReachShare === 'function') {
  8466. Archify.exportMenu.syncReachShare();
  8467. }
  8468. if (options.updateUrl !== false) {
  8469. try {
  8470. history.replaceState(null, '', location.pathname + location.search + '#focus=' +
  8471. encodeURIComponent(activeIds[0]) + '&reach=' + direction);
  8472. } catch (_) {}
  8473. }
  8474. if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
  8475. Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });
  8476. }
  8477. placeRelationshipLens();
  8478. return true;
  8479. }
  8480. function reachabilitySnapshot() {
  8481. if (!activeReachability || activeIds.length !== 1 ||
  8482. (reachabilityMode !== 'upstream' && reachabilityMode !== 'downstream') ||
  8483. activeReachability.direction !== reachabilityMode ||
  8484. activeReachability.originId !== activeIds[0] ||
  8485. svg.getAttribute('data-reach-active') !== reachabilityMode) return null;
  8486. var originId = activeReachability.originId;
  8487. var nodeIds = activeReachability.nodeIds.slice();
  8488. var edgeKeys = activeReachability.edgeKeys.slice();
  8489. if (nodeIds.length < 2 || nodeIds[0] !== originId || !edgeKeys.length ||
  8490. !activeReachability.depths || !Number.isInteger(activeReachability.maxDepth) ||
  8491. activeReachability.maxDepth < 1) return null;
  8492. var allNodes = nodes();
  8493. var allEdges = edges();
  8494. var seenNodeIds = Object.create(null);
  8495. var seenEdgeKeys = Object.create(null);
  8496. var nodeIdSet = Object.create(null);
  8497. var depths = Object.create(null);
  8498. var originNode = null;
  8499. var measuredMaxDepth = 0;
  8500. if (nodeIds.some(function (id) {
  8501. var depth = activeReachability.depths[id];
  8502. var matches = allNodes.filter(function (node) {
  8503. return node.getAttribute('data-node-id') === id;
  8504. });
  8505. if (typeof id !== 'string' || !id || seenNodeIds[id] || matches.length !== 1 ||
  8506. !matches[0].hasAttribute('data-reach-match') ||
  8507. !Number.isInteger(depth) || depth < 0 || depth > activeReachability.maxDepth ||
  8508. (id === originId
  8509. ? (!matches[0].hasAttribute('data-reach-origin') || depth !== 0)
  8510. : depth < 1)) return true;
  8511. seenNodeIds[id] = true;
  8512. nodeIdSet[id] = true;
  8513. depths[id] = depth;
  8514. measuredMaxDepth = Math.max(measuredMaxDepth, depth);
  8515. if (id === originId) originNode = matches[0];
  8516. return false;
  8517. }) || !originNode || measuredMaxDepth !== activeReachability.maxDepth ||
  8518. allNodes.filter(function (node) { return node.hasAttribute('data-reach-match'); }).length !== nodeIds.length) return null;
  8519. var edgeRecords = [];
  8520. if (edgeKeys.some(function (key) {
  8521. if (typeof key !== 'string' || !key || seenEdgeKeys[key]) return true;
  8522. var fragments = allEdges.filter(function (edge) {
  8523. return edge.getAttribute('data-edge-key') === key;
  8524. });
  8525. var drawableFragments = fragments.filter(hasDrawableGeometry);
  8526. if (!fragments.length || drawableFragments.length !== 1 ||
  8527. !fragments.every(function (fragment) { return fragment.hasAttribute('data-reach-match'); })) return true;
  8528. var first = fragments[0];
  8529. var from = first.getAttribute('data-edge-from');
  8530. var to = first.getAttribute('data-edge-to');
  8531. var id = first.getAttribute('data-edge-id') || '';
  8532. var labelValue = first.getAttribute('data-edge-label') || '';
  8533. if (!nodeIdSet[from] || !nodeIdSet[to] || !fragments.every(function (fragment) {
  8534. return fragment.getAttribute('data-edge-from') === from &&
  8535. fragment.getAttribute('data-edge-to') === to &&
  8536. (fragment.getAttribute('data-edge-id') || '') === id;
  8537. })) return true;
  8538. seenEdgeKeys[key] = true;
  8539. edgeRecords.push({
  8540. key: key,
  8541. id: id,
  8542. from: from,
  8543. to: to,
  8544. label: labelValue,
  8545. depth: Math.max(depths[from], depths[to])
  8546. });
  8547. return false;
  8548. })) return null;
  8549. var liveEdgeKeys = Object.create(null);
  8550. if (allEdges.some(function (edge) {
  8551. if (!edge.hasAttribute('data-reach-match')) return false;
  8552. var key = edge.getAttribute('data-edge-key');
  8553. if (!key || !seenEdgeKeys[key]) return true;
  8554. liveEdgeKeys[key] = true;
  8555. return false;
  8556. }) || Object.keys(liveEdgeKeys).length !== edgeKeys.length) return null;
  8557. return {
  8558. direction: reachabilityMode,
  8559. origin: { id: originId, label: nodeLabel(originNode, originId) },
  8560. nodeIds: nodeIds,
  8561. depths: depths,
  8562. maxDepth: activeReachability.maxDepth,
  8563. edges: edgeRecords
  8564. };
  8565. }
  8566. function setPassportValue(element, value) {
  8567. var normalized = value == null ? '' : String(value).trim();
  8568. element.textContent = normalized;
  8569. element.hidden = !normalized;
  8570. }
  8571. function renderSourceEvidence(id) {
  8572. evidenceLinks.textContent = '';
  8573. repositoryLink.removeAttribute('href');
  8574. repositoryLink.removeAttribute('aria-label');
  8575. repositoryLink.textContent = '';
  8576. var sources = Archify.sourceEvidence.node(id);
  8577. var repository = Archify.sourceEvidence.repository();
  8578. if (!repository || !sources.length) {
  8579. evidence.hidden = true;
  8580. return;
  8581. }
  8582. repositoryLink.textContent = repository.label + ' @ ' + repository.shortRevision;
  8583. if (repository.href) {
  8584. repositoryLink.href = repository.href;
  8585. repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
  8586. }
  8587. evidence.title = viewerText('viewer.passport.verificationScope');
  8588. sources.forEach(function (source) {
  8589. var link = document.createElement(source.href ? 'a' : 'div');
  8590. link.className = 'semantic-passport-source';
  8591. if (source.href) {
  8592. link.href = source.href;
  8593. link.target = '_blank';
  8594. link.rel = 'noopener noreferrer';
  8595. link.referrerPolicy = 'no-referrer';
  8596. link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
  8597. }
  8598. var name = document.createElement('strong');
  8599. name.textContent = source.label || source.path.split('/').pop() || source.path;
  8600. var location = document.createElement('code');
  8601. location.textContent = source.line
  8602. ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + (source.href ? ' ↗' : '')
  8603. : source.href ? viewerText('viewer.passport.source.openLink') : '';
  8604. var sourcePath = document.createElement('small');
  8605. sourcePath.textContent = source.path;
  8606. link.appendChild(name);
  8607. link.appendChild(location);
  8608. link.appendChild(sourcePath);
  8609. evidenceLinks.appendChild(link);
  8610. });
  8611. evidence.hidden = false;
  8612. }
  8613. function renderPassport(id, node) {
  8614. setPassportValue(detail, node.getAttribute('data-node-sublabel'));
  8615. setPassportValue(kind, viewerKindLabel(node.getAttribute('data-node-kind') || 'node'));
  8616. setPassportValue(context, node.getAttribute('data-node-context'));
  8617. setPassportValue(tag, node.getAttribute('data-node-tag'));
  8618. setPassportValue(document.getElementById('focus-brand'), node.getAttribute('data-node-brand'));
  8619. semanticId.textContent = id;
  8620. semanticId.hidden = false;
  8621. renderSourceEvidence(id);
  8622. }
  8623. function relationshipsFor(id, byId) {
  8624. var seen = {};
  8625. var relationships = [];
  8626. edges().forEach(function (edge) {
  8627. var from = edge.getAttribute('data-edge-from');
  8628. var to = edge.getAttribute('data-edge-to');
  8629. if (from !== id && to !== id) return;
  8630. var edgeLabel = edge.getAttribute('data-edge-label') || '';
  8631. var edgeKey = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + edgeLabel);
  8632. var edgeId = edge.getAttribute('data-edge-id') || '';
  8633. if (seen[edgeKey]) return;
  8634. seen[edgeKey] = true;
  8635. var direction = from === id && to === id ? 'loop' : (from === id ? 'out' : 'in');
  8636. var neighborId = direction === 'in' ? from : to;
  8637. var neighbor = byId[neighborId];
  8638. relationships.push({
  8639. key: edgeKey,
  8640. id: edgeId,
  8641. from: from,
  8642. to: to,
  8643. direction: direction,
  8644. neighborId: neighborId,
  8645. neighborLabel: neighbor ? nodeLabel(neighbor, neighborId) : neighborId,
  8646. label: edgeLabel || viewerText(direction === 'loop'
  8647. ? 'viewer.passport.relationship.loopsBack'
  8648. : direction === 'out'
  8649. ? 'viewer.passport.relationship.connectsTo'
  8650. : 'viewer.passport.relationship.connectsFrom')
  8651. });
  8652. });
  8653. return relationships;
  8654. }
  8655. function relationshipEdgeShapes(edge) {
  8656. if (!edge) return [];
  8657. if (/^(path|line|polyline)$/i.test(edge.tagName || '')) return [edge];
  8658. return Array.prototype.slice.call(edge.querySelectorAll('path:not([data-ambient-flow-overlay]), line, polyline'));
  8659. }
  8660. function relationshipHitRecords() {
  8661. var recordsByKey = {};
  8662. var recordsById = Object.create(null);
  8663. var byId = Object.create(null);
  8664. nodes().forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
  8665. var records = [];
  8666. edges().forEach(function (edge) {
  8667. var shapes = relationshipEdgeShapes(edge);
  8668. if (!shapes.length) return;
  8669. var from = edge.getAttribute('data-edge-from');
  8670. var to = edge.getAttribute('data-edge-to');
  8671. var labelValue = edge.getAttribute('data-edge-label') || '';
  8672. var edgeId = edge.getAttribute('data-edge-id') || '';
  8673. var key = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + labelValue);
  8674. var existing = recordsByKey[key];
  8675. if (existing) {
  8676. if (existing.from !== from || existing.to !== to || existing.labelValue !== labelValue || existing.id !== edgeId) {
  8677. existing.invalid = true;
  8678. return;
  8679. }
  8680. shapes.forEach(function (shape) {
  8681. if (existing.shapes.indexOf(shape) === -1) existing.shapes.push(shape);
  8682. });
  8683. return;
  8684. }
  8685. var record = {
  8686. key: key,
  8687. id: edgeId,
  8688. from: from,
  8689. to: to,
  8690. fromLabel: byId[from] ? nodeLabel(byId[from], from) : from,
  8691. toLabel: byId[to] ? nodeLabel(byId[to], to) : to,
  8692. labelValue: labelValue,
  8693. label: labelValue || viewerText(from === to
  8694. ? 'viewer.passport.relationship.loopsBack'
  8695. : 'viewer.passport.relationship.connectsTo'),
  8696. edge: edge,
  8697. shapes: shapes,
  8698. invalid: false
  8699. };
  8700. recordsByKey[key] = record;
  8701. if (edgeId) {
  8702. if (recordsById[edgeId]) {
  8703. recordsById[edgeId].invalid = true;
  8704. record.invalid = true;
  8705. } else {
  8706. recordsById[edgeId] = record;
  8707. }
  8708. }
  8709. records.push(record);
  8710. });
  8711. return records.filter(function (record) { return !record.invalid && record.from && record.to; });
  8712. }
  8713. function relationshipRecordForKey(key) {
  8714. return relationshipHitRecords().find(function (record) { return record.key === key; }) || null;
  8715. }
  8716. function pinnedRelationshipRecord() {
  8717. return pinnedRelationshipKey ? relationshipRecordForKey(pinnedRelationshipKey) : null;
  8718. }
  8719. function renderRelationshipCopyAction() {
  8720. var record = pinnedRelationshipRecord();
  8721. if (record && record.id) {
  8722. copyBtn.textContent = viewerText('viewer.passport.copyRelation');
  8723. copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copyPinned'));
  8724. } else if (pinnedRelationshipKey) {
  8725. copyBtn.textContent = viewerText('viewer.passport.copyNode');
  8726. copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copySource'));
  8727. } else {
  8728. copyBtn.textContent = viewerText('viewer.passport.copy');
  8729. copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copy.focus'));
  8730. }
  8731. }
  8732. function relationshipHitGeometry(shape, className) {
  8733. var clone = shape.cloneNode(false);
  8734. clone.removeAttribute('id');
  8735. clone.removeAttribute('class');
  8736. clone.removeAttribute('style');
  8737. clone.removeAttribute('filter');
  8738. clone.removeAttribute('marker-start');
  8739. clone.removeAttribute('marker-mid');
  8740. clone.removeAttribute('marker-end');
  8741. clone.removeAttribute('role');
  8742. clone.removeAttribute('tabindex');
  8743. clone.removeAttribute('aria-label');
  8744. clone.removeAttribute('aria-labelledby');
  8745. clone.removeAttribute('aria-hidden');
  8746. clone.removeAttribute('data-animate');
  8747. clone.removeAttribute('data-edge-from');
  8748. clone.removeAttribute('data-edge-to');
  8749. clone.removeAttribute('data-edge-key');
  8750. clone.removeAttribute('data-edge-id');
  8751. clone.removeAttribute('data-edge-label');
  8752. clone.setAttribute('class', className || 'relationship-hit-rail');
  8753. return clone;
  8754. }
  8755. function removeRelationshipPulse() {
  8756. Array.prototype.forEach.call(svg.querySelectorAll('[data-relationship-pulse-overlay]'), function (element) {
  8757. element.remove();
  8758. });
  8759. }
  8760. function relationshipPulseGeometry(shape) {
  8761. var clone = shape.cloneNode(false);
  8762. if (shape.getAttribute('data-motion-path')) clone.setAttribute('d', relationshipTokenPath(shape));
  8763. clone.removeAttribute('data-motion-path');
  8764. clone.removeAttribute('id');
  8765. clone.removeAttribute('class');
  8766. clone.removeAttribute('style');
  8767. clone.removeAttribute('transform');
  8768. clone.removeAttribute('filter');
  8769. clone.removeAttribute('marker-start');
  8770. clone.removeAttribute('marker-mid');
  8771. clone.removeAttribute('marker-end');
  8772. clone.removeAttribute('role');
  8773. clone.removeAttribute('tabindex');
  8774. clone.removeAttribute('aria-label');
  8775. clone.removeAttribute('aria-hidden');
  8776. clone.removeAttribute('data-animate');
  8777. clone.removeAttribute('data-edge-from');
  8778. clone.removeAttribute('data-edge-to');
  8779. clone.removeAttribute('data-edge-key');
  8780. clone.removeAttribute('data-edge-id');
  8781. clone.removeAttribute('data-edge-label');
  8782. clone.removeAttribute('data-focus-match');
  8783. clone.removeAttribute('data-relationship-preview');
  8784. clone.setAttribute('class', 'relationship-flow-pulse');
  8785. clone.setAttribute('pathLength', '1');
  8786. return clone;
  8787. }
  8788. function relationshipTokenKind(edge) {
  8789. var shapes = relationshipEdgeShapes(edge);
  8790. var classEvidence = [edge.getAttribute('class') || ''].concat(shapes.map(function (shape) {
  8791. return shape.getAttribute('class') || '';
  8792. })).join(' ');
  8793. var from = edge.getAttribute('data-edge-from') || '';
  8794. var to = edge.getAttribute('data-edge-to') || '';
  8795. var source = nodes().find(function (node) { return node.getAttribute('data-node-id') === from; });
  8796. var target = nodes().find(function (node) { return node.getAttribute('data-node-id') === to; });
  8797. var sourceKind = source ? source.getAttribute('data-node-kind') || 'neutral' : 'neutral';
  8798. var targetKind = target ? target.getAttribute('data-node-kind') || 'neutral' : 'neutral';
  8799. if (/\ba-security\b/.test(classEvidence) || sourceKind === 'security' || targetKind === 'security' || targetKind === 'failure') return 'security';
  8800. if (/\ba-dashed\b/.test(classEvidence) || sourceKind === 'messagebus' || targetKind === 'messagebus') return 'event';
  8801. if (sourceKind === 'database' || targetKind === 'database') return 'data';
  8802. if (targetKind === 'waiting' || targetKind === 'success') return 'state';
  8803. return 'call';
  8804. }
  8805. function relationshipTokenPath(shape) {
  8806. if (!shape) return '';
  8807. var tagName = String(shape.tagName || '').toLowerCase();
  8808. if (tagName === 'path') return shape.getAttribute('data-motion-path') || shape.getAttribute('d') || '';
  8809. if (tagName === 'line') {
  8810. return 'M ' + shape.getAttribute('x1') + ' ' + shape.getAttribute('y1') +
  8811. ' L ' + shape.getAttribute('x2') + ' ' + shape.getAttribute('y2');
  8812. }
  8813. if (tagName === 'polyline' && shape.points && shape.points.numberOfItems > 1) {
  8814. var commands = [];
  8815. for (var i = 0; i < shape.points.numberOfItems; i += 1) {
  8816. var point = shape.points.getItem(i);
  8817. commands.push((i === 0 ? 'M ' : 'L ') + point.x + ' ' + point.y);
  8818. }
  8819. return commands.join(' ');
  8820. }
  8821. return '';
  8822. }
  8823. function relationshipTokenPart(tagName, className, attrs) {
  8824. var part = document.createElementNS(svgNamespace, tagName);
  8825. part.setAttribute('class', className);
  8826. Object.keys(attrs || {}).forEach(function (name) { part.setAttribute(name, attrs[name]); });
  8827. return part;
  8828. }
  8829. function relationshipTokenGeometry(shape, kind, key, options) {
  8830. options = options || {};
  8831. var pathData = relationshipTokenPath(shape);
  8832. if (!pathData) return null;
  8833. var token = document.createElementNS(svgNamespace, 'g');
  8834. token.setAttribute('class', 'semantic-flow-token ' + (options.className || 'relationship-flow-token'));
  8835. token.setAttribute('data-token-kind', kind);
  8836. token.setAttribute('data-token-edge-key', key);
  8837. token.setAttribute('aria-hidden', 'true');
  8838. token.appendChild(relationshipTokenPart('circle', 'semantic-flow-token-halo', { cx: '0', cy: '0', r: '7' }));
  8839. if (kind === 'data') {
  8840. token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-5', y: '-4', width: '10', height: '8', rx: '2' }));
  8841. token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'M -2.8 -1.2 h 5.6 M -2.8 1.4 h 3.8' }));
  8842. } else if (kind === 'event') {
  8843. token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-7', y: '-3', width: '4', height: '6', rx: '1' }));
  8844. token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '-2', y: '-3', width: '4', height: '6', rx: '1' }));
  8845. token.appendChild(relationshipTokenPart('rect', 'relationship-flow-token-shape', { x: '3', y: '-3', width: '4', height: '6', rx: '1' }));
  8846. } else if (kind === 'security') {
  8847. token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-shape', { d: 'M 0 -5 L 4 -3.4 V 0 c 0 3 -1.6 4.5 -4 5.5 C -2.4 4.5 -4 3 -4 0 v -3.4 Z' }));
  8848. token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'm -2 .2 1.4 1.4 L 2 -1.4' }));
  8849. } else if (kind === 'state') {
  8850. token.appendChild(relationshipTokenPart('circle', 'relationship-flow-token-shape', { cx: '0', cy: '0', r: '5' }));
  8851. token.appendChild(relationshipTokenPart('circle', 'relationship-flow-token-dot', { cx: '0', cy: '0', r: '1.35' }));
  8852. } else {
  8853. token.appendChild(relationshipTokenPart('path', 'relationship-flow-token-ink', { d: 'M -5 -3 L -1 0 L -5 3 M 0 -3 L 4 0 L 0 3' }));
  8854. }
  8855. var motion = document.createElementNS(svgNamespace, 'animateMotion');
  8856. motion.setAttribute('path', pathData);
  8857. motion.setAttribute('dur', options.duration || '1.2s');
  8858. motion.setAttribute('begin', '0s');
  8859. motion.setAttribute('fill', 'freeze');
  8860. motion.setAttribute('rotate', 'auto');
  8861. motion.setAttribute('calcMode', 'spline');
  8862. motion.setAttribute('keyTimes', '0;1');
  8863. motion.setAttribute('keySplines', '.2 0 .2 1');
  8864. token.appendChild(motion);
  8865. return token;
  8866. }
  8867. function createSemanticFlowToken(edge, shape, options) {
  8868. if (!edge || !shape) return null;
  8869. var key = edge.getAttribute('data-edge-key') || (
  8870. edge.getAttribute('data-edge-from') + '\u0000' +
  8871. edge.getAttribute('data-edge-to') + '\u0000' +
  8872. (edge.getAttribute('data-edge-label') || '')
  8873. );
  8874. return relationshipTokenGeometry(shape, relationshipTokenKind(edge), key, options);
  8875. }
  8876. Archify.flowTokens = {
  8877. create: createSemanticFlowToken,
  8878. kind: function (edge) { return relationshipTokenKind(edge); },
  8879. path: relationshipTokenPath
  8880. };
  8881. function renderRelationshipPulse(key) {
  8882. removeRelationshipPulse();
  8883. if (!key || document.documentElement.getAttribute('data-embed') === 'true') return false;
  8884. if (document.hidden || (Archify.motionGovernor && Archify.motionGovernor.isPaused())) return false;
  8885. if (reducedMotionQuery && reducedMotionQuery.matches) return false;
  8886. var matchingEdges = edges().filter(function (edge) {
  8887. return edge.getAttribute('data-edge-key') === key;
  8888. });
  8889. if (!matchingEdges.length) return false;
  8890. var overlay = document.createElementNS(svgNamespace, 'g');
  8891. overlay.setAttribute('class', 'relationship-pulse-overlay');
  8892. overlay.setAttribute('data-relationship-pulse-overlay', '');
  8893. overlay.setAttribute('data-relationship-pulse-key', key);
  8894. overlay.setAttribute('aria-hidden', 'true');
  8895. var tokenAdded = false;
  8896. matchingEdges.forEach(function (edge) {
  8897. var wrapper = document.createElementNS(svgNamespace, 'g');
  8898. if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
  8899. var shapes = relationshipEdgeShapes(edge);
  8900. shapes.forEach(function (shape) {
  8901. wrapper.appendChild(relationshipPulseGeometry(shape));
  8902. });
  8903. if (!tokenAdded && shapes.length) {
  8904. var tokenKind = relationshipTokenKind(edge);
  8905. var token = relationshipTokenGeometry(shapes[0], tokenKind, key);
  8906. if (token) {
  8907. wrapper.appendChild(token);
  8908. overlay.setAttribute('data-relationship-token-kind', tokenKind);
  8909. tokenAdded = true;
  8910. }
  8911. }
  8912. if (wrapper.childNodes.length) overlay.appendChild(wrapper);
  8913. });
  8914. if (!overlay.childNodes.length) return false;
  8915. var finishPulse = function () {
  8916. if (overlay.parentNode) overlay.remove();
  8917. };
  8918. overlay.addEventListener('animationend', finishPulse, { once: true });
  8919. overlay.addEventListener('animationcancel', finishPulse, { once: true });
  8920. var firstNode = svg.querySelector('[data-node-id]');
  8921. if (firstNode) svg.insertBefore(overlay, firstNode);
  8922. else svg.appendChild(overlay);
  8923. return true;
  8924. }
  8925. function clearRelationshipPreview(options) {
  8926. options = options || {};
  8927. if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
  8928. directPreviewTimer = null;
  8929. removeRelationshipPulse();
  8930. activeRelationshipPreview = null;
  8931. svg.removeAttribute('data-relationship-preview-active');
  8932. svg.removeAttribute('data-relationship-direct-active');
  8933. if (options.clearPin === true) {
  8934. pinnedRelationship = null;
  8935. pinnedRelationshipKey = null;
  8936. svg.removeAttribute('data-relationship-pin-active');
  8937. }
  8938. chip.removeAttribute('data-relationship-previewing');
  8939. edges().forEach(function (edge) { edge.removeAttribute('data-relationship-preview'); });
  8940. nodes().forEach(function (node) {
  8941. node.removeAttribute('data-relationship-preview-node');
  8942. node.removeAttribute('data-relationship-preview-source');
  8943. node.removeAttribute('data-relationship-preview-target');
  8944. });
  8945. Array.prototype.forEach.call(relationshipList.querySelectorAll('[data-preview-active]'), function (button) {
  8946. button.removeAttribute('data-preview-active');
  8947. });
  8948. relationshipHitTargets.forEach(function (target) {
  8949. target.setAttribute('aria-pressed', pinnedRelationshipKey && target.getAttribute('data-relationship-key') === pinnedRelationshipKey ? 'true' : 'false');
  8950. target.removeAttribute('data-preview-active');
  8951. });
  8952. renderRelationshipCopyAction();
  8953. placeRelationshipLens();
  8954. }
  8955. function previewRelationship(button, options) {
  8956. options = options || {};
  8957. if (pinnedRelationshipKey && pinnedRelationship && button !== pinnedRelationship) return;
  8958. clearRelationshipPreview();
  8959. if (!button) return;
  8960. var key = button.getAttribute('data-relationship-key');
  8961. var from = button.getAttribute('data-relationship-from');
  8962. var to = button.getAttribute('data-relationship-to');
  8963. if (!key || !from || !to) return;
  8964. svg.setAttribute('data-relationship-preview-active', key);
  8965. if (options.direct === true) svg.setAttribute('data-relationship-direct-active', key);
  8966. edges().forEach(function (edge) {
  8967. if (edge.getAttribute('data-edge-key') === key) edge.setAttribute('data-relationship-preview', '');
  8968. });
  8969. nodes().forEach(function (node) {
  8970. var id = node.getAttribute('data-node-id');
  8971. if (id !== from && id !== to) return;
  8972. node.setAttribute('data-relationship-preview-node', '');
  8973. if (id === from) node.setAttribute('data-relationship-preview-source', '');
  8974. if (id === to) node.setAttribute('data-relationship-preview-target', '');
  8975. });
  8976. button.setAttribute('data-preview-active', 'true');
  8977. if (!chip.hidden && options.direct !== true) chip.setAttribute('data-relationship-previewing', 'true');
  8978. activeRelationshipPreview = button;
  8979. renderRelationshipPulse(key);
  8980. placeRelationshipLens();
  8981. }
  8982. function syncRelationshipPreview() {
  8983. var next = pinnedRelationship || focusedRelationship || hoveredRelationship;
  8984. if (next === activeRelationshipPreview) return;
  8985. previewRelationship(next, { direct: !!(next && next.hasAttribute('data-relationship-hit-key')) });
  8986. }
  8987. function directRelationshipBlocked() {
  8988. return html.getAttribute('data-embed') === 'true' ||
  8989. html.getAttribute('data-guide-open') === 'true' ||
  8990. container.classList.contains('is-panning') ||
  8991. (activeIds.length > 0 && !pinnedRelationshipKey) ||
  8992. svg.hasAttribute('data-route-picking') ||
  8993. svg.hasAttribute('data-route-active') ||
  8994. svg.hasAttribute('data-lens-active');
  8995. }
  8996. function scheduleDirectRelationshipPreview(target) {
  8997. if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
  8998. if (pinnedRelationshipKey) return;
  8999. directPreviewTimer = window.setTimeout(function () {
  9000. directPreviewTimer = null;
  9001. if (pinnedRelationshipKey || hoveredRelationship !== target || directRelationshipBlocked()) return;
  9002. previewRelationship(target, { direct: true });
  9003. }, reducedMotionQuery && reducedMotionQuery.matches ? 0 : 90);
  9004. }
  9005. function relationshipHitTarget(key) {
  9006. return relationshipHitTargets.find(function (target) {
  9007. return target.getAttribute('data-relationship-key') === key;
  9008. }) || null;
  9009. }
  9010. function revealPinnedRelationship(record) {
  9011. function reveal() {
  9012. if (!record || pinnedRelationshipKey !== record.key) return true;
  9013. if (!Archify.view || typeof Archify.view.reveal !== 'function') return false;
  9014. Archify.view.reveal([record.from, record.to], { reason: 'relationship-direct' });
  9015. return true;
  9016. }
  9017. if (!reveal()) requestAnimationFrame(reveal);
  9018. }
  9019. function inspectRelationship(key, options) {
  9020. options = options || {};
  9021. if (html.getAttribute('data-embed') === 'true') return false;
  9022. if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
  9023. directPreviewTimer = null;
  9024. hoveredRelationship = null;
  9025. focusedRelationship = null;
  9026. if (pinnedRelationshipKey === key) {
  9027. if (options.toggle === false) return true;
  9028. clear({ updateUrl: options.updateUrl !== false });
  9029. return true;
  9030. }
  9031. var record = relationshipRecordForKey(key);
  9032. if (!record) return false;
  9033. set(record.from, { toggle: false, updateUrl: false });
  9034. var row = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-key]')).find(function (candidate) {
  9035. return candidate.getAttribute('data-relationship-key') === key;
  9036. });
  9037. if (!row) return false;
  9038. previewRelationship(row);
  9039. pinnedRelationship = row;
  9040. pinnedRelationshipKey = key;
  9041. svg.setAttribute('data-relationship-pin-active', key);
  9042. var target = relationshipHitTarget(key);
  9043. if (target) target.setAttribute('aria-pressed', 'true');
  9044. renderRelationshipCopyAction();
  9045. summary.textContent = viewerText('viewer.passport.relationship.pinned', {
  9046. from: record.fromLabel,
  9047. to: record.toLabel,
  9048. label: record.label
  9049. });
  9050. revealPinnedRelationship(record);
  9051. if (options.updateUrl !== false && record.id) {
  9052. try { history.replaceState(null, '', location.pathname + location.search + '#relation=' + encodeURIComponent(record.id)); } catch (_) {}
  9053. }
  9054. return true;
  9055. }
  9056. function inspectRelationshipById(id, options) {
  9057. var record = relationshipHitRecords().find(function (item) { return item.id === id; });
  9058. return record ? inspectRelationship(record.key, options) : false;
  9059. }
  9060. function installRelationshipHitTargets() {
  9061. if (html.getAttribute('data-embed') === 'true') return 0;
  9062. var records = relationshipHitRecords();
  9063. if (!records.length) return 0;
  9064. relationshipHitOverlay = document.createElementNS(svgNamespace, 'g');
  9065. relationshipHitOverlay.setAttribute('class', 'relationship-hit-overlay');
  9066. relationshipHitOverlay.setAttribute('data-relationship-hit-overlay', '');
  9067. relationshipHitOverlay.setAttribute('role', 'group');
  9068. relationshipHitOverlay.setAttribute('aria-label', viewerText('viewer.passport.relationship.explorer'));
  9069. var relationshipHelp = document.createElementNS(svgNamespace, 'desc');
  9070. relationshipHelp.id = 'archify-relationship-help';
  9071. relationshipHelp.textContent = viewerText('viewer.passport.relationship.help');
  9072. relationshipHitOverlay.appendChild(relationshipHelp);
  9073. records.forEach(function (record, index) {
  9074. var target = document.createElementNS(svgNamespace, 'g');
  9075. target.setAttribute('class', 'relationship-hit-target');
  9076. target.setAttribute('data-relationship-hit-key', record.key);
  9077. target.setAttribute('data-relationship-key', record.key);
  9078. target.setAttribute('data-relationship-from', record.from);
  9079. target.setAttribute('data-relationship-to', record.to);
  9080. if (record.id) target.setAttribute('data-relationship-id', record.id);
  9081. target.setAttribute('role', 'button');
  9082. target.setAttribute('tabindex', index === 0 ? '0' : '-1');
  9083. target.setAttribute('aria-pressed', 'false');
  9084. target.setAttribute('aria-describedby', relationshipHelp.id);
  9085. var description = viewerText('viewer.passport.relationship.inspect', {
  9086. index: index + 1,
  9087. total: records.length,
  9088. from: record.fromLabel,
  9089. to: record.toLabel,
  9090. label: record.label
  9091. });
  9092. target.setAttribute('aria-label', description);
  9093. var title = document.createElementNS(svgNamespace, 'title');
  9094. title.textContent = record.fromLabel + ' \u2192 ' + record.toLabel + ' \u00b7 ' + record.label;
  9095. target.appendChild(title);
  9096. record.shapes.forEach(function (shape) {
  9097. target.appendChild(relationshipHitGeometry(shape));
  9098. target.appendChild(relationshipHitGeometry(shape, 'relationship-focus-rail'));
  9099. });
  9100. if (target.childNodes.length > 1) {
  9101. relationshipHitTargets.push(target);
  9102. relationshipHitOverlay.appendChild(target);
  9103. }
  9104. });
  9105. if (!relationshipHitTargets.length) return 0;
  9106. var firstNode = svg.querySelector('[data-node-id]');
  9107. var nodeLayer = firstNode;
  9108. while (nodeLayer && nodeLayer.parentNode && nodeLayer.parentNode !== svg) nodeLayer = nodeLayer.parentNode;
  9109. if (nodeLayer && nodeLayer.parentNode === svg) svg.insertBefore(relationshipHitOverlay, nodeLayer);
  9110. else svg.appendChild(relationshipHitOverlay);
  9111. relationshipHitOverlay.addEventListener('pointerdown', function (event) {
  9112. if (event.target.closest('[data-relationship-hit-key]')) event.stopPropagation();
  9113. });
  9114. relationshipHitOverlay.addEventListener('pointerover', function (event) {
  9115. if (event.pointerType === 'touch') return;
  9116. if (finePointerQuery && !finePointerQuery.matches) return;
  9117. var target = event.target.closest('[data-relationship-hit-key]');
  9118. if (!target || directRelationshipBlocked() || pinnedRelationshipKey) return;
  9119. if (event.relatedTarget && target.contains(event.relatedTarget)) return;
  9120. hoveredRelationship = target;
  9121. scheduleDirectRelationshipPreview(target);
  9122. });
  9123. relationshipHitOverlay.addEventListener('pointerout', function (event) {
  9124. var target = event.target.closest('[data-relationship-hit-key]');
  9125. if (!target || (event.relatedTarget && target.contains(event.relatedTarget))) return;
  9126. if (hoveredRelationship === target) hoveredRelationship = null;
  9127. syncRelationshipPreview();
  9128. });
  9129. relationshipHitOverlay.addEventListener('focusin', function (event) {
  9130. var target = event.target.closest('[data-relationship-hit-key]');
  9131. if (!target || directRelationshipBlocked()) return;
  9132. focusedRelationship = target;
  9133. if (!pinnedRelationshipKey) previewRelationship(target, { direct: true });
  9134. });
  9135. relationshipHitOverlay.addEventListener('focusout', function (event) {
  9136. var target = event.target.closest('[data-relationship-hit-key]');
  9137. if (!target || (event.relatedTarget && target.contains(event.relatedTarget))) return;
  9138. if (focusedRelationship === target) focusedRelationship = null;
  9139. syncRelationshipPreview();
  9140. });
  9141. relationshipHitOverlay.addEventListener('click', function (event) {
  9142. var target = event.target.closest('[data-relationship-hit-key]');
  9143. if (!target || directRelationshipBlocked()) return;
  9144. event.preventDefault();
  9145. event.stopPropagation();
  9146. focusedRelationship = null;
  9147. hoveredRelationship = null;
  9148. inspectRelationship(target.getAttribute('data-relationship-key'));
  9149. });
  9150. relationshipHitOverlay.addEventListener('keydown', function (event) {
  9151. var target = event.target.closest('[data-relationship-hit-key]');
  9152. if (!target) return;
  9153. if (event.key === 'Escape' && pinnedRelationshipKey) {
  9154. event.preventDefault();
  9155. clear({ updateUrl: false });
  9156. return;
  9157. }
  9158. if (event.key === 'Enter' || event.key === ' ') {
  9159. event.preventDefault();
  9160. focusedRelationship = null;
  9161. hoveredRelationship = null;
  9162. inspectRelationship(target.getAttribute('data-relationship-key'));
  9163. return;
  9164. }
  9165. if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft' && event.key !== 'ArrowDown' && event.key !== 'ArrowUp' && event.key !== 'Home' && event.key !== 'End') return;
  9166. var index = relationshipHitTargets.indexOf(target);
  9167. if (event.key === 'Home') index = 0;
  9168. else if (event.key === 'End') index = relationshipHitTargets.length - 1;
  9169. else if (event.key === 'ArrowRight' || event.key === 'ArrowDown') index = (index + 1) % relationshipHitTargets.length;
  9170. else index = (index - 1 + relationshipHitTargets.length) % relationshipHitTargets.length;
  9171. event.preventDefault();
  9172. relationshipHitTargets.forEach(function (item, itemIndex) { item.setAttribute('tabindex', itemIndex === index ? '0' : '-1'); });
  9173. try { relationshipHitTargets[index].focus({ preventScroll: true }); }
  9174. catch (_) { try { relationshipHitTargets[index].focus(); } catch (_) {} }
  9175. });
  9176. return relationshipHitTargets.length;
  9177. }
  9178. function renderRelationshipLens(id, byId) {
  9179. hoveredRelationship = null;
  9180. focusedRelationship = null;
  9181. clearRelationshipPreview({ clearPin: true });
  9182. renderPassport(id, byId[id]);
  9183. var relationships = relationshipsFor(id, byId);
  9184. chip.removeAttribute('data-relations-expanded');
  9185. relationsBtn.setAttribute('aria-expanded', 'false');
  9186. relationsBtn.textContent = viewerCount('viewer.passport.relationship.count', relationships.length);
  9187. relationsBtn.setAttribute('aria-label', viewerCount('viewer.passport.relationship.show', relationships.length));
  9188. var counts = { out: 0, in: 0, loop: 0 };
  9189. relationships.forEach(function (relationship) { counts[relationship.direction] += 1; });
  9190. summary.textContent = viewerText('viewer.passport.relationship.summary', {
  9191. out: counts.out,
  9192. in: counts.in,
  9193. loops: counts.loop ? viewerText('viewer.passport.relationship.loops', { count: counts.loop }) : ''
  9194. });
  9195. renderReachabilityControls(id);
  9196. relationshipList.textContent = '';
  9197. if (!relationships.length) {
  9198. var empty = document.createElement('p');
  9199. empty.className = 'relationship-lens-empty';
  9200. empty.textContent = viewerText('viewer.passport.relationship.none');
  9201. relationshipList.appendChild(empty);
  9202. return;
  9203. }
  9204. [
  9205. { id: 'out', label: viewerText('viewer.passport.relationship.group.out') },
  9206. { id: 'in', label: viewerText('viewer.passport.relationship.group.in') },
  9207. { id: 'loop', label: viewerText('viewer.passport.relationship.group.loop') }
  9208. ].forEach(function (group) {
  9209. var items = relationships.filter(function (relationship) { return relationship.direction === group.id; });
  9210. if (!items.length) return;
  9211. var section = document.createElement('div');
  9212. section.className = 'relationship-lens-group';
  9213. var heading = document.createElement('span');
  9214. heading.className = 'relationship-lens-group-title';
  9215. heading.textContent = group.label + ' · ' + items.length;
  9216. section.appendChild(heading);
  9217. items.forEach(function (relationship) {
  9218. var button = document.createElement('button');
  9219. button.type = 'button';
  9220. button.className = 'relationship-lens-row';
  9221. button.setAttribute('data-direction', relationship.direction);
  9222. button.setAttribute('data-relationship-target', relationship.neighborId);
  9223. button.setAttribute('data-relationship-key', relationship.key);
  9224. button.setAttribute('data-relationship-from', relationship.from);
  9225. button.setAttribute('data-relationship-to', relationship.to);
  9226. if (relationship.id) button.setAttribute('data-relationship-id', relationship.id);
  9227. button.setAttribute('aria-label', viewerText('viewer.passport.relationship.row', {
  9228. group: group.label,
  9229. relationship: relationship.label,
  9230. neighbor: relationship.neighborLabel
  9231. }));
  9232. var direction = document.createElement('span');
  9233. direction.className = 'relationship-lens-direction';
  9234. direction.setAttribute('aria-hidden', 'true');
  9235. direction.textContent = viewerText(relationship.direction === 'out'
  9236. ? 'viewer.passport.relationship.direction.out'
  9237. : relationship.direction === 'in'
  9238. ? 'viewer.passport.relationship.direction.in'
  9239. : 'viewer.passport.relationship.direction.loop');
  9240. var target = document.createElement('strong');
  9241. target.textContent = relationship.neighborLabel;
  9242. var relation = document.createElement('small');
  9243. relation.textContent = relationship.label;
  9244. button.appendChild(direction);
  9245. button.appendChild(target);
  9246. button.appendChild(relation);
  9247. section.appendChild(button);
  9248. });
  9249. relationshipList.appendChild(section);
  9250. });
  9251. }
  9252. function lensPlacementBounds() {
  9253. var containerRect = container.getBoundingClientRect();
  9254. if (containerRect.width <= 0 || containerRect.height <= 0 || chip.offsetWidth <= 0 || chip.offsetHeight <= 0) return null;
  9255. var padding = window.innerWidth <= 720 ? 8 : 16;
  9256. var visibleLeft = Math.max(padding, -containerRect.left + padding);
  9257. var visibleRight = Math.min(
  9258. container.clientWidth - padding,
  9259. window.innerWidth - containerRect.left - padding
  9260. );
  9261. var visibleTop = Math.max(padding, -containerRect.top + padding);
  9262. var visibleBottom = Math.min(
  9263. container.clientHeight - padding,
  9264. window.innerHeight - containerRect.top - padding
  9265. );
  9266. var minLeft = visibleLeft;
  9267. var minTop = Math.min(visibleTop, Math.max(padding, visibleBottom - chip.offsetHeight));
  9268. return {
  9269. containerRect: containerRect,
  9270. minLeft: minLeft,
  9271. maxLeft: Math.max(minLeft, visibleRight - chip.offsetWidth),
  9272. minTop: minTop,
  9273. maxTop: Math.max(minTop, visibleBottom - chip.offsetHeight)
  9274. };
  9275. }
  9276. function manualLensPlacementAvailable() {
  9277. return window.innerWidth > 720 && (!finePointerQuery || finePointerQuery.matches);
  9278. }
  9279. function clampLensPosition(position, bounds) {
  9280. if (!position || !bounds) return null;
  9281. return {
  9282. left: Math.max(bounds.minLeft, Math.min(bounds.maxLeft, position.left)),
  9283. top: Math.max(bounds.minTop, Math.min(bounds.maxTop, position.top))
  9284. };
  9285. }
  9286. function currentLensPosition() {
  9287. var bounds = lensPlacementBounds();
  9288. if (!bounds) return null;
  9289. var rect = chip.getBoundingClientRect();
  9290. return clampLensPosition({
  9291. left: rect.left - bounds.containerRect.left,
  9292. top: rect.top - bounds.containerRect.top
  9293. }, bounds);
  9294. }
  9295. function applyManualLensPosition(position) {
  9296. if (!manualLensPlacementAvailable()) return false;
  9297. var bounds = lensPlacementBounds();
  9298. var clamped = clampLensPosition(position, bounds);
  9299. if (!clamped) return false;
  9300. manualLensPosition = clamped;
  9301. chip.setAttribute('data-manual-placement', 'true');
  9302. chip.style.left = Math.round(clamped.left) + 'px';
  9303. chip.style.top = Math.round(clamped.top) + 'px';
  9304. if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
  9305. return true;
  9306. }
  9307. function resetLensPlacement(options) {
  9308. options = options || {};
  9309. manualLensPosition = null;
  9310. chip.removeAttribute('data-manual-placement');
  9311. chip.style.removeProperty('left');
  9312. chip.style.removeProperty('top');
  9313. if (options.reposition !== false && !chip.hidden) requestLensPlacement();
  9314. }
  9315. function beginLensDrag(event) {
  9316. if (!manualLensPlacementAvailable() || event.button !== 0 || lensDrag) return;
  9317. var start = currentLensPosition();
  9318. if (!start) return;
  9319. event.preventDefault();
  9320. event.stopPropagation();
  9321. lensDrag = {
  9322. pointerId: event.pointerId,
  9323. originX: event.clientX,
  9324. originY: event.clientY,
  9325. start: start,
  9326. previousManual: manualLensPosition ? { left: manualLensPosition.left, top: manualLensPosition.top } : null,
  9327. moved: false
  9328. };
  9329. chip.setAttribute('data-panel-dragging', 'true');
  9330. try { moveBtn.setPointerCapture(event.pointerId); } catch (_) {}
  9331. }
  9332. function moveLensDrag(event) {
  9333. if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
  9334. var dx = event.clientX - lensDrag.originX;
  9335. var dy = event.clientY - lensDrag.originY;
  9336. if (!lensDrag.moved && Math.hypot(dx, dy) <= 3) return;
  9337. lensDrag.moved = true;
  9338. event.preventDefault();
  9339. event.stopPropagation();
  9340. applyManualLensPosition({ left: lensDrag.start.left + dx, top: lensDrag.start.top + dy });
  9341. }
  9342. function finishLensDrag(event, cancel) {
  9343. if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
  9344. event.preventDefault();
  9345. event.stopPropagation();
  9346. var activeDrag = lensDrag;
  9347. lensDrag = null;
  9348. if (activeDrag.moved) lensDragClickPointer = activeDrag.pointerId;
  9349. chip.removeAttribute('data-panel-dragging');
  9350. try { moveBtn.releasePointerCapture(event.pointerId); } catch (_) {}
  9351. if (!cancel) return;
  9352. manualLensPosition = activeDrag.previousManual
  9353. ? { left: activeDrag.previousManual.left, top: activeDrag.previousManual.top }
  9354. : null;
  9355. if (manualLensPosition && manualLensPlacementAvailable()) {
  9356. applyManualLensPosition(manualLensPosition);
  9357. } else {
  9358. chip.removeAttribute('data-manual-placement');
  9359. chip.style.removeProperty('left');
  9360. chip.style.removeProperty('top');
  9361. if (!chip.hidden) requestLensPlacement();
  9362. }
  9363. }
  9364. function moveLensWithKeyboard(event) {
  9365. if (event.key === 'Home') {
  9366. event.preventDefault();
  9367. resetLensPlacement();
  9368. return;
  9369. }
  9370. if (event.metaKey || event.ctrlKey || event.altKey || !manualLensPlacementAvailable()) return;
  9371. var directions = {
  9372. ArrowLeft: [-1, 0],
  9373. ArrowRight: [1, 0],
  9374. ArrowUp: [0, -1],
  9375. ArrowDown: [0, 1]
  9376. };
  9377. var direction = directions[event.key];
  9378. if (!direction) return;
  9379. event.preventDefault();
  9380. var current = manualLensPosition || currentLensPosition();
  9381. if (!current) return;
  9382. var distance = event.shiftKey ? 4 : 16;
  9383. applyManualLensPosition({
  9384. left: current.left + direction[0] * distance,
  9385. top: current.top + direction[1] * distance
  9386. });
  9387. }
  9388. var lensFrame = 0;
  9389. function placeRelationshipLens() {
  9390. if (lensFrame) {
  9391. cancelAnimationFrame(lensFrame);
  9392. lensFrame = 0;
  9393. }
  9394. if (chip.hidden || activeIds.length !== 1) return;
  9395. var node = svg.querySelector('[data-node-id="' + activeIds[0] + '"]');
  9396. if (!node) return;
  9397. var containerRect = container.getBoundingClientRect();
  9398. var nodeRect = node.getBoundingClientRect();
  9399. if (containerRect.bottom <= 0 || containerRect.top >= window.innerHeight) return;
  9400. var padding = window.innerWidth <= 720 ? 8 : 16;
  9401. var visibleTop = Math.max(padding, -containerRect.top + padding);
  9402. var visibleBottom = Math.min(containerRect.height - padding, window.innerHeight - containerRect.top - padding);
  9403. var maxTop = Math.max(padding, visibleBottom - chip.offsetHeight);
  9404. var minTop = Math.min(visibleTop, maxTop);
  9405. var mobile = window.innerWidth <= 720;
  9406. if (!manualLensPlacementAvailable()) {
  9407. chip.removeAttribute('data-manual-placement');
  9408. chip.style.removeProperty('left');
  9409. } else if (manualLensPosition) {
  9410. applyManualLensPosition(manualLensPosition);
  9411. return;
  9412. }
  9413. var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
  9414. var previewingOnMobile = mobile && chip.getAttribute('data-relationship-previewing') === 'true';
  9415. var compactOnMobile = mobile && chip.getAttribute('data-relations-expanded') !== 'true';
  9416. var preferred;
  9417. if (compactOnMobile) {
  9418. var nodeTop = nodeRect.top - containerRect.top;
  9419. var nodeBottom = nodeRect.bottom - containerRect.top;
  9420. var gap = 10;
  9421. var above = nodeTop - chip.offsetHeight - gap;
  9422. var below = nodeBottom + gap;
  9423. if (above >= visibleTop) preferred = above;
  9424. else if (below + chip.offsetHeight <= visibleBottom - 56) preferred = below;
  9425. else preferred = nodeCenter < (visibleTop + visibleBottom) / 2
  9426. ? Math.max(minTop, visibleBottom - chip.offsetHeight - 56)
  9427. : visibleTop;
  9428. } else if (previewingOnMobile) {
  9429. var pinnedTop = visibleTop;
  9430. var pinnedBottom = Math.max(minTop, visibleBottom - chip.offsetHeight - 56);
  9431. preferred = nodeCenter < (visibleTop + visibleBottom) / 2 ? pinnedBottom : pinnedTop;
  9432. } else {
  9433. preferred = nodeCenter - chip.offsetHeight / 2;
  9434. }
  9435. var top = Math.max(minTop, Math.min(maxTop, preferred));
  9436. var chipRect = chip.getBoundingClientRect();
  9437. var safeGap = 10;
  9438. var protectViewerChrome = !mobile || compactOnMobile || previewingOnMobile;
  9439. var protectedRects = (protectViewerChrome
  9440. ? [svg.querySelector('[data-legend]'), container.querySelector('.diagram-nav')]
  9441. : [])
  9442. .filter(function (element) {
  9443. if (!element || element.hidden) return false;
  9444. var style = window.getComputedStyle(element);
  9445. return style.display !== 'none' && style.visibility !== 'hidden';
  9446. })
  9447. .map(function (element) { return element.getBoundingClientRect(); })
  9448. .filter(function (rect) {
  9449. return rect.width > 0 && rect.height > 0 &&
  9450. chipRect.left < rect.right + safeGap && chipRect.right > rect.left - safeGap;
  9451. });
  9452. if (protectedRects.length) {
  9453. var candidates = [top, minTop, maxTop];
  9454. protectedRects.forEach(function (rect) {
  9455. candidates.push(
  9456. rect.top - containerRect.top - chip.offsetHeight - safeGap,
  9457. rect.bottom - containerRect.top + safeGap
  9458. );
  9459. });
  9460. var valid = candidates.map(function (candidate) {
  9461. return Math.max(minTop, Math.min(maxTop, candidate));
  9462. }).filter(function (candidate, index, all) {
  9463. if (all.indexOf(candidate) !== index) return false;
  9464. var candidateTop = containerRect.top + candidate;
  9465. var candidateBottom = candidateTop + chip.offsetHeight;
  9466. return protectedRects.every(function (rect) {
  9467. return candidateBottom <= rect.top - safeGap || candidateTop >= rect.bottom + safeGap;
  9468. });
  9469. });
  9470. valid.sort(function (first, second) {
  9471. return Math.abs(first - preferred) - Math.abs(second - preferred);
  9472. });
  9473. if (valid.length) top = valid[0];
  9474. }
  9475. chip.style.top = Math.round(top) + 'px';
  9476. if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
  9477. }
  9478. function requestLensPlacement() {
  9479. if (lensFrame) return;
  9480. lensFrame = requestAnimationFrame(placeRelationshipLens);
  9481. }
  9482. function clear(options) {
  9483. options = options || {};
  9484. if (lensDrag) {
  9485. var dragPointerId = lensDrag.pointerId;
  9486. lensDrag = null;
  9487. chip.removeAttribute('data-panel-dragging');
  9488. try { moveBtn.releasePointerCapture(dragPointerId); } catch (_) {}
  9489. }
  9490. var restoreNode = options.restoreFocus === true && activeIds.length === 1
  9491. ? svg.querySelector('[data-node-id="' + activeIds[0] + '"]')
  9492. : null;
  9493. clearReachability({ updateUrl: false });
  9494. if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {
  9495. Archify.intentTrace.clear({ announce: false });
  9496. }
  9497. hoveredRelationship = null;
  9498. focusedRelationship = null;
  9499. clearRelationshipPreview({ clearPin: true });
  9500. activeIds = [];
  9501. svg.removeAttribute('data-focus-active');
  9502. nodes().forEach(function (node) {
  9503. node.removeAttribute('data-focus-match');
  9504. node.removeAttribute('data-focus-selected');
  9505. node.setAttribute('aria-pressed', 'false');
  9506. });
  9507. edges().forEach(function (edge) { edge.removeAttribute('data-focus-match'); });
  9508. chip.hidden = true;
  9509. label.textContent = '';
  9510. detail.textContent = '';
  9511. detail.hidden = true;
  9512. kind.textContent = '';
  9513. kind.hidden = true;
  9514. context.textContent = '';
  9515. context.hidden = true;
  9516. tag.textContent = '';
  9517. tag.hidden = true;
  9518. semanticId.textContent = '';
  9519. semanticId.hidden = true;
  9520. evidence.hidden = true;
  9521. evidenceLinks.textContent = '';
  9522. repositoryLink.removeAttribute('href');
  9523. repositoryLink.textContent = '';
  9524. summary.textContent = '';
  9525. reachSection.hidden = true;
  9526. upstreamCount.textContent = '0';
  9527. downstreamCount.textContent = '0';
  9528. upstreamBtn.disabled = true;
  9529. downstreamBtn.disabled = true;
  9530. relationshipList.textContent = '';
  9531. copyBtn.textContent = viewerText('viewer.passport.copy');
  9532. copyBtn.setAttribute('aria-label', viewerText('viewer.passport.copy.focus'));
  9533. relationsBtn.textContent = viewerText('viewer.passport.relations');
  9534. relationsBtn.setAttribute('aria-label', viewerText('viewer.passport.relations.show'));
  9535. relationsBtn.setAttribute('aria-expanded', 'false');
  9536. chip.removeAttribute('data-relations-expanded');
  9537. if (options.preserveLensPlacement !== true) resetLensPlacement({ reposition: false });
  9538. if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
  9539. Archify.view.reset({ automatic: true });
  9540. }
  9541. if (options.updateUrl !== false) {
  9542. try { history.replaceState(null, '', location.pathname + location.search); } catch (_) {}
  9543. }
  9544. if (restoreNode) {
  9545. try { restoreNode.focus({ preventScroll: true }); }
  9546. catch (_) { try { restoreNode.focus(); } catch (_) {} }
  9547. }
  9548. }
  9549. function setMany(ids, options) {
  9550. options = options || {};
  9551. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  9552. if (Archify.semanticLens && Archify.semanticLens.active()) {
  9553. Archify.semanticLens.clear({ updateUrl: false, preserveView: true, closePanel: true });
  9554. }
  9555. if (options.preserveRoute !== true && Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {
  9556. Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
  9557. }
  9558. var nodeList = nodes();
  9559. var byId = Object.create(null);
  9560. nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
  9561. var normalized = [];
  9562. (ids || []).forEach(function (id) {
  9563. if (byId[id] && normalized.indexOf(id) === -1) normalized.push(id);
  9564. });
  9565. if (!normalized.length) return false;
  9566. // Hash restoration and internal selections use this path too. Reveal
  9567. // tree ancestors before measuring the selected node for its lens.
  9568. if (Archify.treeBranches && Archify.treeBranches.active) {
  9569. normalized.forEach(function (id) { Archify.treeBranches.reveal(id); });
  9570. }
  9571. if (normalized.length === activeIds.length && normalized.every(function (id, index) { return activeIds[index] === id; }) && options.toggle !== false) {
  9572. clear();
  9573. return true;
  9574. }
  9575. var preserveLensPlacement = activeIds.length === 1 && normalized.length === 1 && !chip.hidden;
  9576. clear({ updateUrl: false, preserveView: true, preserveLensPlacement: preserveLensPlacement });
  9577. activeIds = normalized;
  9578. var selected = Object.create(null);
  9579. var related = Object.create(null);
  9580. var seenEdges = {};
  9581. var matchedEdges = 0;
  9582. normalized.forEach(function (id) { selected[id] = true; related[id] = true; });
  9583. var selectionMode = options.mode === 'selection' || normalized.length > 1;
  9584. edges().forEach(function (edge) {
  9585. var from = edge.getAttribute('data-edge-from');
  9586. var to = edge.getAttribute('data-edge-to');
  9587. var match = selectionMode ? selected[from] && selected[to] : selected[from] || selected[to];
  9588. if (!match) return;
  9589. edge.setAttribute('data-focus-match', '');
  9590. if (!selectionMode) { related[from] = true; related[to] = true; }
  9591. var edgeKey = edge.getAttribute('data-edge-key') || (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));
  9592. if (!seenEdges[edgeKey]) { seenEdges[edgeKey] = true; matchedEdges += 1; }
  9593. });
  9594. nodeList.forEach(function (node) {
  9595. var nodeId = node.getAttribute('data-node-id');
  9596. if (related[nodeId]) node.setAttribute('data-focus-match', '');
  9597. if (selected[nodeId]) {
  9598. node.setAttribute('data-focus-selected', '');
  9599. node.setAttribute('aria-pressed', 'true');
  9600. }
  9601. });
  9602. svg.setAttribute('data-focus-active', normalized.join(' '));
  9603. var defaultLabel = normalized.length === 1
  9604. ? nodeLabel(byId[normalized[0]], normalized[0])
  9605. : viewerText('viewer.focus.selectedNodes', { count: normalized.length });
  9606. label.textContent = options.label || defaultLabel;
  9607. chip.hidden = options.hideChip === true || normalized.length !== 1 || selectionMode;
  9608. if (!chip.hidden) {
  9609. renderRelationshipLens(normalized[0], byId);
  9610. placeRelationshipLens();
  9611. }
  9612. if (options.updateUrl !== false) {
  9613. var key = options.urlKey || 'focus';
  9614. var value = options.urlValue || normalized[0];
  9615. try { history.replaceState(null, '', location.pathname + location.search + '#' + key + '=' + encodeURIComponent(value)); } catch (_) {}
  9616. }
  9617. return true;
  9618. }
  9619. function set(id, options) {
  9620. options = options || {};
  9621. options.mode = 'neighborhood';
  9622. return setMany([id], options);
  9623. }
  9624. function copyFocusLink() {
  9625. if (activeIds.length !== 1) return Promise.resolve(false);
  9626. var record = pinnedRelationshipRecord();
  9627. var relationId = record && record.id;
  9628. var value = readerLink(relationId
  9629. ? 'relation=' + encodeURIComponent(relationId)
  9630. : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
  9631. return (value === null ? Promise.resolve(false) : copyReaderText(value)).then(function (copied) {
  9632. copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
  9633. copyBtn.setAttribute('aria-label', copied
  9634. ? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
  9635. : viewerText(relationId ? 'viewer.passport.copy.pinned.failed' : 'viewer.passport.copy.focused.failed'));
  9636. window.setTimeout(function () {
  9637. renderRelationshipCopyAction();
  9638. }, 1600);
  9639. return copied;
  9640. });
  9641. }
  9642. svg.addEventListener('click', function (event) {
  9643. if (container.getAttribute('data-just-panned') === 'true') return;
  9644. var node = event.target.closest('[data-node-id]');
  9645. if (node) {
  9646. var id = node.getAttribute('data-node-id');
  9647. set(id);
  9648. if (activeIds.indexOf(id) !== -1 && Archify.view && typeof Archify.view.reveal === 'function') {
  9649. Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });
  9650. }
  9651. }
  9652. else if (activeIds.length) clear();
  9653. });
  9654. svg.addEventListener('keydown', function (event) {
  9655. var node = event.target.closest('[data-node-id]');
  9656. if (!node || (event.key !== 'Enter' && event.key !== ' ')) return;
  9657. event.preventDefault();
  9658. var id = node.getAttribute('data-node-id');
  9659. set(id);
  9660. if (activeIds.indexOf(id) !== -1 && Archify.view && typeof Archify.view.reveal === 'function') {
  9661. Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });
  9662. }
  9663. });
  9664. moveBtn.addEventListener('pointerdown', beginLensDrag);
  9665. moveBtn.addEventListener('pointermove', moveLensDrag);
  9666. moveBtn.addEventListener('pointerup', function (event) { finishLensDrag(event, false); });
  9667. moveBtn.addEventListener('pointercancel', function (event) { finishLensDrag(event, true); });
  9668. moveBtn.addEventListener('lostpointercapture', function (event) { finishLensDrag(event, true); });
  9669. moveBtn.addEventListener('dblclick', function (event) {
  9670. event.preventDefault();
  9671. event.stopPropagation();
  9672. resetLensPlacement();
  9673. });
  9674. moveBtn.addEventListener('keydown', moveLensWithKeyboard);
  9675. clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
  9676. copyBtn.addEventListener('click', copyFocusLink);
  9677. upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });
  9678. downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });
  9679. relationsBtn.addEventListener('click', function () {
  9680. var expanded = chip.getAttribute('data-relations-expanded') === 'true';
  9681. if (expanded) chip.removeAttribute('data-relations-expanded');
  9682. else chip.setAttribute('data-relations-expanded', 'true');
  9683. relationsBtn.setAttribute('aria-expanded', expanded ? 'false' : 'true');
  9684. relationsBtn.setAttribute('aria-label', viewerText(expanded
  9685. ? 'viewer.passport.relations.show'
  9686. : 'viewer.passport.relations.hide'));
  9687. placeRelationshipLens();
  9688. });
  9689. relationshipList.addEventListener('click', function (event) {
  9690. var button = event.target.closest('[data-relationship-target]');
  9691. if (!button) return;
  9692. var id = button.getAttribute('data-relationship-target');
  9693. set(id, { toggle: false });
  9694. if (Archify.view && typeof Archify.view.reveal === 'function') {
  9695. Archify.view.reveal([id], { includeNeighbors: true, reason: 'relationship' });
  9696. }
  9697. var node = svg.querySelector('[data-node-id="' + id + '"]');
  9698. if (node) {
  9699. try { node.focus({ preventScroll: true }); } catch (_) { try { node.focus(); } catch (_) {} }
  9700. }
  9701. });
  9702. relationshipList.addEventListener('pointerover', function (event) {
  9703. if (event.pointerType === 'touch') return;
  9704. if (finePointerQuery && !finePointerQuery.matches) return;
  9705. var button = event.target.closest('[data-relationship-key]');
  9706. if (!button || !relationshipList.contains(button)) return;
  9707. if (event.relatedTarget && button.contains(event.relatedTarget)) return;
  9708. hoveredRelationship = button;
  9709. syncRelationshipPreview();
  9710. });
  9711. relationshipList.addEventListener('pointerout', function (event) {
  9712. var button = event.target.closest('[data-relationship-key]');
  9713. if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
  9714. if (hoveredRelationship === button) hoveredRelationship = null;
  9715. syncRelationshipPreview();
  9716. });
  9717. relationshipList.addEventListener('focusin', function (event) {
  9718. var button = event.target.closest('[data-relationship-key]');
  9719. if (!button) return;
  9720. focusedRelationship = button;
  9721. syncRelationshipPreview();
  9722. });
  9723. relationshipList.addEventListener('focusout', function (event) {
  9724. var button = event.target.closest('[data-relationship-key]');
  9725. if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
  9726. if (focusedRelationship === button) focusedRelationship = null;
  9727. syncRelationshipPreview();
  9728. });
  9729. relationshipList.addEventListener('keydown', function (event) {
  9730. if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) return;
  9731. if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp' && event.key !== 'Home' && event.key !== 'End') return;
  9732. var buttons = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-target]'));
  9733. if (!buttons.length) return;
  9734. var index = buttons.indexOf(document.activeElement);
  9735. if (event.key === 'Home') index = 0;
  9736. else if (event.key === 'End') index = buttons.length - 1;
  9737. else if (event.key === 'ArrowDown') index = Math.min(buttons.length - 1, Math.max(0, index + 1));
  9738. else index = Math.max(0, index < 0 ? 0 : index - 1);
  9739. event.preventDefault();
  9740. buttons[index].focus();
  9741. });
  9742. document.addEventListener('pointerdown', function () {
  9743. lensDragClickPointer = null;
  9744. }, true);
  9745. document.addEventListener('click', function (event) {
  9746. // Losing capture (for example when a resize hides the handle) can
  9747. // retarget this drag's final click to the page. It is not dismissal.
  9748. // A new pointerdown releases the guard; keyboard clicks remain live.
  9749. if (lensDragClickPointer != null && event.detail > 0 &&
  9750. (event.pointerId == null || event.pointerId === lensDragClickPointer)) {
  9751. lensDragClickPointer = null;
  9752. event.preventDefault();
  9753. event.stopPropagation();
  9754. return;
  9755. }
  9756. var target = event.target;
  9757. if (chip.hidden || !target || typeof target.closest !== 'function' || chip.contains(target)) return;
  9758. if (container.getAttribute('data-just-panned') === 'true') return;
  9759. // Export consumes the active semantic snapshot; its controls are not
  9760. // an outside selection. Genuine outside activation still clears it.
  9761. if (target.closest('[data-node-id], [data-relationship-hit-key], .overview-map, #btn-export, #export-menu')) return;
  9762. clear();
  9763. }, true);
  9764. window.addEventListener('scroll', requestLensPlacement, { passive: true });
  9765. window.addEventListener('resize', requestLensPlacement);
  9766. container.addEventListener('scroll', requestLensPlacement, { passive: true });
  9767. // Reader and Chrome may finish resizing the stage after window resize.
  9768. // The absolute Passport does not resize its container when reclamped.
  9769. if (typeof ResizeObserver === 'function') {
  9770. new ResizeObserver(function () {
  9771. if (!chip.hidden) requestLensPlacement();
  9772. }).observe(container);
  9773. }
  9774. document.addEventListener('visibilitychange', function () {
  9775. if (document.hidden) removeRelationshipPulse();
  9776. });
  9777. function syncRelationshipMotionPreference(event) {
  9778. if (event.matches) removeRelationshipPulse();
  9779. }
  9780. if (reducedMotionQuery) {
  9781. if (typeof reducedMotionQuery.addEventListener === 'function') {
  9782. reducedMotionQuery.addEventListener('change', syncRelationshipMotionPreference);
  9783. } else if (typeof reducedMotionQuery.addListener === 'function') {
  9784. reducedMotionQuery.addListener(syncRelationshipMotionPreference);
  9785. }
  9786. }
  9787. installRelationshipHitTargets();
  9788. function syncFocusFromHash() {
  9789. try {
  9790. var params = new URLSearchParams(location.hash.replace(/^#/, ''));
  9791. var relation = params.get('relation');
  9792. var initial = params.get('focus');
  9793. var reach = params.get('reach');
  9794. if (relation) {
  9795. if (html.getAttribute('data-embed') === 'true' ||
  9796. !inspectRelationshipById(relation, { updateUrl: false, toggle: false })) clear({ updateUrl: false });
  9797. }
  9798. else if (initial) {
  9799. if (set(initial, { updateUrl: false, toggle: false }) &&
  9800. (reach === 'upstream' || reach === 'downstream')) {
  9801. applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });
  9802. }
  9803. }
  9804. else clear({ updateUrl: false });
  9805. } catch (_) {}
  9806. }
  9807. window.addEventListener('hashchange', syncFocusFromHash);
  9808. syncFocusFromHash();
  9809. return {
  9810. set: set,
  9811. setMany: setMany,
  9812. clear: clear,
  9813. copyLink: copyFocusLink,
  9814. reach: applyReachability,
  9815. clearReach: clearReachability,
  9816. reachabilitySnapshot: reachabilitySnapshot,
  9817. inspectRelationship: inspectRelationship,
  9818. inspectRelationshipById: inspectRelationshipById,
  9819. reposition: placeRelationshipLens,
  9820. relationship: function () {
  9821. var record = pinnedRelationshipRecord();
  9822. return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;
  9823. },
  9824. reachability: function () {
  9825. return activeReachability ? {
  9826. direction: activeReachability.direction,
  9827. originId: activeReachability.originId,
  9828. nodeIds: activeReachability.nodeIds.slice(),
  9829. edgeKeys: activeReachability.edgeKeys.slice(),
  9830. maxDepth: activeReachability.maxDepth
  9831. } : null;
  9832. },
  9833. active: function () { return activeIds.length === 0 ? null : (activeIds.length === 1 ? activeIds[0] : activeIds.slice()); }
  9834. };
  9835. })();
  9836. /* ============================================================
  9837. Intent Trace — temporary one-hop topology before durable focus.
  9838. Fine-pointer hover and keyboard focus share the same stable-ID preview;
  9839. touch continues directly to the existing click-to-focus contract.
  9840. ============================================================ */
  9841. Archify.intentTrace = (function () {
  9842. var html = document.documentElement;
  9843. var container = document.querySelector('.diagram-container');
  9844. var svg = container.querySelector(':scope > svg');
  9845. var status = document.getElementById('intent-trace-status');
  9846. var namespace = 'http://www.w3.org/2000/svg';
  9847. var activeId = null;
  9848. var hoveredNode = null;
  9849. var focusedNode = null;
  9850. var enterTimer = null;
  9851. function nodes() {
  9852. return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
  9853. }
  9854. function edges() {
  9855. return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
  9856. }
  9857. function nodeLabel(node, fallback) {
  9858. return node.getAttribute('data-node-label') ||
  9859. (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];
  9860. }
  9861. function finePointer() {
  9862. return !window.matchMedia || window.matchMedia('(hover: hover) and (pointer: fine)').matches;
  9863. }
  9864. function reducedMotion() {
  9865. return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
  9866. }
  9867. function blocked() {
  9868. return html.getAttribute('data-embed') === 'true' ||
  9869. html.getAttribute('data-guide-open') === 'true' ||
  9870. container.classList.contains('is-panning') ||
  9871. svg.hasAttribute('data-lens-active') ||
  9872. svg.hasAttribute('data-relationship-preview-active') ||
  9873. !!(Archify.routeProbe && typeof Archify.routeProbe.active === 'function' && Archify.routeProbe.active()) ||
  9874. !!(Archify.focus && typeof Archify.focus.active === 'function' && Archify.focus.active());
  9875. }
  9876. function edgeShapes(edge) {
  9877. if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];
  9878. return Array.prototype.slice.call(edge.querySelectorAll('path:not([data-ambient-flow-overlay]), line, polyline'));
  9879. }
  9880. function removeOverlay() {
  9881. Array.prototype.forEach.call(svg.querySelectorAll('[data-intent-trace-overlay]'), function (overlay) {
  9882. overlay.remove();
  9883. });
  9884. }
  9885. function clear(options) {
  9886. options = options || {};
  9887. if (enterTimer) window.clearTimeout(enterTimer);
  9888. enterTimer = null;
  9889. activeId = null;
  9890. svg.removeAttribute('data-intent-trace-active');
  9891. removeOverlay();
  9892. nodes().forEach(function (node) {
  9893. node.removeAttribute('data-intent-trace-match');
  9894. node.removeAttribute('data-intent-trace-selected');
  9895. });
  9896. edges().forEach(function (edge) { edge.removeAttribute('data-intent-trace-match'); });
  9897. if (options.announce !== false) status.textContent = '';
  9898. }
  9899. function traceGeometry(shape, direction) {
  9900. var clone = shape.cloneNode(false);
  9901. if (shape.getAttribute('data-motion-path')) clone.setAttribute('d', shape.getAttribute('data-motion-path'));
  9902. clone.removeAttribute('data-motion-path');
  9903. clone.removeAttribute('id');
  9904. clone.removeAttribute('class');
  9905. clone.removeAttribute('style');
  9906. clone.removeAttribute('marker-start');
  9907. clone.removeAttribute('marker-mid');
  9908. clone.removeAttribute('marker-end');
  9909. clone.removeAttribute('role');
  9910. clone.removeAttribute('aria-label');
  9911. clone.removeAttribute('aria-labelledby');
  9912. clone.removeAttribute('data-animate');
  9913. clone.removeAttribute('data-edge-from');
  9914. clone.removeAttribute('data-edge-to');
  9915. clone.removeAttribute('data-edge-key');
  9916. clone.removeAttribute('data-edge-id');
  9917. clone.removeAttribute('data-edge-label');
  9918. clone.removeAttribute('data-intent-trace-match');
  9919. clone.removeAttribute('data-intent-trace-selected');
  9920. clone.setAttribute('class', 'intent-trace-flow');
  9921. clone.setAttribute('data-direction', direction);
  9922. clone.setAttribute('pathLength', '1');
  9923. return clone;
  9924. }
  9925. function show(id, options) {
  9926. options = options || {};
  9927. if (!id || blocked()) {
  9928. clear({ announce: false });
  9929. return false;
  9930. }
  9931. if (activeId === id) return true;
  9932. clear({ announce: false });
  9933. var nodeList = nodes();
  9934. var edgeList = edges();
  9935. var byId = Object.create(null);
  9936. nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
  9937. var selected = byId[id];
  9938. if (!selected) return false;
  9939. var overlay = document.createElementNS(namespace, 'g');
  9940. overlay.setAttribute('class', 'intent-trace-overlay');
  9941. overlay.setAttribute('data-intent-trace-overlay', '');
  9942. overlay.setAttribute('aria-hidden', 'true');
  9943. var related = Object.create(null);
  9944. var seen = {};
  9945. var counts = { out: 0, in: 0, loop: 0 };
  9946. related[id] = true;
  9947. edgeList.forEach(function (edge) {
  9948. var from = edge.getAttribute('data-edge-from');
  9949. var to = edge.getAttribute('data-edge-to');
  9950. if (from !== id && to !== id) return;
  9951. var direction = from === id && to === id ? 'loop' : (from === id ? 'out' : 'in');
  9952. var key = edge.getAttribute('data-edge-key') ||
  9953. (from + '\u0000' + to + '\u0000' + (edge.getAttribute('data-edge-label') || ''));
  9954. if (!seen[key]) {
  9955. seen[key] = true;
  9956. counts[direction] += 1;
  9957. }
  9958. related[from] = true;
  9959. related[to] = true;
  9960. edge.setAttribute('data-intent-trace-match', '');
  9961. var wrapper = document.createElementNS(namespace, 'g');
  9962. if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
  9963. edgeShapes(edge).forEach(function (shape) {
  9964. wrapper.appendChild(traceGeometry(shape, direction));
  9965. });
  9966. if (wrapper.childNodes.length) overlay.appendChild(wrapper);
  9967. });
  9968. nodeList.forEach(function (node) {
  9969. var nodeId = node.getAttribute('data-node-id');
  9970. if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
  9971. if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
  9972. });
  9973. if (overlay.childNodes.length) {
  9974. var firstEdge = edgeList[0];
  9975. var firstNode = svg.querySelector('[data-node-id]');
  9976. if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
  9977. else if (firstNode) svg.insertBefore(overlay, firstNode);
  9978. else svg.appendChild(overlay);
  9979. }
  9980. activeId = id;
  9981. svg.setAttribute('data-intent-trace-active', id);
  9982. if (options.announce === true) {
  9983. var total = counts.out + counts.in + counts.loop;
  9984. status.textContent = viewerText('viewer.intent.summary', {
  9985. label: nodeLabel(selected, id),
  9986. out: counts.out,
  9987. in: counts.in,
  9988. loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
  9989. total: total
  9990. });
  9991. }
  9992. return true;
  9993. }
  9994. function schedule(node) {
  9995. if (enterTimer) window.clearTimeout(enterTimer);
  9996. enterTimer = window.setTimeout(function () {
  9997. enterTimer = null;
  9998. if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
  9999. }, reducedMotion() ? 0 : 90);
  10000. }
  10001. function sync() {
  10002. var candidate = focusedNode || hoveredNode;
  10003. if (!candidate) {
  10004. clear();
  10005. return;
  10006. }
  10007. show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
  10008. }
  10009. svg.addEventListener('pointerover', function (event) {
  10010. var node = event.target.closest('[data-node-id]');
  10011. if (!node || !finePointer() || event.pointerType === 'touch') return;
  10012. if (event.relatedTarget && node.contains(event.relatedTarget)) return;
  10013. hoveredNode = node;
  10014. schedule(node);
  10015. });
  10016. svg.addEventListener('pointerout', function (event) {
  10017. var node = event.target.closest('[data-node-id]');
  10018. if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
  10019. if (hoveredNode === node) hoveredNode = null;
  10020. sync();
  10021. });
  10022. svg.addEventListener('focusin', function (event) {
  10023. var node = event.target.closest('[data-node-id]');
  10024. if (!node) return;
  10025. focusedNode = node;
  10026. show(node.getAttribute('data-node-id'), { announce: true });
  10027. });
  10028. svg.addEventListener('focusout', function (event) {
  10029. var node = event.target.closest('[data-node-id]');
  10030. if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
  10031. if (focusedNode === node) focusedNode = null;
  10032. sync();
  10033. });
  10034. container.addEventListener('pointerdown', function (event) {
  10035. if (!event.target.closest('[data-node-id]')) clear({ announce: false });
  10036. });
  10037. window.addEventListener('blur', function () { clear({ announce: false }); });
  10038. return {
  10039. show: show,
  10040. clear: clear,
  10041. active: function () { return activeId; }
  10042. };
  10043. })();
  10044. /* ============================================================
  10045. Adaptive Reader Shell — one diagram across laptop and monitor.
  10046. The canonical SVG and viewBox never change. On ordinary desktop pages,
  10047. wide diagrams and measured intrinsic tall workflows receive enough outer width to use the available
  10048. height without pushing summary cards below the viewport. Mobile,
  10049. embed, presentation, print, and unmarked non-wide diagrams retain their own
  10050. established layout contracts.
  10051. ============================================================ */
  10052. // Fixed script-private participants; the CLI sees only the joint wait below.
  10053. const archifyLayoutOwners = { reader: null, viewerChrome: null };
  10054. Archify.waitForStableLayout = function (options) {
  10055. options = options || {};
  10056. var maximumFrames = Math.max(1, Number(options.maximumFrames) || 240);
  10057. var fontsReady = document.fonts && document.fonts.ready
  10058. ? document.fonts.ready.catch(function () {})
  10059. : Promise.resolve();
  10060. return fontsReady.then(function () {
  10061. if (typeof options.schedule === 'function') options.schedule();
  10062. return new Promise(function (resolve, reject) {
  10063. var previous = '';
  10064. var stableFrames = 0;
  10065. var sampledFrames = 0;
  10066. function sample() {
  10067. sampledFrames += 1;
  10068. if (typeof options.pending === 'function' && options.pending()) {
  10069. previous = '';
  10070. stableFrames = 0;
  10071. } else {
  10072. var current = typeof options.snapshot === 'function' ? options.snapshot() : '';
  10073. if (current === previous) stableFrames += 1;
  10074. else {
  10075. previous = current;
  10076. stableFrames = 0;
  10077. }
  10078. if (stableFrames >= 3) {
  10079. resolve({ stable: true, snapshot: current, sampledFrames: sampledFrames });
  10080. return;
  10081. }
  10082. }
  10083. if (sampledFrames >= maximumFrames) {
  10084. reject(new Error(options.timeoutMessage || 'Layout did not reach stable dimensions.'));
  10085. return;
  10086. }
  10087. requestAnimationFrame(sample);
  10088. }
  10089. requestAnimationFrame(sample);
  10090. });
  10091. });
  10092. };
  10093. Archify.readerLayout = (function () {
  10094. var html = document.documentElement;
  10095. var body = document.body;
  10096. var shell = document.querySelector('.container');
  10097. var diagram = document.querySelector('.diagram-container');
  10098. var svg = diagram && diagram.querySelector(':scope > svg');
  10099. var legend = svg && svg.querySelector('[data-legend]');
  10100. var header = shell && shell.querySelector('.header');
  10101. var cards = shell && shell.querySelector('.cards');
  10102. var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;
  10103. var ratio = viewBox && viewBox.height > 0 ? viewBox.width / viewBox.height : 0;
  10104. var readerFit = svg && svg.getAttribute('data-reader-fit');
  10105. var widthFirstReading = readerFit === 'width-first';
  10106. var automaticSequence = widthFirstReading && svg.hasAttribute('data-sequence-column-fit');
  10107. var readingScroll = widthFirstReading;
  10108. var measuredHeightFit = readerFit === 'intrinsic-height' || widthFirstReading;
  10109. var frame = 0;
  10110. var settleFrame = 0;
  10111. var lastWidth = 0;
  10112. var automaticAreaHeight = 0;
  10113. // Widest reader the overflow settle has accepted for this viewport (0 =
  10114. // uncapped). Card copy rewraps as the reader narrows, so recomputing
  10115. // from fixed heights alone would widen again and oscillate; only a
  10116. // resize lifts the cap.
  10117. var settledCap = 0;
  10118. var WIDE_RATIO = 1.55;
  10119. var MIN_DESKTOP_WIDTH = 1024;
  10120. var MIN_READER_WIDTH = 960;
  10121. var MAX_READER_WIDTH = 1920;
  10122. var MAX_AUTOMATIC_SCALE = 1.5;
  10123. var MIN_PROJECTED_NODE_TEXT_PX = 6;
  10124. var declaredMinimumText = svg ? parseFloat(svg.getAttribute('data-reader-min-text') || '') : null;
  10125. var requestedMinimumText = Number.isFinite(declaredMinimumText)
  10126. ? Math.max(MIN_PROJECTED_NODE_TEXT_PX, declaredMinimumText)
  10127. : MIN_PROJECTED_NODE_TEXT_PX;
  10128. var declaredPrimaryText = svg ? parseFloat(svg.getAttribute('data-reader-primary-text') || '') : null;
  10129. var SAFE_BOTTOM_GAP = 12;
  10130. // Wide viewports move summary cards beside the diagram, so the height
  10131. // budget belongs to the diagram and spare width holds the notes.
  10132. var RAIL_MIN_VIEWPORT = 1280;
  10133. var RAIL_WIDTH = 288;
  10134. var RAIL_GAP = 20;
  10135. // A default rail must leave primary node labels comfortably readable;
  10136. // otherwise it starts collapsed and the reader can still open it.
  10137. var RAIL_COMFORT_PRIMARY_PX = 12;
  10138. var railPanel = shell && shell.querySelector('.reader-rail');
  10139. var railReveal = document.getElementById('rail-reveal');
  10140. var railCollapse = document.getElementById('rail-collapse');
  10141. var railPlacement = document.getElementById('rail-placement');
  10142. var RAIL_COLLAPSED_KEY = 'archify-rail-collapsed';
  10143. var RAIL_PLACEMENT_KEY = 'archify-rail-placement';
  10144. // Memory is the page's source of truth; storage only carries the choice
  10145. // to later artifacts, so a blocked or full localStorage cannot freeze it.
  10146. var preferences = Object.create(null);
  10147. function readPreference(key) {
  10148. if (key in preferences) return preferences[key];
  10149. try { return localStorage.getItem(key); } catch (_) { return null; }
  10150. }
  10151. function writePreference(key, value) {
  10152. preferences[key] = value;
  10153. try { localStorage.setItem(key, value); } catch (_) {}
  10154. }
  10155. if (diagram && ratio >= WIDE_RATIO) {
  10156. diagram.setAttribute('data-wide-diagram', 'true');
  10157. html.setAttribute('data-diagram-shape', 'wide');
  10158. }
  10159. function number(value) {
  10160. var parsed = parseFloat(value);
  10161. return Number.isFinite(parsed) ? parsed : 0;
  10162. }
  10163. function visible(element) {
  10164. return Boolean(element && !element.hidden && window.getComputedStyle(element).display !== 'none');
  10165. }
  10166. function outerHeight(element) {
  10167. if (!visible(element)) return 0;
  10168. var style = window.getComputedStyle(element);
  10169. return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
  10170. }
  10171. // Smallest scale that keeps node text at the requested floor and
  10172. // context relationship labels readable. A declared wide reader holds
  10173. // relationship labels to the requested floor too; every other reader
  10174. // still keeps them at the 6px hard floor the browser gate enforces, so
  10175. // a first-screen fit can never push them below it.
  10176. function minimumReadableScale() {
  10177. var nodeMinimum = null;
  10178. var edgeMinimum = null;
  10179. var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
  10180. Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
  10181. if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
  10182. var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
  10183. if (!Number.isFinite(sourceFontPx)) return;
  10184. var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
  10185. var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
  10186. if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
  10187. edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
  10188. } else if (primary || text.closest('[data-node-id]')) {
  10189. nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
  10190. }
  10191. });
  10192. var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
  10193. ? requestedMinimumText
  10194. : MIN_PROJECTED_NODE_TEXT_PX;
  10195. var scale = 0;
  10196. if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
  10197. if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
  10198. return scale > 0 ? Math.min(1, scale) : 1;
  10199. }
  10200. var sourcePrimary = null;
  10201. if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
  10202. var size = parseFloat(text.getAttribute('font-size') || '');
  10203. if (Number.isFinite(size) && size > 0) sourcePrimary = sourcePrimary == null ? size : Math.max(sourcePrimary, size);
  10204. });
  10205. // SVG width at which the largest node label renders at targetPx. Every
  10206. // renderer writes label font sizes, so the rail comfort check works for
  10207. // all diagram types; only the renderer-declared floor needs metadata.
  10208. function labelWidth(targetPx) {
  10209. return sourcePrimary == null || !viewBox ? 0 : viewBox.width * targetPx / sourcePrimary;
  10210. }
  10211. function primaryReadingWidth() {
  10212. if (!measuredHeightFit || !Number.isFinite(declaredPrimaryText) || declaredPrimaryText <= 0) return 0;
  10213. // Primary labels should remain comfortable to read when cards or
  10214. // auxiliary rows make a one-screen fit too small. Ordinary page
  10215. // scroll preserves that reading size; viewport width still caps it.
  10216. // A long title may already use a smaller fitted font. Preserve that
  10217. // hierarchy rather than enlarging every other node to compensate.
  10218. return labelWidth(declaredPrimaryText);
  10219. }
  10220. function eligible() {
  10221. return Boolean(
  10222. shell && diagram && svg && (ratio >= WIDE_RATIO || measuredHeightFit) &&
  10223. window.innerWidth >= MIN_DESKTOP_WIDTH &&
  10224. html.getAttribute('data-embed') !== 'true' &&
  10225. html.getAttribute('data-present') !== 'true' &&
  10226. (!window.matchMedia || !window.matchMedia('print').matches)
  10227. );
  10228. }
  10229. function clear() {
  10230. html.style.removeProperty('--archify-reader-width');
  10231. html.style.removeProperty('--archify-diagram-max-width');
  10232. html.style.removeProperty('--archify-diagram-min-height');
  10233. html.removeAttribute('data-reader-area');
  10234. html.removeAttribute('data-reader-narrow');
  10235. html.removeAttribute('data-reader-layout');
  10236. html.removeAttribute('data-reader-overflow');
  10237. setRail(false);
  10238. lastWidth = 0;
  10239. automaticAreaHeight = 0;
  10240. settledCap = 0;
  10241. clearLegend();
  10242. }
  10243. function clearLegend() {
  10244. if (!legend || !legend.hasAttribute('data-reader-legend-corner')) return;
  10245. legend.removeAttribute('data-reader-legend-corner');
  10246. legend.style.removeProperty('--archify-reader-legend-transform');
  10247. }
  10248. // Keep the original legend in its SVG: renderer hover/focus selectors and
  10249. // canonical export still own that same group. Ordinary capped reading
  10250. // and fitted automatic sequences borrow the outer corner at 25–100%.
  10251. function syncLegend() {
  10252. var cameraScale = Number(svg && svg.getAttribute('data-view-scale')) || 1;
  10253. var cornerReading = html.getAttribute('data-reader-area') === 'true' || automaticSequence && !readingScroll;
  10254. if (!legend || !eligible() || !cornerReading || cameraScale > 1.001) {
  10255. clearLegend();
  10256. return;
  10257. }
  10258. var box = legend.getBBox();
  10259. var parentMatrix = legend.parentNode.getScreenCTM();
  10260. if (!parentMatrix || !box.width || !box.height) {
  10261. clearLegend();
  10262. return;
  10263. }
  10264. var rect = diagram.getBoundingClientRect();
  10265. var style = window.getComputedStyle(diagram);
  10266. var scale = Math.min(svg.clientWidth / viewBox.width, svg.clientHeight / viewBox.height);
  10267. if (!Number.isFinite(scale) || scale <= 0) {
  10268. clearLegend();
  10269. return;
  10270. }
  10271. var left = rect.left + number(style.borderLeftWidth) + number(style.paddingLeft);
  10272. var right = rect.right - number(style.borderRightWidth) - number(style.paddingRight);
  10273. var bottom = rect.bottom - number(style.borderBottomWidth) - number(style.paddingBottom);
  10274. var top = bottom - box.height * scale;
  10275. var nav = diagram.querySelector('.diagram-nav');
  10276. var navRect = visible(nav) ? nav.getBoundingClientRect() : null;
  10277. // Long or multi-row legends retain their canonical position if the
  10278. // spare corner cannot hold them clear of the dock and content area.
  10279. if (left + box.width * scale > right || top < rect.top + number(style.paddingTop) + number(style.borderTopWidth) ||
  10280. (navRect && left < navRect.right + 10 && left + box.width * scale > navRect.left - 10 &&
  10281. top < navRect.bottom + 10 && bottom > navRect.top - 10)) {
  10282. clearLegend();
  10283. return;
  10284. }
  10285. var matrix = parentMatrix.inverse().translate(left, top).scale(scale).translate(-box.x, -box.y);
  10286. var value = 'matrix(' + [matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f].join(',') + ')';
  10287. if (legend.style.getPropertyValue('--archify-reader-legend-transform') !== value) {
  10288. legend.style.setProperty('--archify-reader-legend-transform', value);
  10289. }
  10290. if (!legend.hasAttribute('data-reader-legend-corner')) legend.setAttribute('data-reader-legend-corner', '');
  10291. }
  10292. // Rail modes: "true" docks beside the diagram, "collapsed" leaves only the
  10293. // reveal control, "overlay" opens a drawer when docking would break the
  10294. // readable floor, and "bottom" stacks notes and index below the diagram.
  10295. function setRail(mode) {
  10296. if (mode) {
  10297. html.setAttribute('data-reader-rail', mode);
  10298. html.style.setProperty('--archify-rail-width', RAIL_WIDTH + 'px');
  10299. html.style.setProperty('--archify-rail-gap', RAIL_GAP + 'px');
  10300. } else {
  10301. html.removeAttribute('data-reader-rail');
  10302. html.style.removeProperty('--archify-rail-width');
  10303. html.style.removeProperty('--archify-rail-gap');
  10304. }
  10305. if (railReveal) railReveal.hidden = mode !== 'collapsed';
  10306. if (railCollapse) {
  10307. railCollapse.hidden = mode !== 'true' && mode !== 'overlay';
  10308. railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
  10309. }
  10310. if (railPlacement) {
  10311. railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
  10312. railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
  10313. railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
  10314. railPlacement.title = railPlacement.getAttribute('aria-label');
  10315. }
  10316. }
  10317. var outline = document.getElementById('node-outline');
  10318. function hasCards() {
  10319. return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
  10320. }
  10321. // Bottom notes and index are reading material below the fold: the first
  10322. // screen belongs to the interactive diagram and its controls.
  10323. function belowFold() {
  10324. return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
  10325. }
  10326. // A docked rail may run past a short diagram down to the viewport floor,
  10327. // so the index uses that space instead of scrolling inside the diagram's
  10328. // height; it never pushes the page into overflow.
  10329. function fitDockedRail() {
  10330. if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
  10331. var top = railPanel.getBoundingClientRect().top + window.scrollY;
  10332. var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
  10333. html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
  10334. }
  10335. function chromeMetrics() {
  10336. var bodyStyle = window.getComputedStyle(body);
  10337. var diagramStyle = window.getComputedStyle(diagram);
  10338. return {
  10339. bodyX: number(bodyStyle.paddingLeft) + number(bodyStyle.paddingRight),
  10340. bodyY: number(bodyStyle.paddingTop) + number(bodyStyle.paddingBottom),
  10341. diagramX: number(diagramStyle.paddingLeft) + number(diagramStyle.paddingRight) +
  10342. number(diagramStyle.borderLeftWidth) + number(diagramStyle.borderRightWidth),
  10343. diagramY: number(diagramStyle.paddingTop) + number(diagramStyle.paddingBottom) +
  10344. number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)
  10345. };
  10346. }
  10347. // `width` is the diagram's reading width. The page shell never narrows
  10348. // below the desktop reader floor, so a narrow, tall diagram keeps a
  10349. // usable header, toolbar, and controls; its SVG is centred instead.
  10350. function applyWidth(width, minWidth) {
  10351. var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));
  10352. var changed = Math.abs(rounded - lastWidth) >= 1;
  10353. lastWidth = rounded;
  10354. var shellFloor = Math.min(MIN_READER_WIDTH, Math.max(0, window.innerWidth - chromeMetrics().bodyX));
  10355. html.style.setProperty('--archify-reader-width', Math.max(rounded, shellFloor) + 'px');
  10356. var railShare = html.getAttribute('data-reader-rail') === 'true' ? RAIL_WIDTH + RAIL_GAP : 0;
  10357. var diagramWidth = Math.max(1, rounded - railShare - chromeMetrics().diagramX);
  10358. // Content fitting and automatic enlargement never reduce the outer
  10359. // reader region. The SVG alone takes the narrower reading width.
  10360. var automaticWidthCap = measuredHeightFit && viewBox && viewBox.width > 0
  10361. ? viewBox.width * MAX_AUTOMATIC_SCALE : 0;
  10362. if (automaticWidthCap && diagramWidth > automaticWidthCap) {
  10363. diagramWidth = automaticWidthCap;
  10364. html.style.setProperty('--archify-diagram-min-height', automaticAreaHeight + 'px');
  10365. html.setAttribute('data-reader-area', 'true');
  10366. } else {
  10367. // Ordinary automatic diagrams retain their existing document flow.
  10368. // Settling can also stop binding the cap without a new measure.
  10369. html.style.removeProperty('--archify-diagram-min-height');
  10370. html.removeAttribute('data-reader-area');
  10371. }
  10372. if (diagramWidth < Math.max(rounded, shellFloor) - railShare - chromeMetrics().diagramX) {
  10373. html.style.setProperty('--archify-diagram-max-width', diagramWidth + 'px');
  10374. html.setAttribute('data-reader-narrow', 'true');
  10375. } else {
  10376. html.style.removeProperty('--archify-diagram-max-width');
  10377. html.removeAttribute('data-reader-narrow');
  10378. }
  10379. html.setAttribute('data-reader-layout', 'adaptive');
  10380. syncLegend();
  10381. return changed;
  10382. }
  10383. function settleOverflow(minWidth) {
  10384. if (settleFrame) cancelAnimationFrame(settleFrame);
  10385. settleFrame = requestAnimationFrame(function () {
  10386. settleFrame = 0;
  10387. if (!eligible() || !lastWidth) return;
  10388. fitDockedRail();
  10389. var overflow = Math.max(
  10390. document.documentElement.scrollHeight,
  10391. document.body.scrollHeight
  10392. ) - window.innerHeight - belowFold();
  10393. // visual-check fails any page whose rounded-up height exceeds the
  10394. // viewport, so even a 1px remainder must be reduced or declared.
  10395. if (overflow > 0 && !readingScroll && lastWidth > Math.ceil(minWidth)) {
  10396. applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
  10397. settledCap = lastWidth;
  10398. html.setAttribute('data-reader-overflow', 'reduced');
  10399. } else if (overflow > 0) {
  10400. html.setAttribute('data-reader-overflow', 'authored');
  10401. } else {
  10402. html.removeAttribute('data-reader-overflow');
  10403. }
  10404. });
  10405. }
  10406. function measure() {
  10407. frame = 0;
  10408. if (!eligible()) {
  10409. clear();
  10410. return null;
  10411. }
  10412. var chrome = chromeMetrics();
  10413. var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
  10414. // Sequence first-screen fitting preserves source text sizes instead
  10415. // of shrinking to the shared hard readability floor.
  10416. var readableWidth = viewBox && viewBox.width > 0
  10417. ? viewBox.width * (automaticSequence ? 1 : minimumReadableScale()) + chrome.diagramX
  10418. : MIN_READER_WIDTH;
  10419. var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
  10420. var readableMinimumWidth = automaticSequence || measuredHeightFit && ratio < WIDE_RATIO
  10421. ? readableWidth
  10422. : measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
  10423. ? Math.max(MIN_READER_WIDTH, readableWidth)
  10424. : MIN_READER_WIDTH;
  10425. var minWidth;
  10426. if (automaticSequence) {
  10427. minWidth = Math.min(readableMinimumWidth, maxWidth);
  10428. } else if (measuredHeightFit && ratio < WIDE_RATIO) {
  10429. minWidth = Math.min(readableMinimumWidth, viewportCap);
  10430. } else if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
  10431. minWidth = Math.min(readableMinimumWidth, maxWidth);
  10432. } else {
  10433. minWidth = Math.min(readableMinimumWidth, viewportCap);
  10434. }
  10435. var primaryWidth = primaryReadingWidth();
  10436. var railExtra = RAIL_WIDTH + RAIL_GAP;
  10437. var mode = null;
  10438. // Notes default below the diagram; the right rail is the reader's
  10439. // opt-in and needs a wide viewport.
  10440. if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
  10441. mode = 'bottom';
  10442. } else if (hasCards()) {
  10443. var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
  10444. var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
  10445. var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
  10446. var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
  10447. if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
  10448. else mode = fitsReadable ? 'true' : 'overlay';
  10449. }
  10450. // Height-fit families with notes below the fold may shrink to their
  10451. // readable floor. Width-first families choose their reading width
  10452. // below and retain page scrolling instead.
  10453. if (mode === 'bottom') primaryWidth = 0;
  10454. if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
  10455. var docked = mode === 'true';
  10456. setRail(mode);
  10457. chrome = chromeMetrics();
  10458. if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
  10459. var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
  10460. var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
  10461. outerHeight(header) + stackedBelow;
  10462. var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
  10463. var desiredWidth = availableSvgHeight * ratio + chrome.diagramX + (docked ? railExtra : 0);
  10464. // Compact automatic sequences fit the first screen without shrinking
  10465. // their authored text. Longer sequences retain reading width and page
  10466. // scroll; other width-first families keep their existing strategy.
  10467. var sequenceFits = automaticSequence && Math.min(desiredWidth, maxWidth) >=
  10468. readableWidth + (docked ? railExtra : 0);
  10469. readingScroll = widthFirstReading && !sequenceFits;
  10470. if (readingScroll) desiredWidth = maxWidth;
  10471. // Only a binding enlargement cap needs a separate normal reader area.
  10472. // Uncapped diagrams keep their existing natural height and Chrome fit.
  10473. automaticAreaHeight = availableSvgHeight + chrome.diagramY;
  10474. var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth, settledCap || desiredWidth));
  10475. applyWidth(width, minWidth);
  10476. settleOverflow(minWidth);
  10477. return {
  10478. ratio: ratio,
  10479. width: lastWidth,
  10480. availableSvgHeight: Math.round(availableSvgHeight),
  10481. fixedHeight: Math.round(fixedHeight)
  10482. };
  10483. }
  10484. function schedule() {
  10485. if (frame) return;
  10486. frame = requestAnimationFrame(measure);
  10487. }
  10488. function stableSnapshot() {
  10489. var shellRect = shell ? shell.getBoundingClientRect() : { width: 0, height: 0 };
  10490. var diagramRect = diagram ? diagram.getBoundingClientRect() : { width: 0, height: 0 };
  10491. return [
  10492. lastWidth,
  10493. html.getAttribute('data-reader-layout') || '',
  10494. html.getAttribute('data-reader-overflow') || '',
  10495. Math.ceil(document.documentElement.scrollWidth),
  10496. Math.ceil(document.documentElement.scrollHeight),
  10497. Math.ceil(document.body.scrollWidth),
  10498. Math.ceil(document.body.scrollHeight),
  10499. Math.round(shellRect.width * 100) / 100,
  10500. Math.round(shellRect.height * 100) / 100,
  10501. Math.round(diagramRect.width * 100) / 100,
  10502. Math.round(diagramRect.height * 100) / 100,
  10503. legend && legend.hasAttribute('data-reader-legend-corner') ? legend.style.getPropertyValue('--archify-reader-legend-transform') : ''
  10504. ].join('|');
  10505. }
  10506. function layoutPending() { return Boolean(frame || settleFrame); }
  10507. function whenStable() {
  10508. return Archify.waitForStableLayout({
  10509. schedule: schedule,
  10510. pending: layoutPending,
  10511. snapshot: stableSnapshot,
  10512. timeoutMessage: 'Adaptive reader layout did not reach stable dimensions.'
  10513. });
  10514. }
  10515. archifyLayoutOwners.reader = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
  10516. window.addEventListener('resize', function () {
  10517. settledCap = 0;
  10518. schedule();
  10519. }, { passive: true });
  10520. window.addEventListener('load', schedule, { once: true });
  10521. window.addEventListener('beforeprint', clearLegend);
  10522. window.addEventListener('afterprint', schedule);
  10523. if (document.fonts && document.fonts.ready) document.fonts.ready.then(schedule).catch(function () {});
  10524. if (typeof ResizeObserver === 'function') {
  10525. var resizeObserver = new ResizeObserver(schedule);
  10526. [header, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
  10527. }
  10528. if (typeof MutationObserver === 'function') {
  10529. var contentObserver = new MutationObserver(schedule);
  10530. if (cards) contentObserver.observe(cards, { attributes: true, childList: true, subtree: true });
  10531. contentObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });
  10532. }
  10533. // Reader choices persist across artifacts; a resize-style remeasure
  10534. // applies them without reloading.
  10535. function chooseRail(key, value) {
  10536. writePreference(key, value);
  10537. settledCap = 0;
  10538. schedule();
  10539. }
  10540. function collapseRail() {
  10541. chooseRail(RAIL_COLLAPSED_KEY, '1');
  10542. if (railReveal) requestAnimationFrame(function () { try { railReveal.focus({ preventScroll: true }); } catch (_) {} });
  10543. }
  10544. if (railReveal) railReveal.addEventListener('click', function () { chooseRail(RAIL_COLLAPSED_KEY, '0'); });
  10545. if (railCollapse) railCollapse.addEventListener('click', collapseRail);
  10546. if (railPlacement) railPlacement.addEventListener('click', function () {
  10547. var toBottom = html.getAttribute('data-reader-rail') !== 'bottom';
  10548. if (!toBottom) writePreference(RAIL_COLLAPSED_KEY, '0');
  10549. chooseRail(RAIL_PLACEMENT_KEY, toBottom ? 'bottom' : 'right');
  10550. });
  10551. document.addEventListener('keydown', function (event) {
  10552. if (event.key === 'Escape' && html.getAttribute('data-reader-rail') === 'overlay') collapseRail();
  10553. });
  10554. document.addEventListener('pointerdown', function (event) {
  10555. if (html.getAttribute('data-reader-rail') !== 'overlay' || !railPanel) return;
  10556. if (!railPanel.contains(event.target) && !(railReveal && railReveal.contains(event.target))) chooseRail(RAIL_COLLAPSED_KEY, '1');
  10557. });
  10558. if (typeof ResizeObserver === 'function' && railPanel) new ResizeObserver(schedule).observe(railPanel);
  10559. schedule();
  10560. return {
  10561. measure: measure,
  10562. schedule: schedule,
  10563. whenStable: whenStable,
  10564. syncLegend: syncLegend,
  10565. active: function () { return html.getAttribute('data-reader-layout') === 'adaptive'; },
  10566. receipt: function () { return { ratio: ratio, width: lastWidth }; }
  10567. };
  10568. })();
  10569. /* ============================================================
  10570. Viewer Chrome Layout — keep HTML controls clear of the canonical SVG
  10571. stage without changing authored geometry. The dock keeps its floating
  10572. appearance while a small bottom stage rail becomes part of the reader
  10573. budget whenever its zero-reserve position would enter the stage.
  10574. ============================================================ */
  10575. Archify.viewerChromeLayout = (function () {
  10576. var html = document.documentElement;
  10577. var container = document.querySelector('.diagram-container');
  10578. var svg = container && container.querySelector(':scope > svg');
  10579. var nav = container && container.querySelector('.diagram-nav');
  10580. var legend = svg && svg.querySelector('[data-legend]');
  10581. var frame = 0;
  10582. var settleFrame = 0;
  10583. var reserve = 0;
  10584. var railLatched = false;
  10585. var probingBaseline = false;
  10586. var probePromise = null;
  10587. var baselineIntersectionArea = 0;
  10588. var baselineStageGap = null;
  10589. var restorableReserve = 0;
  10590. var probeFallbackReserve = 0;
  10591. var lastReceipt = null;
  10592. var SAFE_GAP = 10;
  10593. function visible(element) {
  10594. if (!element || element.hidden) return false;
  10595. var style = window.getComputedStyle(element);
  10596. return style.display !== 'none' && style.visibility !== 'hidden';
  10597. }
  10598. function usable(rect) {
  10599. return Boolean(rect && rect.width > 0 && rect.height > 0);
  10600. }
  10601. function intersectionArea(a, b) {
  10602. var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));
  10603. var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));
  10604. return width * height;
  10605. }
  10606. function protectedStageRect() {
  10607. if (!svg) return null;
  10608. var rect = svg.getBoundingClientRect();
  10609. var transform = '';
  10610. try { transform = window.getComputedStyle(svg).transform || ''; } catch (_) {}
  10611. var scaleX = 1;
  10612. var scaleY = 1;
  10613. var translateX = 0;
  10614. var translateY = 0;
  10615. var matrix = transform.match(/^matrix\(([^)]+)\)$/);
  10616. var matrix3d = transform.match(/^matrix3d\(([^)]+)\)$/);
  10617. if (matrix) {
  10618. var values = matrix[1].split(',').map(Number);
  10619. if (values.length === 6 && values.every(Number.isFinite)) {
  10620. scaleX = Math.abs(values[0]) || 1;
  10621. scaleY = Math.abs(values[3]) || 1;
  10622. translateX = values[4];
  10623. translateY = values[5];
  10624. }
  10625. } else if (matrix3d) {
  10626. var values3d = matrix3d[1].split(',').map(Number);
  10627. if (values3d.length === 16 && values3d.every(Number.isFinite)) {
  10628. scaleX = Math.abs(values3d[0]) || 1;
  10629. scaleY = Math.abs(values3d[5]) || 1;
  10630. translateX = values3d[12];
  10631. translateY = values3d[13];
  10632. }
  10633. }
  10634. var width = rect.width / scaleX;
  10635. var height = rect.height / scaleY;
  10636. var left = rect.left - translateX;
  10637. var top = rect.top - translateY;
  10638. return {
  10639. x: left,
  10640. y: top,
  10641. left: left,
  10642. top: top,
  10643. right: left + width,
  10644. bottom: top + height,
  10645. width: width,
  10646. height: height
  10647. };
  10648. }
  10649. function eligible() {
  10650. return Boolean(
  10651. container && svg && nav &&
  10652. window.innerWidth > 720 &&
  10653. html.getAttribute('data-embed') !== 'true' &&
  10654. (!window.matchMedia || !window.matchMedia('print').matches) &&
  10655. visible(nav)
  10656. );
  10657. }
  10658. function cameraAtBaseline() {
  10659. var scale = Number(svg && svg.getAttribute('data-view-scale'));
  10660. return !Number.isFinite(scale) || Math.abs(scale - 1) < 0.001;
  10661. }
  10662. function writeReserve(next, options) {
  10663. options = options || {};
  10664. next = Math.max(0, Math.ceil(next));
  10665. if (Math.abs(next - reserve) < 1) return false;
  10666. reserve = next;
  10667. if (reserve) {
  10668. if (options.remember !== false) restorableReserve = reserve;
  10669. container.style.setProperty('--archify-nav-reserve', reserve + 'px');
  10670. container.setAttribute('data-nav-stage-rail', 'true');
  10671. html.setAttribute('data-nav-stage-rail', 'true');
  10672. } else {
  10673. container.style.removeProperty('--archify-nav-reserve');
  10674. container.removeAttribute('data-nav-stage-rail');
  10675. html.removeAttribute('data-nav-stage-rail');
  10676. }
  10677. if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') {
  10678. Archify.readerLayout.schedule();
  10679. }
  10680. if (options.quiet !== true) {
  10681. if (settleFrame) cancelAnimationFrame(settleFrame);
  10682. settleFrame = requestAnimationFrame(function () {
  10683. settleFrame = 0;
  10684. schedule();
  10685. });
  10686. }
  10687. return true;
  10688. }
  10689. function clear(options) {
  10690. options = options || {};
  10691. railLatched = false;
  10692. if (options.preserveBaseline !== true) {
  10693. baselineIntersectionArea = 0;
  10694. baselineStageGap = null;
  10695. restorableReserve = 0;
  10696. }
  10697. writeReserve(0, { quiet: probingBaseline });
  10698. lastReceipt = {
  10699. eligible: false,
  10700. active: false,
  10701. reserve: 0,
  10702. gap: SAFE_GAP,
  10703. baselineStageGap: null,
  10704. stageGap: null,
  10705. stageIntersectionArea: 0,
  10706. baselineIntersectionArea: 0,
  10707. intersectionArea: 0
  10708. };
  10709. return lastReceipt;
  10710. }
  10711. /* When the stage runs below the viewport, the dock lifts to the viewport
  10712. floor so its controls stay reachable while reading. Stage-rail
  10713. decisions and receipts use its resting position, so the lift never
  10714. feeds back into layout. */
  10715. var lift = 0;
  10716. var liftFrame = 0;
  10717. function restingNavRect() {
  10718. var rect = nav.getBoundingClientRect();
  10719. if (!lift) return rect;
  10720. return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
  10721. }
  10722. function updateLift() {
  10723. liftFrame = 0;
  10724. var next = 0;
  10725. if (eligible()) {
  10726. var rest = restingNavRect();
  10727. var box = container.getBoundingClientRect();
  10728. next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
  10729. }
  10730. if (next === lift) return;
  10731. lift = next;
  10732. if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
  10733. else container.style.removeProperty('--archify-dock-lift');
  10734. }
  10735. function scheduleLift() {
  10736. if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
  10737. }
  10738. function measure() {
  10739. frame = 0;
  10740. scheduleLift();
  10741. if (probingBaseline) return null;
  10742. if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
  10743. /* Camera transforms enlarge and translate authored paint inside the
  10744. fixed, clipped root SVG viewport. They must not redefine the
  10745. reader's baseline rail.
  10746. Restore that baseline after temporary mobile/embed/print states.
  10747. Camera Reset preserves the established rail while viewport, mode,
  10748. and content changes remain responsible for baseline reprobes. */
  10749. if (!cameraAtBaseline()) {
  10750. if (reserve === 0 && restorableReserve > 0) {
  10751. if (writeReserve(restorableReserve)) return null;
  10752. }
  10753. var cameraNavRect = restingNavRect();
  10754. var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
  10755. var cameraStageRect = protectedStageRect();
  10756. var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
  10757. ? intersectionArea(cameraNavRect, cameraLegendRect)
  10758. : 0;
  10759. lastReceipt = {
  10760. eligible: true,
  10761. active: reserve > 0,
  10762. reserve: reserve,
  10763. gap: SAFE_GAP,
  10764. baselineStageGap: baselineStageGap == null ? null : Math.round(baselineStageGap * 100) / 100,
  10765. stageGap: Math.round((cameraNavRect.top - cameraStageRect.bottom) * 100) / 100,
  10766. stageIntersectionArea: Math.round(intersectionArea(cameraNavRect, cameraStageRect) * 100) / 100,
  10767. baselineIntersectionArea: Math.round(baselineIntersectionArea * 100) / 100,
  10768. intersectionArea: Math.round(cameraIntersectionArea * 100) / 100
  10769. };
  10770. return lastReceipt;
  10771. }
  10772. var navRect = restingNavRect();
  10773. var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
  10774. var stageRect = protectedStageRect();
  10775. if (!usable(navRect) || !usable(stageRect)) return clear();
  10776. var actualIntersectionArea = usable(legendRect) ? intersectionArea(navRect, legendRect) : 0;
  10777. var stageGap = navRect.top - stageRect.bottom;
  10778. if (!railLatched && reserve === 0) {
  10779. baselineIntersectionArea = actualIntersectionArea;
  10780. baselineStageGap = stageGap;
  10781. if (stageGap < SAFE_GAP) {
  10782. railLatched = true;
  10783. if (writeReserve(Math.max(0, SAFE_GAP - stageGap))) return null;
  10784. }
  10785. } else if (railLatched && reserve > 0 && stageGap < SAFE_GAP) {
  10786. /* Keep the decision latched while Adaptive Reader incorporates the
  10787. rail. Presentation and rounded layout values can require one
  10788. bounded follow-up before the full stage gap is established. */
  10789. var remaining = Math.max(1, SAFE_GAP - stageGap);
  10790. if (writeReserve(reserve + remaining)) return null;
  10791. }
  10792. navRect = restingNavRect();
  10793. legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
  10794. stageRect = protectedStageRect();
  10795. stageGap = navRect.top - stageRect.bottom;
  10796. lastReceipt = {
  10797. eligible: true,
  10798. active: reserve > 0,
  10799. reserve: reserve,
  10800. gap: SAFE_GAP,
  10801. baselineStageGap: baselineStageGap == null ? null : Math.round(baselineStageGap * 100) / 100,
  10802. stageGap: Math.round(stageGap * 100) / 100,
  10803. stageIntersectionArea: Math.round(intersectionArea(navRect, stageRect) * 100) / 100,
  10804. baselineIntersectionArea: Math.round(baselineIntersectionArea * 100) / 100,
  10805. intersectionArea: Math.round((usable(legendRect) ? intersectionArea(navRect, legendRect) : 0) * 100) / 100
  10806. };
  10807. return lastReceipt;
  10808. }
  10809. function reprobe() {
  10810. if (probingBaseline) return probePromise || Promise.resolve(false);
  10811. if (!cameraAtBaseline()) {
  10812. schedule();
  10813. return Promise.resolve(false);
  10814. }
  10815. if (!reserve && !railLatched && !restorableReserve) {
  10816. schedule();
  10817. return Promise.resolve(false);
  10818. }
  10819. probeFallbackReserve = restorableReserve || reserve;
  10820. probingBaseline = true;
  10821. railLatched = false;
  10822. baselineIntersectionArea = 0;
  10823. baselineStageGap = null;
  10824. restorableReserve = 0;
  10825. writeReserve(0, { quiet: true });
  10826. var readerReady = Archify.readerLayout && typeof Archify.readerLayout.whenStable === 'function'
  10827. ? Archify.readerLayout.whenStable().catch(function () {})
  10828. : Promise.resolve();
  10829. probePromise = readerReady.then(function () {
  10830. probingBaseline = false;
  10831. probePromise = null;
  10832. if (!cameraAtBaseline() && probeFallbackReserve > 0) {
  10833. restorableReserve = probeFallbackReserve;
  10834. }
  10835. probeFallbackReserve = 0;
  10836. schedule();
  10837. return true;
  10838. });
  10839. return probePromise;
  10840. }
  10841. function schedule() {
  10842. if (frame) return;
  10843. frame = requestAnimationFrame(measure);
  10844. }
  10845. function stableSnapshot() {
  10846. var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
  10847. var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
  10848. var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
  10849. return [
  10850. reserve,
  10851. lift,
  10852. Math.round(containerRect.width * 100) / 100,
  10853. Math.round(containerRect.height * 100) / 100,
  10854. Math.round(navRect.left * 100) / 100,
  10855. Math.round(navRect.top * 100) / 100,
  10856. Math.round(legendRect.left * 100) / 100,
  10857. Math.round(legendRect.top * 100) / 100,
  10858. railLatched ? 'latched' : 'clear',
  10859. lastReceipt ? lastReceipt.stageGap : ''
  10860. ].join('|');
  10861. }
  10862. function layoutPending() { return Boolean(frame || settleFrame || liftFrame || probingBaseline); }
  10863. function whenStable() {
  10864. return Archify.waitForStableLayout({
  10865. schedule: schedule,
  10866. pending: layoutPending,
  10867. snapshot: stableSnapshot,
  10868. timeoutMessage: 'Viewer chrome layout did not reach stable dimensions.'
  10869. });
  10870. }
  10871. archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
  10872. window.addEventListener('resize', reprobe, { passive: true });
  10873. window.addEventListener('scroll', scheduleLift, { passive: true });
  10874. window.addEventListener('load', schedule, { once: true });
  10875. window.addEventListener('beforeprint', schedule);
  10876. window.addEventListener('afterprint', reprobe);
  10877. if (document.fonts && document.fonts.ready) document.fonts.ready.then(reprobe).catch(function () {});
  10878. if (typeof ResizeObserver === 'function') {
  10879. var resizeObserver = new ResizeObserver(schedule);
  10880. [nav, svg, legend].forEach(function (element) { if (element) resizeObserver.observe(element); });
  10881. // Camera zoom changes outer page flow without changing intrinsic SVG
  10882. // size. Follow that box for dock placement, independently of scrolling
  10883. // and the baseline stage-rail measurement.
  10884. new ResizeObserver(scheduleLift).observe(container);
  10885. }
  10886. if (typeof MutationObserver === 'function') {
  10887. var contentObserver = new MutationObserver(function (records) {
  10888. // A theme switch changes paint, not the stage geometry. Reprobing
  10889. // drops the bottom rail for several frames and makes the diagram jump.
  10890. var viewerModeChanged = records.some(function (record) {
  10891. return record.target === html && record.attributeName !== 'data-theme';
  10892. });
  10893. if (viewerModeChanged) reprobe();
  10894. else schedule();
  10895. });
  10896. if (legend) contentObserver.observe(legend, { attributes: true, childList: true, subtree: true });
  10897. contentObserver.observe(html, {
  10898. attributes: true,
  10899. attributeFilter: ['data-embed', 'data-present', 'data-preset', 'data-theme']
  10900. });
  10901. }
  10902. schedule();
  10903. return {
  10904. measure: measure,
  10905. schedule: schedule,
  10906. reprobe: reprobe,
  10907. whenStable: whenStable,
  10908. stageRect: protectedStageRect,
  10909. dockRect: function () { return nav ? restingNavRect() : null; },
  10910. active: function () { return reserve > 0; },
  10911. receipt: function () { return lastReceipt || measure(); }
  10912. };
  10913. })();
  10914. Archify.layoutStability = {
  10915. whenStable: function () {
  10916. var reader = archifyLayoutOwners.reader;
  10917. var chrome = archifyLayoutOwners.viewerChrome;
  10918. if (!reader || !chrome) {
  10919. return Promise.reject(new Error('Joint layout owners are unavailable.'));
  10920. }
  10921. var observedFontsReady = document.fonts && document.fonts.ready;
  10922. var fontCyclePending = false;
  10923. var fontGeneration = 0;
  10924. function scheduleOwners() { reader.schedule(); chrome.schedule(); }
  10925. function fontsPending() {
  10926. var fonts = document.fonts;
  10927. var ready = fonts && fonts.ready;
  10928. if (ready && (ready !== observedFontsReady || (fonts.status === 'loading' && !fontCyclePending))) {
  10929. observedFontsReady = ready;
  10930. fontCyclePending = true;
  10931. var generation = ++fontGeneration;
  10932. ready.catch(function () {}).then(function () {
  10933. if (generation !== fontGeneration) return;
  10934. fontCyclePending = false;
  10935. scheduleOwners();
  10936. });
  10937. }
  10938. return fontCyclePending || Boolean(fonts && fonts.status === 'loading');
  10939. }
  10940. return Archify.waitForStableLayout({
  10941. maximumFrames: 960,
  10942. schedule: scheduleOwners,
  10943. pending: function () {
  10944. // Recapture readiness for font cycles that begin during sampling.
  10945. return fontsPending() || reader.pending() || chrome.pending();
  10946. },
  10947. snapshot: function () {
  10948. return JSON.stringify([
  10949. ['reader', reader.snapshot()],
  10950. ['viewerChrome', chrome.snapshot()]
  10951. ]);
  10952. },
  10953. timeoutMessage: 'Joint reader and viewer chrome layout did not reach stable dimensions.'
  10954. });
  10955. }
  10956. };
  10957. Archify.view = (function () {
  10958. var container = document.querySelector('.diagram-container');
  10959. var svg = container.querySelector('svg');
  10960. var outBtn = container.querySelector('[data-view="out"]');
  10961. var resetBtn = container.querySelector('[data-view="reset"]');
  10962. var resetDetailLabel = resetBtn.querySelector('[data-view-detail]');
  10963. var resetPercentLabel = resetBtn.querySelector('[data-view-percent]');
  10964. var inBtn = container.querySelector('[data-view="in"]');
  10965. var state = { scale: 1, x: 0, y: 0, mode: 'overview' };
  10966. var minimumZoom = 0.25;
  10967. var maximumZoom = 3;
  10968. var drag = null;
  10969. var cameraTimer = null;
  10970. var cameraFrame = null;
  10971. var cameraGeneration = 0;
  10972. var cameraTransaction = null;
  10973. var clipFrame = 0;
  10974. var resizeFrame = 0;
  10975. var autoScrollUntil = 0;
  10976. var originalFlowHeight = container.style.getPropertyValue('height');
  10977. var originalFlowHeightPriority = container.style.getPropertyPriority('height');
  10978. var compactPageFlow = false;
  10979. var viewBox = svg.viewBox && svg.viewBox.baseVal;
  10980. function clamp() {
  10981. var width = svg.clientWidth || 1;
  10982. var height = svg.clientHeight || 1;
  10983. if (state.scale < 1) {
  10984. var visibleWidth = Math.min(width, container.clientWidth);
  10985. var availableX = visibleWidth - width * state.scale;
  10986. state.x = availableX >= 0 ? container.scrollLeft + availableX / 2
  10987. : Math.max(container.scrollLeft + availableX, Math.min(container.scrollLeft, state.x));
  10988. // Long sequences keep their first rows in view instead of centering
  10989. // inside a layout box that can be several screens tall.
  10990. state.y = height > window.innerHeight ? 0 : height * (1 - state.scale) / 2;
  10991. return;
  10992. }
  10993. state.x = Math.min(0, Math.max(width - width * state.scale, state.x));
  10994. state.y = Math.min(0, Math.max(height - height * state.scale, state.y));
  10995. }
  10996. function reducedMotion() {
  10997. return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  10998. }
  10999. function contentMetrics() {
  11000. if (!viewBox || viewBox.width <= 0 || viewBox.height <= 0) return null;
  11001. var width = svg.clientWidth || 1;
  11002. var height = svg.clientHeight || 1;
  11003. var scale = Math.min(width / viewBox.width, height / viewBox.height);
  11004. return {
  11005. width: width,
  11006. height: height,
  11007. scale: scale,
  11008. offsetX: (width - viewBox.width * scale) / 2,
  11009. offsetY: (height - viewBox.height * scale) / 2
  11010. };
  11011. }
  11012. function logicalViewport() {
  11013. var metrics = contentMetrics();
  11014. if (!metrics) return null;
  11015. var camera = sampleRenderedState();
  11016. var x;
  11017. var y;
  11018. var width;
  11019. var height;
  11020. if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram') && camera.scale >= 1) {
  11021. x = viewBox.x + container.scrollLeft / metrics.scale;
  11022. y = viewBox.y;
  11023. width = Math.min(viewBox.width, Math.max(1, container.clientWidth / metrics.scale));
  11024. height = viewBox.height;
  11025. } else {
  11026. x = viewBox.x + (((container.scrollLeft - camera.x) / camera.scale) - metrics.offsetX) / metrics.scale;
  11027. y = viewBox.y + ((-camera.y / camera.scale) - metrics.offsetY) / metrics.scale;
  11028. width = Math.min(viewBox.width, Math.min(metrics.width, container.clientWidth) / camera.scale / metrics.scale);
  11029. height = Math.min(viewBox.height, metrics.height / camera.scale / metrics.scale);
  11030. }
  11031. width = Math.max(1, Math.min(viewBox.width, width));
  11032. height = Math.max(1, Math.min(viewBox.height, height));
  11033. x = Math.max(viewBox.x, Math.min(viewBox.x + viewBox.width - width, x));
  11034. y = Math.max(viewBox.y, Math.min(viewBox.y + viewBox.height - height, y));
  11035. // The camera's layout box can span several browser screens. Intersect
  11036. // its logical bounds with the actual window, including page scrolling.
  11037. var matrix = svg.getScreenCTM();
  11038. if (matrix && matrix.d > 0) {
  11039. var end = y + height;
  11040. y = Math.max(y, Math.min(end - 1, -matrix.f / matrix.d));
  11041. height = Math.max(1, Math.min(end, (window.innerHeight - matrix.f) / matrix.d) - y);
  11042. }
  11043. return { x: x, y: y, width: width, height: height, scale: camera.scale };
  11044. }
  11045. function detailLevel() {
  11046. if (state.mode === 'semantic') return 'full';
  11047. if (state.scale >= 1.75) return 'full';
  11048. if (state.scale >= 1) return 'read';
  11049. return 'map';
  11050. }
  11051. function renderControls() {
  11052. var semantic = state.mode === 'semantic' && state.scale > 1.01;
  11053. var detail = detailLevel();
  11054. var percent = Math.round(state.scale * 100) + '%';
  11055. var levelLabel = viewerText('viewer.nav.level.' + detail);
  11056. var detailHint = detail === 'map'
  11057. ? viewerText('viewer.nav.detail.map')
  11058. : detail === 'read'
  11059. ? viewerText('viewer.nav.detail.read')
  11060. : viewerText('viewer.nav.detail.full');
  11061. var resolvedLevel = semantic ? viewerText('viewer.nav.level.auto') : levelLabel;
  11062. var showDetailLevel = semantic || detail !== 'read';
  11063. if (resetDetailLabel) {
  11064. resetDetailLabel.textContent = resolvedLevel;
  11065. resetDetailLabel.hidden = !showDetailLevel;
  11066. }
  11067. if (resetPercentLabel) resetPercentLabel.textContent = percent;
  11068. resetBtn.toggleAttribute('data-detail-visible', showDetailLevel);
  11069. resetBtn.title = viewerText('viewer.nav.camera.title', {
  11070. semantic: semantic ? viewerText('viewer.nav.camera.semantic') : '',
  11071. hint: detailHint
  11072. });
  11073. var readout = (showDetailLevel ? resolvedLevel + ' ' : '') + percent;
  11074. resetBtn.setAttribute('aria-label', readout + ' · ' + viewerText('viewer.nav.camera', { hint: detailHint }));
  11075. resetBtn.setAttribute('data-detail-level', detail);
  11076. container.setAttribute('data-detail-level', detail);
  11077. container.setAttribute('data-camera-mode', state.mode);
  11078. container.setAttribute('data-camera-indicator', semantic ? 'true' : 'false');
  11079. }
  11080. function clipToViewport(camera) {
  11081. camera = camera || state;
  11082. if (camera.scale <= 1.001) {
  11083. svg.style.removeProperty('clip-path');
  11084. return;
  11085. }
  11086. var width = svg.clientWidth || 1;
  11087. var height = svg.clientHeight || 1;
  11088. var scale = camera.scale;
  11089. var top = Math.max(0, Math.min(height, -camera.y / scale));
  11090. var left = Math.max(0, Math.min(width, -camera.x / scale));
  11091. var right = Math.max(0, Math.min(width, width - (width - camera.x) / scale));
  11092. var bottom = Math.max(0, Math.min(height, height - (height - camera.y) / scale));
  11093. svg.style.clipPath = 'inset(' + [top, right, bottom, left].map(function (value) {
  11094. return Math.round(value * 1000) / 1000 + 'px';
  11095. }).join(' ') + ')';
  11096. }
  11097. function cameraSettled(rendered) {
  11098. return Math.abs(rendered.scale - state.scale) < 0.001 &&
  11099. Math.abs(rendered.x - state.x) < 0.05 &&
  11100. Math.abs(rendered.y - state.y) < 0.05;
  11101. }
  11102. // CSS transforms keep the SVG's intrinsic layout size. Shrink only its
  11103. // outer page-flow box for long ordinary diagrams, never the SVG itself:
  11104. // changing its height would feed the smaller size back into camera math.
  11105. function ordinaryPage() {
  11106. var html = document.documentElement;
  11107. return html.getAttribute('data-embed') !== 'true' &&
  11108. html.getAttribute('data-present') !== 'true' &&
  11109. (!window.matchMedia || !window.matchMedia('print').matches);
  11110. }
  11111. function syncPageFlow(camera) {
  11112. camera = camera || state;
  11113. var height = svg.clientHeight;
  11114. var ordinary = ordinaryPage();
  11115. // Restore ordinary flow as soon as the target reaches 100%. Chrome
  11116. // uses that target to resume baseline rail measurement; retaining a
  11117. // partially shrunk box during the CSS transition would inflate reserve.
  11118. if (ordinary && state.scale < 1 && camera.scale < 1 && height > window.innerHeight) {
  11119. var style = getComputedStyle(container);
  11120. var chrome = ['paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth']
  11121. .reduce(function (total, key) { return total + (parseFloat(style[key]) || 0); }, 0);
  11122. var flowHeight = Math.ceil(height * camera.scale + Math.max(0, camera.y) + chrome) + 'px';
  11123. if (container.style.getPropertyValue('height') !== flowHeight) container.style.setProperty('height', flowHeight);
  11124. compactPageFlow = true;
  11125. } else if (compactPageFlow) {
  11126. if (originalFlowHeight) container.style.setProperty('height', originalFlowHeight, originalFlowHeightPriority);
  11127. else container.style.removeProperty('height');
  11128. compactPageFlow = false;
  11129. }
  11130. }
  11131. function syncViewportClip() {
  11132. if (clipFrame) cancelAnimationFrame(clipFrame);
  11133. clipFrame = 0;
  11134. function sample() {
  11135. clipFrame = 0;
  11136. var rendered = sampleRenderedState();
  11137. syncPageFlow(rendered);
  11138. clipToViewport(rendered);
  11139. if (Archify.radar && Archify.radar.isOpen()) Archify.radar.sync();
  11140. if (Archify.readerLayout && typeof Archify.readerLayout.syncLegend === 'function') Archify.readerLayout.syncLegend();
  11141. if (!cameraSettled(rendered)) clipFrame = requestAnimationFrame(sample);
  11142. }
  11143. sample();
  11144. }
  11145. function apply() {
  11146. clamp();
  11147. svg.style.transform = 'translate(' + state.x + 'px,' + state.y + 'px) scale(' + state.scale + ')';
  11148. svg.setAttribute('data-view-scale', String(state.scale));
  11149. syncViewportClip();
  11150. renderControls();
  11151. outBtn.disabled = state.scale <= minimumZoom;
  11152. inBtn.disabled = state.scale >= maximumZoom;
  11153. container.classList.toggle('is-pannable', state.scale > 1);
  11154. if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
  11155. if (Archify.viewerChromeLayout && typeof Archify.viewerChromeLayout.schedule === 'function') {
  11156. Archify.viewerChromeLayout.schedule();
  11157. }
  11158. }
  11159. function sampleRenderedState() {
  11160. var transform = '';
  11161. try { transform = getComputedStyle(svg).transform || ''; } catch (_) {}
  11162. var match = transform.match(/^matrix\(([^)]+)\)$/);
  11163. if (!match) return { scale: state.scale, x: state.x, y: state.y, mode: state.mode };
  11164. var values = match[1].split(',').map(Number);
  11165. if (values.length !== 6 || !values.every(Number.isFinite)) {
  11166. return { scale: state.scale, x: state.x, y: state.y, mode: state.mode };
  11167. }
  11168. return { scale: values[0], x: values[4], y: values[5], mode: state.mode };
  11169. }
  11170. function finishCameraTransaction(transaction, outcome) {
  11171. if (!transaction || transaction.settled) return false;
  11172. transaction.settled = true;
  11173. transaction.state = outcome || 'complete';
  11174. if (transaction.frame) cancelAnimationFrame(transaction.frame);
  11175. if (transaction.timer) clearTimeout(transaction.timer);
  11176. transaction.frame = null;
  11177. transaction.timer = null;
  11178. if (cameraTransaction === transaction) cameraTransaction = null;
  11179. cameraFrame = null;
  11180. cameraTimer = null;
  11181. container.classList.remove('is-camera-moving');
  11182. container.classList.remove('is-camera-transaction');
  11183. container.removeAttribute('data-camera-transaction');
  11184. if (Archify.focus && Archify.focus.reposition) Archify.focus.reposition();
  11185. transaction.resolve({ id: transaction.id, state: transaction.state });
  11186. return true;
  11187. }
  11188. function cameraReceipt(target, options) {
  11189. var resolver;
  11190. var transaction = {
  11191. id: ++cameraGeneration,
  11192. state: 'running',
  11193. target: target,
  11194. settled: false,
  11195. frame: null,
  11196. timer: null,
  11197. finished: new Promise(function (resolve) { resolver = resolve; }),
  11198. resolve: resolver,
  11199. cancel: function (reason, commitTarget) {
  11200. if (transaction.settled) return false;
  11201. if (commitTarget && transaction.target) {
  11202. if (Object.prototype.hasOwnProperty.call(transaction.target, 'scrollLeft')) {
  11203. container.scrollLeft = transaction.target.scrollLeft;
  11204. } else {
  11205. state = {
  11206. scale: transaction.target.scale,
  11207. x: transaction.target.x,
  11208. y: transaction.target.y,
  11209. mode: transaction.target.mode
  11210. };
  11211. apply();
  11212. }
  11213. }
  11214. return finishCameraTransaction(transaction, reason || 'cancelled');
  11215. }
  11216. };
  11217. return transaction;
  11218. }
  11219. function stopCameraMotion(reason, commitTarget) {
  11220. if (cameraTransaction && !cameraTransaction.settled) {
  11221. cameraTransaction.cancel(reason || 'cancelled', commitTarget === true);
  11222. return;
  11223. }
  11224. if (cameraTimer) clearTimeout(cameraTimer);
  11225. if (cameraFrame) cancelAnimationFrame(cameraFrame);
  11226. cameraTimer = null;
  11227. cameraFrame = null;
  11228. container.classList.remove('is-camera-moving');
  11229. container.classList.remove('is-camera-transaction');
  11230. container.removeAttribute('data-camera-transaction');
  11231. }
  11232. function interruptCamera(reason) {
  11233. var rendered = sampleRenderedState();
  11234. stopCameraMotion(reason || 'manual', false);
  11235. state = rendered;
  11236. state.mode = 'manual';
  11237. apply();
  11238. renderControls();
  11239. if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
  11240. Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: reason || 'manual' });
  11241. }
  11242. }
  11243. function zoom(next, options) {
  11244. options = options || {};
  11245. if (options.manual !== false) interruptCamera();
  11246. var previous = state.scale;
  11247. next = Math.max(minimumZoom, Math.min(maximumZoom, Math.round(next * 4) / 4));
  11248. if (next === previous) return;
  11249. var longDiagram = svg.clientHeight > window.innerHeight && Math.min(previous, next) < 1;
  11250. var before = longDiagram ? svg.getBoundingClientRect() : null;
  11251. var anchorY = before ? Math.max(0, Math.min(window.innerHeight, before.bottom) + Math.max(0, before.top)) / 2 : 0;
  11252. if (before && (before.bottom <= 0 || before.top >= window.innerHeight)) anchorY = window.innerHeight / 2;
  11253. var logicalY = before ? Math.max(0, Math.min(svg.clientHeight, (anchorY - before.top) / previous)) : 0;
  11254. var documentTop = before ? window.scrollY + before.top - state.y : 0;
  11255. var centerX = (svg.clientWidth || 1) / 2;
  11256. var centerY = (svg.clientHeight || 1) / 2;
  11257. var contentX = (centerX - state.x) / previous;
  11258. var contentY = (centerY - state.y) / previous;
  11259. state.scale = next;
  11260. state.x = centerX - contentX * next;
  11261. state.y = centerY - contentY * next;
  11262. apply();
  11263. if (longDiagram) {
  11264. var scaledHeight = svg.clientHeight * next;
  11265. var pageY = scaledHeight <= window.innerHeight ? documentTop + state.y
  11266. : documentTop + state.y + logicalY * next - anchorY;
  11267. window.scrollTo({ left: window.scrollX, top: Math.max(0, pageY), behavior: 'instant' });
  11268. }
  11269. }
  11270. function reset(options) {
  11271. options = options || {};
  11272. if (options.automatic !== true) interruptCamera();
  11273. else stopCameraMotion('reset', false);
  11274. state = { scale: 1, x: 0, y: 0, mode: 'overview' };
  11275. apply();
  11276. }
  11277. function scrollLongDiagramTo(contentY, metrics, options) {
  11278. if (!ordinaryPage() || metrics.height <= window.innerHeight) return;
  11279. // apply() may still be animating its CSS transform. Recover the layout
  11280. // origin from the painted transform, then use the final camera target.
  11281. var painted = sampleRenderedState();
  11282. var rect = svg.getBoundingClientRect();
  11283. var pixelScale = rect.height / metrics.height / painted.scale;
  11284. var documentTop = window.scrollY + rect.top - painted.y * pixelScale;
  11285. var target = documentTop + (state.y + contentY * state.scale) * pixelScale - window.innerHeight / 2;
  11286. window.scrollTo({ left: window.scrollX, top: Math.max(0, target), behavior: options.instant ? 'instant' : 'smooth' });
  11287. }
  11288. function centerAt(logicalX, logicalY, options) {
  11289. options = options || {};
  11290. logicalX = Number(logicalX);
  11291. logicalY = Number(logicalY);
  11292. var metrics = contentMetrics();
  11293. if (!metrics || !Number.isFinite(logicalX) || !Number.isFinite(logicalY)) return false;
  11294. interruptCamera();
  11295. if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram')) {
  11296. state.scale = 1;
  11297. state.x = 0;
  11298. state.y = 0;
  11299. state.mode = 'manual';
  11300. apply();
  11301. var mobileTarget = (logicalX - viewBox.x) * metrics.scale - container.clientWidth / 2;
  11302. mobileTarget = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, mobileTarget));
  11303. autoScrollUntil = Date.now() + 80;
  11304. try { container.scrollTo({ left: mobileTarget, behavior: options.instant ? 'auto' : 'smooth' }); }
  11305. catch (_) { container.scrollLeft = mobileTarget; }
  11306. scrollLongDiagramTo(metrics.offsetY + (logicalY - viewBox.y) * metrics.scale, metrics, options);
  11307. return true;
  11308. }
  11309. var minimumScale = Math.max(1, Math.min(3, Number(options.minimumScale) || 1));
  11310. var requestedScale = Number(options.scale);
  11311. state.scale = Math.max(minimumScale, Math.min(3, Number.isFinite(requestedScale) ? requestedScale : state.scale));
  11312. var contentX = metrics.offsetX + (logicalX - viewBox.x) * metrics.scale;
  11313. var contentY = metrics.offsetY + (logicalY - viewBox.y) * metrics.scale;
  11314. state.x = metrics.width / 2 - contentX * state.scale;
  11315. state.y = metrics.height / 2 - contentY * state.scale;
  11316. state.mode = 'manual';
  11317. apply();
  11318. scrollLongDiagramTo(contentY, metrics, options);
  11319. if (Archify.focus && Archify.focus.reposition) Archify.focus.reposition();
  11320. return true;
  11321. }
  11322. function semanticIds(ids, includeNeighbors) {
  11323. var seeds = Object.create(null);
  11324. var wanted = Object.create(null);
  11325. (ids || []).forEach(function (id) { seeds[id] = true; wanted[id] = true; });
  11326. if (includeNeighbors) {
  11327. Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
  11328. var from = edge.getAttribute('data-edge-from');
  11329. var to = edge.getAttribute('data-edge-to');
  11330. if (seeds[from] || seeds[to]) { wanted[from] = true; wanted[to] = true; }
  11331. });
  11332. }
  11333. return wanted;
  11334. }
  11335. function boxesFor(ids, includeNeighbors) {
  11336. var wanted = semanticIds(ids, includeNeighbors);
  11337. return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'))
  11338. .filter(function (node) { return wanted[node.getAttribute('data-node-id')]; })
  11339. .map(function (node) {
  11340. try { return node.getBBox(); } catch (_) { return null; }
  11341. })
  11342. .filter(Boolean);
  11343. }
  11344. function frameDesktop(ids, options) {
  11345. options = options || {};
  11346. var boxes = boxesFor(ids, options.includeNeighbors === true);
  11347. if (!boxes.length || !viewBox || viewBox.width <= 0 || viewBox.height <= 0) return false;
  11348. var svgWidth = svg.clientWidth || 1;
  11349. var svgHeight = svg.clientHeight || 1;
  11350. var contentScale = Math.min(svgWidth / viewBox.width, svgHeight / viewBox.height);
  11351. var contentOffsetX = (svgWidth - viewBox.width * contentScale) / 2;
  11352. var contentOffsetY = (svgHeight - viewBox.height * contentScale) / 2;
  11353. var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));
  11354. var minY = Math.min.apply(Math, boxes.map(function (box) { return box.y; }));
  11355. var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
  11356. var maxY = Math.max.apply(Math, boxes.map(function (box) { return box.y + box.height; }));
  11357. var bounds = {
  11358. x: contentOffsetX + (minX - viewBox.x) * contentScale,
  11359. y: contentOffsetY + (minY - viewBox.y) * contentScale,
  11360. width: Math.max(1, (maxX - minX) * contentScale),
  11361. height: Math.max(1, (maxY - minY) * contentScale)
  11362. };
  11363. var padding = options.padding || 48;
  11364. var left = padding;
  11365. var right = svgWidth - padding;
  11366. var top = padding;
  11367. var bottom = svgHeight - Math.max(padding, 72);
  11368. var containerRect = container.getBoundingClientRect();
  11369. var visibleTop = Math.max(0, -containerRect.top);
  11370. var visibleBottom = Math.min(svgHeight, window.innerHeight - containerRect.top);
  11371. if (visibleBottom - visibleTop >= 240) {
  11372. top = Math.max(top, visibleTop + padding);
  11373. bottom = Math.min(bottom, visibleBottom - Math.max(padding, 72));
  11374. }
  11375. var chip = document.getElementById('focus-chip');
  11376. if (chip && !chip.hidden) {
  11377. var lensEnd = chip.offsetLeft + chip.offsetWidth + 24 - (svg.offsetLeft || 0);
  11378. left = Math.max(left, Math.min(svgWidth * 0.42, lensEnd));
  11379. }
  11380. var routeReceipt = document.getElementById('route-probe');
  11381. if (routeReceipt && !routeReceipt.hidden && routeReceipt.hasAttribute('data-route-journey')) {
  11382. var receiptTop = routeReceipt.offsetTop;
  11383. var receiptBottom = receiptTop + routeReceipt.offsetHeight;
  11384. if (receiptTop < svgHeight / 2) top = Math.max(top, receiptBottom + 24);
  11385. else bottom = Math.min(bottom, receiptTop - 24);
  11386. }
  11387. if (right <= left || bottom <= top) return false;
  11388. var maxScale = options.maxScale || (options.includeNeighbors ? 1.9 : 2.15);
  11389. var targetScale = Math.min((right - left) / bounds.width, (bottom - top) / bounds.height) * 0.9;
  11390. targetScale = Math.max(1, Math.min(maxScale, targetScale));
  11391. if (targetScale < 1.08) targetScale = 1;
  11392. var target = {
  11393. scale: Math.round(targetScale * 100) / 100,
  11394. x: 0,
  11395. y: 0,
  11396. mode: 'semantic'
  11397. };
  11398. target.x = (left + right) / 2 - (bounds.x + bounds.width / 2) * target.scale;
  11399. target.y = (top + bottom) / 2 - (bounds.y + bounds.height / 2) * target.scale;
  11400. var start = sampleRenderedState();
  11401. stopCameraMotion('replaced', false);
  11402. var transaction = cameraReceipt(target, options);
  11403. cameraTransaction = transaction;
  11404. var instant = options.instant === true || reducedMotion() || document.hidden;
  11405. if (instant) {
  11406. state = target;
  11407. apply();
  11408. finishCameraTransaction(transaction, reducedMotion() ? 'reduced-motion' : (document.hidden ? 'hidden' : 'complete'));
  11409. return transaction;
  11410. }
  11411. var duration = Math.max(180, Math.min(520, Number(options.duration) || 420));
  11412. var startedAt = 0;
  11413. state = start;
  11414. state.mode = 'semantic';
  11415. apply();
  11416. container.classList.add('is-camera-moving');
  11417. container.classList.add('is-camera-transaction');
  11418. container.setAttribute('data-camera-transaction', String(transaction.id));
  11419. var step = function (timestamp) {
  11420. if (cameraTransaction !== transaction || transaction.settled) return;
  11421. if (!startedAt) startedAt = timestamp;
  11422. var fraction = Math.max(0, Math.min(1, (timestamp - startedAt) / duration));
  11423. var eased = 1 - Math.pow(1 - fraction, 3);
  11424. state = {
  11425. scale: start.scale + (target.scale - start.scale) * eased,
  11426. x: start.x + (target.x - start.x) * eased,
  11427. y: start.y + (target.y - start.y) * eased,
  11428. mode: 'semantic'
  11429. };
  11430. apply();
  11431. if (fraction < 1) {
  11432. transaction.frame = requestAnimationFrame(step);
  11433. cameraFrame = transaction.frame;
  11434. } else {
  11435. state = target;
  11436. apply();
  11437. finishCameraTransaction(transaction, 'complete');
  11438. }
  11439. };
  11440. transaction.frame = requestAnimationFrame(step);
  11441. cameraFrame = transaction.frame;
  11442. return transaction;
  11443. }
  11444. function reveal(ids, options) {
  11445. options = options || {};
  11446. if (window.innerWidth > 720) return frameDesktop(ids, options);
  11447. stopCameraMotion('replaced', false);
  11448. state.scale = 1;
  11449. state.x = 0;
  11450. state.y = 0;
  11451. state.mode = 'semantic';
  11452. apply();
  11453. if (!container.hasAttribute('data-wide-diagram')) {
  11454. var contained = cameraReceipt({ scale: 1, x: 0, y: 0, mode: 'semantic' }, options);
  11455. cameraTransaction = contained;
  11456. finishCameraTransaction(contained, 'complete');
  11457. return contained;
  11458. }
  11459. var boxes = boxesFor(ids, options.includeNeighbors === true);
  11460. if (!boxes.length || !viewBox || viewBox.width <= 0) return false;
  11461. var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));
  11462. var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
  11463. var center = (((minX + maxX) / 2 - viewBox.x) / viewBox.width) * (svg.clientWidth || 1);
  11464. var target = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, center - container.clientWidth / 2));
  11465. var transaction = cameraReceipt({ scrollLeft: target }, options);
  11466. cameraTransaction = transaction;
  11467. var instant = options.instant === true || reducedMotion() || document.hidden;
  11468. autoScrollUntil = Date.now() + (instant ? 50 : 470);
  11469. try { container.scrollTo({ left: target, behavior: instant ? 'auto' : 'smooth' }); }
  11470. catch (_) { container.scrollLeft = target; }
  11471. if (instant) finishCameraTransaction(transaction, reducedMotion() ? 'reduced-motion' : (document.hidden ? 'hidden' : 'complete'));
  11472. else {
  11473. transaction.timer = setTimeout(function () { finishCameraTransaction(transaction, 'complete'); }, 460);
  11474. cameraTimer = transaction.timer;
  11475. container.classList.add('is-camera-moving');
  11476. container.setAttribute('data-camera-transaction', String(transaction.id));
  11477. }
  11478. return transaction;
  11479. }
  11480. function syncSemantic() {
  11481. var active = Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null;
  11482. if (typeof active === 'string') return reveal([active], { includeNeighbors: true, reason: 'focus-sync' });
  11483. if (Array.isArray(active) && active.length) return reveal(active, { reason: 'selection-sync' });
  11484. return false;
  11485. }
  11486. function pinControls() {
  11487. container.style.setProperty('--archify-scroll-x', container.scrollLeft + 'px');
  11488. }
  11489. function onScroll() {
  11490. pinControls();
  11491. if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
  11492. if (window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram') && Date.now() > autoScrollUntil) {
  11493. interruptCamera();
  11494. }
  11495. }
  11496. function onPointerEnd(event) {
  11497. if (!drag) return;
  11498. var moved = drag.moved;
  11499. drag = null;
  11500. container.classList.remove('is-panning');
  11501. try { container.releasePointerCapture(event.pointerId); } catch (_) {}
  11502. if (moved) {
  11503. container.setAttribute('data-just-panned', 'true');
  11504. setTimeout(function () { container.removeAttribute('data-just-panned'); }, 80);
  11505. }
  11506. }
  11507. inBtn.addEventListener('click', function () { zoom(state.scale + 0.25); });
  11508. outBtn.addEventListener('click', function () { zoom(state.scale - 0.25); });
  11509. resetBtn.addEventListener('click', reset);
  11510. container.addEventListener('pointerdown', function (event) {
  11511. if (state.scale <= 1 || event.button !== 0 || event.target.closest('.diagram-nav, .focus-chip, .node-finder, .diagram-guide, .overview-map, .route-probe, .semantic-lens') || event.target.closest('[data-node-id]') || event.target.closest('[data-relationship-hit-key]')) return;
  11512. interruptCamera();
  11513. drag = { startX: event.clientX, startY: event.clientY, x: state.x, y: state.y, moved: false };
  11514. container.classList.add('is-panning');
  11515. try { container.setPointerCapture(event.pointerId); } catch (_) {}
  11516. });
  11517. container.addEventListener('pointermove', function (event) {
  11518. if (!drag) return;
  11519. var dx = event.clientX - drag.startX;
  11520. var dy = event.clientY - drag.startY;
  11521. if (Math.abs(dx) + Math.abs(dy) > 3) drag.moved = true;
  11522. state.x = drag.x + dx;
  11523. state.y = drag.y + dy;
  11524. apply();
  11525. });
  11526. container.addEventListener('pointerup', onPointerEnd);
  11527. container.addEventListener('pointercancel', onPointerEnd);
  11528. container.addEventListener('scroll', onScroll, { passive: true });
  11529. window.addEventListener('resize', function () {
  11530. if (resizeFrame) cancelAnimationFrame(resizeFrame);
  11531. resizeFrame = requestAnimationFrame(function () {
  11532. resizeFrame = 0;
  11533. if (state.mode === 'semantic') syncSemantic();
  11534. else apply();
  11535. });
  11536. });
  11537. // Reader width and Chrome reserve can change without a window resize.
  11538. // Observe their resulting sizes; the SVG remains intrinsically sized, so
  11539. // the outer flow height cannot feed back into its camera base.
  11540. if (typeof ResizeObserver === 'function') {
  11541. var flowObserver = new ResizeObserver(function () { syncPageFlow(sampleRenderedState()); });
  11542. flowObserver.observe(svg);
  11543. flowObserver.observe(container);
  11544. }
  11545. if (typeof MutationObserver === 'function') {
  11546. new MutationObserver(function () { syncPageFlow(sampleRenderedState()); })
  11547. .observe(document.documentElement, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });
  11548. }
  11549. var printMedia = window.matchMedia && window.matchMedia('print');
  11550. if (printMedia && printMedia.addEventListener) printMedia.addEventListener('change', function () { syncPageFlow(sampleRenderedState()); });
  11551. window.addEventListener('hashchange', function () { requestAnimationFrame(syncSemantic); });
  11552. apply();
  11553. pinControls();
  11554. requestAnimationFrame(syncSemantic);
  11555. return {
  11556. zoomIn: function () { zoom(state.scale + 0.25); },
  11557. zoomOut: function () { zoom(state.scale - 0.25); },
  11558. reset: reset,
  11559. reveal: reveal,
  11560. centerAt: centerAt,
  11561. logicalViewport: logicalViewport,
  11562. sync: syncSemantic,
  11563. state: function () { return { scale: state.scale, x: state.x, y: state.y, mode: state.mode }; }
  11564. };
  11565. })();
  11566. /* ============================================================
  11567. Semantic Radar — simplified semantic bounds + live viewport.
  11568. The radar is built at runtime so the checked artifact still contains
  11569. one canonical SVG block, and export serialization remains untouched.
  11570. ============================================================ */
  11571. Archify.radar = (function () {
  11572. var container = document.querySelector('.diagram-container');
  11573. var diagram = container.querySelector(':scope > svg');
  11574. var panel = document.getElementById('overview-map');
  11575. var panelHead = panel.querySelector('.overview-map-head');
  11576. var surface = document.getElementById('overview-map-surface');
  11577. var status = document.getElementById('overview-map-status');
  11578. var trigger = document.getElementById('btn-overview-map');
  11579. var closeBtn = document.getElementById('overview-map-close');
  11580. var expandBtn = document.getElementById('overview-map-expand');
  11581. var feedback = document.getElementById('overview-map-feedback');
  11582. var navigation = container.querySelector('.diagram-nav');
  11583. var passport = document.getElementById('focus-chip');
  11584. var namespace = 'http://www.w3.org/2000/svg';
  11585. var viewBox = diagram.viewBox && diagram.viewBox.baseVal;
  11586. var mapSvg = document.createElementNS(namespace, 'svg');
  11587. var nodeLayer = document.createElementNS(namespace, 'g');
  11588. var viewport = document.createElementNS(namespace, 'rect');
  11589. var nodes = [];
  11590. var viewportDrag = null;
  11591. var panelDrag = null;
  11592. var manualPosition = null;
  11593. var lastPlacement = null;
  11594. var requestedOpen = false;
  11595. var passportYielded = false;
  11596. var passportPreviousAriaHidden = null;
  11597. var syncFrame = 0;
  11598. var spaceRetryTimer = 0;
  11599. var spaceRetryCount = 0;
  11600. var placementGap = 16;
  11601. mapSvg.setAttribute('role', 'group');
  11602. mapSvg.setAttribute('aria-label', viewerText('viewer.radar.nodes'));
  11603. mapSvg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
  11604. nodeLayer.setAttribute('class', 'overview-map-nodes');
  11605. viewport.setAttribute('class', 'overview-map-viewport');
  11606. viewport.setAttribute('rx', '3');
  11607. viewport.setAttribute('ry', '3');
  11608. mapSvg.appendChild(nodeLayer);
  11609. mapSvg.appendChild(viewport);
  11610. surface.appendChild(mapSvg);
  11611. function nodeLabel(node, fallback) {
  11612. return node.getAttribute('data-node-label') ||
  11613. (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];
  11614. }
  11615. function build() {
  11616. if (!viewBox || viewBox.width <= 0 || viewBox.height <= 0) return false;
  11617. mapSvg.setAttribute('viewBox', [viewBox.x, viewBox.y, viewBox.width, viewBox.height].join(' '));
  11618. nodeLayer.textContent = '';
  11619. nodes = [];
  11620. Array.prototype.forEach.call(diagram.querySelectorAll('[data-node-id]'), function (node) {
  11621. var box;
  11622. try { box = node.getBBox(); } catch (_) { box = null; }
  11623. if (!box || box.width <= 0 || box.height <= 0) return;
  11624. var id = node.getAttribute('data-node-id');
  11625. var rect = document.createElementNS(namespace, 'rect');
  11626. rect.setAttribute('class', 'overview-map-node');
  11627. rect.setAttribute('x', String(box.x));
  11628. rect.setAttribute('y', String(box.y));
  11629. rect.setAttribute('width', String(Math.max(3, box.width)));
  11630. rect.setAttribute('height', String(Math.max(3, box.height)));
  11631. rect.setAttribute('rx', String(Math.max(2, Math.min(8, Math.min(box.width, box.height) * 0.1))));
  11632. rect.setAttribute('data-radar-node-id', id);
  11633. rect.setAttribute('data-kind', node.getAttribute('data-node-kind') || 'neutral');
  11634. rect.setAttribute('tabindex', '0');
  11635. rect.setAttribute('role', 'button');
  11636. rect.setAttribute('aria-label', viewerText('viewer.radar.focus', { label: nodeLabel(node, id) }));
  11637. nodeLayer.appendChild(rect);
  11638. nodes.push({ id: id, node: node, rect: rect });
  11639. });
  11640. status.textContent = viewerText('viewer.radar.fullMap', { count: nodes.length });
  11641. return true;
  11642. }
  11643. function visibleRect(element) {
  11644. if (!element || element.hidden) return null;
  11645. var rect = element.getBoundingClientRect();
  11646. if (rect.width <= 0 || rect.height <= 0 || rect.right <= 0 || rect.bottom <= 0 || rect.left >= window.innerWidth || rect.top >= window.innerHeight) return null;
  11647. return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height };
  11648. }
  11649. function panelRectAt(position) {
  11650. return {
  11651. left: position.left,
  11652. top: position.top,
  11653. right: position.left + panel.offsetWidth,
  11654. bottom: position.top + panel.offsetHeight,
  11655. width: panel.offsetWidth,
  11656. height: panel.offsetHeight
  11657. };
  11658. }
  11659. function rectsIntersect(first, second, gap) {
  11660. gap = Number(gap) || 0;
  11661. return first.left < second.right + gap &&
  11662. first.right > second.left - gap &&
  11663. first.top < second.bottom + gap &&
  11664. first.bottom > second.top - gap;
  11665. }
  11666. function intersectionArea(first, second) {
  11667. var width = Math.max(0, Math.min(first.right, second.right) - Math.max(first.left, second.left));
  11668. var height = Math.max(0, Math.min(first.bottom, second.bottom) - Math.max(first.top, second.top));
  11669. return width * height;
  11670. }
  11671. function clamp(value, minimum, maximum) {
  11672. if (maximum < minimum) return minimum;
  11673. return Math.max(minimum, Math.min(maximum, value));
  11674. }
  11675. function placementContext() {
  11676. var containerRect = visibleRect(container);
  11677. if (!containerRect) return null;
  11678. var controlRect = visibleRect(navigation);
  11679. var left = Math.max(placementGap, containerRect.left + placementGap);
  11680. var top = Math.max(placementGap, containerRect.top + placementGap);
  11681. var right = Math.min(window.innerWidth - placementGap, containerRect.right - placementGap);
  11682. var bottom = Math.min(window.innerHeight - placementGap, containerRect.bottom - placementGap);
  11683. if (controlRect) bottom = Math.min(bottom, controlRect.top - placementGap);
  11684. var lens = document.getElementById('focus-chip');
  11685. var lensRect = visibleRect(lens);
  11686. var legendRect = visibleRect(diagram.querySelector('[data-legend]'));
  11687. var active = diagram.querySelector('[data-focus-selected]');
  11688. var activeRect = visibleRect(active);
  11689. return {
  11690. bounds: { left: left, top: top, right: right, bottom: bottom },
  11691. hardBlockers: [lensRect, controlRect, legendRect].filter(Boolean),
  11692. softBlockers: [activeRect].filter(Boolean),
  11693. preferredSide: !activeRect || activeRect.left + activeRect.width / 2 > window.innerWidth / 2 ? 'left' : 'right'
  11694. };
  11695. }
  11696. function positionIsValid(position, context) {
  11697. if (!position || !context) return false;
  11698. var rect = panelRectAt(position);
  11699. var bounds = context.bounds;
  11700. if (rect.left < bounds.left || rect.top < bounds.top || rect.right > bounds.right || rect.bottom > bounds.bottom) return false;
  11701. return context.hardBlockers.every(function (blocker) { return !rectsIntersect(rect, blocker, placementGap); });
  11702. }
  11703. function cornerCandidates(context) {
  11704. var bounds = context.bounds;
  11705. var left = bounds.left;
  11706. var right = Math.max(left, bounds.right - panel.offsetWidth);
  11707. var top = bounds.top;
  11708. var bottom = Math.max(top, bounds.bottom - panel.offsetHeight);
  11709. var preferredLeft = context.preferredSide === 'left' ? left : right;
  11710. var alternateLeft = context.preferredSide === 'left' ? right : left;
  11711. return [
  11712. { left: preferredLeft, top: bottom },
  11713. { left: alternateLeft, top: bottom },
  11714. { left: preferredLeft, top: top },
  11715. { left: alternateLeft, top: top }
  11716. ].filter(function (candidate, index, all) {
  11717. return all.findIndex(function (other) { return other.left === candidate.left && other.top === candidate.top; }) === index;
  11718. });
  11719. }
  11720. function nearbyCandidates(context, reference) {
  11721. var bounds = context.bounds;
  11722. var maximumLeft = bounds.right - panel.offsetWidth;
  11723. var maximumTop = bounds.bottom - panel.offsetHeight;
  11724. var requested = reference ? {
  11725. left: clamp(reference.left, bounds.left, maximumLeft),
  11726. top: clamp(reference.top, bounds.top, maximumTop)
  11727. } : null;
  11728. var horizontal = [bounds.left, maximumLeft];
  11729. var vertical = [bounds.top, maximumTop];
  11730. if (requested) {
  11731. horizontal.push(requested.left);
  11732. vertical.push(requested.top);
  11733. }
  11734. context.hardBlockers.forEach(function (blocker) {
  11735. horizontal.push(
  11736. blocker.left - placementGap - panel.offsetWidth,
  11737. blocker.right + placementGap
  11738. );
  11739. vertical.push(
  11740. blocker.top - placementGap - panel.offsetHeight,
  11741. blocker.bottom + placementGap
  11742. );
  11743. });
  11744. horizontal = horizontal.map(function (left) { return clamp(left, bounds.left, maximumLeft); });
  11745. vertical = vertical.map(function (top) { return clamp(top, bounds.top, maximumTop); });
  11746. var candidates = [];
  11747. horizontal.forEach(function (left) {
  11748. vertical.forEach(function (top) { candidates.push({ left: left, top: top }); });
  11749. });
  11750. return candidates.filter(function (candidate, index, all) {
  11751. return all.findIndex(function (other) { return other.left === candidate.left && other.top === candidate.top; }) === index;
  11752. });
  11753. }
  11754. function placementScore(position, context, reference, softWeight) {
  11755. var rect = panelRectAt(position);
  11756. var referenceLeft = reference ? reference.left : (context.preferredSide === 'left' ? context.bounds.left : context.bounds.right - panel.offsetWidth);
  11757. var referenceTop = reference ? reference.top : context.bounds.bottom - panel.offsetHeight;
  11758. var distance = Math.pow(position.left - referenceLeft, 2) + Math.pow(position.top - referenceTop, 2);
  11759. var softOverlap = context.softBlockers.reduce(function (total, blocker) { return total + intersectionArea(rect, blocker); }, 0);
  11760. return distance + softOverlap * softWeight;
  11761. }
  11762. function chooseRadarPlacement(context, reference, options) {
  11763. options = options || {};
  11764. var softWeight = Number.isFinite(options.softWeight) ? options.softWeight : 100;
  11765. var candidates = nearbyCandidates(context, reference).concat(cornerCandidates(context));
  11766. var valid = candidates.filter(function (candidate) { return positionIsValid(candidate, context); });
  11767. valid.sort(function (first, second) {
  11768. return placementScore(first, context, reference, softWeight) - placementScore(second, context, reference, softWeight);
  11769. });
  11770. return valid.length ? valid[0] : null;
  11771. }
  11772. function applyPlacement(position, remember) {
  11773. var useLeft = position.left + panel.offsetWidth / 2 <= window.innerWidth / 2;
  11774. panel.setAttribute('data-docked', 'true');
  11775. panel.setAttribute('data-dock-side', useLeft ? 'left' : 'right');
  11776. if (useLeft) {
  11777. panel.style.setProperty('--archify-radar-left', Math.round(position.left) + 'px');
  11778. panel.style.removeProperty('--archify-radar-right');
  11779. } else {
  11780. panel.style.setProperty('--archify-radar-right', Math.round(window.innerWidth - position.left - panel.offsetWidth) + 'px');
  11781. panel.style.removeProperty('--archify-radar-left');
  11782. }
  11783. panel.style.setProperty('--archify-radar-top', Math.round(position.top) + 'px');
  11784. if (remember !== false) lastPlacement = { left: position.left, top: position.top };
  11785. }
  11786. function resetDockingStyles() {
  11787. panel.removeAttribute('data-docked');
  11788. panel.removeAttribute('data-dock-side');
  11789. panel.removeAttribute('data-panel-dragging');
  11790. panel.removeAttribute('data-placement-invalid');
  11791. panel.removeAttribute('data-placement-degraded');
  11792. panel.removeAttribute('data-placement-unavailable');
  11793. panel.removeAttribute('data-compact');
  11794. panel.removeAttribute('title');
  11795. panel.style.removeProperty('visibility');
  11796. panel.style.removeProperty('--archify-radar-right');
  11797. panel.style.removeProperty('--archify-radar-left');
  11798. panel.style.removeProperty('--archify-radar-top');
  11799. }
  11800. function updateDocking() {
  11801. var options = arguments[0] || {};
  11802. if (panel.hidden) return false;
  11803. if (panelDrag) return true;
  11804. panel.removeAttribute('data-compact');
  11805. panel.removeAttribute('data-placement-degraded');
  11806. panel.removeAttribute('data-placement-invalid');
  11807. panel.removeAttribute('data-placement-unavailable');
  11808. panel.removeAttribute('title');
  11809. panel.style.removeProperty('visibility');
  11810. var context = placementContext();
  11811. if (!context) {
  11812. resetDockingStyles();
  11813. return false;
  11814. }
  11815. var reference = manualPosition || lastPlacement;
  11816. var placementOptions = { softWeight: manualPosition ? 0 : 100 };
  11817. var placement = manualPosition && positionIsValid(manualPosition, context)
  11818. ? manualPosition
  11819. : chooseRadarPlacement(context, reference, placementOptions);
  11820. var compact = false;
  11821. if (!placement && options.allowCompact !== false) {
  11822. compact = true;
  11823. panel.setAttribute('data-compact', 'true');
  11824. panel.setAttribute('data-placement-degraded', 'true');
  11825. panel.setAttribute('title', viewerText('viewer.radar.compacted'));
  11826. context = placementContext();
  11827. placement = chooseRadarPlacement(context, reference, placementOptions);
  11828. }
  11829. if (!placement) {
  11830. resetDockingStyles();
  11831. panel.setAttribute('data-placement-unavailable', 'true');
  11832. return false;
  11833. }
  11834. if (manualPosition && !compact) manualPosition = { left: placement.left, top: placement.top };
  11835. applyPlacement(placement, true);
  11836. return true;
  11837. }
  11838. function clearSpaceRetry() {
  11839. if (spaceRetryTimer) window.clearTimeout(spaceRetryTimer);
  11840. spaceRetryTimer = 0;
  11841. }
  11842. function yieldPassport() {
  11843. if (!passport || passport.hidden || passportYielded) return passportYielded;
  11844. passportPreviousAriaHidden = passport.getAttribute('aria-hidden');
  11845. passportYielded = true;
  11846. passport.setAttribute('data-radar-yielded', 'true');
  11847. passport.setAttribute('aria-hidden', 'true');
  11848. return true;
  11849. }
  11850. function restorePassport() {
  11851. if (!passport || !passportYielded) return;
  11852. passportYielded = false;
  11853. passport.removeAttribute('data-radar-yielded');
  11854. if (passportPreviousAriaHidden === null) passport.removeAttribute('aria-hidden');
  11855. else passport.setAttribute('aria-hidden', passportPreviousAriaHidden);
  11856. passportPreviousAriaHidden = null;
  11857. }
  11858. function reflectVisible() {
  11859. panel.hidden = false;
  11860. panel.removeAttribute('data-placement-unavailable');
  11861. trigger.setAttribute('aria-expanded', 'true');
  11862. trigger.removeAttribute('data-radar-space-limited');
  11863. trigger.setAttribute('aria-label', viewerText('viewer.radar.close'));
  11864. trigger.title = viewerText('viewer.nav.radar.title');
  11865. feedback.hidden = true;
  11866. }
  11867. function scheduleSpaceRetry() {
  11868. if (!requestedOpen || spaceRetryTimer || spaceRetryCount >= 4) return;
  11869. spaceRetryCount += 1;
  11870. spaceRetryTimer = window.setTimeout(function () {
  11871. spaceRetryTimer = 0;
  11872. attemptRequestedOpen();
  11873. }, 60);
  11874. }
  11875. function reflectUnavailable() {
  11876. restorePassport();
  11877. panel.hidden = true;
  11878. panel.setAttribute('data-placement-unavailable', 'true');
  11879. trigger.setAttribute('aria-expanded', 'false');
  11880. trigger.setAttribute('aria-label', viewerText('viewer.radar.cancelWaiting'));
  11881. trigger.setAttribute('data-radar-space-limited', 'true');
  11882. trigger.title = viewerText('viewer.radar.needsSpace');
  11883. feedback.hidden = false;
  11884. scheduleSpaceRetry();
  11885. }
  11886. function attemptRequestedOpen(options) {
  11887. options = options || {};
  11888. if (!requestedOpen) return false;
  11889. panel.hidden = false;
  11890. if (!updateDocking(options)) {
  11891. reflectUnavailable();
  11892. return false;
  11893. }
  11894. clearSpaceRetry();
  11895. spaceRetryCount = 0;
  11896. reflectVisible();
  11897. sync();
  11898. if (options.focus === true && !panel.hasAttribute('data-compact')) surface.focus();
  11899. return true;
  11900. }
  11901. function expandCompactRadar() {
  11902. if (!requestedOpen || panel.hidden || !panel.hasAttribute('data-compact')) return false;
  11903. yieldPassport();
  11904. if (!updateDocking({ allowCompact: false })) {
  11905. restorePassport();
  11906. if (!updateDocking()) {
  11907. reflectUnavailable();
  11908. return false;
  11909. }
  11910. }
  11911. reflectVisible();
  11912. sync();
  11913. if (!panel.hasAttribute('data-compact')) surface.focus();
  11914. return !panel.hasAttribute('data-compact');
  11915. }
  11916. function syncNow() {
  11917. syncFrame = 0;
  11918. if (panel.hidden || !Archify.view || typeof Archify.view.logicalViewport !== 'function') return;
  11919. if (!updateDocking()) {
  11920. reflectUnavailable();
  11921. return;
  11922. }
  11923. if (passportYielded && panel.hasAttribute('data-compact')) {
  11924. restorePassport();
  11925. if (!updateDocking()) {
  11926. reflectUnavailable();
  11927. return;
  11928. }
  11929. }
  11930. reflectVisible();
  11931. var visible = Archify.view.logicalViewport();
  11932. if (!visible) return;
  11933. viewport.setAttribute('x', String(visible.x));
  11934. viewport.setAttribute('y', String(visible.y));
  11935. viewport.setAttribute('width', String(visible.width));
  11936. viewport.setAttribute('height', String(visible.height));
  11937. var full = visible.width >= viewBox.width * 0.98 && visible.height >= viewBox.height * 0.98;
  11938. var mobileWide = window.innerWidth <= 720 && container.hasAttribute('data-wide-diagram');
  11939. var viewportCopy = full
  11940. ? viewerText('viewer.radar.viewport.full')
  11941. : (mobileWide
  11942. ? viewerText('viewer.radar.viewport.width', { percent: Math.round(visible.width / viewBox.width * 100) })
  11943. : viewerText('viewer.radar.viewport.scale', { percent: Math.round(visible.scale * 100) }));
  11944. status.textContent = viewerText('viewer.radar.status', { count: nodes.length, viewport: viewportCopy });
  11945. nodes.forEach(function (item) {
  11946. var active = item.node.hasAttribute('data-focus-selected');
  11947. if (active) item.rect.setAttribute('data-radar-active', 'true');
  11948. else item.rect.removeAttribute('data-radar-active');
  11949. });
  11950. }
  11951. function sync() {
  11952. if (requestedOpen && panel.hidden) {
  11953. attemptRequestedOpen();
  11954. return;
  11955. }
  11956. if (syncFrame) return;
  11957. syncFrame = requestAnimationFrame(syncNow);
  11958. }
  11959. function setOpen(next, options) {
  11960. options = options || {};
  11961. next = Boolean(next);
  11962. if (next && Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  11963. if (next && Archify.semanticLens && Archify.semanticLens.isOpen()) {
  11964. Archify.semanticLens.close({ restoreFocus: false });
  11965. }
  11966. requestedOpen = next;
  11967. if (next) {
  11968. clearSpaceRetry();
  11969. spaceRetryCount = 0;
  11970. trigger.setAttribute('data-radar-requested', 'true');
  11971. build();
  11972. attemptRequestedOpen(options);
  11973. } else {
  11974. clearSpaceRetry();
  11975. spaceRetryCount = 0;
  11976. viewportDrag = null;
  11977. panelDrag = null;
  11978. container.classList.remove('is-panning');
  11979. panel.hidden = true;
  11980. resetDockingStyles();
  11981. restorePassport();
  11982. feedback.hidden = true;
  11983. // Focus before collapsing: the dock hides this trigger at 100% unless it holds focus.
  11984. if (options.restoreFocus === true) trigger.focus();
  11985. trigger.setAttribute('aria-expanded', 'false');
  11986. trigger.removeAttribute('data-radar-requested');
  11987. trigger.removeAttribute('data-radar-space-limited');
  11988. trigger.setAttribute('aria-label', viewerText('viewer.nav.radar'));
  11989. trigger.title = viewerText('viewer.nav.radar.title');
  11990. }
  11991. return next;
  11992. }
  11993. function toggle() { return setOpen(!requestedOpen, { focus: false }); }
  11994. function close(options) { return setOpen(false, options); }
  11995. function bringNodeIntoWindow(node) {
  11996. var delay = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 540;
  11997. window.setTimeout(function () {
  11998. var rect = node.getBoundingClientRect();
  11999. var safeTop = 64;
  12000. var safeBottom = window.innerHeight - 64;
  12001. if (rect.top >= safeTop && rect.bottom <= safeBottom) return;
  12002. var top = Math.max(0, window.scrollY + rect.top + rect.height / 2 - window.innerHeight / 2);
  12003. try { window.scrollTo({ top: top, behavior: delay ? 'smooth' : 'auto' }); }
  12004. catch (_) { window.scrollTo(0, top); }
  12005. }, delay);
  12006. }
  12007. function focusNode(id) {
  12008. var main = diagram.querySelector('[data-node-id="' + id + '"]');
  12009. if (!main) return false;
  12010. if (Archify.focus && typeof Archify.focus.set === 'function') {
  12011. Archify.focus.set(id, { toggle: false });
  12012. }
  12013. if (Archify.view && typeof Archify.view.reveal === 'function') {
  12014. Archify.view.reveal([id], { includeNeighbors: true, reason: 'radar' });
  12015. }
  12016. bringNodeIntoWindow(main);
  12017. try { main.focus({ preventScroll: true }); } catch (_) { try { main.focus(); } catch (_) {} }
  12018. sync();
  12019. return true;
  12020. }
  12021. function diagramPoint(event) {
  12022. var matrix = mapSvg.getScreenCTM();
  12023. if (!matrix) return null;
  12024. var point = mapSvg.createSVGPoint();
  12025. point.x = event.clientX;
  12026. point.y = event.clientY;
  12027. return point.matrixTransform(matrix.inverse());
  12028. }
  12029. function navigate(event) {
  12030. var point = diagramPoint(event);
  12031. if (!point || !Archify.view || typeof Archify.view.centerAt !== 'function') return;
  12032. Archify.view.centerAt(point.x, point.y, { minimumScale: 1.5, instant: true });
  12033. sync();
  12034. }
  12035. function endViewportDrag(event) {
  12036. if (!viewportDrag) return;
  12037. viewportDrag = null;
  12038. panel.removeAttribute('data-dragging');
  12039. container.classList.remove('is-panning');
  12040. try { surface.releasePointerCapture(event.pointerId); } catch (_) {}
  12041. }
  12042. function beginPanelDrag(event) {
  12043. if (event.button !== 0 || event.target.closest('button, a, input, [role="button"]')) return;
  12044. var context = placementContext();
  12045. if (!context) return;
  12046. var rect = panel.getBoundingClientRect();
  12047. event.preventDefault();
  12048. event.stopPropagation();
  12049. panelDrag = {
  12050. pointerId: event.pointerId,
  12051. originX: event.clientX,
  12052. originY: event.clientY,
  12053. start: { left: rect.left, top: rect.top },
  12054. current: { left: rect.left, top: rect.top },
  12055. previousManual: manualPosition ? { left: manualPosition.left, top: manualPosition.top } : null
  12056. };
  12057. panel.setAttribute('data-panel-dragging', 'true');
  12058. try { panelHead.setPointerCapture(event.pointerId); } catch (_) {}
  12059. }
  12060. function movePanelDrag(event) {
  12061. if (!panelDrag || panelDrag.pointerId !== event.pointerId) return;
  12062. var context = placementContext();
  12063. if (!context) return;
  12064. event.preventDefault();
  12065. event.stopPropagation();
  12066. var bounds = context.bounds;
  12067. var position = {
  12068. left: clamp(panelDrag.start.left + event.clientX - panelDrag.originX, bounds.left, bounds.right - panel.offsetWidth),
  12069. top: clamp(panelDrag.start.top + event.clientY - panelDrag.originY, bounds.top, bounds.bottom - panel.offsetHeight)
  12070. };
  12071. panelDrag.current = position;
  12072. if (positionIsValid(position, context)) panel.removeAttribute('data-placement-invalid');
  12073. else panel.setAttribute('data-placement-invalid', 'true');
  12074. applyPlacement(position, false);
  12075. }
  12076. function finishPanelDrag(event, cancel) {
  12077. if (!panelDrag || panelDrag.pointerId !== event.pointerId) return;
  12078. event.preventDefault();
  12079. event.stopPropagation();
  12080. var activeDrag = panelDrag;
  12081. panelDrag = null;
  12082. panel.removeAttribute('data-panel-dragging');
  12083. panel.removeAttribute('data-placement-invalid');
  12084. try { panelHead.releasePointerCapture(event.pointerId); } catch (_) {}
  12085. var context = placementContext();
  12086. if (!context) return;
  12087. if (cancel) {
  12088. manualPosition = activeDrag.previousManual;
  12089. lastPlacement = { left: activeDrag.start.left, top: activeDrag.start.top };
  12090. updateDocking();
  12091. return;
  12092. }
  12093. var requested = activeDrag.current;
  12094. manualPosition = { left: requested.left, top: requested.top };
  12095. updateDocking();
  12096. }
  12097. trigger.addEventListener('click', toggle);
  12098. closeBtn.addEventListener('click', function () { close({ restoreFocus: true }); });
  12099. expandBtn.addEventListener('click', expandCompactRadar);
  12100. panelHead.addEventListener('pointerdown', beginPanelDrag);
  12101. panelHead.addEventListener('pointermove', movePanelDrag);
  12102. panelHead.addEventListener('pointerup', function (event) { finishPanelDrag(event, false); });
  12103. panelHead.addEventListener('pointercancel', function (event) { finishPanelDrag(event, true); });
  12104. surface.addEventListener('pointerdown', function (event) {
  12105. if (event.button !== 0 || event.target.closest('[data-radar-node-id]')) return;
  12106. event.preventDefault();
  12107. viewportDrag = { pointerId: event.pointerId };
  12108. panel.setAttribute('data-dragging', 'true');
  12109. container.classList.add('is-panning');
  12110. try { surface.setPointerCapture(event.pointerId); } catch (_) {}
  12111. navigate(event);
  12112. });
  12113. surface.addEventListener('pointermove', function (event) {
  12114. if (!viewportDrag || viewportDrag.pointerId !== event.pointerId) return;
  12115. navigate(event);
  12116. });
  12117. surface.addEventListener('pointerup', endViewportDrag);
  12118. surface.addEventListener('pointercancel', endViewportDrag);
  12119. surface.addEventListener('click', function (event) {
  12120. var node = event.target.closest('[data-radar-node-id]');
  12121. if (node) focusNode(node.getAttribute('data-radar-node-id'));
  12122. });
  12123. surface.addEventListener('keydown', function (event) {
  12124. if (event.key === 'Escape') {
  12125. event.preventDefault();
  12126. event.stopPropagation();
  12127. close({ restoreFocus: true });
  12128. return;
  12129. }
  12130. var node = event.target.closest('[data-radar-node-id]');
  12131. if (node && (event.key === 'Enter' || event.key === ' ')) {
  12132. event.preventDefault();
  12133. focusNode(node.getAttribute('data-radar-node-id'));
  12134. return;
  12135. }
  12136. if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight' && event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return;
  12137. var visible = Archify.view && Archify.view.logicalViewport ? Archify.view.logicalViewport() : null;
  12138. if (!visible) return;
  12139. event.preventDefault();
  12140. var x = visible.x + visible.width / 2;
  12141. var y = visible.y + visible.height / 2;
  12142. var stepX = Math.max(12, visible.width * 0.24);
  12143. var stepY = Math.max(12, visible.height * 0.24);
  12144. if (event.key === 'ArrowLeft') x -= stepX;
  12145. else if (event.key === 'ArrowRight') x += stepX;
  12146. else if (event.key === 'ArrowUp') y -= stepY;
  12147. else y += stepY;
  12148. Archify.view.centerAt(x, y, { minimumScale: 1.5, instant: true });
  12149. sync();
  12150. });
  12151. document.addEventListener('keydown', function (event) {
  12152. if (!panelDrag || event.key !== 'Escape') return;
  12153. finishPanelDrag({
  12154. pointerId: panelDrag.pointerId,
  12155. preventDefault: function () { event.preventDefault(); },
  12156. stopPropagation: function () { event.stopPropagation(); }
  12157. }, true);
  12158. }, true);
  12159. function reflow() {
  12160. if (!requestedOpen) return;
  12161. clearSpaceRetry();
  12162. spaceRetryCount = 0;
  12163. sync();
  12164. }
  12165. window.addEventListener('resize', reflow);
  12166. window.addEventListener('scroll', reflow, { passive: true });
  12167. if (typeof ResizeObserver === 'function') {
  12168. var radarResizeObserver = new ResizeObserver(function (entries) {
  12169. if (!requestedOpen) return;
  12170. if (panel.hidden && entries.every(function (entry) { return entry.target === panel; })) return;
  12171. reflow();
  12172. });
  12173. [container, navigation, document.getElementById('focus-chip'), panel].filter(Boolean).forEach(function (element) {
  12174. radarResizeObserver.observe(element);
  12175. });
  12176. }
  12177. requestAnimationFrame(build);
  12178. return {
  12179. open: function () { return setOpen(true); },
  12180. close: close,
  12181. toggle: toggle,
  12182. sync: sync,
  12183. focus: focusNode,
  12184. isOpen: function () { return requestedOpen; },
  12185. count: function () { return nodes.length; }
  12186. };
  12187. })();
  12188. /* ============================================================
  12189. Presentation Stage — a shareable, viewport-filling live view.
  12190. It changes only HTML layout and URL state; SVG semantics and export
  12191. serialization remain untouched. Escape first clears an active
  12192. focus, then exits the stage.
  12193. ============================================================ */
  12194. Archify.presentation = (function () {
  12195. var html = document.documentElement;
  12196. var btn = document.getElementById('btn-present');
  12197. var label = document.getElementById('present-label');
  12198. var previousScrollY = 0;
  12199. function active() { return html.getAttribute('data-present') === 'true'; }
  12200. function updateUrl(next) {
  12201. try {
  12202. var url = new URL(window.location.href);
  12203. if (next) url.searchParams.set('present', '1');
  12204. else url.searchParams.delete('present');
  12205. history.replaceState(null, '', url.pathname + url.search + url.hash);
  12206. } catch (_) {}
  12207. }
  12208. function render(next) {
  12209. btn.setAttribute('aria-pressed', next ? 'true' : 'false');
  12210. btn.setAttribute('aria-label', viewerText(next ? 'viewer.present.exit' : 'viewer.present.enter'));
  12211. btn.title = viewerText(next ? 'viewer.present.exit.title' : 'viewer.present.enter.title');
  12212. label.textContent = viewerText(next ? 'viewer.present.exit.label' : 'viewer.present.present');
  12213. }
  12214. function setActive(next, options) {
  12215. options = options || {};
  12216. next = Boolean(next);
  12217. if (next === active()) {
  12218. render(next);
  12219. return next;
  12220. }
  12221. if (next) {
  12222. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  12223. previousScrollY = window.scrollY || 0;
  12224. html.setAttribute('data-present', 'true');
  12225. try { window.scrollTo(0, 0); } catch (_) {}
  12226. } else {
  12227. html.removeAttribute('data-present');
  12228. }
  12229. render(next);
  12230. if (options.updateUrl !== false) updateUrl(next);
  12231. requestAnimationFrame(function () {
  12232. if (Archify.view && typeof Archify.view.reset === 'function') {
  12233. Archify.view.reset({ automatic: true });
  12234. requestAnimationFrame(function () {
  12235. if (Archify.view && typeof Archify.view.sync === 'function') Archify.view.sync();
  12236. });
  12237. }
  12238. if (!next && previousScrollY) {
  12239. try { window.scrollTo(0, previousScrollY); } catch (_) {}
  12240. }
  12241. });
  12242. return next;
  12243. }
  12244. function toggle() { return setActive(!active()); }
  12245. render(active());
  12246. btn.addEventListener('click', toggle);
  12247. return {
  12248. enter: function () { return setActive(true); },
  12249. exit: function () { return setActive(false); },
  12250. toggle: toggle,
  12251. active: active
  12252. };
  12253. })();
  12254. /* ============================================================
  12255. Node Finder — stable-ID search over the existing semantic SVG.
  12256. Search never changes the IR or SVG geometry: selecting a result resets
  12257. the viewport and delegates to semantic focus.
  12258. ============================================================ */
  12259. Archify.finder = (function () {
  12260. var html = document.documentElement;
  12261. var container = document.querySelector('.diagram-container');
  12262. var svg = container.querySelector('svg');
  12263. var trigger = document.getElementById('btn-node-finder');
  12264. var panel = document.getElementById('node-finder');
  12265. var heading = document.getElementById('node-finder-title');
  12266. var closeBtn = document.getElementById('node-finder-close');
  12267. var input = document.getElementById('node-finder-input');
  12268. var results = document.getElementById('node-finder-results');
  12269. var empty = document.getElementById('node-finder-empty');
  12270. var status = document.getElementById('node-finder-status');
  12271. var visibleItems = [];
  12272. function defaultContext() {
  12273. return {
  12274. kind: 'focus',
  12275. title: viewerText('viewer.finder.title'),
  12276. placeholder: viewerText('viewer.finder.placeholder'),
  12277. empty: viewerText('viewer.finder.empty'),
  12278. resultsLabel: viewerText('viewer.finder.results'),
  12279. availableNoun: viewerText('viewer.finder.noun.nodes'),
  12280. allowedIds: null,
  12281. badges: null
  12282. };
  12283. }
  12284. var context = defaultContext();
  12285. function semanticType(node) {
  12286. var authored = node.getAttribute('data-node-kind');
  12287. if (authored) return authored;
  12288. var types = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
  12289. return types.find(function (type) { return node.querySelector('.c-' + type); }) || 'node';
  12290. }
  12291. function connectionsFor(id) {
  12292. var count = 0;
  12293. var seen = {};
  12294. Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
  12295. var from = edge.getAttribute('data-edge-from');
  12296. var to = edge.getAttribute('data-edge-to');
  12297. var key = from + '\u0000' + to;
  12298. if ((from === id || to === id) && !seen[key]) {
  12299. seen[key] = true;
  12300. count += 1;
  12301. }
  12302. });
  12303. return count;
  12304. }
  12305. var items = Array.prototype.map.call(svg.querySelectorAll('[data-node-id]'), function (node) {
  12306. var id = node.getAttribute('data-node-id');
  12307. var label = node.getAttribute('data-node-label') || (node.getAttribute('aria-label') || id).replace(/^Focus\s+/, '');
  12308. var text = (node.textContent || '').replace(/\s+/g, ' ').trim();
  12309. var sublabel = node.getAttribute('data-node-sublabel') || '';
  12310. var context = node.getAttribute('data-node-context') || '';
  12311. var tag = node.getAttribute('data-node-tag') || '';
  12312. var brand = node.getAttribute('data-node-brand') || '';
  12313. var type = semanticType(node);
  12314. var sources = Archify.sourceEvidence.node(id);
  12315. var sourceSearch = sources.map(function (source) {
  12316. return [source.path, source.label, source.line, source.endLine].filter(Boolean).join(' ');
  12317. }).join(' ');
  12318. return {
  12319. id: id,
  12320. label: label,
  12321. type: type,
  12322. sublabel: sublabel,
  12323. context: context,
  12324. tag: tag,
  12325. brand: brand,
  12326. sources: sources,
  12327. links: connectionsFor(id),
  12328. search: (id + ' ' + label + ' ' + type + ' ' + sublabel + ' ' + context + ' ' + tag + ' ' + sourceSearch + ' ' + text).toLowerCase() + ' ' + brand.toLowerCase(),
  12329. node: node
  12330. };
  12331. });
  12332. function resultButtons() {
  12333. return Array.prototype.slice.call(results.querySelectorAll('.node-finder-result'));
  12334. }
  12335. function resolveContext(options) {
  12336. var requested = options && options.context ? options.context : null;
  12337. if (!requested && Archify.routeProbe && typeof Archify.routeProbe.finderContext === 'function') {
  12338. requested = Archify.routeProbe.finderContext();
  12339. }
  12340. if (!requested) return defaultContext();
  12341. var resolved = defaultContext();
  12342. Object.keys(requested).forEach(function (key) { resolved[key] = requested[key]; });
  12343. return resolved;
  12344. }
  12345. function availableItems() {
  12346. if (!context.allowedIds) return items.slice();
  12347. return items.filter(function (item) { return context.allowedIds.indexOf(item.id) !== -1; });
  12348. }
  12349. function applyContext() {
  12350. panel.setAttribute('data-context', context.kind);
  12351. heading.textContent = context.title;
  12352. input.placeholder = context.placeholder;
  12353. empty.textContent = context.empty;
  12354. results.setAttribute('aria-label', context.resultsLabel);
  12355. }
  12356. function select(id) {
  12357. var item = items.find(function (candidate) { return candidate.id === id; });
  12358. if (!item) return false;
  12359. var routeSelection = context.kind === 'route-source' || context.kind === 'route-target';
  12360. if (routeSelection) {
  12361. if (!Archify.routeProbe || typeof Archify.routeProbe.choose !== 'function' || !Archify.routeProbe.choose(id)) return false;
  12362. if (Archify.routeProbe.active() === 'target' && Archify.view && typeof Archify.view.reveal === 'function') {
  12363. Archify.view.reveal([id], { includeNeighbors: true, reason: 'route-pick' });
  12364. }
  12365. close({ restoreFocus: false });
  12366. try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }
  12367. return true;
  12368. }
  12369. if (Archify.view && typeof Archify.view.reset === 'function') Archify.view.reset({ automatic: true });
  12370. Archify.focus.set(id, { toggle: false });
  12371. if (Archify.view && typeof Archify.view.reveal === 'function') {
  12372. Archify.view.reveal([id], { includeNeighbors: true, reason: 'finder' });
  12373. }
  12374. close({ restoreFocus: false });
  12375. try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }
  12376. return true;
  12377. }
  12378. function render(query) {
  12379. query = (query || '').trim().toLowerCase();
  12380. var available = availableItems();
  12381. visibleItems = available.filter(function (item) { return !query || item.search.indexOf(query) !== -1; });
  12382. results.textContent = '';
  12383. visibleItems.forEach(function (item) {
  12384. var button = document.createElement('button');
  12385. button.type = 'button';
  12386. button.className = 'node-finder-result';
  12387. button.setAttribute('data-node-id', item.id);
  12388. var badge = context.badges && context.badges[item.id]
  12389. ? context.badges[item.id]
  12390. : context.kind === 'focus'
  12391. ? viewerCount('viewer.finder.link', item.links)
  12392. : String(item.links);
  12393. var action = context.kind === 'route-source'
  12394. ? viewerText('viewer.finder.result.routeStart', { label: item.label })
  12395. : context.kind === 'route-target'
  12396. ? viewerText('viewer.finder.result.routeTarget', { label: item.label, links: badge })
  12397. : viewerCount('viewer.finder.result.focus', item.links, { label: item.label });
  12398. button.setAttribute('aria-label', action);
  12399. var name = document.createElement('strong');
  12400. name.textContent = item.label;
  12401. var links = document.createElement('em');
  12402. links.textContent = badge;
  12403. links.title = context.kind === 'focus' ? badge : action;
  12404. if (item.links === 0) links.setAttribute('data-zero', 'true');
  12405. var meta = document.createElement('small');
  12406. meta.textContent = [viewerKindLabel(item.type), item.id, item.sublabel, item.tag].filter(Boolean).join(' \u00b7 ');
  12407. meta.title = [viewerKindLabel(item.type), item.id, item.context, item.sublabel, item.tag].filter(Boolean).join(' \u00b7 ');
  12408. button.appendChild(name);
  12409. button.appendChild(links);
  12410. button.appendChild(meta);
  12411. button.addEventListener('click', function () { select(item.id); });
  12412. results.appendChild(button);
  12413. });
  12414. empty.hidden = visibleItems.length !== 0;
  12415. status.textContent = query
  12416. ? viewerText('viewer.finder.status.filtered', {
  12417. visible: visibleItems.length,
  12418. available: available.length,
  12419. noun: context.availableNoun
  12420. })
  12421. : viewerText('viewer.finder.status.all', { available: available.length, noun: context.availableNoun });
  12422. }
  12423. function open(options) {
  12424. if (html.getAttribute('data-embed') === 'true') return false;
  12425. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  12426. if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);
  12427. if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
  12428. context = resolveContext(options || {});
  12429. applyContext();
  12430. panel.hidden = false;
  12431. trigger.setAttribute('aria-expanded', 'true');
  12432. if (context.kind.indexOf('route-') === 0 && Archify.routeProbe && typeof Archify.routeProbe.finderOpening === 'function') {
  12433. Archify.routeProbe.finderOpening();
  12434. }
  12435. input.value = '';
  12436. render('');
  12437. requestAnimationFrame(function () { input.focus(); });
  12438. return true;
  12439. }
  12440. function close(options) {
  12441. options = options || {};
  12442. var routeContext = context.kind.indexOf('route-') === 0;
  12443. panel.hidden = true;
  12444. trigger.setAttribute('aria-expanded', 'false');
  12445. input.value = '';
  12446. if (routeContext && Archify.routeProbe && typeof Archify.routeProbe.finderClosed === 'function') {
  12447. Archify.routeProbe.finderClosed({ restoreFocus: options.restoreFocus !== false });
  12448. } else if (options.restoreFocus !== false) {
  12449. trigger.focus();
  12450. }
  12451. }
  12452. function toggle() { return panel.hidden ? open() : (close(), false); }
  12453. trigger.addEventListener('click', toggle);
  12454. closeBtn.addEventListener('click', function () { close(); });
  12455. input.addEventListener('input', function () { render(input.value); });
  12456. input.addEventListener('keydown', function (event) {
  12457. if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) return;
  12458. var buttons = resultButtons();
  12459. if (event.key === 'ArrowDown' && buttons.length) {
  12460. event.preventDefault();
  12461. buttons[0].focus();
  12462. } else if (event.key === 'Enter' && visibleItems.length) {
  12463. event.preventDefault();
  12464. select(visibleItems[0].id);
  12465. }
  12466. });
  12467. results.addEventListener('keydown', function (event) {
  12468. if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) return;
  12469. var buttons = resultButtons();
  12470. var index = buttons.indexOf(document.activeElement);
  12471. if (index < 0 || !buttons.length) return;
  12472. var next = null;
  12473. if (event.key === 'ArrowDown') next = (index + 1) % buttons.length;
  12474. else if (event.key === 'ArrowUp') next = (index - 1 + buttons.length) % buttons.length;
  12475. else if (event.key === 'Home') next = 0;
  12476. else if (event.key === 'End') next = buttons.length - 1;
  12477. if (next !== null) {
  12478. event.preventDefault();
  12479. buttons[next].focus();
  12480. }
  12481. });
  12482. panel.addEventListener('keydown', function (event) {
  12483. if (event.key !== 'Escape') return;
  12484. event.preventDefault();
  12485. event.stopPropagation();
  12486. close();
  12487. });
  12488. document.addEventListener('click', function (event) {
  12489. if (!panel.hidden && !panel.contains(event.target) && !event.target.closest('[data-node-finder-trigger]')) close({ restoreFocus: false });
  12490. });
  12491. render('');
  12492. return {
  12493. open: open,
  12494. close: close,
  12495. toggle: toggle,
  12496. select: select,
  12497. isOpen: function () { return !panel.hidden; },
  12498. context: function () { return context.kind; },
  12499. count: items.length
  12500. };
  12501. })();
  12502. /* ============================================================
  12503. Node Outline — a rail index of the semantic nodes, grouped by their
  12504. authored context. Hover previews neighbors through Intent Trace;
  12505. selection delegates to the Finder's focus-and-reveal path. It reads
  12506. the canonical SVG and never changes geometry or export state.
  12507. ============================================================ */
  12508. Archify.outline = (function () {
  12509. var panel = document.getElementById('node-outline');
  12510. var list = document.getElementById('node-outline-list');
  12511. var count = document.getElementById('node-outline-count');
  12512. var svg = document.querySelector('.diagram-container > svg');
  12513. if (!panel || !list || !svg) return { count: 0 };
  12514. var TONES = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
  12515. var nodes = Array.from(svg.querySelectorAll('[data-node-id]')).filter(function (node) {
  12516. return !node.closest('[data-legend-hit], .legend') && node.getAttribute('data-node-label');
  12517. });
  12518. var buttons = Object.create(null);
  12519. function tone(node) {
  12520. var shape = node.querySelector('[class*="c-"]:not(.c-mask)');
  12521. var match = shape && /(?:^|\s)c-([a-z]+)/.exec(shape.getAttribute('class') || '');
  12522. return match && TONES.indexOf(match[1]) !== -1 ? match[1] : 'external';
  12523. }
  12524. function preview(id) {
  12525. if (Archify.intentTrace && typeof Archify.intentTrace.show === 'function') Archify.intentTrace.show(id);
  12526. }
  12527. function clearPreview() {
  12528. if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
  12529. }
  12530. function select(id) {
  12531. clearPreview();
  12532. var finder = Archify.finder;
  12533. if (finder && typeof finder.select === 'function') {
  12534. if (finder.select(id)) return;
  12535. var routeMode = Archify.routeProbe && typeof Archify.routeProbe.active === 'function' ? Archify.routeProbe.active() : 'idle';
  12536. // Only an active endpoint picker owns a refused selection.
  12537. if (routeMode === 'source' || routeMode === 'target') return;
  12538. }
  12539. if (Archify.focus && typeof Archify.focus.set === 'function') Archify.focus.set(id, { toggle: false });
  12540. }
  12541. var groups = [];
  12542. var byContext = Object.create(null);
  12543. nodes.forEach(function (node) {
  12544. // Group by the outermost context (lane or stage); deeper segments
  12545. // such as workflow groups and columns would split the index into
  12546. // one-node sections.
  12547. var context = (node.getAttribute('data-node-context') || '').split(' \u203a ')[0];
  12548. if (!byContext[context]) {
  12549. byContext[context] = { label: context, nodes: [] };
  12550. groups.push(byContext[context]);
  12551. }
  12552. byContext[context].nodes.push(node);
  12553. });
  12554. groups.forEach(function (group) {
  12555. var section = document.createElement('li');
  12556. section.className = 'node-outline-group';
  12557. if (groups.length > 1 && group.label) {
  12558. var heading = document.createElement('span');
  12559. heading.className = 'node-outline-heading';
  12560. var headingLabel = document.createElement('span');
  12561. headingLabel.textContent = group.label;
  12562. var headingCount = document.createElement('small');
  12563. headingCount.textContent = String(group.nodes.length);
  12564. heading.appendChild(headingLabel);
  12565. heading.appendChild(headingCount);
  12566. section.appendChild(heading);
  12567. }
  12568. var items = document.createElement('ul');
  12569. group.nodes.forEach(function (node) {
  12570. var id = node.getAttribute('data-node-id');
  12571. var item = document.createElement('li');
  12572. var button = document.createElement('button');
  12573. button.type = 'button';
  12574. button.className = 'node-outline-item';
  12575. button.setAttribute('data-outline-node', id);
  12576. button.style.setProperty('--outline-tone', 'var(--' + tone(node) + '-stroke)');
  12577. var dot = document.createElement('span');
  12578. dot.className = 'node-outline-dot';
  12579. dot.setAttribute('aria-hidden', 'true');
  12580. var label = document.createElement('strong');
  12581. label.textContent = node.getAttribute('data-node-label');
  12582. button.appendChild(dot);
  12583. button.appendChild(label);
  12584. var sublabel = node.getAttribute('data-node-sublabel');
  12585. if (sublabel) {
  12586. var detail = document.createElement('small');
  12587. detail.textContent = sublabel;
  12588. button.appendChild(detail);
  12589. }
  12590. button.addEventListener('pointerenter', function () { preview(id); });
  12591. button.addEventListener('focus', function () { preview(id); });
  12592. button.addEventListener('pointerleave', clearPreview);
  12593. button.addEventListener('blur', clearPreview);
  12594. button.addEventListener('click', function () { select(id); });
  12595. buttons[id] = button;
  12596. item.appendChild(button);
  12597. items.appendChild(item);
  12598. });
  12599. section.appendChild(items);
  12600. list.appendChild(section);
  12601. });
  12602. var previewing = null;
  12603. function syncCurrent() {
  12604. nodes.forEach(function (node) {
  12605. var button = buttons[node.getAttribute('data-node-id')];
  12606. if (!button) return;
  12607. if (node.getAttribute('aria-pressed') === 'true') button.setAttribute('aria-current', 'true');
  12608. else button.removeAttribute('aria-current');
  12609. });
  12610. // Mirror a diagram-side hover so the index answers "where is this?".
  12611. var active = buttons[svg.getAttribute('data-intent-trace-active') || ''] || null;
  12612. if (active === previewing) return;
  12613. if (previewing) previewing.removeAttribute('data-previewing');
  12614. previewing = active;
  12615. if (!active) return;
  12616. active.setAttribute('data-previewing', '');
  12617. if (!active.matches(':hover') && panel.offsetParent) {
  12618. var box = list.getBoundingClientRect();
  12619. var item = active.getBoundingClientRect();
  12620. if (item.top < box.top || item.bottom > box.bottom - 24) {
  12621. list.scrollTop += item.top - box.top - box.height / 2 + item.height / 2;
  12622. }
  12623. }
  12624. }
  12625. if (typeof MutationObserver === 'function') {
  12626. new MutationObserver(syncCurrent).observe(svg, { attributes: true, subtree: true, attributeFilter: ['aria-pressed', 'data-intent-trace-active'] });
  12627. }
  12628. if (count) count.textContent = String(nodes.length);
  12629. panel.hidden = nodes.length < 2;
  12630. syncCurrent();
  12631. if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') Archify.readerLayout.schedule();
  12632. return { count: nodes.length, select: select };
  12633. })();
  12634. /* ============================================================
  12635. Route Probe — shortest directed path over compiled semantics.
  12636. The graph is read from renderer-owned stable IDs and relationship
  12637. endpoints. BFS order follows authored DOM edge order, so equal-length
  12638. choices are deterministic without adding weights or a graph runtime.
  12639. ============================================================ */
  12640. Archify.routeProbe = (function () {
  12641. var html = document.documentElement;
  12642. var container = document.querySelector('.diagram-container');
  12643. var svg = container.querySelector(':scope > svg');
  12644. var trigger = document.getElementById('btn-route-probe');
  12645. var panel = document.getElementById('route-probe');
  12646. var title = document.getElementById('route-probe-title');
  12647. var path = document.getElementById('route-probe-path');
  12648. var status = document.getElementById('route-probe-status');
  12649. var findBtn = document.getElementById('route-probe-find');
  12650. var copyBtn = document.getElementById('route-probe-copy');
  12651. var clearBtn = document.getElementById('route-probe-clear');
  12652. var journeyControls = document.getElementById('route-journey-controls');
  12653. var journeyPrevBtn = document.getElementById('route-journey-prev');
  12654. var journeyPlayBtn = document.getElementById('route-journey-play');
  12655. var journeyPlayIcon = document.getElementById('route-journey-play-icon');
  12656. var journeyPlayLabel = document.getElementById('route-journey-play-label');
  12657. var journeyNextBtn = document.getElementById('route-journey-next');
  12658. var journeyOverviewBtn = document.getElementById('route-journey-overview');
  12659. var namespace = 'http://www.w3.org/2000/svg';
  12660. var mode = 'idle';
  12661. var startId = null;
  12662. var endId = null;
  12663. var activeNodeIds = [];
  12664. var activeEdges = [];
  12665. var journeyIndex = -1;
  12666. var journeyPlaying = false;
  12667. var journeyComplete = false;
  12668. var journeyGeneration = 0;
  12669. var journeyTimer = null;
  12670. var journeyStartedAt = 0;
  12671. var journeyElapsedMs = 0;
  12672. var journeyOwnerToken = 0;
  12673. var JOURNEY_DWELL_MS = 1100;
  12674. function nodes() {
  12675. return Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
  12676. }
  12677. function edges() {
  12678. return Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
  12679. }
  12680. function nodesById() {
  12681. var out = Object.create(null);
  12682. nodes().forEach(function (node) { out[node.getAttribute('data-node-id')] = node; });
  12683. return out;
  12684. }
  12685. function nodeLabel(node, fallback) {
  12686. return node.getAttribute('data-node-label') ||
  12687. (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '').split(',')[0];
  12688. }
  12689. function exportSnapshot() {
  12690. if (mode !== 'result' || activeNodeIds.length < 2 || activeEdges.length !== activeNodeIds.length - 1) return null;
  12691. var allNodes = nodes();
  12692. var byId = nodesById();
  12693. var seenNodeIds = Object.create(null);
  12694. var seenEdgeKeys = Object.create(null);
  12695. if (startId !== activeNodeIds[0] || endId !== activeNodeIds[activeNodeIds.length - 1] ||
  12696. activeNodeIds.some(function (id) {
  12697. if (seenNodeIds[id] || allNodes.filter(function (node) {
  12698. return node.getAttribute('data-node-id') === id;
  12699. }).length !== 1) return true;
  12700. seenNodeIds[id] = true;
  12701. return !byId[id];
  12702. }) ||
  12703. activeEdges.some(function (edge, index) {
  12704. if (!edge || !svg.contains(edge)) return true;
  12705. var edgeKey = edge.getAttribute('data-edge-key');
  12706. var edgeId = edge.getAttribute('data-edge-id') || '';
  12707. if (!edgeKey || seenEdgeKeys[edgeKey]) return true;
  12708. seenEdgeKeys[edgeKey] = true;
  12709. var fragments = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-key]')).filter(function (candidate) {
  12710. return candidate.getAttribute('data-edge-key') === edgeKey;
  12711. });
  12712. var drawableFragments = fragments.filter(hasDrawableGeometry);
  12713. return !fragments.length || !fragments.every(function (fragment) {
  12714. return fragment.getAttribute('data-edge-from') === activeNodeIds[index] &&
  12715. fragment.getAttribute('data-edge-to') === activeNodeIds[index + 1] &&
  12716. (fragment.getAttribute('data-edge-id') || '') === edgeId;
  12717. }) || drawableFragments.length !== 1 || drawableFragments[0] !== edge ||
  12718. edge.getAttribute('data-edge-from') !== activeNodeIds[index] ||
  12719. edge.getAttribute('data-edge-to') !== activeNodeIds[index + 1];
  12720. })) return null;
  12721. return {
  12722. source: { id: startId, label: nodeLabel(byId[startId], startId) },
  12723. target: { id: endId, label: nodeLabel(byId[endId], endId) },
  12724. nodeIds: activeNodeIds.slice(),
  12725. hops: activeEdges.length,
  12726. edges: activeEdges.map(function (edge) {
  12727. return {
  12728. key: edge.getAttribute('data-edge-key'),
  12729. id: edge.getAttribute('data-edge-id') || '',
  12730. from: edge.getAttribute('data-edge-from'),
  12731. to: edge.getAttribute('data-edge-to'),
  12732. label: edge.getAttribute('data-edge-label') || ''
  12733. };
  12734. })
  12735. };
  12736. }
  12737. function edgeShapes(edge) {
  12738. if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];
  12739. return Array.prototype.slice.call(edge.querySelectorAll('path:not([data-ambient-flow-overlay]), line, polyline'));
  12740. }
  12741. function removeOverlay() {
  12742. Array.prototype.forEach.call(svg.querySelectorAll('[data-route-probe-overlay]'), function (overlay) {
  12743. overlay.remove();
  12744. });
  12745. }
  12746. function removeJourneyPulse(options) {
  12747. options = options || {};
  12748. Array.prototype.forEach.call(svg.querySelectorAll('[data-route-journey-overlay]'), function (overlay) {
  12749. overlay.remove();
  12750. });
  12751. if (journeyOwnerToken && options.release !== false && Archify.motionGovernor) {
  12752. var token = journeyOwnerToken;
  12753. journeyOwnerToken = 0;
  12754. Archify.motionGovernor.release(token);
  12755. }
  12756. }
  12757. function stopJourneyTimer(options) {
  12758. options = options || {};
  12759. journeyGeneration += 1;
  12760. if (journeyTimer) {
  12761. if (options.preserveElapsed === true && journeyStartedAt) {
  12762. journeyElapsedMs = Math.min(JOURNEY_DWELL_MS, journeyElapsedMs + Math.max(0, Date.now() - journeyStartedAt));
  12763. }
  12764. window.clearTimeout(journeyTimer);
  12765. }
  12766. journeyTimer = null;
  12767. journeyStartedAt = 0;
  12768. if (options.preserveElapsed !== true) journeyElapsedMs = 0;
  12769. }
  12770. function clearJourneyPresentation(options) {
  12771. options = options || {};
  12772. removeJourneyPulse();
  12773. svg.removeAttribute('data-route-journey');
  12774. panel.removeAttribute('data-route-journey');
  12775. nodes().forEach(function (node) {
  12776. node.removeAttribute('data-route-journey-state');
  12777. node.removeAttribute('data-route-journey-current');
  12778. });
  12779. edges().forEach(function (edge) {
  12780. edge.removeAttribute('data-route-journey-state');
  12781. edge.removeAttribute('data-route-journey-current');
  12782. });
  12783. Array.prototype.forEach.call(path.querySelectorAll('[data-route-journey-index]'), function (button, index) {
  12784. button.removeAttribute('data-route-journey-state');
  12785. button.removeAttribute('aria-current');
  12786. button.setAttribute('tabindex', index === 0 ? '0' : '-1');
  12787. });
  12788. if (options.keepControls !== true) journeyControls.hidden = true;
  12789. journeyControls.setAttribute('data-playing', 'false');
  12790. }
  12791. function resetJourneyState() {
  12792. stopJourneyTimer();
  12793. journeyPlaying = false;
  12794. journeyComplete = false;
  12795. journeyIndex = -1;
  12796. clearJourneyPresentation();
  12797. }
  12798. function cleanSvgState() {
  12799. resetJourneyState();
  12800. svg.removeAttribute('data-route-picking');
  12801. svg.removeAttribute('data-route-active');
  12802. removeOverlay();
  12803. nodes().forEach(function (node) {
  12804. node.removeAttribute('data-route-match');
  12805. node.removeAttribute('data-route-start');
  12806. node.removeAttribute('data-route-end');
  12807. node.removeAttribute('data-route-step');
  12808. node.removeAttribute('data-route-candidate');
  12809. node.style.removeProperty('--route-step');
  12810. });
  12811. edges().forEach(function (edge) {
  12812. edge.removeAttribute('data-route-match');
  12813. edge.removeAttribute('data-route-step');
  12814. edge.style.removeProperty('--route-step');
  12815. });
  12816. panel.removeAttribute('data-route-dock');
  12817. }
  12818. function replaceRouteHash(value) {
  12819. try {
  12820. history.replaceState(null, '', location.pathname + location.search + (value ? '#route=' + value : ''));
  12821. } catch (_) {}
  12822. }
  12823. function renderPlaceholder(copy) {
  12824. path.textContent = '';
  12825. var placeholder = document.createElement('span');
  12826. placeholder.className = 'route-probe-placeholder';
  12827. placeholder.textContent = copy;
  12828. path.appendChild(placeholder);
  12829. }
  12830. function renderPath(ids, options) {
  12831. options = options || {};
  12832. var byId = nodesById();
  12833. path.textContent = '';
  12834. ids.forEach(function (id, index) {
  12835. if (index) {
  12836. var arrow = document.createElement('span');
  12837. arrow.className = 'route-probe-arrow';
  12838. arrow.setAttribute('aria-hidden', 'true');
  12839. arrow.textContent = '\u2192';
  12840. path.appendChild(arrow);
  12841. }
  12842. var item = document.createElement(options.interactive === true ? 'button' : 'span');
  12843. if (options.interactive === true) {
  12844. item.type = 'button';
  12845. item.setAttribute('data-route-journey-index', String(index));
  12846. item.setAttribute('data-route-node-id', id);
  12847. item.setAttribute('tabindex', index === 0 ? '0' : '-1');
  12848. item.setAttribute('aria-label', viewerText('viewer.route.position', {
  12849. index: index + 1,
  12850. total: ids.length,
  12851. label: nodeLabel(byId[id], id)
  12852. }));
  12853. }
  12854. item.className = 'route-probe-node';
  12855. item.textContent = nodeLabel(byId[id], id);
  12856. item.title = nodeLabel(byId[id], id) + ' · ' + id;
  12857. if (index === 0) item.setAttribute('data-endpoint', 'start');
  12858. if (index === ids.length - 1 && ids.length > 1) item.setAttribute('data-endpoint', 'end');
  12859. path.appendChild(item);
  12860. });
  12861. }
  12862. function setTrigger(active) {
  12863. trigger.setAttribute('aria-pressed', active ? 'true' : 'false');
  12864. trigger.setAttribute('aria-label', viewerText(active ? 'viewer.route.trigger.clear' : 'viewer.guide.route.aria'));
  12865. }
  12866. function clear(options) {
  12867. options = options || {};
  12868. var wasActive = mode !== 'idle';
  12869. if (Archify.finder && Archify.finder.isOpen() && typeof Archify.finder.context === 'function' && Archify.finder.context().indexOf('route-') === 0) {
  12870. Archify.finder.close({ restoreFocus: false });
  12871. }
  12872. mode = 'idle';
  12873. startId = null;
  12874. endId = null;
  12875. activeNodeIds = [];
  12876. activeEdges = [];
  12877. cleanSvgState();
  12878. panel.hidden = true;
  12879. panel.setAttribute('data-state', 'idle');
  12880. panel.removeAttribute('data-finder-open');
  12881. title.textContent = viewerText('viewer.route.start');
  12882. renderPlaceholder(viewerText('viewer.route.pickTwo'));
  12883. status.textContent = viewerText('viewer.route.instructions');
  12884. findBtn.hidden = true;
  12885. findBtn.textContent = viewerText('viewer.route.start.find');
  12886. findBtn.setAttribute('aria-label', viewerText('viewer.route.start.find.aria'));
  12887. copyBtn.hidden = true;
  12888. copyBtn.textContent = viewerText('viewer.route.copy');
  12889. if (Archify.exportMenu && typeof Archify.exportMenu.syncRouteShare === 'function') Archify.exportMenu.syncRouteShare();
  12890. setTrigger(false);
  12891. if (wasActive && options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
  12892. Archify.view.reset({ automatic: true });
  12893. }
  12894. if (options.updateUrl !== false) replaceRouteHash('');
  12895. if (options.restoreFocus === true) trigger.focus();
  12896. }
  12897. function outgoingByNode() {
  12898. var byId = nodesById();
  12899. var outgoing = Object.create(null);
  12900. edges().forEach(function (edge) {
  12901. var from = edge.getAttribute('data-edge-from');
  12902. var to = edge.getAttribute('data-edge-to');
  12903. if (!byId[from] || !byId[to] || from === to) return;
  12904. if (!outgoing[from]) outgoing[from] = [];
  12905. outgoing[from].push({ edge: edge, to: to });
  12906. });
  12907. return outgoing;
  12908. }
  12909. function reachableFrom(source) {
  12910. var outgoing = outgoingByNode();
  12911. var reached = Object.create(null);
  12912. var queue = [source];
  12913. reached[source] = true;
  12914. for (var cursor = 0; cursor < queue.length; cursor += 1) {
  12915. var links = outgoing[queue[cursor]] || [];
  12916. links.forEach(function (link) {
  12917. if (reached[link.to]) return;
  12918. reached[link.to] = true;
  12919. queue.push(link.to);
  12920. });
  12921. }
  12922. return reached;
  12923. }
  12924. function hopDistancesFrom(source) {
  12925. var outgoing = outgoingByNode();
  12926. var distances = Object.create(null);
  12927. var queue = [source];
  12928. distances[source] = 0;
  12929. for (var cursor = 0; cursor < queue.length; cursor += 1) {
  12930. var links = outgoing[queue[cursor]] || [];
  12931. links.forEach(function (link) {
  12932. if (Object.prototype.hasOwnProperty.call(distances, link.to)) return;
  12933. distances[link.to] = distances[queue[cursor]] + 1;
  12934. queue.push(link.to);
  12935. });
  12936. }
  12937. return distances;
  12938. }
  12939. function shortestDirectedPath(source, target) {
  12940. if (source === target) return null;
  12941. var outgoing = outgoingByNode();
  12942. var previous = Object.create(null);
  12943. var queue = [source];
  12944. previous[source] = null;
  12945. for (var cursor = 0; cursor < queue.length && !Object.prototype.hasOwnProperty.call(previous, target); cursor += 1) {
  12946. var links = outgoing[queue[cursor]] || [];
  12947. links.some(function (link) {
  12948. if (Object.prototype.hasOwnProperty.call(previous, link.to)) return false;
  12949. previous[link.to] = { from: queue[cursor], edge: link.edge };
  12950. queue.push(link.to);
  12951. return link.to === target;
  12952. });
  12953. }
  12954. if (!Object.prototype.hasOwnProperty.call(previous, target)) return null;
  12955. var nodeIds = [target];
  12956. var routeEdges = [];
  12957. var current = target;
  12958. while (current !== source) {
  12959. var step = previous[current];
  12960. if (!step) return null;
  12961. routeEdges.unshift(step.edge);
  12962. nodeIds.unshift(step.from);
  12963. current = step.from;
  12964. }
  12965. return { nodes: nodeIds, edges: routeEdges };
  12966. }
  12967. function traceGeometry(shape, step) {
  12968. var clone = shape.cloneNode(false);
  12969. if (shape.getAttribute('data-motion-path')) clone.setAttribute('d', shape.getAttribute('data-motion-path'));
  12970. clone.removeAttribute('data-motion-path');
  12971. clone.removeAttribute('id');
  12972. clone.removeAttribute('class');
  12973. clone.removeAttribute('style');
  12974. clone.removeAttribute('marker-start');
  12975. clone.removeAttribute('marker-mid');
  12976. clone.removeAttribute('marker-end');
  12977. clone.removeAttribute('role');
  12978. clone.removeAttribute('aria-label');
  12979. clone.removeAttribute('aria-labelledby');
  12980. clone.removeAttribute('data-animate');
  12981. clone.removeAttribute('data-edge-from');
  12982. clone.removeAttribute('data-edge-to');
  12983. clone.removeAttribute('data-edge-key');
  12984. clone.removeAttribute('data-edge-id');
  12985. clone.removeAttribute('data-edge-label');
  12986. clone.removeAttribute('data-route-match');
  12987. clone.removeAttribute('data-route-step');
  12988. clone.setAttribute('class', 'route-probe-flow');
  12989. clone.setAttribute('pathLength', '1');
  12990. clone.style.setProperty('--route-step', String(step));
  12991. return clone;
  12992. }
  12993. function renderOverlay(routeEdges) {
  12994. removeOverlay();
  12995. if (!routeEdges.length) return;
  12996. var overlay = document.createElementNS(namespace, 'g');
  12997. overlay.setAttribute('class', 'route-probe-overlay');
  12998. overlay.setAttribute('data-route-probe-overlay', '');
  12999. overlay.setAttribute('aria-hidden', 'true');
  13000. routeEdges.forEach(function (edge, step) {
  13001. var wrapper = document.createElementNS(namespace, 'g');
  13002. if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
  13003. edgeShapes(edge).forEach(function (shape) { wrapper.appendChild(traceGeometry(shape, step)); });
  13004. if (wrapper.childNodes.length) overlay.appendChild(wrapper);
  13005. });
  13006. var firstNode = svg.querySelector('[data-node-id]');
  13007. if (firstNode) svg.insertBefore(overlay, firstNode);
  13008. else svg.appendChild(overlay);
  13009. }
  13010. function journeyButtons() {
  13011. return Array.prototype.slice.call(path.querySelectorAll('[data-route-journey-index]'));
  13012. }
  13013. function journeyMotionAllowed() {
  13014. return html.getAttribute('data-embed') !== 'true' &&
  13015. !document.hidden &&
  13016. Archify.motionGovernor &&
  13017. Archify.motionGovernor.capable === true &&
  13018. !Archify.motionGovernor.isPaused();
  13019. }
  13020. function routeOverviewStatus() {
  13021. return viewerText('viewer.route.overview.status', {
  13022. nodes: viewerCount('viewer.route.overview.node', activeNodeIds.length),
  13023. hops: viewerCount('viewer.route.overview.hop', activeEdges.length)
  13024. });
  13025. }
  13026. function centerJourneyButton(button) {
  13027. if (!button) return;
  13028. var target = button.offsetLeft - Math.max(0, (path.clientWidth - button.offsetWidth) / 2);
  13029. path.scrollLeft = Math.max(0, target);
  13030. }
  13031. function focusJourneyButton(index) {
  13032. var buttons = journeyButtons();
  13033. if (!buttons.length) return false;
  13034. var next = Math.max(0, Math.min(buttons.length - 1, index));
  13035. buttons.forEach(function (button, buttonIndex) {
  13036. button.setAttribute('tabindex', buttonIndex === next ? '0' : '-1');
  13037. });
  13038. try { buttons[next].focus({ preventScroll: true }); } catch (_) { buttons[next].focus(); }
  13039. centerJourneyButton(buttons[next]);
  13040. return true;
  13041. }
  13042. function renderJourneyControls() {
  13043. var hasRoute = mode === 'result' && activeNodeIds.length > 1;
  13044. var canPlay = hasRoute && journeyMotionAllowed();
  13045. journeyControls.hidden = !hasRoute;
  13046. journeyControls.setAttribute('data-playing', journeyPlaying ? 'true' : 'false');
  13047. journeyPrevBtn.disabled = !hasRoute || journeyIndex <= 0;
  13048. journeyNextBtn.disabled = !hasRoute || journeyIndex >= activeNodeIds.length - 1;
  13049. journeyOverviewBtn.disabled = !hasRoute || journeyIndex < 0;
  13050. journeyPlayBtn.disabled = !canPlay;
  13051. journeyPlayBtn.setAttribute('aria-pressed', journeyPlaying ? 'true' : 'false');
  13052. if (journeyPlaying) {
  13053. journeyPlayIcon.textContent = '\u275a\u275a';
  13054. journeyPlayLabel.textContent = viewerText('viewer.route.pause.label');
  13055. journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.pause'));
  13056. journeyPlayBtn.title = viewerText('viewer.route.pause');
  13057. } else if (journeyComplete || journeyIndex === activeNodeIds.length - 1) {
  13058. journeyPlayIcon.textContent = '\u21bb';
  13059. journeyPlayLabel.textContent = viewerText('viewer.route.replay.label');
  13060. journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.replay'));
  13061. journeyPlayBtn.title = viewerText(canPlay ? 'viewer.route.replay' : 'viewer.route.motionRequired');
  13062. } else {
  13063. journeyPlayIcon.textContent = '\u25b6';
  13064. journeyPlayLabel.textContent = viewerText('viewer.route.journey');
  13065. journeyPlayBtn.setAttribute('aria-label', viewerText('viewer.route.play'));
  13066. journeyPlayBtn.title = viewerText(canPlay ? 'viewer.route.play' : 'viewer.route.motionRequired');
  13067. }
  13068. }
  13069. function journeyGeometry(shape) {
  13070. var clone = shape.cloneNode(false);
  13071. if (shape.getAttribute('data-motion-path')) clone.setAttribute('d', shape.getAttribute('data-motion-path'));
  13072. clone.removeAttribute('data-motion-path');
  13073. clone.removeAttribute('id');
  13074. clone.removeAttribute('class');
  13075. clone.removeAttribute('style');
  13076. clone.removeAttribute('marker-start');
  13077. clone.removeAttribute('marker-mid');
  13078. clone.removeAttribute('marker-end');
  13079. clone.removeAttribute('role');
  13080. clone.removeAttribute('aria-label');
  13081. clone.removeAttribute('aria-labelledby');
  13082. clone.removeAttribute('data-animate');
  13083. clone.removeAttribute('data-edge-from');
  13084. clone.removeAttribute('data-edge-to');
  13085. clone.removeAttribute('data-edge-key');
  13086. clone.removeAttribute('data-edge-id');
  13087. clone.removeAttribute('data-edge-label');
  13088. clone.removeAttribute('data-route-match');
  13089. clone.removeAttribute('data-route-step');
  13090. clone.removeAttribute('data-route-journey-state');
  13091. clone.removeAttribute('data-route-journey-current');
  13092. clone.setAttribute('class', 'route-journey-flow');
  13093. clone.setAttribute('pathLength', '1');
  13094. return clone;
  13095. }
  13096. function renderJourneyPulse(edge) {
  13097. removeJourneyPulse();
  13098. if (!edge || !journeyMotionAllowed()) return false;
  13099. var overlay = document.createElementNS(namespace, 'g');
  13100. overlay.setAttribute('class', 'route-journey-overlay');
  13101. overlay.setAttribute('data-route-journey-overlay', '');
  13102. overlay.setAttribute('aria-hidden', 'true');
  13103. var wrapper = document.createElementNS(namespace, 'g');
  13104. if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
  13105. edgeShapes(edge).forEach(function (shape) { wrapper.appendChild(journeyGeometry(shape)); });
  13106. if (!wrapper.childNodes.length) return false;
  13107. overlay.appendChild(wrapper);
  13108. var firstNode = svg.querySelector('[data-node-id]');
  13109. if (firstNode) svg.insertBefore(overlay, firstNode);
  13110. else svg.appendChild(overlay);
  13111. if (Archify.motionGovernor && Archify.motionGovernor.capable) {
  13112. var token = 0;
  13113. token = Archify.motionGovernor.claim('route', function () {
  13114. if (journeyOwnerToken === token) journeyOwnerToken = 0;
  13115. removeJourneyPulse({ release: false });
  13116. });
  13117. journeyOwnerToken = token;
  13118. }
  13119. overlay.addEventListener('animationend', function () {
  13120. if (overlay.isConnected) removeJourneyPulse();
  13121. }, { once: true });
  13122. window.setTimeout(function () {
  13123. if (overlay.isConnected) removeJourneyPulse();
  13124. }, 860);
  13125. return true;
  13126. }
  13127. function applyJourneyState(index, options) {
  13128. options = options || {};
  13129. if (mode !== 'result' || !activeNodeIds.length) return false;
  13130. var byId = nodesById();
  13131. journeyIndex = Math.max(0, Math.min(activeNodeIds.length - 1, index));
  13132. removeJourneyPulse();
  13133. svg.setAttribute('data-route-journey', (journeyIndex + 1) + '/' + activeNodeIds.length);
  13134. panel.setAttribute('data-route-journey', String(journeyIndex));
  13135. activeNodeIds.forEach(function (id, step) {
  13136. var node = byId[id];
  13137. if (!node) return;
  13138. var state = step < journeyIndex ? 'past' : (step === journeyIndex ? 'current' : 'future');
  13139. node.setAttribute('data-route-journey-state', state);
  13140. if (step === journeyIndex) node.setAttribute('data-route-journey-current', '');
  13141. else node.removeAttribute('data-route-journey-current');
  13142. });
  13143. activeEdges.forEach(function (edge, step) {
  13144. var destination = step + 1;
  13145. var state = destination < journeyIndex ? 'past' : (destination === journeyIndex ? 'current' : 'future');
  13146. edge.setAttribute('data-route-journey-state', state);
  13147. if (destination === journeyIndex) edge.setAttribute('data-route-journey-current', '');
  13148. else edge.removeAttribute('data-route-journey-current');
  13149. });
  13150. var buttons = journeyButtons();
  13151. buttons.forEach(function (button, step) {
  13152. var state = step < journeyIndex ? 'past' : (step === journeyIndex ? 'current' : 'future');
  13153. button.setAttribute('data-route-journey-state', state);
  13154. button.setAttribute('tabindex', step === journeyIndex ? '0' : '-1');
  13155. if (step === journeyIndex) button.setAttribute('aria-current', 'step');
  13156. else button.removeAttribute('aria-current');
  13157. });
  13158. if (options.center !== false) centerJourneyButton(buttons[journeyIndex]);
  13159. var phase = viewerText(journeyPlaying
  13160. ? 'viewer.route.phase.playing'
  13161. : journeyComplete
  13162. ? 'viewer.route.phase.complete'
  13163. : 'viewer.route.phase.inspecting');
  13164. status.textContent = viewerText('viewer.route.step', {
  13165. index: journeyIndex + 1,
  13166. total: activeNodeIds.length,
  13167. phase: phase,
  13168. label: nodeLabel(byId[activeNodeIds[journeyIndex]], activeNodeIds[journeyIndex])
  13169. });
  13170. if (options.pulse === true && journeyIndex > 0) renderJourneyPulse(activeEdges[journeyIndex - 1]);
  13171. if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
  13172. Archify.view.reveal(activeNodeIds.slice(Math.max(0, journeyIndex - 1), Math.min(activeNodeIds.length, journeyIndex + 2)), {
  13173. includeNeighbors: false,
  13174. reason: 'route-journey',
  13175. maxScale: 1.65,
  13176. padding: 64,
  13177. duration: 360,
  13178. instant: !journeyMotionAllowed()
  13179. });
  13180. }
  13181. renderJourneyControls();
  13182. requestDocking();
  13183. return true;
  13184. }
  13185. function pauseJourney(options) {
  13186. options = options || {};
  13187. if (!journeyPlaying && options.complete !== true) {
  13188. renderJourneyControls();
  13189. return false;
  13190. }
  13191. stopJourneyTimer({ preserveElapsed: options.complete !== true && options.preserveElapsed !== false });
  13192. journeyPlaying = false;
  13193. journeyComplete = options.complete === true;
  13194. if (journeyComplete) journeyElapsedMs = 0;
  13195. removeJourneyPulse();
  13196. if (journeyIndex >= 0) applyJourneyState(journeyIndex, { center: false, pulse: false, reveal: false });
  13197. else renderJourneyControls();
  13198. return true;
  13199. }
  13200. function selectJourneyIndex(index) {
  13201. if (mode !== 'result') return false;
  13202. stopJourneyTimer();
  13203. journeyPlaying = false;
  13204. journeyComplete = false;
  13205. return applyJourneyState(index, { pulse: true, reveal: true });
  13206. }
  13207. function showJourneyOverview(options) {
  13208. options = options || {};
  13209. if (mode !== 'result') return false;
  13210. stopJourneyTimer();
  13211. journeyPlaying = false;
  13212. journeyComplete = false;
  13213. journeyIndex = -1;
  13214. clearJourneyPresentation({ keepControls: true });
  13215. status.textContent = routeOverviewStatus();
  13216. renderJourneyControls();
  13217. if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
  13218. Archify.view.reveal(activeNodeIds, { includeNeighbors: false, reason: 'route', instant: !journeyMotionAllowed() });
  13219. }
  13220. requestDocking();
  13221. return true;
  13222. }
  13223. function scheduleJourney() {
  13224. if (!journeyPlaying || !journeyMotionAllowed()) {
  13225. pauseJourney({ preserveElapsed: true });
  13226. return false;
  13227. }
  13228. var generation = ++journeyGeneration;
  13229. var remaining = Math.max(0, JOURNEY_DWELL_MS - journeyElapsedMs);
  13230. journeyStartedAt = Date.now();
  13231. journeyTimer = window.setTimeout(function () {
  13232. if (generation !== journeyGeneration || !journeyPlaying) return;
  13233. journeyTimer = null;
  13234. journeyStartedAt = 0;
  13235. journeyElapsedMs = 0;
  13236. if (journeyIndex >= activeNodeIds.length - 1) {
  13237. pauseJourney({ complete: true, preserveElapsed: false });
  13238. return;
  13239. }
  13240. applyJourneyState(journeyIndex + 1, { pulse: true, reveal: true });
  13241. // Camera and motion-owner handoff are allowed to synchronously
  13242. // settle the previous step. The new step always starts with a fresh
  13243. // dwell; never carry cleanup time into the next scheduler lease.
  13244. journeyElapsedMs = 0;
  13245. journeyStartedAt = 0;
  13246. scheduleJourney();
  13247. }, remaining);
  13248. return true;
  13249. }
  13250. function playJourney() {
  13251. if (mode !== 'result' || activeNodeIds.length < 2 || !journeyMotionAllowed()) {
  13252. renderJourneyControls();
  13253. return false;
  13254. }
  13255. if (journeyPlaying) return true;
  13256. if (journeyComplete || journeyIndex >= activeNodeIds.length - 1) {
  13257. journeyIndex = -1;
  13258. journeyElapsedMs = 0;
  13259. journeyComplete = false;
  13260. }
  13261. journeyPlaying = true;
  13262. if (journeyIndex < 0) applyJourneyState(0, { pulse: false, reveal: true });
  13263. else applyJourneyState(journeyIndex, { center: false, pulse: false, reveal: false });
  13264. scheduleJourney();
  13265. return true;
  13266. }
  13267. function toggleJourney() {
  13268. return journeyPlaying ? pauseJourney({ preserveElapsed: true }) : playJourney();
  13269. }
  13270. function previousJourney() {
  13271. return selectJourneyIndex(Math.max(0, journeyIndex < 0 ? 0 : journeyIndex - 1));
  13272. }
  13273. function nextJourney() {
  13274. return selectJourneyIndex(Math.min(activeNodeIds.length - 1, journeyIndex + 1));
  13275. }
  13276. function overlapArea(a, b) {
  13277. var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));
  13278. var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));
  13279. return width * height;
  13280. }
  13281. function updateDocking() {
  13282. if (panel.hidden) {
  13283. panel.removeAttribute('data-route-dock');
  13284. return;
  13285. }
  13286. var containerRect = container.getBoundingClientRect();
  13287. var width = panel.offsetWidth;
  13288. var height = panel.offsetHeight;
  13289. if (!width || !height) return;
  13290. var currentRect = panel.getBoundingClientRect();
  13291. var left = currentRect.left;
  13292. var topCandidate = {
  13293. left: left,
  13294. right: left + width,
  13295. top: containerRect.top + 8,
  13296. bottom: containerRect.top + 8 + height
  13297. };
  13298. var nav = container.querySelector('.diagram-nav');
  13299. var navRect = nav ? nav.getBoundingClientRect() : null;
  13300. var bottom = navRect ? navRect.top - 9 : containerRect.bottom - 8;
  13301. var bottomCandidate = {
  13302. left: left,
  13303. right: left + width,
  13304. top: bottom - height,
  13305. bottom: bottom
  13306. };
  13307. var byId = nodesById();
  13308. var relevant = activeNodeIds.length ? activeNodeIds : (startId ? [startId] : []);
  13309. var blockers = relevant.map(function (id) { return byId[id]; }).filter(Boolean).map(function (node) {
  13310. return node.getBoundingClientRect();
  13311. });
  13312. function score(candidate) {
  13313. var value = blockers.reduce(function (sum, rect) { return sum + overlapArea(candidate, rect); }, 0);
  13314. if (navRect) value += overlapArea(candidate, navRect) * 4;
  13315. if (candidate.top < containerRect.top || candidate.bottom > containerRect.bottom) value += 1000000;
  13316. return value;
  13317. }
  13318. if (score(topCandidate) <= score(bottomCandidate)) panel.setAttribute('data-route-dock', 'top');
  13319. else panel.setAttribute('data-route-dock', 'bottom');
  13320. }
  13321. function requestDocking() {
  13322. requestAnimationFrame(updateDocking);
  13323. window.setTimeout(updateDocking, 120);
  13324. window.setTimeout(updateDocking, 560);
  13325. }
  13326. function chooseStart(id) {
  13327. var byId = nodesById();
  13328. if (!byId[id]) return false;
  13329. cleanSvgState();
  13330. startId = id;
  13331. endId = null;
  13332. mode = 'target';
  13333. var reached = reachableFrom(id);
  13334. byId[id].setAttribute('data-route-start', '');
  13335. byId[id].setAttribute('data-route-match', '');
  13336. Object.keys(reached).forEach(function (candidateId) {
  13337. if (candidateId !== id && byId[candidateId]) byId[candidateId].setAttribute('data-route-candidate', '');
  13338. });
  13339. svg.setAttribute('data-route-picking', 'target');
  13340. panel.setAttribute('data-state', 'target');
  13341. title.textContent = viewerText('viewer.route.destination', { label: nodeLabel(byId[id], id) });
  13342. renderPath([id]);
  13343. var count = Math.max(0, Object.keys(reached).length - 1);
  13344. status.textContent = count
  13345. ? viewerCount('viewer.route.destination.count', count)
  13346. : viewerText('viewer.route.noOutgoing');
  13347. findBtn.hidden = false;
  13348. findBtn.textContent = viewerText('viewer.route.destination.find');
  13349. findBtn.setAttribute('aria-label', viewerText('viewer.route.destination.find.aria'));
  13350. requestDocking();
  13351. return true;
  13352. }
  13353. function showResult(result, options) {
  13354. options = options || {};
  13355. var byId = nodesById();
  13356. cleanSvgState();
  13357. mode = 'result';
  13358. startId = result.nodes[0];
  13359. endId = result.nodes[result.nodes.length - 1];
  13360. activeNodeIds = result.nodes.slice();
  13361. activeEdges = result.edges.slice();
  13362. result.nodes.forEach(function (id, step) {
  13363. var node = byId[id];
  13364. if (!node) return;
  13365. node.setAttribute('data-route-match', '');
  13366. node.setAttribute('data-route-step', String(step));
  13367. node.style.setProperty('--route-step', String(step));
  13368. if (step === 0) node.setAttribute('data-route-start', '');
  13369. if (step === result.nodes.length - 1) node.setAttribute('data-route-end', '');
  13370. });
  13371. result.edges.forEach(function (edge, step) {
  13372. edge.setAttribute('data-route-match', '');
  13373. edge.setAttribute('data-route-step', String(step));
  13374. edge.style.setProperty('--route-step', String(step));
  13375. });
  13376. svg.setAttribute('data-route-active', startId + '~' + endId);
  13377. renderOverlay(result.edges);
  13378. renderPath(result.nodes, { interactive: true });
  13379. panel.setAttribute('data-state', 'result');
  13380. panel.hidden = false;
  13381. title.textContent = viewerText('viewer.route.result.title', {
  13382. source: nodeLabel(byId[startId], startId),
  13383. target: nodeLabel(byId[endId], endId)
  13384. });
  13385. findBtn.hidden = true;
  13386. copyBtn.hidden = false;
  13387. setTrigger(true);
  13388. if (Archify.exportMenu && typeof Archify.exportMenu.syncRouteShare === 'function') Archify.exportMenu.syncRouteShare();
  13389. if (options.updateUrl !== false) {
  13390. replaceRouteHash(encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
  13391. }
  13392. showJourneyOverview({ reveal: false });
  13393. if (Archify.view && typeof Archify.view.reveal === 'function') {
  13394. Archify.view.reveal(result.nodes, { includeNeighbors: false, reason: 'route' });
  13395. }
  13396. return true;
  13397. }
  13398. function choose(id, options) {
  13399. options = options || {};
  13400. var byId = nodesById();
  13401. if (!byId[id]) return false;
  13402. if (mode === 'source') return chooseStart(id);
  13403. if (mode !== 'target') return false;
  13404. if (id === startId) {
  13405. panel.setAttribute('data-state', 'error');
  13406. title.textContent = viewerText('viewer.route.differentDestination');
  13407. status.textContent = viewerText('viewer.route.distinct');
  13408. return false;
  13409. }
  13410. var result = shortestDirectedPath(startId, id);
  13411. if (!result) {
  13412. panel.setAttribute('data-state', 'error');
  13413. title.textContent = viewerText('viewer.route.unreachable', { label: nodeLabel(byId[id], id) });
  13414. status.textContent = viewerText('viewer.route.unreachable.detail', {
  13415. target: nodeLabel(byId[id], id),
  13416. source: nodeLabel(byId[startId], startId)
  13417. });
  13418. return false;
  13419. }
  13420. return showResult(result, options);
  13421. }
  13422. function begin(options) {
  13423. options = options || {};
  13424. if (html.getAttribute('data-embed') === 'true') return false;
  13425. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  13426. if (Archify.semanticLens && Archify.semanticLens.active()) {
  13427. Archify.semanticLens.clear({ updateUrl: false, preserveView: true, closePanel: true });
  13428. }
  13429. var focused = options.source || (Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null);
  13430. if (Array.isArray(focused)) focused = null;
  13431. clear({ updateUrl: false, preserveView: true, restoreFocus: false });
  13432. if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
  13433. if (Archify.focus && typeof Archify.focus.clear === 'function') {
  13434. Archify.focus.clear({ updateUrl: false, preserveView: true });
  13435. }
  13436. if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
  13437. if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
  13438. mode = 'source';
  13439. panel.hidden = false;
  13440. panel.setAttribute('data-state', 'source');
  13441. svg.setAttribute('data-route-picking', 'source');
  13442. title.textContent = viewerText('viewer.route.start');
  13443. renderPlaceholder(viewerText('viewer.route.pickOne'));
  13444. status.textContent = viewerText('viewer.route.start.instructions');
  13445. findBtn.hidden = false;
  13446. findBtn.textContent = viewerText('viewer.route.start.find');
  13447. findBtn.setAttribute('aria-label', viewerText('viewer.route.start.find.aria'));
  13448. copyBtn.hidden = true;
  13449. setTrigger(true);
  13450. if (focused && nodesById()[focused]) chooseStart(focused);
  13451. if (options.focusNode === true && !focused) {
  13452. var first = nodes()[0];
  13453. if (first) {
  13454. try { first.focus({ preventScroll: true }); } catch (_) { try { first.focus(); } catch (_) {} }
  13455. }
  13456. }
  13457. return true;
  13458. }
  13459. function toggle(options) {
  13460. if (mode !== 'idle') {
  13461. clear({ restoreFocus: true });
  13462. return false;
  13463. }
  13464. return begin(options);
  13465. }
  13466. function finderContext() {
  13467. var byId = nodesById();
  13468. if (mode === 'source') {
  13469. var outgoing = outgoingByNode();
  13470. var sourceIds = nodes().map(function (node) { return node.getAttribute('data-node-id'); }).filter(function (id) {
  13471. return outgoing[id] && outgoing[id].length;
  13472. });
  13473. var sourceBadges = Object.create(null);
  13474. sourceIds.forEach(function (id) { sourceBadges[id] = viewerText('viewer.route.finder.source.badge'); });
  13475. return {
  13476. kind: 'route-source',
  13477. title: viewerText('viewer.route.finder.source.title'),
  13478. placeholder: viewerText('viewer.route.finder.source.placeholder'),
  13479. empty: viewerText('viewer.route.finder.source.empty'),
  13480. resultsLabel: viewerText('viewer.route.finder.source.results'),
  13481. availableNoun: viewerText('viewer.route.finder.source.noun'),
  13482. allowedIds: sourceIds,
  13483. badges: sourceBadges
  13484. };
  13485. }
  13486. if (mode === 'target' && startId && byId[startId]) {
  13487. var distances = hopDistancesFrom(startId);
  13488. var targetIds = Object.keys(distances).filter(function (id) { return id !== startId && byId[id]; });
  13489. var targetBadges = Object.create(null);
  13490. targetIds.forEach(function (id) {
  13491. targetBadges[id] = viewerCount('viewer.route.hop', distances[id]);
  13492. });
  13493. return {
  13494. kind: 'route-target',
  13495. title: viewerText('viewer.route.finder.target.title', { label: nodeLabel(byId[startId], startId) }),
  13496. placeholder: viewerText('viewer.route.finder.target.placeholder'),
  13497. empty: viewerText('viewer.route.finder.target.empty'),
  13498. resultsLabel: viewerText('viewer.route.finder.target.results'),
  13499. availableNoun: viewerText('viewer.route.finder.target.noun'),
  13500. allowedIds: targetIds,
  13501. badges: targetBadges
  13502. };
  13503. }
  13504. return null;
  13505. }
  13506. function finderOpening() {
  13507. panel.setAttribute('data-finder-open', 'true');
  13508. }
  13509. function finderClosed(options) {
  13510. options = options || {};
  13511. panel.removeAttribute('data-finder-open');
  13512. requestDocking();
  13513. if (options.restoreFocus === true && !findBtn.hidden) findBtn.focus();
  13514. }
  13515. function openFinder() {
  13516. var context = finderContext();
  13517. if (!context || !Archify.finder) return false;
  13518. return Archify.finder.open({ context: context });
  13519. }
  13520. function copyLink() {
  13521. if (mode !== 'result') return Promise.resolve(false);
  13522. var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
  13523. return (value === null ? Promise.resolve(false) : copyReaderText(value)).then(function (copied) {
  13524. copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
  13525. copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
  13526. window.setTimeout(function () {
  13527. copyBtn.textContent = viewerText('viewer.route.copy');
  13528. copyBtn.setAttribute('aria-label', viewerText('viewer.route.copy.aria'));
  13529. }, 1600);
  13530. return copied;
  13531. });
  13532. }
  13533. function interceptSelection(event) {
  13534. if (mode !== 'source' && mode !== 'target') return;
  13535. if (container.getAttribute('data-just-panned') === 'true') return;
  13536. var node = event.target.closest('[data-node-id]');
  13537. if (!node) return;
  13538. if (event.type === 'keydown' && event.key !== 'Enter' && event.key !== ' ') return;
  13539. event.preventDefault();
  13540. event.stopImmediatePropagation();
  13541. choose(node.getAttribute('data-node-id'));
  13542. }
  13543. function syncFromHash() {
  13544. try {
  13545. var params = new URLSearchParams(location.hash.replace(/^#/, ''));
  13546. var route = params.get('route');
  13547. if (!route) {
  13548. if (mode !== 'idle') clear({ updateUrl: false, restoreFocus: false });
  13549. return;
  13550. }
  13551. var parts = route.split('~');
  13552. if (parts.length !== 2) return;
  13553. var byId = nodesById();
  13554. if (!byId[parts[0]] || !byId[parts[1]]) return;
  13555. begin({ source: parts[0], focusNode: false });
  13556. choose(parts[1], { updateUrl: false });
  13557. } catch (_) {}
  13558. }
  13559. function escapeRoute(options) {
  13560. options = options || {};
  13561. if (journeyPlaying) {
  13562. pauseJourney({ preserveElapsed: true });
  13563. if (options.restoreFocus === true) journeyPlayBtn.focus();
  13564. return 'paused';
  13565. }
  13566. if (journeyIndex >= 0) {
  13567. showJourneyOverview({ reveal: true });
  13568. if (options.restoreFocus === true) journeyOverviewBtn.focus();
  13569. return 'overview';
  13570. }
  13571. clear({ restoreFocus: options.restoreFocus === true });
  13572. return 'cleared';
  13573. }
  13574. function syncJourneyMotion() {
  13575. if (journeyPlaying && !journeyMotionAllowed()) pauseJourney({ preserveElapsed: true });
  13576. renderJourneyControls();
  13577. return journeyMotionAllowed();
  13578. }
  13579. trigger.addEventListener('click', function () { toggle({ focusNode: false }); });
  13580. findBtn.addEventListener('click', openFinder);
  13581. clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
  13582. copyBtn.addEventListener('click', copyLink);
  13583. journeyPrevBtn.addEventListener('click', previousJourney);
  13584. journeyPlayBtn.addEventListener('click', toggleJourney);
  13585. journeyNextBtn.addEventListener('click', nextJourney);
  13586. journeyOverviewBtn.addEventListener('click', function () { showJourneyOverview({ reveal: true }); });
  13587. path.addEventListener('click', function (event) {
  13588. var button = event.target.closest('[data-route-journey-index]');
  13589. if (!button) return;
  13590. selectJourneyIndex(Number(button.getAttribute('data-route-journey-index')));
  13591. });
  13592. path.addEventListener('focusin', function (event) {
  13593. if (journeyPlaying && event.target.closest('[data-route-journey-index]')) pauseJourney({ preserveElapsed: true });
  13594. });
  13595. path.addEventListener('keydown', function (event) {
  13596. if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) return;
  13597. var button = event.target.closest('[data-route-journey-index]');
  13598. if (!button) return;
  13599. var index = Number(button.getAttribute('data-route-journey-index'));
  13600. var next = null;
  13601. if (event.key === 'ArrowRight') next = Math.min(activeNodeIds.length - 1, index + 1);
  13602. else if (event.key === 'ArrowLeft') next = Math.max(0, index - 1);
  13603. else if (event.key === 'Home') next = 0;
  13604. else if (event.key === 'End') next = activeNodeIds.length - 1;
  13605. if (next !== null) {
  13606. event.preventDefault();
  13607. focusJourneyButton(next);
  13608. return;
  13609. }
  13610. if (event.key === 'Enter' || event.key === ' ') {
  13611. event.preventDefault();
  13612. selectJourneyIndex(index);
  13613. }
  13614. });
  13615. svg.addEventListener('click', interceptSelection, true);
  13616. svg.addEventListener('keydown', interceptSelection, true);
  13617. container.addEventListener('scroll', updateDocking, { passive: true });
  13618. window.addEventListener('resize', requestDocking);
  13619. window.addEventListener('beforeprint', function () {
  13620. if (journeyPlaying) pauseJourney({ preserveElapsed: true, reason: 'print' });
  13621. else removeJourneyPulse();
  13622. });
  13623. window.addEventListener('hashchange', function () { requestAnimationFrame(syncFromHash); });
  13624. syncFromHash();
  13625. return {
  13626. begin: begin,
  13627. choose: choose,
  13628. clear: clear,
  13629. toggle: toggle,
  13630. escape: escapeRoute,
  13631. copyLink: copyLink,
  13632. playJourney: playJourney,
  13633. pauseJourney: pauseJourney,
  13634. showOverview: showJourneyOverview,
  13635. selectJourneyIndex: selectJourneyIndex,
  13636. syncMotion: syncJourneyMotion,
  13637. isJourneyPlaying: function () { return journeyPlaying; },
  13638. finderContext: finderContext,
  13639. finderOpening: finderOpening,
  13640. finderClosed: finderClosed,
  13641. openFinder: openFinder,
  13642. exportSnapshot: exportSnapshot,
  13643. active: function () { return mode === 'idle' ? null : mode; },
  13644. result: function () {
  13645. return mode === 'result'
  13646. ? { source: startId, target: endId, nodes: activeNodeIds.slice(), hops: activeEdges.length, journey: journeyIndex, playing: journeyPlaying }
  13647. : null;
  13648. }
  13649. };
  13650. })();
  13651. /* ============================================================
  13652. Semantic Lens — a counted, viewer-only legend over data-node-kind.
  13653. One selected kind reveals every authored relationship touching it.
  13654. Two selected kinds compare only direct cross-kind relationships while
  13655. preserving the full diagram as a dimmed spatial reference.
  13656. ============================================================ */
  13657. Archify.semanticLens = (function () {
  13658. var html = document.documentElement;
  13659. var container = document.querySelector('.diagram-container');
  13660. var svg = container.querySelector(':scope > svg');
  13661. var trigger = document.getElementById('btn-semantic-lens');
  13662. var panel = document.getElementById('semantic-lens');
  13663. var closeBtn = document.getElementById('semantic-lens-close');
  13664. var kindsRoot = document.getElementById('semantic-lens-kinds');
  13665. var status = document.getElementById('semantic-lens-status');
  13666. var copyBtn = document.getElementById('semantic-lens-copy');
  13667. var clearBtn = document.getElementById('semantic-lens-clear');
  13668. var legendBridge = svg.querySelector('[data-legend-bridge]');
  13669. var legendEntries = [];
  13670. var hoveredLegendEntry = null;
  13671. var focusedLegendEntry = null;
  13672. var activeLegendPreview = null;
  13673. var lensOpener = trigger;
  13674. var selectedKinds = [];
  13675. var namespace = 'http://www.w3.org/2000/svg';
  13676. var finePointerQuery = window.matchMedia ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;
  13677. var MAX_LENS_FLOW_EDGES = 24;
  13678. function nodesById() {
  13679. var byId = Object.create(null);
  13680. Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-node-kind]'), function (node) {
  13681. var id = node.getAttribute('data-node-id');
  13682. if (id && !byId[id]) byId[id] = node;
  13683. });
  13684. return byId;
  13685. }
  13686. function collectKinds() {
  13687. var kinds = {};
  13688. var byId = nodesById();
  13689. Object.keys(byId).forEach(function (id) {
  13690. var node = byId[id];
  13691. var value = node.getAttribute('data-node-kind') || 'neutral';
  13692. var kind = kinds[value] || (kinds[value] = { id: value, label: viewerKindLabel(value), nodes: [] });
  13693. kind.nodes.push(node);
  13694. });
  13695. return Object.keys(kinds).map(function (key) { return kinds[key]; }).sort(function (a, b) {
  13696. return b.nodes.length - a.nodes.length || a.label.localeCompare(b.label);
  13697. });
  13698. }
  13699. function edgeGroups() {
  13700. var groups = {};
  13701. Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
  13702. var from = edge.getAttribute('data-edge-from');
  13703. var to = edge.getAttribute('data-edge-to');
  13704. var key = edge.getAttribute('data-edge-key') || [from, to, edge.getAttribute('data-edge-label') || ''].join('\u0000');
  13705. if (!groups[key]) groups[key] = { key: key, from: from, to: to, members: [] };
  13706. groups[key].members.push(edge);
  13707. });
  13708. return Object.keys(groups).map(function (key) { return groups[key]; });
  13709. }
  13710. function edgeShapes(edge) {
  13711. if (!edge) return [];
  13712. if (/^(path|line|polyline)$/i.test(edge.tagName || '')) return [edge];
  13713. return Array.prototype.slice.call(edge.querySelectorAll('path:not([data-ambient-flow-overlay]), line, polyline'));
  13714. }
  13715. function legendSourceBounds(entry) {
  13716. var bounds = null;
  13717. Array.prototype.forEach.call(entry.children, function (child) {
  13718. if (child.hasAttribute('data-legend-bridge-runtime')) return;
  13719. var box;
  13720. try { box = child.getBBox(); } catch (_) { return; }
  13721. if (!box || !Number.isFinite(box.x) || !Number.isFinite(box.y)) return;
  13722. var next = { left: box.x, top: box.y, right: box.x + box.width, bottom: box.y + box.height };
  13723. if (!bounds) bounds = next;
  13724. else {
  13725. bounds.left = Math.min(bounds.left, next.left);
  13726. bounds.top = Math.min(bounds.top, next.top);
  13727. bounds.right = Math.max(bounds.right, next.right);
  13728. bounds.bottom = Math.max(bounds.bottom, next.bottom);
  13729. }
  13730. });
  13731. return bounds;
  13732. }
  13733. function layoutLegendEntry(entry) {
  13734. var bounds = legendSourceBounds(entry);
  13735. var hit = entry.querySelector('[data-legend-hit]');
  13736. var badge = entry.querySelector('[data-legend-count-badge]');
  13737. if (!bounds || !hit || !badge) return false;
  13738. var count = entry.getAttribute('data-legend-count') || '0';
  13739. var centerY = (bounds.top + bounds.bottom) / 2;
  13740. var badgeWidth = Math.max(14, count.length * 5 + 8);
  13741. var badgeX = bounds.right + 3;
  13742. var hitX = bounds.left - 5;
  13743. var hitRight = badgeX + badgeWidth + 4;
  13744. hit.setAttribute('x', hitX.toFixed(2));
  13745. hit.setAttribute('y', (centerY - 12).toFixed(2));
  13746. hit.setAttribute('width', Math.max(24, hitRight - hitX).toFixed(2));
  13747. hit.setAttribute('height', '24');
  13748. hit.setAttribute('rx', '4');
  13749. var badgeRect = badge.querySelector('rect');
  13750. var badgeText = badge.querySelector('text');
  13751. badgeRect.setAttribute('x', badgeX.toFixed(2));
  13752. badgeRect.setAttribute('y', (centerY - 7).toFixed(2));
  13753. badgeRect.setAttribute('width', badgeWidth.toFixed(2));
  13754. badgeRect.setAttribute('height', '14');
  13755. badgeRect.setAttribute('rx', '7');
  13756. badgeText.setAttribute('x', (badgeX + badgeWidth / 2).toFixed(2));
  13757. badgeText.setAttribute('y', (centerY + 2.5).toFixed(2));
  13758. return true;
  13759. }
  13760. function layoutLegendBridge() {
  13761. legendEntries.forEach(layoutLegendEntry);
  13762. if (!legendBridge) return;
  13763. Array.prototype.forEach.call(legendBridge.querySelectorAll('[data-legend-zero]'), layoutLegendEntry);
  13764. }
  13765. function decorateLegendBridge() {
  13766. legendEntries = [];
  13767. if (!legendBridge || html.getAttribute('data-embed') === 'true') return false;
  13768. var facts = {};
  13769. collectKinds().forEach(function (kind) { facts[kind.id] = kind; });
  13770. Array.prototype.forEach.call(legendBridge.querySelectorAll('[data-legend-kind]'), function (entry) {
  13771. var kind = entry.getAttribute('data-legend-kind');
  13772. var fact = facts[kind];
  13773. var count = fact ? fact.nodes.length : 0;
  13774. entry.setAttribute('data-legend-count', String(count));
  13775. var hit = document.createElementNS(namespace, 'rect');
  13776. hit.setAttribute('data-legend-bridge-runtime', '');
  13777. hit.setAttribute('data-legend-hit', '');
  13778. hit.setAttribute('aria-hidden', 'true');
  13779. entry.insertBefore(hit, entry.firstChild);
  13780. var badge = document.createElementNS(namespace, 'g');
  13781. badge.setAttribute('data-legend-bridge-runtime', '');
  13782. badge.setAttribute('data-legend-count-badge', '');
  13783. badge.setAttribute('aria-hidden', 'true');
  13784. badge.appendChild(document.createElementNS(namespace, 'rect'));
  13785. var countText = document.createElementNS(namespace, 'text');
  13786. countText.textContent = String(count);
  13787. badge.appendChild(countText);
  13788. entry.appendChild(badge);
  13789. if (!fact || !count) {
  13790. entry.setAttribute('data-legend-zero', '');
  13791. return;
  13792. }
  13793. entry.setAttribute('role', 'button');
  13794. entry.setAttribute('tabindex', legendEntries.length ? '-1' : '0');
  13795. var visibleLabel = entry.getAttribute('data-legend-label') || fact.label;
  13796. entry.setAttribute('aria-label', viewerCount('viewer.lens.legend.inspect', count, { label: visibleLabel }));
  13797. entry.setAttribute('aria-pressed', 'false');
  13798. entry.setAttribute('aria-haspopup', 'dialog');
  13799. entry.setAttribute('aria-controls', 'semantic-lens');
  13800. entry.setAttribute('aria-expanded', 'false');
  13801. legendEntries.push(entry);
  13802. });
  13803. if (!legendEntries.length) return false;
  13804. legendBridge.setAttribute('role', legendEntries.length >= 3 ? 'toolbar' : 'group');
  13805. legendBridge.setAttribute('aria-label', viewerText('viewer.lens.legend'));
  13806. syncLegendBridge();
  13807. layoutLegendBridge();
  13808. try {
  13809. if (document.fonts && document.fonts.ready) document.fonts.ready.then(layoutLegendBridge);
  13810. } catch (_) {}
  13811. return true;
  13812. }
  13813. function syncLegendBridge() {
  13814. legendEntries.forEach(function (entry) {
  13815. var selected = selectedKinds.indexOf(entry.getAttribute('data-legend-kind')) >= 0;
  13816. entry.setAttribute('aria-pressed', selected ? 'true' : 'false');
  13817. entry.setAttribute('aria-expanded', !panel.hidden && lensOpener === entry ? 'true' : 'false');
  13818. if (selected) entry.setAttribute('data-legend-selected', '');
  13819. else entry.removeAttribute('data-legend-selected');
  13820. });
  13821. }
  13822. function clearLegendPreview() {
  13823. activeLegendPreview = null;
  13824. svg.removeAttribute('data-legend-preview-active');
  13825. Array.prototype.forEach.call(svg.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (element) {
  13826. element.removeAttribute('data-legend-preview-match');
  13827. element.removeAttribute('data-legend-preview-selected');
  13828. element.removeAttribute('data-legend-preview-peer');
  13829. });
  13830. }
  13831. function strongerLegendOwnerActive() {
  13832. return selectedKinds.length > 0 || !panel.hidden || html.getAttribute('data-present') === 'true' ||
  13833. svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-intent-trace-active') ||
  13834. svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active') ||
  13835. svg.hasAttribute('data-relationship-preview-active');
  13836. }
  13837. function previewLegendKind(entry) {
  13838. clearLegendPreview();
  13839. if (!entry || strongerLegendOwnerActive()) return false;
  13840. var kind = entry.getAttribute('data-legend-kind');
  13841. var byId = nodesById();
  13842. var matches = Object.keys(byId).filter(function (id) {
  13843. return (byId[id].getAttribute('data-node-kind') || 'neutral') === kind;
  13844. });
  13845. if (!matches.length) return false;
  13846. var chosen = Object.create(null);
  13847. matches.forEach(function (id) {
  13848. chosen[id] = true;
  13849. byId[id].setAttribute('data-legend-preview-match', '');
  13850. byId[id].setAttribute('data-legend-preview-selected', '');
  13851. });
  13852. edgeGroups().forEach(function (edge) {
  13853. if (!chosen[edge.from] && !chosen[edge.to]) return;
  13854. edge.members.forEach(function (member) { member.setAttribute('data-legend-preview-match', ''); });
  13855. [edge.from, edge.to].forEach(function (id) {
  13856. if (!byId[id] || chosen[id]) return;
  13857. byId[id].setAttribute('data-legend-preview-match', '');
  13858. byId[id].setAttribute('data-legend-preview-peer', '');
  13859. });
  13860. });
  13861. svg.setAttribute('data-legend-preview-active', kind);
  13862. activeLegendPreview = entry;
  13863. return true;
  13864. }
  13865. function syncLegendPreview() {
  13866. var next = focusedLegendEntry || hoveredLegendEntry;
  13867. if (next === activeLegendPreview) return;
  13868. clearLegendPreview();
  13869. if (next) previewLegendKind(next);
  13870. }
  13871. function activateLegendEntry(entry) {
  13872. if (!entry || entry.getAttribute('role') !== 'button') return false;
  13873. clearLegendPreview();
  13874. select(entry.getAttribute('data-legend-kind'));
  13875. return open({ opener: entry });
  13876. }
  13877. function removeFlowOverlay() {
  13878. Array.prototype.forEach.call(svg.querySelectorAll('[data-semantic-lens-overlay]'), function (element) {
  13879. element.remove();
  13880. });
  13881. svg.removeAttribute('data-lens-flow-count');
  13882. svg.removeAttribute('data-lens-flow-density');
  13883. }
  13884. function flowGeometry(shape, direction, step) {
  13885. var clone = shape.cloneNode(false);
  13886. if (shape.getAttribute('data-motion-path')) clone.setAttribute('d', shape.getAttribute('data-motion-path'));
  13887. clone.removeAttribute('data-motion-path');
  13888. clone.removeAttribute('id');
  13889. clone.removeAttribute('class');
  13890. clone.removeAttribute('style');
  13891. clone.removeAttribute('marker-start');
  13892. clone.removeAttribute('marker-mid');
  13893. clone.removeAttribute('marker-end');
  13894. clone.removeAttribute('role');
  13895. clone.removeAttribute('aria-label');
  13896. clone.removeAttribute('aria-hidden');
  13897. clone.removeAttribute('data-animate');
  13898. clone.removeAttribute('data-edge-from');
  13899. clone.removeAttribute('data-edge-to');
  13900. clone.removeAttribute('data-edge-key');
  13901. clone.removeAttribute('data-edge-id');
  13902. clone.removeAttribute('data-edge-label');
  13903. clone.removeAttribute('data-lens-match');
  13904. clone.setAttribute('class', 'semantic-lens-flow');
  13905. clone.setAttribute('data-direction', direction);
  13906. clone.setAttribute('pathLength', '1');
  13907. clone.style.setProperty('--lens-flow-delay', (step * 0.08).toFixed(2) + 's');
  13908. return clone;
  13909. }
  13910. function renderFlowOverlay(entries) {
  13911. removeFlowOverlay();
  13912. svg.setAttribute('data-lens-flow-count', String(entries.length));
  13913. if (!entries.length || html.getAttribute('data-embed') === 'true') return false;
  13914. if (entries.length > MAX_LENS_FLOW_EDGES) {
  13915. svg.setAttribute('data-lens-flow-density', 'quiet');
  13916. return false;
  13917. }
  13918. var overlay = document.createElementNS(namespace, 'g');
  13919. overlay.setAttribute('class', 'semantic-lens-overlay');
  13920. overlay.setAttribute('data-semantic-lens-overlay', '');
  13921. overlay.setAttribute('aria-hidden', 'true');
  13922. entries.forEach(function (entry, step) {
  13923. var wrapper = document.createElementNS(namespace, 'g');
  13924. if (entry.edge.members[0].hasAttribute('transform')) {
  13925. wrapper.setAttribute('transform', entry.edge.members[0].getAttribute('transform'));
  13926. }
  13927. edgeShapes(entry.edge.members[0]).forEach(function (shape) {
  13928. wrapper.appendChild(flowGeometry(shape, entry.direction, step));
  13929. });
  13930. if (wrapper.childNodes.length) overlay.appendChild(wrapper);
  13931. });
  13932. if (!overlay.childNodes.length) return false;
  13933. var firstNode = svg.querySelector('[data-node-id]');
  13934. if (firstNode) svg.insertBefore(overlay, firstNode);
  13935. else svg.appendChild(overlay);
  13936. return true;
  13937. }
  13938. function cleanSvgState() {
  13939. removeFlowOverlay();
  13940. svg.removeAttribute('data-lens-active');
  13941. Array.prototype.forEach.call(svg.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (element) {
  13942. element.removeAttribute('data-lens-match');
  13943. element.removeAttribute('data-lens-selected');
  13944. element.removeAttribute('data-lens-peer');
  13945. });
  13946. }
  13947. function renderKinds() {
  13948. kindsRoot.textContent = '';
  13949. collectKinds().forEach(function (kind) {
  13950. var button = document.createElement('button');
  13951. button.type = 'button';
  13952. button.className = 'semantic-lens-kind';
  13953. button.setAttribute('data-kind', kind.id);
  13954. button.setAttribute('aria-pressed', selectedKinds.indexOf(kind.id) >= 0 ? 'true' : 'false');
  13955. button.setAttribute('aria-label', viewerCount('viewer.lens.kind.count', kind.nodes.length, { label: kind.label }));
  13956. button.disabled = selectedKinds.length >= 2 && selectedKinds.indexOf(kind.id) === -1;
  13957. var swatch = document.createElement('span');
  13958. swatch.className = 'semantic-lens-swatch';
  13959. swatch.setAttribute('aria-hidden', 'true');
  13960. var label = document.createElement('strong');
  13961. label.textContent = kind.label;
  13962. var count = document.createElement('em');
  13963. count.textContent = String(kind.nodes.length);
  13964. button.appendChild(swatch);
  13965. button.appendChild(label);
  13966. button.appendChild(count);
  13967. kindsRoot.appendChild(button);
  13968. });
  13969. }
  13970. function updateHash() {
  13971. try {
  13972. var hash = selectedKinds.length
  13973. ? '#lens=' + selectedKinds.map(encodeURIComponent).join('~')
  13974. : '';
  13975. history.replaceState(null, '', location.pathname + location.search + hash);
  13976. } catch (_) {}
  13977. }
  13978. function updateTrigger() {
  13979. var active = selectedKinds.length > 0;
  13980. trigger.setAttribute('aria-pressed', active ? 'true' : 'false');
  13981. trigger.setAttribute('aria-label', viewerText(active ? 'viewer.lens.openActive' : 'viewer.lens.open'));
  13982. copyBtn.hidden = !active;
  13983. syncLegendBridge();
  13984. }
  13985. function overlapArea(a, b) {
  13986. var width = Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left));
  13987. var height = Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top));
  13988. return width * height;
  13989. }
  13990. function dockPanel(byId) {
  13991. panel.removeAttribute('data-dock-side');
  13992. if (panel.hidden || window.innerWidth <= 720) return 'right';
  13993. var panelRect = panel.getBoundingClientRect();
  13994. var containerRect = container.getBoundingClientRect();
  13995. if (!panelRect.width || !panelRect.height) return 'right';
  13996. var selectedRects = Object.keys(byId).filter(function (id) {
  13997. return selectedKinds.indexOf(byId[id].getAttribute('data-node-kind') || 'neutral') >= 0;
  13998. }).map(function (id) { return byId[id].getBoundingClientRect(); });
  13999. var top = panelRect.top;
  14000. var width = panelRect.width;
  14001. var leftCandidate = { left: containerRect.left + 16, right: containerRect.left + 16 + width, top: top, bottom: panelRect.bottom };
  14002. var rightCandidate = { left: containerRect.right - 16 - width, right: containerRect.right - 16, top: top, bottom: panelRect.bottom };
  14003. var leftScore = selectedRects.reduce(function (score, rect) { return score + overlapArea(leftCandidate, rect); }, 0);
  14004. var rightScore = selectedRects.reduce(function (score, rect) { return score + overlapArea(rightCandidate, rect); }, 0);
  14005. var legend = svg.querySelector('[data-legend]');
  14006. var nav = container.querySelector('.diagram-nav');
  14007. var protectedRects = [legend, nav].filter(function (element) {
  14008. return element && !element.hidden && window.getComputedStyle(element).display !== 'none';
  14009. }).map(function (element) { return element.getBoundingClientRect(); });
  14010. leftScore += protectedRects.reduce(function (score, rect) {
  14011. return score + overlapArea(leftCandidate, rect) * 1000;
  14012. }, 0);
  14013. rightScore += protectedRects.reduce(function (score, rect) {
  14014. return score + overlapArea(rightCandidate, rect) * 1000;
  14015. }, 0);
  14016. var side = leftScore < rightScore ? 'left' : 'right';
  14017. panel.setAttribute('data-dock-side', side);
  14018. return side;
  14019. }
  14020. function applySelection(options) {
  14021. options = options || {};
  14022. cleanSvgState();
  14023. var byId = nodesById();
  14024. var nodeKind = Object.create(null);
  14025. Object.keys(byId).forEach(function (id) { nodeKind[id] = byId[id].getAttribute('data-node-kind') || 'neutral'; });
  14026. if (!selectedKinds.length) {
  14027. status.textContent = viewerText('viewer.lens.choose');
  14028. updateTrigger();
  14029. renderKinds();
  14030. dockPanel(byId);
  14031. if (options.updateUrl !== false) updateHash();
  14032. return false;
  14033. }
  14034. var chosen = {};
  14035. selectedKinds.forEach(function (kind) { chosen[kind] = true; });
  14036. Object.keys(byId).forEach(function (id) {
  14037. if (!chosen[nodeKind[id]]) return;
  14038. byId[id].setAttribute('data-lens-match', '');
  14039. byId[id].setAttribute('data-lens-selected', '');
  14040. });
  14041. var touching = 0;
  14042. var forward = 0;
  14043. var reverse = 0;
  14044. var crossKind = selectedKinds.length === 2;
  14045. var matchedFlow = [];
  14046. edgeGroups().forEach(function (edge) {
  14047. var fromKind = nodeKind[edge.from];
  14048. var toKind = nodeKind[edge.to];
  14049. var match = false;
  14050. if (crossKind) {
  14051. if (fromKind === selectedKinds[0] && toKind === selectedKinds[1]) { match = true; forward += 1; }
  14052. if (fromKind === selectedKinds[1] && toKind === selectedKinds[0]) { match = true; reverse += 1; }
  14053. } else if (fromKind === selectedKinds[0] || toKind === selectedKinds[0]) {
  14054. match = true;
  14055. touching += 1;
  14056. }
  14057. if (!match) return;
  14058. var direction = 'within';
  14059. if (crossKind) {
  14060. direction = fromKind === selectedKinds[0] ? 'forward' : 'reverse';
  14061. } else {
  14062. direction = fromKind === selectedKinds[0] && toKind !== selectedKinds[0] ? 'out'
  14063. : (toKind === selectedKinds[0] && fromKind !== selectedKinds[0] ? 'in' : 'within');
  14064. }
  14065. matchedFlow.push({ edge: edge, direction: direction });
  14066. edge.members.forEach(function (member) { member.setAttribute('data-lens-match', ''); });
  14067. if (!crossKind) {
  14068. [edge.from, edge.to].forEach(function (id) {
  14069. if (!byId[id]) return;
  14070. byId[id].setAttribute('data-lens-match', '');
  14071. if (!chosen[nodeKind[id]]) byId[id].setAttribute('data-lens-peer', '');
  14072. });
  14073. }
  14074. });
  14075. svg.setAttribute('data-lens-active', selectedKinds.join(' '));
  14076. renderFlowOverlay(matchedFlow);
  14077. if (crossKind) {
  14078. var total = forward + reverse;
  14079. status.textContent = viewerCount('viewer.lens.compare', total, {
  14080. first: viewerKindLabel(selectedKinds[0]),
  14081. second: viewerKindLabel(selectedKinds[1]),
  14082. forward: forward,
  14083. reverse: reverse
  14084. });
  14085. } else {
  14086. var nodeCount = collectKinds().filter(function (kind) { return kind.id === selectedKinds[0]; })[0].nodes.length;
  14087. status.textContent = viewerText('viewer.lens.single', {
  14088. nodes: viewerCount('viewer.lens.node', nodeCount, { label: viewerKindLabel(selectedKinds[0]) }),
  14089. relationships: viewerCount('viewer.lens.relationship', touching)
  14090. });
  14091. }
  14092. updateTrigger();
  14093. renderKinds();
  14094. dockPanel(byId);
  14095. if (options.updateUrl !== false) updateHash();
  14096. return true;
  14097. }
  14098. function prepareForLens() {
  14099. clearLegendPreview();
  14100. if (Archify.focus && typeof Archify.focus.clear === 'function') {
  14101. Archify.focus.clear({ updateUrl: false, preserveView: true });
  14102. }
  14103. if (Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {
  14104. Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
  14105. }
  14106. if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {
  14107. Archify.intentTrace.clear({ announce: false });
  14108. }
  14109. }
  14110. function select(kind, options) {
  14111. options = options || {};
  14112. clearLegendPreview();
  14113. var exists = collectKinds().some(function (entry) { return entry.id === kind; });
  14114. if (!exists) return false;
  14115. var index = selectedKinds.indexOf(kind);
  14116. if (index >= 0) selectedKinds.splice(index, 1);
  14117. else {
  14118. if (selectedKinds.length >= 2) return false;
  14119. if (!selectedKinds.length) prepareForLens();
  14120. selectedKinds.push(kind);
  14121. }
  14122. return applySelection(options);
  14123. }
  14124. function close(options) {
  14125. options = options || {};
  14126. panel.hidden = true;
  14127. trigger.setAttribute('aria-expanded', 'false');
  14128. updateTrigger();
  14129. if (options.restoreFocus !== false && lensOpener && typeof lensOpener.focus === 'function') lensOpener.focus();
  14130. return false;
  14131. }
  14132. function open(options) {
  14133. options = options || {};
  14134. if (html.getAttribute('data-embed') === 'true') return false;
  14135. lensOpener = options.opener || trigger;
  14136. if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);
  14137. if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
  14138. if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
  14139. if (Archify.guide && Archify.guide.isOpen()) Archify.guide.close({ restoreFocus: false });
  14140. renderKinds();
  14141. panel.hidden = false;
  14142. trigger.setAttribute('aria-expanded', 'true');
  14143. updateTrigger();
  14144. requestAnimationFrame(function () {
  14145. dockPanel(nodesById());
  14146. var activeButton = kindsRoot.querySelector('[aria-pressed="true"]');
  14147. var firstButton = activeButton || kindsRoot.querySelector('button:not(:disabled)');
  14148. if (firstButton) firstButton.focus();
  14149. });
  14150. return true;
  14151. }
  14152. function toggle() { return panel.hidden ? open({ opener: trigger }) : close(); }
  14153. function clear(options) {
  14154. options = options || {};
  14155. selectedKinds = [];
  14156. cleanSvgState();
  14157. panel.removeAttribute('data-dock-side');
  14158. updateTrigger();
  14159. renderKinds();
  14160. status.textContent = viewerText('viewer.lens.choose');
  14161. if (options.updateUrl !== false) updateHash();
  14162. if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
  14163. Archify.view.reset({ automatic: true });
  14164. }
  14165. if (options.closePanel === true) close({ restoreFocus: false });
  14166. return false;
  14167. }
  14168. function copyLink() {
  14169. if (!selectedKinds.length) return Promise.resolve(false);
  14170. var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
  14171. return (value === null ? Promise.resolve(false) : copyReaderText(value)).then(function (copied) {
  14172. copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
  14173. copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed'));
  14174. window.setTimeout(function () {
  14175. copyBtn.textContent = viewerText('viewer.common.copyLink');
  14176. copyBtn.setAttribute('aria-label', viewerText('viewer.lens.copy'));
  14177. }, 1600);
  14178. return copied;
  14179. });
  14180. }
  14181. function syncFromHash() {
  14182. try {
  14183. var params = new URLSearchParams(location.hash.replace(/^#/, ''));
  14184. var value = params.get('lens');
  14185. if (!value) {
  14186. if (selectedKinds.length) clear({ updateUrl: false, preserveView: true });
  14187. return;
  14188. }
  14189. var available = collectKinds().map(function (kind) { return kind.id; });
  14190. var requested = value.split('~').filter(function (kind, index, list) {
  14191. return available.indexOf(kind) >= 0 && list.indexOf(kind) === index;
  14192. }).slice(0, 2);
  14193. if (!requested.length) return;
  14194. prepareForLens();
  14195. selectedKinds = requested;
  14196. applySelection({ updateUrl: false });
  14197. } catch (_) {}
  14198. }
  14199. trigger.addEventListener('click', toggle);
  14200. if (decorateLegendBridge()) {
  14201. legendBridge.addEventListener('click', function (event) {
  14202. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14203. if (entry) activateLegendEntry(entry);
  14204. });
  14205. legendBridge.addEventListener('pointerover', function (event) {
  14206. if (event.pointerType === 'touch' || (finePointerQuery && !finePointerQuery.matches)) return;
  14207. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14208. if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;
  14209. hoveredLegendEntry = entry;
  14210. syncLegendPreview();
  14211. });
  14212. legendBridge.addEventListener('pointerout', function (event) {
  14213. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14214. if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;
  14215. if (hoveredLegendEntry === entry) hoveredLegendEntry = null;
  14216. syncLegendPreview();
  14217. });
  14218. legendBridge.addEventListener('focusin', function (event) {
  14219. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14220. if (!entry) return;
  14221. focusedLegendEntry = entry;
  14222. legendEntries.forEach(function (candidate) {
  14223. candidate.setAttribute('tabindex', candidate === entry ? '0' : '-1');
  14224. });
  14225. syncLegendPreview();
  14226. });
  14227. legendBridge.addEventListener('focusout', function (event) {
  14228. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14229. if (!entry || (event.relatedTarget && entry.contains(event.relatedTarget))) return;
  14230. if (focusedLegendEntry === entry) focusedLegendEntry = null;
  14231. syncLegendPreview();
  14232. });
  14233. legendBridge.addEventListener('keydown', function (event) {
  14234. var entry = event.target.closest('[data-legend-kind][role="button"]');
  14235. if (!entry) return;
  14236. if (event.key === 'Enter' || event.key === ' ') {
  14237. event.preventDefault();
  14238. activateLegendEntry(entry);
  14239. return;
  14240. }
  14241. var index = legendEntries.indexOf(entry);
  14242. var next = null;
  14243. if (event.key === 'ArrowRight') next = (index + 1) % legendEntries.length;
  14244. else if (event.key === 'ArrowLeft') next = (index - 1 + legendEntries.length) % legendEntries.length;
  14245. else if (event.key === 'Home') next = 0;
  14246. else if (event.key === 'End') next = legendEntries.length - 1;
  14247. if (next === null) return;
  14248. event.preventDefault();
  14249. legendEntries.forEach(function (candidate, candidateIndex) {
  14250. candidate.setAttribute('tabindex', candidateIndex === next ? '0' : '-1');
  14251. });
  14252. legendEntries[next].focus();
  14253. });
  14254. }
  14255. closeBtn.addEventListener('click', function () { close(); });
  14256. clearBtn.addEventListener('click', function () { clear({ preserveView: true }); });
  14257. copyBtn.addEventListener('click', copyLink);
  14258. kindsRoot.addEventListener('click', function (event) {
  14259. var button = event.target.closest('[data-kind]');
  14260. if (!button || button.disabled) return;
  14261. select(button.getAttribute('data-kind'));
  14262. });
  14263. kindsRoot.addEventListener('keydown', function (event) {
  14264. if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) return;
  14265. var buttons = Array.prototype.slice.call(kindsRoot.querySelectorAll('button:not(:disabled)'));
  14266. var index = buttons.indexOf(document.activeElement);
  14267. var next = null;
  14268. if (index >= 0 && (event.key === 'ArrowRight' || event.key === 'ArrowDown')) next = (index + 1) % buttons.length;
  14269. else if (index >= 0 && (event.key === 'ArrowLeft' || event.key === 'ArrowUp')) next = (index - 1 + buttons.length) % buttons.length;
  14270. else if (event.key === 'Home' && buttons.length) next = 0;
  14271. else if (event.key === 'End' && buttons.length) next = buttons.length - 1;
  14272. if (next !== null) { event.preventDefault(); buttons[next].focus(); }
  14273. });
  14274. panel.addEventListener('keydown', function (event) {
  14275. if (event.key !== 'Escape') return;
  14276. event.preventDefault();
  14277. event.stopPropagation();
  14278. close();
  14279. });
  14280. document.addEventListener('click', function (event) {
  14281. var eventPath = typeof event.composedPath === 'function' ? event.composedPath() : [];
  14282. var clickedInside = eventPath.indexOf(panel) >= 0 || panel.contains(event.target);
  14283. var clickedLauncher = event.target === trigger || legendEntries.some(function (entry) {
  14284. return event.target === entry || entry.contains(event.target);
  14285. });
  14286. if (!panel.hidden && !clickedInside && !clickedLauncher) close({ restoreFocus: false });
  14287. });
  14288. window.addEventListener('hashchange', syncFromHash);
  14289. window.addEventListener('resize', function () {
  14290. if (!panel.hidden && selectedKinds.length) dockPanel(nodesById());
  14291. layoutLegendBridge();
  14292. });
  14293. renderKinds();
  14294. syncFromHash();
  14295. return {
  14296. open: open,
  14297. close: close,
  14298. toggle: toggle,
  14299. clear: clear,
  14300. clearPreview: clearLegendPreview,
  14301. select: select,
  14302. copyLink: copyLink,
  14303. isOpen: function () { return !panel.hidden; },
  14304. active: function () { return selectedKinds.length ? selectedKinds.slice() : null; },
  14305. kinds: function () { return collectKinds().map(function (kind) { return { id: kind.id, count: kind.nodes.length }; }); }
  14306. };
  14307. })();
  14308. /* ============================================================
  14309. Diagram Guide — a factual command deck over existing interactions.
  14310. Counts come from compiled semantics; actions delegate to Finder, Route
  14311. Probe, Semantic Radar, Semantic Lens, Presentation, theme, export, and
  14312. camera without adding a second command implementation or SVG state.
  14313. ============================================================ */
  14314. Archify.guide = (function () {
  14315. var html = document.documentElement;
  14316. var container = document.querySelector('.diagram-container');
  14317. var svg = container.querySelector(':scope > svg');
  14318. var trigger = document.getElementById('btn-diagram-guide');
  14319. var panel = document.getElementById('diagram-guide');
  14320. var closeBtn = document.getElementById('diagram-guide-close');
  14321. var stats = document.getElementById('diagram-guide-stats');
  14322. var actions = document.getElementById('diagram-guide-actions');
  14323. var feedback = document.getElementById('diagram-guide-feedback');
  14324. var routePanel = document.getElementById('route-probe');
  14325. var returnFocus = null;
  14326. function relationshipCount() {
  14327. var seen = {};
  14328. Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
  14329. var key = edge.getAttribute('data-edge-key') || [
  14330. edge.getAttribute('data-edge-from'),
  14331. edge.getAttribute('data-edge-to'),
  14332. edge.getAttribute('data-edge-label') || ''
  14333. ].join('\u0000');
  14334. seen[key] = true;
  14335. });
  14336. return Object.keys(seen).length;
  14337. }
  14338. function renderFacts() {
  14339. var nodes = svg.querySelectorAll('[data-node-id]').length;
  14340. var relationships = relationshipCount();
  14341. stats.textContent = viewerText('viewer.guide.facts', {
  14342. nodes: viewerCount('viewer.guide.fact.node', nodes),
  14343. relationships: viewerCount('viewer.guide.fact.relationship', relationships)
  14344. });
  14345. }
  14346. function actionButtons() {
  14347. return Array.prototype.slice.call(actions.querySelectorAll('.diagram-guide-action:not(:disabled)'));
  14348. }
  14349. function close(options) {
  14350. options = options || {};
  14351. panel.hidden = true;
  14352. html.removeAttribute('data-guide-open');
  14353. routePanel.removeAttribute('data-guide-open');
  14354. trigger.setAttribute('aria-expanded', 'false');
  14355. trigger.setAttribute('aria-label', viewerText('viewer.guide.open'));
  14356. feedback.textContent = '';
  14357. if (options.restoreFocus !== false) {
  14358. // Return focus where the reader was when the guide opened; the
  14359. // trigger itself is only the fallback when that element is gone.
  14360. var target = returnFocus && returnFocus.isConnected ? returnFocus : trigger;
  14361. if (target && typeof target.focus === 'function') target.focus();
  14362. }
  14363. return false;
  14364. }
  14365. function open() {
  14366. if (html.getAttribute('data-embed') === 'true') return false;
  14367. if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
  14368. if (Archify.exportMenu && Archify.exportMenu.isOpen()) Archify.exportMenu.close(false);
  14369. if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
  14370. if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
  14371. if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
  14372. if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
  14373. Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: 'guide' });
  14374. }
  14375. returnFocus = document.activeElement;
  14376. renderFacts();
  14377. panel.hidden = false;
  14378. html.setAttribute('data-guide-open', 'true');
  14379. routePanel.setAttribute('data-guide-open', 'true');
  14380. trigger.setAttribute('aria-expanded', 'true');
  14381. trigger.setAttribute('aria-label', viewerText('viewer.guide.close'));
  14382. feedback.textContent = '';
  14383. requestAnimationFrame(function () {
  14384. var first = actionButtons()[0];
  14385. if (first) first.focus();
  14386. });
  14387. return true;
  14388. }
  14389. function toggle() { return panel.hidden ? open() : close(); }
  14390. function execute(action) {
  14391. feedback.textContent = '';
  14392. close({ restoreFocus: false });
  14393. if (action === 'find') return Archify.finder.open();
  14394. if (action === 'route') return Archify.routeProbe.begin({ focusNode: true });
  14395. if (action === 'map') return Archify.radar.open();
  14396. if (action === 'lens') return Archify.semanticLens.open();
  14397. if (action === 'present') return Archify.presentation.enter();
  14398. if (action === 'export') return Archify.exportMenu.open();
  14399. if (action === 'theme') return Archify.theme.toggle();
  14400. if (action === 'preset') return Archify.preset.cycle();
  14401. if (action === 'reset') return Archify.view.reset();
  14402. if (action === 'zoom-in') return Archify.view.zoomIn();
  14403. if (action === 'zoom-out') return Archify.view.zoomOut();
  14404. return false;
  14405. }
  14406. function actionForKey(key) {
  14407. return {
  14408. '/': 'find',
  14409. r: 'route',
  14410. m: 'map',
  14411. l: 'lens',
  14412. f: 'present',
  14413. e: 'export',
  14414. t: 'theme',
  14415. s: 'preset',
  14416. '0': 'reset',
  14417. '+': 'zoom-in',
  14418. '=': 'zoom-in',
  14419. '-': 'zoom-out'
  14420. }[key] || null;
  14421. }
  14422. trigger.addEventListener('click', toggle);
  14423. closeBtn.addEventListener('click', function () { close(); });
  14424. actions.addEventListener('click', function (event) {
  14425. var button = event.target.closest('[data-guide-action]');
  14426. if (!button || button.disabled) return;
  14427. event.stopPropagation();
  14428. execute(button.getAttribute('data-guide-action'));
  14429. });
  14430. panel.addEventListener('keydown', function (event) {
  14431. if (event.key === 'Escape' || event.key === '?') {
  14432. event.preventDefault();
  14433. event.stopPropagation();
  14434. close();
  14435. return;
  14436. }
  14437. var buttons = actionButtons();
  14438. var index = buttons.indexOf(document.activeElement);
  14439. var next = null;
  14440. if (index >= 0 && event.key === 'ArrowRight') next = (index + 1) % buttons.length;
  14441. else if (index >= 0 && event.key === 'ArrowDown') next = (index + 1) % buttons.length;
  14442. else if (index >= 0 && event.key === 'ArrowLeft') next = (index - 1 + buttons.length) % buttons.length;
  14443. else if (index >= 0 && event.key === 'ArrowUp') next = (index - 1 + buttons.length) % buttons.length;
  14444. else if (event.key === 'Home' && buttons.length) next = 0;
  14445. else if (event.key === 'End' && buttons.length) next = buttons.length - 1;
  14446. if (next !== null) {
  14447. event.preventDefault();
  14448. event.stopPropagation();
  14449. buttons[next].focus();
  14450. return;
  14451. }
  14452. var action = actionForKey(event.key.length === 1 ? event.key.toLowerCase() : event.key);
  14453. if (!action) return;
  14454. event.preventDefault();
  14455. event.stopPropagation();
  14456. execute(action);
  14457. });
  14458. document.addEventListener('click', function (event) {
  14459. // Clicks anywhere on the trigger (including its icon span) are the
  14460. // toggle itself, never an outside dismissal.
  14461. if (!panel.hidden && !panel.contains(event.target) && !trigger.contains(event.target)) close({ restoreFocus: false });
  14462. });
  14463. renderFacts();
  14464. return {
  14465. open: open,
  14466. close: close,
  14467. toggle: toggle,
  14468. execute: execute,
  14469. isOpen: function () { return !panel.hidden; },
  14470. facts: function () {
  14471. return {
  14472. nodes: svg.querySelectorAll('[data-node-id]').length,
  14473. relationships: relationshipCount()
  14474. };
  14475. }
  14476. };
  14477. })();
  14478. /* ============================================================
  14479. Global keyboard shortcuts
  14480. ? -> open Diagram Guide
  14481. T -> toggle theme
  14482. S -> cycle visual style
  14483. E -> open export menu
  14484. F -> toggle presentation stage
  14485. M -> toggle Semantic Radar
  14486. L -> toggle Semantic Lens
  14487. R -> start/clear Route Probe
  14488. / -> open node finder or the active route endpoint picker
  14489. + / - -> zoom, 0 -> reset view
  14490. Escape -> clear temporary trace/focus/view first, then exit presentation
  14491. Ignored when focus is inside an input/textarea/contenteditable.
  14492. ============================================================ */
  14493. document.addEventListener('keydown', function (e) {
  14494. if (e.metaKey || e.ctrlKey || e.altKey) return;
  14495. if (e.shiftKey && (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End')) return;
  14496. if (e.defaultPrevented) return;
  14497. var t = e.target;
  14498. if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;
  14499. if (Archify.preset && Archify.preset.isOpen() && e.key !== 'Escape' && e.key !== 's' && e.key !== 'S') {
  14500. Archify.preset.close(false);
  14501. }
  14502. if (e.key === '?') {
  14503. e.preventDefault();
  14504. Archify.guide.toggle();
  14505. } else if (e.key === '/') {
  14506. e.preventDefault();
  14507. Archify.finder.open();
  14508. } else if (e.key === 't' || e.key === 'T') {
  14509. e.preventDefault();
  14510. Archify.theme.toggle();
  14511. } else if (e.key === 's' || e.key === 'S') {
  14512. e.preventDefault();
  14513. Archify.preset.cycle();
  14514. } else if (e.key === 'e' || e.key === 'E') {
  14515. e.preventDefault();
  14516. if (!Archify.exportMenu.isOpen()) Archify.exportMenu.open();
  14517. } else if (e.key === 'f' || e.key === 'F') {
  14518. e.preventDefault();
  14519. Archify.presentation.toggle();
  14520. } else if (e.key === 'm' || e.key === 'M') {
  14521. e.preventDefault();
  14522. Archify.radar.toggle();
  14523. } else if (e.key === 'l' || e.key === 'L') {
  14524. e.preventDefault();
  14525. Archify.semanticLens.toggle();
  14526. } else if (e.key === 'r' || e.key === 'R') {
  14527. e.preventDefault();
  14528. Archify.routeProbe.toggle({ focusNode: true });
  14529. } else if (e.key === '+' || e.key === '=') {
  14530. e.preventDefault();
  14531. Archify.view.zoomIn();
  14532. } else if (e.key === '-') {
  14533. e.preventDefault();
  14534. Archify.view.zoomOut();
  14535. } else if (e.key === '0') {
  14536. e.preventDefault();
  14537. Archify.view.reset();
  14538. } else if (e.key === 'Escape' && Archify.preset.isOpen()) {
  14539. e.preventDefault();
  14540. Archify.preset.close(true);
  14541. } else if (e.key === 'Escape' && Archify.semanticLens.isOpen()) {
  14542. e.preventDefault();
  14543. Archify.semanticLens.close({ restoreFocus: true });
  14544. } else if (e.key === 'Escape' && Archify.semanticLens.active()) {
  14545. e.preventDefault();
  14546. Archify.semanticLens.clear({ preserveView: true });
  14547. } else if (e.key === 'Escape' && Archify.guide.isOpen()) {
  14548. e.preventDefault();
  14549. Archify.guide.close({ restoreFocus: true });
  14550. } else if (e.key === 'Escape' && Archify.radar.isOpen()) {
  14551. e.preventDefault();
  14552. Archify.radar.close({ restoreFocus: true });
  14553. } else if (e.key === 'Escape' && Archify.routeProbe.active()) {
  14554. e.preventDefault();
  14555. Archify.routeProbe.escape({ restoreFocus: true });
  14556. } else if (e.key === 'Escape' && Archify.intentTrace.active()) {
  14557. e.preventDefault();
  14558. Archify.intentTrace.clear();
  14559. } else if (e.key === 'Escape' && Archify.focus.active()) {
  14560. e.preventDefault();
  14561. Archify.focus.clear({ restoreFocus: true });
  14562. } else if (e.key === 'Escape' && Archify.presentation.active()) {
  14563. e.preventDefault();
  14564. Archify.presentation.exit();
  14565. }
  14566. });
  14567. </script>
  14568. </body>
  14569. </html>